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 thecron tool automatically when you ask for reminders or scheduled tasks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Action to perform: add, list, remove, enable, disable |
message | string | For add | The reminder/task message to display |
command | string | Optional | Shell command to execute |
at_seconds | integer | Optional | One-time: seconds from now (e.g., 600 for 10 minutes) |
every_seconds | integer | Optional | Recurring: interval in seconds (e.g., 3600 for hourly) |
cron_expr | string | Optional | Cron expression for complex schedules |
job_id | string | For remove/enable/disable | Job ID to operate on |
deliver | boolean | Optional | If true, send message directly; if false, let agent process (default: true) |
Usage Examples
One-time Reminders
User: “Remind me in 10 minutes to check the server” Agent calls:Recurring Tasks
User: “Remind me every 2 hours to take a break” Agent calls:Cron Expressions
User: “Remind me to review emails at 9am every weekday” Agent calls:Command Execution
User: “Check disk usage every hour” Agent calls:df -h and reports output.
Managing Jobs
List all jobs:Cron Expression Format
Cron expressions use the standard 5-field format:Common Examples
| Expression | Description |
|---|---|
0 9 * * * | Daily at 9:00 AM |
0 */2 * * * | Every 2 hours |
30 8 * * 1-5 | Weekdays at 8:30 AM |
0 0 1 * * | First day of each month at midnight |
0 12 * * 6 | Every Saturday at noon |
*/15 * * * * | Every 15 minutes |
0 0,12 * * * | Twice a day (midnight and noon) |
0 9 * * 1 | Every Monday at 9 AM |
Special Characters
*- Any value,- Value list (e.g.,1,15for 1st and 15th)-- Range (e.g.,1-5for Monday-Friday)/- Step values (e.g.,*/15for every 15 minutes)
CLI Commands
You can also manage cron jobs via CLI:List Jobs
Add Job via CLI
Storage
Cron jobs are stored in your workspace:Job Format
Configuration
Configure execution timeout in~/.picoclaw/config.json:
Options
| Option | Type | Default | Description |
|---|---|---|---|
exec_timeout_minutes | integer | 5 | Command execution timeout (0 = no timeout) |
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 acommand field:
- Command executed via
ExecTool(respects workspace restrictions) - Output captured
- Result sent to channel/chat specified in job
- Execution timeout enforced (default: 5 minutes)
Delivery Modes
Direct delivery (deliver: true):
- Message sent directly to channel
- No agent processing
- Fast and simple
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
Best Practices
Choosing Schedule Type
✅ Useat_seconds for:
- One-time reminders
- Temporary schedules
- Countdown timers
every_seconds for:
- Simple recurring tasks
- Regular intervals
- Monitoring checks
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: truefor 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_workspacesetting - Blocked dangerous commands (rm -rf, etc.)
- Timeout enforcement prevents runaway processes
Troubleshooting
Job Not Triggering
- Check job is enabled:
-
Verify schedule:
- For
at_seconds: Check time is in future - For
every_seconds: Ensure interval is reasonable - For
cron_expr: Validate expression format
- For
- Check logs:
Command Not Executing
-
Verify command field is set:
- Commands must have
commandfield in payload deliveris automatically set to false for commands
- Commands must have
-
Check timeout:
- Default: 5 minutes
- Increase if command takes longer
-
Verify workspace restrictions:
- Command paths must be within workspace if restricted
- Check
restrict_to_workspacesetting
Wrong Delivery Channel
-
Check session context:
- Jobs remember channel/chat where created
- Create new job from correct channel
-
Manual override:
- Edit job file manually if needed
- Located in
~/.picoclaw/workspace/cron/
Differences from Heartbeat
| Feature | Cron | Heartbeat |
|---|---|---|
| Trigger | Time-based schedules | Fixed interval |
| Configuration | Dynamic via tool calls | Static HEARTBEAT.md file |
| Use Case | Specific reminders & tasks | Background monitoring |
| Precision | Exact times/intervals | Approximate interval |
| Management | Add/remove via commands | Edit markdown file |
- Specific time-based reminders
- One-time notifications
- User-requested schedules
- Continuous background monitoring
- Regular health checks
- Automated maintenance tasks
Related Features
- Heartbeat - Periodic background tasks
- Spawn Tool - Async subagent execution
- Exec Tool - Command execution