Heartbeat vs Cron in OpenClaw: Ultimate 2026 Guide – When to Use Each for Proactive AI Agents

Heartbeat vs Cron in OpenClaw: Ultimate 2026 Guide – When to Use Each for Proactive AI Agents

10 mins read

OpenClaw (and setups like Clawnify on VPS) turns your AI agent from a simple chat responder into a truly proactive assistant using two main automation tools: Heartbeat and Cron. Many users get confused because both enable "scheduled" or "background" work, but they serve different needs, especially when handling periodic checks (ongoing monitoring) or long-running tasks (deep processing that takes time).

  • Heartbeat is the agent's built-in "pulse" — a recurring wake-up (default every 30 minutes, configurable) that runs inside the main conversation session. It loads a short checklist from a file called HEARTBEAT.md in your workspace and asks the agent: "Anything need attention right now?" Examples: quick scans for urgent emails, calendar events, notifications, stalled projects, or context usage alerts. Key traits:

    • Uses full chat history and workspace context → great for tasks that benefit from recent conversations ("follow up on what we discussed").

    • Batches multiple lightweight checks efficiently in one turn → saves tokens compared to separate jobs.

    • Blocks new user messages briefly while running (seconds to a minute or two if kept lean).

    • Timing is interval-based and can drift slightly under load.

    • Ideal for periodic, opportunistic monitoring that needs awareness of ongoing chats.

  • Cron is the flexible, precise scheduler (like Unix cron) managed via CLI commands (openclaw cron add ...) or naturally through chat. It supports exact timing: "every day at 9 AM", "every 2 hours", one-time triggers (--at), or intervals. Jobs can run in two modes:

    • Isolated (default and recommended for most): separate sub-agent session → no blocking of your main chat. Uses clean/minimal context (no full history drag).

    • Main session (via --session main or system events): queues to the next heartbeat → still blocks briefly. Key traits:

    • Perfect for long-running or heavy tasks (e.g., generating full reports, deep analysis, file processing, API polling) — won't freeze your conversation for minutes.

    • Precise, drift-free timing — no queue delays.

    • Model flexibility: run heavy crons on cheaper/faster models (e.g., Haiku, Mini) while main agent uses powerful ones.

    • Great for standalone periodic automations (daily briefings, weekly reviews) or exact reminders.

Quick analogy:

  • Heartbeat = your agent glancing at a to-do list every half hour during a conversation → quick, aware, but pauses the chat briefly.

  • Cron = setting independent alarms that ring and handle jobs in the background → reliable timing, no interruptions, handles big jobs without hassle.

Why the confusion? Both automate recurring work, but Heartbeat shines for short, context-aware periodic checks, while Cron excels at non-blocking, precise, or long tasks. Misusing them (e.g., putting heavy work in Heartbeat) leads to blocked chats, high token costs, or unreliable timing.

Now that you understand what Heartbeat and Cron are, the next big question is when to use each. The choice boils down to three main factors:

  • How long the task takes (quick vs. long-running/heavy)

  • Whether it needs full conversational context

  • How precise the timing must be (opportunistic vs. exact/scheduled)

Misusing one for the other's strengths is the #1 source of frustration: blocked chats during big jobs, drifting schedules, unnecessary token burn, or missed urgents. Here's the clear breakdown, with real-world examples for periodic monitoring (ongoing checks like inbox scans) and long-running tasks (reports, analysis, processing).

When to Use Heartbeat (Main-Session Periodic Pulse)

Best for: Short, frequent, context-aware periodic checks that finish in seconds to ~1 minute. Heartbeat excels when the agent should "glance" opportunistically using recent chat history and workspace state.

Ideal scenarios:

  • Quick routine monitoring: "Scan inbox for urgent emails?", "Any calendar conflicts today?", "Check notifications or stalled tasks?"

  • Batching lightweight periodic tasks: One heartbeat turn can handle 5–8 small checks (e.g., email + calendar + memory cleanup + context usage alert) cheaper and more intelligently than separate crons.

  • Tasks where conversational continuity matters: "Follow up on the project we discussed yesterday" or "Remind me about that idea from earlier chat."

  • Opportunistic awareness: Agent decides "nothing urgent → reply HEARTBEAT_OK and stay silent" (suppresses noise).

