Skip to content

Measure What Survives Compaction, Then Write the Rest Down

2026-07-23

Three hours into chasing a loss spike, you hold ten facts that matter: the seed that reproduces it, the step where it starts, the config hash, the learning-rate change you ruled out, and the commands already run. Then the session compacts, and the next turn remembers the proposed fix but not the seed.

Claude Code's context-management guidance gives you controls. Auto compaction summarizes what matters most, including code patterns, file states and key decisions. You can run /compact with instructions, such as /compact Focus on the API changes, or add compaction instructions to CLAUDE.md, such as always preserving the list of modified files and test commands. The rewind menu also offers Summarize from here and Summarize up to here.

Steering is not a guarantee, and the gap is something you can measure.

The protocol. This course has not run it; here is how you would.

  1. Over a realistic stretch of work, state ten specific facts in a session.
  2. Fork or copy the session. Compact one copy with a plain /compact, and the other with instructions that name the kinds of facts to keep.
  3. Ask each copy to list all ten facts. Score each fact as recalled exactly, recalled wrong or missing.
  4. Repeat over five sessions with different facts.

With 5 × 10 = 50 facts per condition, a 90% recall rate has a 95% half-width of 1.96 × √(0.9 × 0.1 / 50) ≈ ±0.08. That is enough to see a large difference between conditions, not a small one. Count "recalled wrong" separately: a confidently wrong seed costs more than a missing one.

Whatever the numbers show, write the facts that must survive to a HANDOFF.md before the context fills. On resumption, compare it with git status and rerun the checks whose results may have changed. Chapter 21 measured where models lose facts in long contexts and found that pinned records held on every model it tried.