Cron Job Setup
Our conventions for creating cron jobs in OpenClaw.
Default Settings
| Setting |
Default |
Why |
| Model |
anthropic/claude-sonnet-4-5 |
Reliable tool calls, works with any Anthropic Max plan — no OpenRouter needed |
| Session |
isolated |
Cron jobs run in their own session, not the main chat |
| Delivery |
"mode": "none" |
Job handles its own output (posts to Discord, etc.) |
| Timeout |
120-180s |
Most jobs should finish fast |
Model Notes
- Default to Sonnet (
anthropic/claude-sonnet-4-5). Reliable, portable (no OpenRouter API key needed).
- DeepSeek is unreliable for tool calls — don't use it for cron jobs.
- Use Opus (
anthropic/claude-opus-4-6) only as a last resort — expensive for scheduled tasks.
- Model ID format: Use
anthropic/claude-sonnet-4-5 not the full dated version (anthropic/claude-sonnet-4-20250514).
Job Template
{
"name": "descriptive-kebab-case-name",
"schedule": {
"kind": "cron",
"expr": "*/30 * * * *",
"tz": "America/New_York"
},
"sessionTarget": "isolated",
"payload": {
"kind": "agentTurn",
"message": "TASK INSTRUCTIONS HERE",
"model": "openrouter/deepseek/deepseek-v3.2",
"timeoutSeconds": 120
},
"delivery": {
"mode": "none"
}
}
Schedule Patterns
| Pattern |
Cron Expression |
Notes |
| Every 30 min |
*/30 * * * * |
Good for inbox checks, monitoring |
| Every hour |
0 * * * * |
Self-reflection, status checks |
| Daily at 4 AM |
0 4 * * * |
Cleanup, backups (during quiet hours) |
| Daily at 6 AM |
0 6 * * * |
Morning digests, daily summaries |
| Weekly Monday 2 PM |
0 14 * * 1 |
Weekly outreach, reviews |
| One-shot |
Use "kind": "at" instead |
Reminders, one-time tasks |
Task Instruction Conventions
- Be explicit with commands — Give the cron agent exact bash commands to run. It doesn't have our context.
- Include skip conditions — If there's nothing to do, the agent should reply
SKIP to avoid wasting tokens.
- Handle its own output — The job should post results to Telegram (or wherever) using the
message tool directly. Don't rely on delivery mode for formatted output.
- Include error handling — What should happen if a command fails?
- Keep instructions self-contained — The cron agent wakes up with no context. Everything it needs should be in the task message.
Telegram Posting from Cron Jobs
When a cron job needs to notify us, include these instructions in the task:
Post to Telegram using the message tool:
- action: send
- channel: telegram
- target: -1003856094222
- threadId: TOPIC_ID
- message: Your formatted message
Topic IDs:
1 — Main topic (general updates, alerts)
573 — Research
1032 — Crypto
1488 — PR updates / dev notifications
1869 — Sticker store
3188 — Activity feed (workspace changes)
Delivery Modes
| Mode |
When to Use |
"mode": "none" |
Job posts its own output to Telegram (most common) |
"mode": "announce" |
OpenClaw auto-delivers the agent's final message to a channel. Use when output IS the message (e.g., daily digest). Set "channel": "telegram" and "to": "-1003856094222:TOPIC_ID" |
Anti-Patterns
❌ Don't use Opus for cron jobs unless the task genuinely needs it. Most cron tasks are simple checks.
❌ Don't use heartbeat for things that can be a cron job. Heartbeat runs in the main session (Opus) and costs way more.
❌ Don't create cron jobs that loop/poll — each run should be a single check. If you need polling, use a background exec script instead.
❌ Don't set delivery mode to "announce" and also have the job post to Telegram — you'll get duplicate messages.
Existing Jobs (Reference)
Check current jobs anytime with the cron list tool. As of setup:
workspace-activity-feed — Every 30 min, commits workspace changes, posts to activity feed
agentmail-inbox-check — Every 30 min, checks for new emails, responds to agents
sub-agent-monitor — Every 15 min, checks on stalled sub-agents
self-reflection — Hourly, reviews recent sessions for lessons learned
daily-workspace-commit — Daily 4 AM, git commits workspace changes
system-watchdog — Daily 4 AM, checks system resources
OpenClaw Daily News Digest — Daily 6 AM, generates news digest
sticker-sales-loop — Weekly Monday 2 PM, agent outreach for sticker store
1---2name: cron-setup3description: Create and manage OpenClaw cron jobs following our conventions. Use when setting up periodic tasks, reminders, automated checks, or any scheduled work.4---5
6# Cron Job Setup
7
8Our conventions for creating cron jobs in OpenClaw.
9
10## Default Settings
11
12| Setting | Default | Why |
13|---------|---------|-----|
14| **Model** | `anthropic/claude-sonnet-4-5` | Reliable tool calls, works with any Anthropic Max plan — no OpenRouter needed |
15| **Session** | `isolated` | Cron jobs run in their own session, not the main chat |
16| **Delivery** | `"mode": "none"` | Job handles its own output (posts to Discord, etc.) |
17| **Timeout** | 120-180s | Most jobs should finish fast |
18
19## Model Notes
20
21- **Default to Sonnet** (`anthropic/claude-sonnet-4-5`). Reliable, portable (no OpenRouter API key needed).
22- **DeepSeek is unreliable** for tool calls — don't use it for cron jobs.
23- **Use Opus** (`anthropic/claude-opus-4-6`) only as a last resort — expensive for scheduled tasks.
24- **Model ID format:** Use `anthropic/claude-sonnet-4-5` not the full dated version (`anthropic/claude-sonnet-4-20250514`).
25
26## Job Template
27
28```json
29{
30 "name": "descriptive-kebab-case-name",
31 "schedule": {
32 "kind": "cron",
33 "expr": "*/30 * * * *",
34 "tz": "America/New_York"
35 },
36 "sessionTarget": "isolated",
37 "payload": {
38 "kind": "agentTurn",
39 "message": "TASK INSTRUCTIONS HERE",
40 "model": "openrouter/deepseek/deepseek-v3.2",
41 "timeoutSeconds": 120
42 },
43 "delivery": {
44 "mode": "none"
45 }
46}
47```
48
49## Schedule Patterns
50
51| Pattern | Cron Expression | Notes |
52|---------|----------------|-------|
53| Every 30 min | `*/30 * * * *` | Good for inbox checks, monitoring |
54| Every hour | `0 * * * *` | Self-reflection, status checks |
55| Daily at 4 AM | `0 4 * * *` | Cleanup, backups (during quiet hours) |
56| Daily at 6 AM | `0 6 * * *` | Morning digests, daily summaries |
57| Weekly Monday 2 PM | `0 14 * * 1` | Weekly outreach, reviews |
58| One-shot | Use `"kind": "at"` instead | Reminders, one-time tasks |
59
60## Task Instruction Conventions
61
621. **Be explicit with commands** — Give the cron agent exact bash commands to run. It doesn't have our context.
632. **Include skip conditions** — If there's nothing to do, the agent should reply `SKIP` to avoid wasting tokens.
643. **Handle its own output** — The job should post results to Telegram (or wherever) using the `message` tool directly. Don't rely on delivery mode for formatted output.
654. **Include error handling** — What should happen if a command fails?
665. **Keep instructions self-contained** — The cron agent wakes up with no context. Everything it needs should be in the task message.
67
68## Telegram Posting from Cron Jobs
69
70When a cron job needs to notify us, include these instructions in the task:
71
72```
73Post to Telegram using the message tool:
74- action: send
75- channel: telegram
76- target: -1003856094222
77- threadId: TOPIC_ID
78- message: Your formatted message
79```
80
81**Topic IDs:**
82- `1` — Main topic (general updates, alerts)
83- `573` — Research
84- `1032` — Crypto
85- `1488` — PR updates / dev notifications
86- `1869` — Sticker store
87- `3188` — Activity feed (workspace changes)
88
89## Delivery Modes
90
91| Mode | When to Use |
92|------|------------|
93| `"mode": "none"` | Job posts its own output to Telegram (most common) |
94| `"mode": "announce"` | OpenClaw auto-delivers the agent's final message to a channel. Use when output IS the message (e.g., daily digest). Set `"channel": "telegram"` and `"to": "-1003856094222:TOPIC_ID"` |
95
96## Anti-Patterns
97
98❌ **Don't use Opus for cron jobs** unless the task genuinely needs it. Most cron tasks are simple checks.
99❌ **Don't use heartbeat** for things that can be a cron job. Heartbeat runs in the main session (Opus) and costs way more.
100❌ **Don't create cron jobs that loop/poll** — each run should be a single check. If you need polling, use a background exec script instead.
101❌ **Don't set delivery mode to "announce"** and also have the job post to Telegram — you'll get duplicate messages.
102
103## Existing Jobs (Reference)
104
105Check current jobs anytime with the `cron list` tool. As of setup:
106
107- `workspace-activity-feed` — Every 30 min, commits workspace changes, posts to activity feed
108- `agentmail-inbox-check` — Every 30 min, checks for new emails, responds to agents
109- `sub-agent-monitor` — Every 15 min, checks on stalled sub-agents
110- `self-reflection` — Hourly, reviews recent sessions for lessons learned
111- `daily-workspace-commit` — Daily 4 AM, git commits workspace changes
112- `system-watchdog` — Daily 4 AM, checks system resources
113- `OpenClaw Daily News Digest` — Daily 6 AM, generates news digest
114- `sticker-sales-loop` — Weekly Monday 2 PM, agent outreach for sticker store
115
116