Skip to main content
PicoClaw’s cron tool allows the agent to schedule reminders, recurring tasks, and automated commands. This is perfect for time-based reminders, periodic checks, and scheduled automation.

Overview

The cron system supports:
  • One-time reminders - “Remind me in 10 minutes”
  • Recurring tasks - “Remind me every 2 hours”
  • Complex schedules - “Remind me at 9am daily” (cron expressions)
  • Command execution - Run shell commands on schedule

Tool Usage

The agent uses the cron tool automatically when you ask for reminders or scheduled tasks.

Parameters

Usage Examples

One-time Reminders

User: “Remind me in 10 minutes to check the server” Agent calls:
User: “Remind me in 1 hour to start the meeting” Agent calls:

Recurring Tasks

User: “Remind me every 2 hours to take a break” Agent calls:
User: “Check disk space every 30 minutes” Agent calls:

Cron Expressions

User: “Remind me to review emails at 9am every weekday” Agent calls:
User: “Run backup at midnight daily” Agent calls:

Command Execution

User: “Check disk usage every hour” Agent calls:
When triggered, the agent executes df -h and reports output.

Managing Jobs

List all jobs:
Agent calls:
Remove a job:
Agent calls:
Disable a job:
Agent calls:

Cron Expression Format

Cron expressions use the standard 5-field format:

Common Examples

Special Characters

  • * - Any value
  • , - Value list (e.g., 1,15 for 1st and 15th)
  • - - Range (e.g., 1-5 for Monday-Friday)
  • / - Step values (e.g., */15 for every 15 minutes)

CLI Commands

You can also manage cron jobs via CLI:

List Jobs

Output:

Add Job via CLI

Storage

Cron jobs are stored in your workspace:

Job Format

Configuration

Configure execution timeout in ~/.picoclaw/config.json:

Options

How It Works

Schedule Types

The cron service supports three schedule types:

1. At (One-time)

Triggers once at a specific Unix timestamp:

2. Every (Recurring Interval)

Triggers at regular intervals:

3. Cron (Expression-based)

Triggers based on cron expression:

Execution Flow

Command Execution

When a job has a command field:
  1. Command executed via ExecTool (respects workspace restrictions)
  2. Output captured
  3. Result sent to channel/chat specified in job
  4. Execution timeout enforced (default: 5 minutes)

Delivery Modes

Direct delivery (deliver: true):
  • Message sent directly to channel
  • No agent processing
  • Fast and simple
Agent processing (deliver: false):
  • Message processed by agent
  • Agent can use tools, access context
  • For complex tasks requiring decision-making

Session Context

When creating jobs, the cron tool captures current session context:
  • Channel: Where the job was created (telegram, discord, cli, etc.)
  • Chat ID: Which chat/user requested the job
This ensures notifications go to the right place:

Best Practices

Choosing Schedule Type

✅ Use at_seconds for:
  • One-time reminders
  • Temporary schedules
  • Countdown timers
✅ Use every_seconds for:
  • Simple recurring tasks
  • Regular intervals
  • Monitoring checks
✅ Use cron_expr for:
  • Specific times (“9am daily”)
  • Complex schedules (“weekdays only”)
  • Calendar-based triggers

Performance Considerations

  • Avoid very frequent jobs (< 1 minute intervals)
  • Use deliver: true for simple notifications
  • Keep command execution under timeout limit
  • Consider using heartbeat for background tasks instead

Security

Commands execute with same restrictions as agent:
  • Respects restrict_to_workspace setting
  • Blocked dangerous commands (rm -rf, etc.)
  • Timeout enforcement prevents runaway processes

Troubleshooting

Job Not Triggering

  1. Check job is enabled:
  1. Verify schedule:
    • For at_seconds: Check time is in future
    • For every_seconds: Ensure interval is reasonable
    • For cron_expr: Validate expression format
  2. Check logs:

Command Not Executing

  1. Verify command field is set:
    • Commands must have command field in payload
    • deliver is automatically set to false for commands
  2. Check timeout:
    • Default: 5 minutes
    • Increase if command takes longer
  3. Verify workspace restrictions:
    • Command paths must be within workspace if restricted
    • Check restrict_to_workspace setting

Wrong Delivery Channel

  1. Check session context:
    • Jobs remember channel/chat where created
    • Create new job from correct channel
  2. Manual override:
    • Edit job file manually if needed
    • Located in ~/.picoclaw/workspace/cron/

Differences from Heartbeat

Choose cron for:
  • Specific time-based reminders
  • One-time notifications
  • User-requested schedules
Choose heartbeat for:
  • Continuous background monitoring
  • Regular health checks
  • Automated maintenance tasks