···110110111111### `todo_update`
112112113113-Maintains `TODO.md` / `TODO.DONE.md` under `file_state_dir`, including add and complete operations.
113113+Maintains todo files under `file_state_dir`, including one-off todos in `TODO.md`, completed one-off todos in `TODO.DONE.md`, and recurring todos in `TODO.RECUR.md`.
114114115115- Key limits: `add` requires `people`; `complete` uses semantic matching and will error on no-match or ambiguous match.
116116-- Recurring todos are added with `action=add_recurring` and stored in `TODO.RECUR.md` under `file_state_dir`:
117117- ```text
118118- - [ ] [Next](2026-05-02 09:00), [Repeat](daily), [TZ](Asia/Tokyo), [ChatID](tg:-100123) | Remind [John](tg:@john) to submit report.
119119- ```
120120- Supported repeat values are `daily`, `weekly`, `every N days`, and `every N hours`. `TZ` is optional; when omitted, the runtime local timezone is used. Heartbeat expands due recurring records into ordinary `TODO.md` items, advances `Next`, then includes the current open `TODO.md` items in the heartbeat task.
116116+- Recurring todos are added with `action=add_recurring`.
117117+118118+For the runtime workflow around TODO files and `HEARTBEAT.md`, see [TODO and Heartbeat](/guide/todo-and-heartbeat).
121119122120## Dedicated Tools
123121
···11+---
22+title: TODO and Heartbeat
33+description: How TODO files and HEARTBEAT.md let the agent track work outside the current chat.
44+---
55+66+# TODO and Heartbeat
77+88+Heartbeat is the runtime trigger for recurring checks. It can run on a timer or be started by an external poke. Each heartbeat run creates a fresh runtime task and does not include chat history.
99+1010+## Heartbeat Flow
1111+1212+On each heartbeat tick or poke:
1313+1414+1. The runtime reads `TODO.RECUR.md`.
1515+2. Due recurring todos are copied into `TODO.md`.
1616+3. Their `Next` timestamp is advanced.
1717+4. The runtime reads `TODO.md`.
1818+5. If there are open todos, they are added to the heartbeat task.
1919+6. The runtime reads `HEARTBEAT.md`.
2020+7. If `HEARTBEAT.md` is not empty, it is added to the heartbeat task.
2121+8. If the task has any content, the agent handles it with normal tools, including `todo_update`.
2222+2323+If `TODO.RECUR.md`, `TODO.md`, and `HEARTBEAT.md` produce no task content, no agent task is started.
2424+2525+## HEARTBEAT.md
2626+2727+`HEARTBEAT.md` is the standing instruction for each heartbeat. It should describe what the agent should check, not a one-off user request.
2828+2929+Good uses:
3030+3131+- Check open todos.
3232+- Look for due follow-ups.
3333+- Inspect routine files.
3434+- Send reminders when a todo asks for it.
3535+3636+Avoid putting one-off tasks directly into `HEARTBEAT.md`. Put those in `TODO.md`, or use `TODO.RECUR.md` if they repeat.
3737+3838+## TODO Flow
3939+4040+TODO files hold concrete work. The `todo_update` tool writes and completes TODO records. During heartbeat, current open `TODO.md` items are added to the heartbeat task so the agent can act on them.
4141+4242+There are three TODO files.
4343+4444+### TODO.md
4545+4646+`TODO.md` contains work that should happen once:
4747+4848+```text
4949+- [ ] [Created](2026-05-01 12:41), [ChatID](tg:-100123) | Remind [John](tg:@john) to submit report.
5050+```
5151+5252+Use `TODO.md` for reminders and tasks that should be handled once.
5353+5454+### TODO.DONE.md
5555+5656+`TODO.DONE.md` contains completed one-off todos. When `todo_update` completes a `TODO.md` item, it moves the record here.
5757+5858+Recurring todos do not move to `TODO.DONE.md`.
5959+6060+### TODO.RECUR.md
6161+6262+`TODO.RECUR.md` contains repeat rules:
6363+6464+```text
6565+- [ ] [Next](2026-05-07 15:00), [Repeat](weekly), [TZ](Asia/Tokyo) | Play tennis.
6666+- [ ] [Next](2026-05-02 09:00), [Repeat](every 6 hours) | Check the report queue.
6767+```
6868+6969+Supported repeat values:
7070+7171+- `daily`
7272+- `weekly`
7373+- `every N days`
7474+- `every N hours`
7575+7676+`TZ` is optional. If it is omitted, the runtime local timezone is used.
7777+7878+Recurring records stay in `TODO.RECUR.md`. On heartbeat, due records are copied into `TODO.md`, and only their `Next` timestamp moves forward.
7979+8080+## Choosing the File
8181+8282+| Need | File |
8383+|---|---|
8484+| Tell the agent what to check on each heartbeat | `HEARTBEAT.md` |
8585+| Do this once | `TODO.md` |
8686+| Keep a record of completed one-off todos | `TODO.DONE.md` |
8787+| Do this repeatedly | `TODO.RECUR.md` |
8888+8989+For the tool that updates todo files, see [`todo_update`](/guide/built-in-tools#todo_update). For state directory placement, see [Filesystem Roots](/guide/filesystem-roots).