Spec-driven development, for real
Spec-driven development, for realPart 12
Memory and handoffs
On this page
New to the short codes like REQ, ADR or AC? See the vocabulary in Part 1, or hover over any code.
In short: A Claude session starts with no memory of yesterday. So where the work stands lives in files: a status board (STATUS.md), one handoff per module whose most important line is the next step, a running tracker (work.md), one changelog line per pull request, and dated context drops for what the code cannot show. A session-start hook reads the board and every in-progress next step to Claude before it does anything. A handoff skill writes them back at the end.
Part 11 proved the work. This part covers block 11, which makes sure the next person can carry on from it. The team and product are invented.
Friday, 8:50
Maya is on leave today. Jonas opens a new Claude session to finish the last task. Before he types anything, Claude already knows that rentals is in progress, that the next step is the staff fee panel in fee-panel.tsx, and that billing is blocked on OQ-07. It read that from a hook, not from Jonas.
His first message is “carry on”. It is enough.
Think of it like this: On a ship, the officer coming on watch reads the log before taking the wheel: course, weather, anything odd. The officer going off watch writes it before leaving. Nobody relies on catching the other in the corridor.
Five files, five questions
Start from the handoff, end by writing it
Here is what Jonas’s session saw before his first message:
SESSION BRIEF (spec-driven-kit). Before writing code, read in this order: 1. docs/modules/STATUS.md 2. the module handoff 3. its context drop 4. the closest CLAUDE.md Resume from the handoff's "Next step". Update the handoff, STATUS.md and work.md before you finish. Work in flight: - billing [blocked] next: Post late fees once OQ-07 is answered: fill accounts.late_fee per company. - rentals [in-progress] next: T5: show fee_basis on the staff return panel (web, fee-panel.tsx).
The handoff
# rentals: handoff
- Status: in-progress
- Last worked by: Maya Last updated: 2026-03-07
- Code: src/rentals/ Rules: src/rentals/CLAUDE.md
- Context drop: docs/context/2026-03-07-late-fees.md
- Specs: REQ-041 Decisions: DEC-018, ADR-0009 Open: OQ-07
## Done
- [x] T1-T3: terms.late_fee_minor, stored at return, gated serializer
(test_late_fee.py, test_return_fields.py)
- [x] T4: schema exported, web client regenerated
## Remaining
- [ ] T5 (web): staff fee panel
## Next step <- start here
T5: in web/src/features/returns/fee-panel.tsx render
<FeeBasis value={ret.fee_basis} /> with no role check (review #88).
## Decisions made
- A 59-second delay is one started hour (definitions/late-return.md).
## Notes for the next session
- The test fixtures rent for 2 hours by default: the day cap needs
a 30-hour fixture or it is never exercised.
Rule: the next step is one concrete action: the file and the change. “Continue the feature” sends the next session back to reading everything.
The context drop
Handoffs say where the work stands. Context drops say what was learned: the traps, the dead ends, the numbers.
# Late fees: what we learned (2026-03-07) Supersedes nothing. Read with docs/modules/rentals.md. ## Traps that cost time - Rates can be edited after a return. Computing fees at invoice time showed one fee and billed another. Settled by ADR-0009. - The cap test passed with min() removed: default fixtures rent for 2 hours. Use the 30-hour fixture. - A resolved conflict on day 12 dropped Jonas's rounding fix. Caught by the merge warning (9 behind). Always merge main in first. ## Measured - Recording a return: 38 ms p50 with the fee, 35 ms without.
Under the hood: keeping memory honest
- When documents disagree, the newest dated section wins, and you name the file and date you took the answer from. Mark the older one superseded with today’s date.
- Trackers merge by union (Part 10), so many pull requests can append at once without conflicts. Append; do not reorder lines another pull request may also touch.
- Runbooks in
docs/runbooks/are a different kind of memory: written for whoever is on call, symptom first, one query to a diagnosis, then the branch. - Claude’s own auto memory (
/memory) is useful for personal facts about your machine, but it stays on that machine. Anything a teammate needs goes in the repository. See memory. - Keep trackers short. The real project’s web tracker grew past twenty thousand lines. Archive finished sections once they are in the changelog; the tracker is for what is true now.
- Never put secrets, personal data or customer data in any of these files.
Which file do I write?
- I am starting a session: Read the brief, then the handoffSTATUS, the module handoff, its context drop, the closest CLAUDE.md. Resume from Next step.
- I am stopping for the day: The handoff skillwork.md, the handoff with a concrete next step, the STATUS row, and a context drop if something was learned.
- I lost an hour to something: A context dropThe trap, how you found it, what to do instead. Dated and linked from the handoff.
- Two docs say different things: The newest dated sectionName the file and date you used, and fix or mark the older one superseded.
- Production is broken: A runbookWritten for whoever is on call: symptom first, one query to a diagnosis, then the branch.
In the kit
docs/modules/_TEMPLATE.md,STATUS.md,work.md,CHANGELOG.md, and the context and runbook templates.- The
session-briefhook and thehandoffskill.
Three rules of thumb
One concrete action with the file and the change. "Continue" is not a next step.
Traps, dead ends, measurements. The code already says what it does.
A wrong handoff sends the next session the wrong way with confidence. Update it every time.
QuizMaya’s handoff says “Next step: keep going on late fees”. What is wrong with it?
Show the answer
Answer: It names no file and no change, so the next session has to rediscover both
A next step is a single concrete action: which file, what change. Anything vaguer sends the next session back to reading the code to find out where things stand.
Words in this post:
- Handoff: a module’s status, what is done, what is left and the next step.
- STATUS.md: the board with one row per module.
- work.md: the running tracker per branch, updated on every push.
- Context drop: a dated note on what was learned that the code cannot show.
- Session brief: a hook that reads the board to Claude at session start.
Next, Part 13: One ticket, end to end puts all twelve blocks in order and walks ACME-41 through every one.
Setting up Claude Code or AI agents for your team?
I help teams build this: agents, RAG search and Claude Code setups that hold up in production.
Series
Spec-driven development, for real
- Spec-driven development, for realThe building blocks
- Spec-driven development, for realThe paper trail
- Spec-driven development, for realPrinciples and scoped rules
- Spec-driven development, for realDecision records
- Spec-driven development, for realDefinitions and open questions
- Spec-driven development, for realFeature specs and plans
- Spec-driven development, for realThe contract
- Spec-driven development, for realGates that make Claude show its work
- Spec-driven development, for realSkills and reviewers
- Spec-driven development, for realGuardrail hooks
- Spec-driven development, for realProof of done
- Spec-driven development, for realMemory and handoffsyou are here
- Spec-driven development, for realOne ticket, end to end