Direct answer · the boundary problem
How do you resume a Claude Code session after context loss?
Stop making the next session reconstruct the project — hand it a record instead. Compaction and session death are where AI coding work quietly loses its memory. The summary that survives is lossy and confident; the touched files are expensive to re-read. A compact, verified work record is both smaller and checkable.
22,897
tokens · re-read the 8 touched files
→
1,013
tokens · read one VeriCommand record
Measured on a real multi-file task (RatePilot team seats), tiktoken o200k_base. Method, payloads, and caveats.
What happens when Claude Code compacts my session?
When the context window fills, the session gets summarized and work continues from the summary. That summary is lossy by construction: file contents, decisions, and verification state compress into prose, and the next stretch of work proceeds confidently from whatever survived. Nothing tells you which details were dropped — the model sounds exactly the same either way.
How do I resume without re-reading the whole project?
Keep durable state outside the context window. Even without special tooling, three habits help:
- A working-state file the agent updates as it goes — what's done, what's verified, what's next.
- A written hand-off before compaction — ask the agent to write its successor a briefing while it still knows everything.
- Commit early and often — git history is ground truth a fresh session can read cheaply.
The structural version of those habits is VeriCommand: work is recorded as packets, dispatches, signals, and returns on a hash-chained record, and the resuming session reads that one compact record. On the measured task that read cost 1,013 tokens versus 22,897 for re-reading the touched files — about 23× smaller, net-positive from the first boundary.
Source: the VeriCommand token benchmark →
Why not just trust the compaction summary?
Because it is confident even where it's wrong, and there's no way to check it from inside the session. In one recorded production incident, a resumed session's carried summary asserted the update feed was on one version; the board's chain-verified truth record said another. The record was right, the memory was stale — and the deploy went out correct only because the session was required to read the record instead of trusting itself. A summary is a recollection; a record is evidence.
The AI's own account of that incident →
Does this work when I switch models?
Yes — the record is model-neutral. Claude Code, Codex, Cursor, or Kimi can each read the same chain-verified record at a boundary. A hand-off between vendors costs the same compact read as a resume within one tool, instead of a fresh reconstruction per model. That's the point of putting the memory in the record instead of in any one agent.
How cross-model hand-offs work →
What does it cost inside one continuous session?
About 427 tokens of overhead, and no saving. With no boundary there is nothing to resume, so a single unbroken session is the honest worst case. The measured advantage begins at the first compaction, session death, or model hand-off — which, on long tasks, is not an if.
See the honest one-session case →