Scheduled Runs
Clawpy agents are not just reactive — they can wake on a schedule, check for pending work, and operate autonomously in the background. This is powered by the Heartbeat Protocol.
How It Works
The heartbeat system uses a three-stage cycle:
- Triage — A lightweight local model (the Guardian) checks whether there is any work to do. If there is nothing pending, the expensive LLM is never called, saving you API costs.
- Execute — If there is work, the full agent wakes up, reads its identity and memory, checks out pending tasks, and executes them.
- Sleep — Once all tasks are complete, the agent goes back to sleep until the next scheduled wake.
This means agents can perform recurring tasks — checking logs, generating reports, monitoring systems — without you being present.
Setting Up a Scheduled Run
Configure scheduled runs from the dashboard under Agent Settings → Routine:
- Interval — How often the agent wakes (e.g. every 5 minutes, hourly, daily)
- Wake conditions — What triggers a full wake-up (pending tasks, new messages, time-based)
- Budget limits — Maximum API spend per wake cycle
Example schedule for a log auditor:
Interval: Every 6 hours
Wake condition: Pending tasks or new log entries
Budget: 5,000 tokens per cycle
The Guardian (Cost Control)
The Guardian is a tiny local model that runs before any expensive LLM call. It reads the agent's task list and recent memory, then decides:
- WAKE — There is meaningful work to do. Invoke the full agent.
- SLEEP — Nothing has changed. Skip this cycle entirely (zero API cost).
This prevents unnecessary API spending on idle cycles.
Task Orchestration
When an agent wakes, it follows a standardised operating procedure:
- Read identity — Confirm its role and constraints
- Read memory — Understand current state and context
- List tasks — Check for assigned work
- Checkout — Lock a task to prevent double-work
- Execute — Perform the actual work
- Release — Mark the task as done, blocked, or failed
- Log — Record the outcome in memory
- Delegate — If needed, assign sub-tasks to other agents
All task checkouts are atomic — if two agents try to grab the same task, only one succeeds.
Executive Heartbeats
Manager-level agents (CTO, CMO, Operations) have extended heartbeat protocols that include supervisory responsibilities like reviewing team output, tracking budgets, and rebalancing workloads.