Skip to content
zeeshare.com

writing / FDE and agents

Spec-driven development, for real

Spec-driven development, for realPart 12

Memory and handoffs

On this page
  1. Friday, 8:50
  2. Five files, five questions
  3. Start from the handoff, end by writing it
  4. The handoff
  5. The context drop
  6. Which file do I write?
  7. In the kit
  8. Three rules of thumb

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.

Where the work stands What happened Gates and hooks What was learned Claude

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

docs/modules/STATUS.mdthe board: one row per module rentals: in-progress billing: blocked docs/modules/<module>.mdthe handoff: status, done, next step Next step <- start here work.mdper branch: ticked and unticked [x] T1 to T3 [ ] T5 docs/context/<date>-*.mdwhat the code does not show traps dead ends numbers CHANGELOG.mdone line per pull request ACME-41: late fees
Five files, each answering one question a fresh session asks. None of them is the chat.

Start from the handoff, end by writing it

Start session-brief hook STATUS + next steps open the handoff resume Finish /handoff skill next step written STATUS row updated push: work.md gate
The start reads what the last finish wrote. Both are files, so it works across days, machines and people.

Here is what Jonas’s session saw before his first message:

what Claude sees at session start (session-brief hook)
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).
A SessionStart hook’s output is added to Claude’s context. The first thing a fresh session knows is where the work stands.

The handoff

docs/modules/rentals.md
# 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.
The Next step names the file and the change. The notes save the next person the hour Maya lost.

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.

docs/context/2026-03-07-late-fees.md (excerpt)
# 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.
Dated, specific, and about what the code cannot tell you.
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

Three rules of thumb

The last line is the next step

One concrete action with the file and the change. "Continue" is not a next step.

Write what the code cannot say

Traps, dead ends, measurements. The code already says what it does.

Stale is worse than none

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.

See services
Next in this seriesSpec-driven development, for realOne ticket, end to end3 min read