| name | heartbeat |
| description | Your heartbeat cron has fired and you need to update your status so the dashboard shows you as alive. Or you are checking whether another agent is responsive before sending them work. Or an agent appears offline or stale in the dashboard and you need to investigate whether their session is still running. A dead heartbeat means the system thinks you are down — update it proactively and check fleet health on every heartbeat cycle. |
| triggers | ["heartbeat","update heartbeat","check health","agent health","fleet health","agent status","is agent alive","agent offline","agent stale","read heartbeats","heartbeat cron","i'm alive","prove alive","agent not responding","stale agent","check fleet","fleet status","who is online","agent last seen"] |
| external_calls | [] |
Heartbeat
The heartbeat is how the dashboard and other agents know you are alive. If you stop updating it, you appear DEAD.
Your Heartbeat Cron
Your heartbeat cron is daemon-managed (default every 4h). It lives in ${CTX_ROOT}/state/${CTX_AGENT_NAME}/crons.json and fires even after restarts — no manual restoration needed. When it fires:
cortextos bus update-heartbeat "WORKING ON: <current task summary>"
cortextos bus check-inbox
cortextos bus log-event heartbeat agent_heartbeat info \
--meta "{\"agent\":\"$CTX_AGENT_NAME\",\"status\":\"active\"}"
cortextos bus list-tasks --agent $CTX_AGENT_NAME --status in_progress
Updating Heartbeat
cortextos bus update-heartbeat "<one sentence: what you are doing right now>"
Call this:
- On every heartbeat cron fire
- On session start (before sending online notification)
- When starting a new significant task
- Before going into a long-running operation
Never claim a status you haven't verified. To confirm your crons are active: cortextos bus list-crons $CTX_AGENT_NAME (shows each cron's next_fire_at). Crons are daemon-managed and survive restarts — if a cron is missing, add it via cortextos bus add-cron.
Reading Fleet Heartbeats
cortextos bus read-all-heartbeats
cortextos bus read-all-heartbeats --format json
Returns: agent name, status, last update timestamp, current task.
Stale threshold: An agent that hasn't updated in >6h should be investigated. Check their status via cortextos status or their heartbeat file.
Checking a Specific Agent
cat "$CTX_ROOT/state/<agent-name>/heartbeat.json"
cortextos status
pm2 list
Heartbeat File Schema
{
"agent": "agent-name",
"status": "active | idle | crashed",
"timestamp": "2026-04-01T12:00:00Z",
"current_task": "What I'm doing right now"
}
Location: $CTX_ROOT/state/{agent}/heartbeat.json