skip to content

After upgrading OpenClaw, edits to the workspace HEARTBEAT.md checklist no longer change what the heartbeat checks; why, and what do you do instead?

level: seniorimportance: nice to knowfreq 4%

answer

  1. the runtime stopped reading the file
  2. a private scratch per monitor job
  3. doctor --fix migrates and archives
  4. cron scratch with a job id
  5. context, not a scheduler

basics

~20 s

In OpenClaw 2026.9.9 the runtime never reads a workspace HEARTBEAT.md; heartbeat instructions come from the monitor job's scratch in the state database. Run openclaw doctor --fix to import the file, then edit with openclaw cron scratch <jobId>.

solid answer

~40 s

The heartbeat checklist moved out of the workspace. Each heartbeat automation job owns a private **monitor scratch** in the shared state database, appended to the heartbeat prompt; in 2026.9.9 the runtime never reads `HEARTBEAT.md`. `openclaw doctor --fix` creates the monitor rows, imports each agent's `HEARTBEAT.md` into scratch, converts valid legacy `tasks:` entries into separate automation jobs, archives the original under the state directory's `backups/heartbeat-migration/` and removes the file. From then on you read and write it with `openclaw cron scratch <jobId>` (`--set`, `--file`, `--unset`), taking the id from `openclaw cron list --all`. Scratch is capped at 256 KiB, writes are compare-and-swap guarded, and the agent can replace it through `heartbeat_respond`'s `scratch` field. It is prompt context, not a scheduler.

go deeper

for a junior

Recall that the heartbeat checklist now lives in the monitor job's scratch, not in a workspace HEARTBEAT.md file.

for a middle

Explain the doctor --fix migration steps and how to read and write scratch with openclaw cron scratch and a job id from cron list --all.

for a senior

Diagnose an upgraded install that ignores checklist edits or went silent, using the empty-scratch skip, the 256 KiB cap and compare-and-swap writes.

for a principal

Treat scratch as prompt context the agent itself can rewrite, not a control; keep schedules in automation jobs and plan the doctor --fix step for every agent.

## What changed Older OpenClaw installs kept the heartbeat's standing checklist in a workspace file, `HEARTBEAT.md`, that the agent read on each tick. By the 2026.9.9 release that file is no longer part of the runtime. The heartbeat became a **system-owned automation job** in the Automations scheduler, and its checklist moved with it into a **monitor scratch**: a private text field owned by that job and stored in the **shared state database**. The docs are explicit: runtime heartbeat instructions come from database scratch only, and the runtime never reads `HEARTBEAT.md`. So an upgraded install where someone keeps editing `HEARTBEAT.md` is editing a file nothing reads. The heartbeat either sees the scratch that was imported earlier or no scratch at all. ## Migrating with Doctor `openclaw doctor --fix` performs the migration in a fixed order: 1. Creates or updates the system-owned monitor rows from `agents.*.heartbeat`. 2. Imports each agent's workspace `HEARTBEAT.md` into that agent's monitor scratch. 3. Converts any valid legacy `tasks:` entries into **independent automation jobs**, keeping each entry's interval and previous last-run timing, and removes the retired block while keeping the surrounding prose. 4. Archives the original under the state directory in `backups/heartbeat-migration/` and removes the workspace file. If the workspace and the state directory are on different filesystems, Doctor keeps the original in a private `HEARTBEAT.md.doctor-archived.*` directory beside its former location. Doctor stops with an error instead of migrating a `HEARTBEAT.md` whose symlink target escapes the workspace, and refuses automatic removal of one with multiple hard links. ## Managing scratch afterwards Find the job id with `openclaw cron list --all`, where the monitor appears as `Heartbeat (agent-id)`. `openclaw cron` is also registered as `openclaw automations`. ```bash openclaw cron scratch <jobId> # print it openclaw cron scratch <jobId> --set "- Anything urgent in the inbox?" openclaw cron scratch <jobId> --file notes.md # - reads stdin openclaw cron scratch <jobId> --unset # remove it ``` Properties worth knowing: - **Capped at 256 KiB** and never shown in `cron list` or `cron runs` output. - **Compare-and-swap guarded**: a write fails rather than overwrite a concurrent edit; `--expected-revision <n>` pins an explicit revision. - **Writable by the agent**: during a heartbeat turn, `heartbeat_respond` accepts a `scratch` string that **fully replaces** the scratch for future heartbeats. You can also ask the agent in chat to run the CLI command. - **Kept when cadence is off**: with `every: "0m"` the job is disabled but its scratch is retained. ## Empty scratch and missing scratch behave differently | State | What the heartbeat does | | --- | --- | | No scratch exists | the heartbeat still runs; the model decides what to do from the prompt | | Scratch exists but is effectively empty | the run is **skipped** to save an API call, reported as `empty-heartbeat-file` | | Scratch has content | content is appended to the heartbeat prompt | Effectively empty means only blank lines, Markdown or HTML comments, headings, fence markers or empty checklist stubs. The skip reason still carries the old file name, a leftover worth recognising in logs. ## What scratch is not - **Not a scheduler.** A `tasks:` block in scratch is no longer parsed as schedules; recurring checks belong in their own automation jobs with their own cadence, enable state and run history. - **Not a place for secrets.** It becomes prompt context, so API keys, phone numbers and tokens do not belong there. - **Not an enforcement layer.** Scratch shapes what the model looks at; what it may do is still decided by tool policy, exec approvals and the sandbox. Keep it tiny. Every line is resent on every tick, so a short checklist is both cheaper and easier for the model to follow.

  • In OpenClaw 2026.9.9, what is the difference between a heartbeat monitor with no scratch and one with effectively empty scratch?
    With no scratch row the heartbeat still runs and the model decides from the prompt alone. With scratch that holds only blank lines, comments, headings, fence markers or empty checklist stubs, OpenClaw skips the run to save an API call and reports `empty-heartbeat-file`. Deleting content without `--unset` can therefore silence the monitor.
  • An old OpenClaw HEARTBEAT.md had a `tasks:` block with intervals; where do those checks live after `openclaw doctor --fix`?
    Doctor converts each valid entry into an independent automation job, keeping its interval and previous last-run timing, and removes the block from the scratch while keeping the surrounding prose. Those jobs keep heartbeat active hours, cooldown, flood and busy guards, and jobs due together can coalesce into one heartbeat turn.

  • The heartbeat rereads HEARTBEAT.md from the workspace on every tick in 2026.9.9.
  • A tasks: block in the scratch schedules recurring checks.
  • Clearing the scratch to a heading makes the heartbeat check everything.
  • Monitor scratch is a safe place to keep the API keys a check needs.
  • Doctor deletes HEARTBEAT.md without keeping a copy.

Assumes OpenClaw 2026.9.9, where heartbeat instructions come only from monitor scratch and HEARTBEAT.md survives only as a Doctor migration source.