From agent
Runs periodic agent heartbeat checks including cron health, memory consolidation, and proactive work. Useful for maintaining long-running sessions and repairing orphaned cron tasks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent:heartbeatThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Run the agent's periodic checks. Triggered every 30 minutes by a local cron, or manually.
Run the agent's periodic checks. Triggered every 30 minutes by a local cron, or manually.
Cron health (ALWAYS — even outside active hours). This is infrastructure, not a user-facing check; it is what heals orphaned reminders in long-running sessions (see issue #32). This step manages its own state: it reads AND writes the cronAudit field of memory/heartbeat-state.json itself, here, regardless of whether the later steps run. Every heartbeat:
ToolSearch(query="select:CronList,CronCreate").bash "$CLAUDE_PLUGIN_ROOT/skills/crons/writeback.sh" prune-expiredCronList and pipe its FULL output to:
bash "$CLAUDE_PLUGIN_ROOT/skills/crons/writeback.sh" audit
(mechanical diff: refreshes lastSeenAlive, relinks survivors, prints orphan key=… / blocked key=… lines and an audit: alive=K/N … summary; exit 4 = format drift — stop, surface it, do not create anything).orphaned=0 and blocked=0: clear cronAudit.pending in memory/heartbeat-state.json if set — done, say nothing.orphaned>0: repair orphan key= lines ONLY (NEVER blocked key= lines — those have ambiguous live duplicates; recreating them would add a third copy). touch "$CLAUDE_PROJECT_DIR/memory/.reconciling" (the registry's crons are replayed verbatim, so the cron-from.sh stamp gate must be bypassed), then for each orphan key: CronCreate with that entry's cron/prompt/recurring from memory/crons.json + writeback.sh set-alive --key <key> --harness-task-id <new id>; continue past individual failures. Then rm -f "$CLAUDE_PROJECT_DIR/memory/.reconciling" immediately and re-run CronList → audit.cronAudit.pending (with a timestamp) in memory/heartbeat-state.json. Notify the user ONLY when the same key(s) were already in cronAudit.pending from the previous beat — one notice (orphans: "couldn't re-create X, run /agent:crons reconcile"; blocked: "X has duplicate live reminders, review with /agent:crons list"), then record it as notified so it doesn't repeat every beat.Check active hours — read agent-config.json for heartbeat.activeHours. If outside the window, skip the remaining steps silently (the cron-health step above already ran).
Load state — read memory/heartbeat-state.json (if exists) to know when each check last ran. Avoid repeating checks done less than 30 min ago.
Read HEARTBEAT.md — this is the checklist. Follow it strictly. Do not infer or repeat old tasks from prior conversations. If nothing in the checklist needs attention, skip to step 7.
Execute checks — rotate through the items in HEARTBEAT.md, doing 2-4 per heartbeat (not all every time). For each:
dream(action='status') → note high-recall items not yet promotedProactive work (do without asking):
IMPORT_BACKLOG.md if it exists — remind user about pending itemsUpdate state — write memory/heartbeat-state.json with timestamps for each check performed.
Notify or stay quiet:
The agent should edit HEARTBEAT.md during normal conversations when something needs periodic attention:
- **Email inbox** — check for urgent unread to HEARTBEAT.mdRule: batch similar checks into HEARTBEAT.md instead of creating multiple cron jobs. Heartbeats are cheaper (one turn, multiple checks) than separate crons (one turn each).
{
"heartbeat": {
"activeHours": {
"start": "08:00",
"end": "23:00",
"timezone": "America/Santiago"
}
}
}
Outside this window, heartbeats skip silently. Configure via /agent:settings.
Created automatically on first session (SessionStart hook):
*/30 * * * * (every 30 minutes)/agent:service installnpx claudepluginhub crisandrews/clawcode --plugin agentRuns diagnostic checks on agent workspace: config, identity, memory, SQLite index, crons, hooks, HTTP bridge, messaging plugins, and dreaming. Supports --fix for safe auto-repairs. Use after agent create/import or when something feels off.
Scans your Claude setup (CLAUDE.md, SOUL.md, MCPs, plugins) and guides improvements with setup, review, or status modes. Use for personal AI system health.
Initializes aweek projects by creating the .aweek data directory and optionally installing a 10-minute heartbeat scheduler via launchd on macOS or crontab on Linux/POSIX.