Keep it fast:

  • HEARTBEAT.md should be a minimal bullet list of conditions + "If nothing needs action, reply only HEARTBEAT_OK."

  • Use cheap/fast models (e.g., Haiku, Gemini Flash, Mini) for heartbeats via tiered config.

  • Avoid: Anything >30–60 seconds (e.g., full report generation, deep analysis) — it blocks your chat too long.

Community-proven pattern (from power users on X/Reddit): Rotate checks in HEARTBEAT.md (e.g., Mon: inbox focus, Tue: calendar deep-dive) or make them conditional ("only if no chat in last 2h"). This prevents token waste on redundant runs.

When to Use Cron (Precise, Non-Blocking Scheduler)

Best for: Everything else — especially long-running tasks, exact timing, or anything that shouldn't interrupt your main chat.

Isolated Cron (default/recommended):

  • No blocking: Runs in separate sub-agent session → you keep chatting normally.

  • Precise timing: "Every day at 9 AM", "every 2 hours", one-shots (--at "tomorrow 3pm").

  • Heavy or standalone work: Generate weekly summaries, deep research, file processing, API polling over time, data analysis.

  • Periodic automations without context drag: Daily briefing email, stock/crypto watch, weekly review, disk usage report.

  • Model optimization: Run expensive crons on cheaper models to save tokens.

Main-Session Cron (use sparingly with --session main or --system-event):

  • Queues to next heartbeat for batched processing.

  • Still blocks briefly → only when you need the output/event in main chat history.

  • Example: Timed reminder that should appear naturally in conversation.

Ideal scenarios:

  • Long tasks: "Compile a 10-page market report" (would freeze chat for minutes if in heartbeat).

  • Exact schedules: "Send daily 9 AM briefing" (heartbeat drifts under load).

  • Frequent polling: Anything <15–30 min interval risks excessive blocking if heartbeat-based.

  • One-shot future triggers: Reminders, follow-ups, or scheduled actions.

Community tip (battle-tested on X): For reliability, add checkpointing in long crons (save progress to file/memory) so restarts don't lose work. Use deliver: false for silent background jobs. Script deterministic parts (e.g., data fetch) and LLM only for analysis/writing.

Quick Decision Tree

  • Will it take > a few seconds / is it resource-heavy? → Yes → Cron (isolated)

  • Does it need recent chat context or workspace awareness? → Yes → Heartbeat (keep ultra-short!) → No → Cron (isolated)

  • Needs exact / predictable timing (no drift)? → Yes → Cron

  • Frequent periodic check + cheap/light? → Heartbeat (batched) or isolated cron with gates

  • Users chat often / hate blocked windows? → Favor Cron isolated; minimize Heartbeat scope

Default VPS/Clawnify recommendation:

  • Heartbeat (30–60 min): Only ultra-light, silent-by-default checks (urgent inbox? memory health?).

  • Cron isolated: All substantive periodic work (daily briefings, reports, analysis) + long tasks.

This split keeps your agent responsive 99% of the time while automating reliably in the background. In the next section, we'll dive into cost comparisons, silent patterns, and real examples from the community.

Start using OpenClaw in an isolated computer

Make you first hire

Choosing between Heartbeat and Cron isn't just about functionality—it's also about cost control, responsiveness, reliability, and avoiding silent failures. Misconfigurations here are the #2 reason agents become expensive, unresponsive, or unreliable in production (especially on VPS/Clawnify setups).

Cost & Token Usage Comparison


Mechanism

Blocks Main Chat?

Execution Cost Profile

Typical Token Burn Risk

Best Cost-Saving Tricks

Heartbeat

Yes (briefly)

One periodic turn per interval; scales with checklist length & model choice

Medium–High if bloated

Cheap model, silent default, conditional checks, suppress HEARTBEAT_OK

Cron (isolated)

No

Full sub-agent turn per job; can use cheaper/faster models independently

Predictable per job

Cheap model per cron, checkpointing, deliver:false for silent jobs

Cron (main)

Yes (at next HB)

Adds load to next heartbeat turn; no separate model override

Adds to HB burn

Use sparingly; only when main-context output is required


Real numbers from community reports (2025–2026 setups):

  • Lean Heartbeat (5–8 quick checks, Haiku/Mini model, silent if nothing): ~800–2,500 tokens per run → ~$0.001–0.005 per day at 48 runs.

  • Bloated Heartbeat (large context, full analysis, Sonnet/Claude): 10k–40k+ tokens/run → $0.10–0.50+/day easily.

  • Isolated Cron (daily 9 AM report, Haiku): 5k–15k tokens/job → very low daily cost.

  • Heavy Cron (weekly deep analysis, o3/GPT-4o): 50k–200k tokens → still cheaper than equivalent heartbeat because it doesn't repeat.

