Sub topic 3
Keeping Plans and Progress Outside the Chat
Assume you can use a terminal, Git, and a coding agent. Also assume you understand that a context window has a fixed token limit.
Keep a Small Progress File
Conversation history is temporary working memory. Store durable decisions and status in a file such as PROGRESS.md. Keep it short enough that a new session can read it quickly.
# PROGRESS.md
## Goal
Migrate the settings loader from INI to TOML.
## Decisions
- Keep `load_settings()` unchanged.
- Use Python's standard-library `tomllib`.
## Done
- [x] Added the TOML parser path.
- [x] Updated loader tests.
## Next
- [ ] Update configuration documentation.
- [ ] Run the full test suite.
## Open questions
- Should INI support remain temporarily?Commit this file when it represents a useful checkpoint. The chat can contain exploration, but the file should contain the current truth.
Start Fresh with a Handoff
When the session becomes crowded, start a new one before the agent begins losing important details. Give the new session the goal, relevant file paths, completed work, unresolved errors, and the next command to run. Point it to PROGRESS.md instead of pasting every previous message.
A good handoff is concrete:
- Read
PROGRESS.md. - Inspect
src/config.pyandtests/test_config.py. - Run the loader tests.
- Preserve the public function signature.
Isolate Noisy Work with Subagents
Use a subagent for a bounded task that produces large or specialized output, such as exploring test failures or comparing two APIs. Ask it to return a short report containing findings, evidence, and recommended changes. Keep the main session focused on decisions and integration.
Do not delegate an undefined goal. A subagent that reads the whole repository without a limit can consume time and produce more context than it saves.
Keep Prefixes Stable for Prompt Caching
Prompt caching can reuse stable early input across requests. Keep project instructions, tool conventions, and common task context unchanged when possible. Put changing details, such as the current error or target file, later in the prompt. Caching reduces repeated processing, but it does not increase the context window or replace concise inputs.
A Routine for Long Sessions
Use this cycle:
- Define one deliverable and its acceptance check.
- Read only the files needed for the next decision.
- Limit command output with capped searches or
tail. - Record decisions and progress after meaningful milestones.
- Compact the session when the summary still fits comfortably.
- Start fresh when the task boundary or context becomes unclear.
- Delegate noisy, independent investigation to a subagent.
Exercise
What should a handoff contain when moving work to a fresh session?
Show answer
The goal, decisions, changed files, unresolved failures, and the next concrete action.