Sub topic 10
Keeping plans and progress in files outside the chat
This chapter assumes you have used a coding agent in a terminal, know basic git, and understand that a model can only read a limited number of tokens at once. It covers external notes: plan and progress files that live in your repository instead of in the conversation.
Why the chat is a poor place for state
A conversation is the most fragile storage you have. Compaction rewrites it, and a new session starts without it. If the only record of a decision is a message from two hours ago, a summary can drop it, and the agent may then reverse the decision without telling you.
A file in the repository does not have these problems. It survives compaction, it survives a restart, and it can be reviewed and committed like any other file. The agent reads it on demand, so it costs context only when you ask for it.
What belongs in a progress file
Keep the file short, so that reading it costs little. A useful file has five parts:
- Goal: one or two sentences describing the finished result.
- Decisions: choices already made, with the reason when it is not obvious.
- Done: completed steps, as a checklist.
- Next: the next concrete steps, in order.
- Open questions: things you or the agent still need to settle.
Here is a progress file for a settings loader migration.
# PROGRESS.md
## Goal
Migrate the settings loader from INI to TOML without changing the public API.
## Decisions
- Keep `load_settings()` signature unchanged.
- Use the standard library `tomllib` for parsing (read-only).
## Done
- [x] Added TOML parser path in `config.py`
- [x] Updated unit tests for the loader
## Next
- [ ] Update the docs page for configuration
- [ ] Run the full test suite and fix failures
## Open questions
- Should INI files still be accepted with a deprecation warning?The Decisions section does the most work. It is the part a summary is most likely to lose, and the part that is most expensive to rediscover.
Plan files versus progress files
A plan file describes the intended route before work starts. A progress file records what has actually happened. You can keep them in one file for a small task. For a larger one, keep them separate, because the plan changes rarely and the progress file changes after every step.
| File | Changes | Written by | Purpose |
|---|---|---|---|
| `PLAN.md` | Rarely | You, or the agent with your review | The intended steps and constraints |
| `PROGRESS.md` | After each step | The agent, with your review | What is done, what is next |
A working routine
- Before coding, ask the agent to draft the plan and read it yourself. Correct it while corrections are cheap.
- Tell the agent to update
PROGRESS.mdafter each finished step, not at the end of the session. - Commit the file with the code. The git history then shows when a decision was made.
- When you compact or start a new session, point the agent at the file first.
A prompt that starts a fresh session can be one line: "Read PROGRESS.md and continue with the first item under Next."
Common errors
- Letting the file grow. If it reaches hundreds of lines, reading it fills the context you were trying to protect. Move finished items into a short summary line.
- Updating only at the end. If the session fails midway, the file is out of date. Update after each step.
- Trusting the file blindly. It can be stale or wrong. Check it against
git statusand the test results before continuing. - Recording output instead of conclusions. Store "the test failed because the fixture lacked a default", not 80 lines of a stack trace.
Exercise
A session ran for two hours and was compacted. Afterward, the agent re-proposed an approach you had rejected earlier. Which section of a progress file would have prevented this, and what should it contain?
Show answer
The Decisions section. It should record the rejected approach and the reason, for example "Do not parse INI and TOML in one function, because it breaks the unchanged public signature." After compaction, the agent reads the file and sees the decision even if the summary dropped it.