Key insight: Heartbeat costs scale with frequency + complexity. Cron costs are per-execution and highly optimizable.

Performance & Responsiveness Trade-offs

  • Heartbeat → brief but noticeable chat pauses (5–90 seconds typical). Users chatting frequently notice and get annoyed ("Why is the agent ignoring me?").

  • Isolated Cron → zero interruption. Perfect for 24/7 agents where humans expect instant replies.

  • Under high load (many agents, queue backlog): Heartbeat timing drifts (e.g., "every 30 min" becomes 35–50 min). Cron stays precise.

Battle-Tested Community Patterns (from X/Reddit/GitHub 2025–2026)

  1. Silent-by-Default Heartbeat In HEARTBEAT.md: "If no urgent items AND no user chat in last 2 hours, reply only HEARTBEAT_OK and do nothing else." → 80–95% of runs become invisible → huge token & frustration savings.

  2. Cheap-Model Tiering Run heartbeats + monitoring crons on fast/cheap models (Haiku, Gemini Flash, Mini). Reserve powerful models (Sonnet, o3, GPT-4o) for user chat + important crons only. Config trick: agents.models.tiers or per-cron --model flag.

  3. Checkpointing for Long Crons For reports/analysis >10 min: save intermediate results to file/memory ("checkpoint: wrote section 1 to report.md"). On restart/failure: resume from last checkpoint → prevents lost work and repeated full runs.

  4. Stagger / Jitter Heavy Crons Instead of 10 agents all running "0 9 * * *", offset them (9:00, 9:05, 9:10…). Prevents thundering herd → lower peak API usage & queue delays.

  5. Replace Heavy Heartbeat with Isolated "Heartbeat Cron" Many power users disable native heartbeat (every: "0m") and run a cheap isolated cron every 15–30 min that:

    • Checks inbox/calendar/urgents

    • Spawns subagents if needed

    • Posts to main session only if action required → Combines heartbeat's awareness with cron’s non-blocking precision.

  6. Deliver: false + Discord/Email Sink For monitoring crons: set deliver: false → no chat clutter. Send alerts via Discord webhook, email, or log file instead.

  7. Git-Tracked Configs Put HEARTBEAT.md, cron definitions, and checkpoint files in git → easy rollback, versioning, multi-agent sync.

You've now seen the full picture: Heartbeat for quick, context-smart periodic glances in the main session, and Cron for precise, non-blocking, heavy or standalone automations. The hybrid approach—lean heartbeat + isolated crons—turns your OpenClaw/Clawnify agent from reactive chatbot into a reliable 24/7 ops teammate.

Visual Decision Flowchart (Text Version)






Real-World Example Files & Commands

Minimal HEARTBEAT.md (lean, silent-by-default – copy-paste ready)







Example Cron Commands (via CLI – run these once)

  • Daily 9 AM briefing (isolated, no blocking):



    
    
    
    
    
    



  • One-shot reminder (main session, appears in chat):



    
    
    
    
    
    



  • Weekly deep report (long-running, cheap model):



    
    
    
    
    
    



Troubleshooting Quick Checklist

  • Agent ignores crons / never runs? → Verify with openclaw cron list. Ensure gateway is running 24/7. Check logs for tool failures.

  • Heartbeat eats tokens? → Disable temporarily (agents.defaults.heartbeat.every: "0m" in config), slim HEARTBEAT.md, use cheap model, add "silent by default" rule.

  • Blocking too often? → Move heavy checks to isolated crons. Keep heartbeat ultra-light.

  • Timing drifts? → Use cron for precision; heartbeat is opportunistic.

  • Silent failures? → Add logging/checkpointing in crons. Use Discord/email sinks for alerts (deliver: false + webhook).

Final Recommendation for Most Users (VPS/Clawnify 2026 Pattern)

  1. Heartbeat – 30–60 min, cheap model, HEARTBEAT.md with 4–6 urgent-only checks + silent default.

  2. Cron isolated – All real periodic/heavy work: daily briefings, reports, reminders, polling.

  3. Extras – Memory plugin (persistent recall), git backups, model tiering (cheap for background), silent alerts.

This setup keeps your agent responsive (<5s replies), low-cost, proactive, and reliable—no babysitting required.