Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/paulonasc/orchestra/heartbeatgit clone --depth 1 https://github.com/paulonasc/orchestraWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/paulonasc/orchestra/heartbeat)<a href="https://agentmods.dev/commands/paulonasc/orchestra/heartbeat"><img src="https://agentmods.dev/badge/commands/paulonasc/orchestra/heartbeat.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01301 |
| Opus 5 | $0.00000 | $0.00651 |
| Sonnet 5 | $0.00000 | $0.00260 |
| Haiku 4.5 | $0.00000 | $0.00130 |
Grade A, and why
heartbeat scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/o heartbeat — Periodic state audit
Lightweight check that audits whether Orchestra state is current and fixes gaps.
How it gets triggered: The agent runs /o heartbeat on the first /o invocation in a session (see dashboard section). Hooks do NOT trigger heartbeat — this prevents compaction loops.
Usage:
/o heartbeat— audit now + auto-schedule recurring checks every 30 minutes/o heartbeat stop— cancel the recurring schedule
The main agent does exactly this (in order):
Step 1 — Quick mental check (NO tool calls): Did I do anything noteworthy since the last heartbeat? If no → output Heartbeat: all current. and stop. Zero tool calls. Done. This is the common case.
Step 2 — Schedule cron (first invocation only, 3 tool calls in main context):
Cron scheduling MUST happen in the main agent, not a subagent. Subagents can't reliably construct the exact cron prompt — they tend to simplify it to /o heartbeat, creating the recursive loop this system is designed to prevent.
# 1. List existing cron jobs
CronList()
# 2. Delete ALL existing cron jobs (prevents duplicates after compaction)
CronDelete(<each job id>)
# 3. Create new cron with INLINE prompt (NEVER "/o heartbeat")
CronCreate(
cron: "*/30 * * * *",
prompt: "Quick mental check: did I make commits, decisions, or progress since my last check? If yes, update .orchestra/state/sessions/{session-id}.md briefly. If no, do nothing and say nothing. Do NOT run /o heartbeat. Do NOT create cron jobs. Do NOT read files unless you need to write. Maximum 1 tool call.",
recurring: true
)
CRITICAL: The cron prompt must NEVER be /o heartbeat or invoke any skill. It is a minimal inline instruction. If the cron invokes the skill, it creates a recursive scheduling bomb that consumes the entire context window.
Store in state/sessions/{session-id}.md: heartbeat_scheduled: true, heartbeat_job_id: <id>, heartbeat_created_at: <ISO timestamp>
Step 3 — State audit (subagent, only if noteworthy work happened):
If you did something worth recording, spawn a background subagent for the file writes:
Agent(
description: "Heartbeat state update",
prompt: "Update Orchestra state at <ORCH_ROOT>. Active thread: <THREAD>.
What happened since last heartbeat:
<bullet list: commits, decisions, progress, blockers, current state>
Update ONLY files that need changes:
- state/sessions/{session-id}.md — current working state
- memory/YYYY-MM-DD.md — append daily log entry
- threads/<thread>/progress.yaml — mark items done if applicable
Do NOT create cron jobs. Do NOT run /o heartbeat. Do NOT invoke skills.
Return a single summary line of what you updated.",
run_in_background: true,
mode: "bypassPermissions"
)
Step 4 — Output: One line to the user. Either Heartbeat: all current. or Heartbeat: [what the subagent updated]. Scheduled every 30 min.
/o heartbeat stop — inline: CronList → CronDelete each → remove heartbeat fields from session file. Confirm: Heartbeat cancelled.
Rules:
- The no-op case (nothing happened) = ZERO tool calls. Just one line of text.
- Cron scheduling = main agent only (3 tool calls, deterministic).
- State audit file I/O = subagent only (background, returns one line).
- Hooks NEVER trigger
/o heartbeat. Only the first/oinvocation and manual user runs do. - After compaction, do NOT re-run heartbeat. The cron is still alive.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 100 lines · 0 tokens per session scan A b0da1444b632
heartbeat is a command published in the GitHub repository paulonasc/orchestra (15 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,301 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.