Context Rot: Why Claude Code Sessions Decay, and How to Govern Them
Towards Data Science (Jake Minns, 2026-07-13): a practitioner playbook for managing context-rot in Claude Code. Its thesis line: “governed context is not commanding the model. It is tending the half of the problem that is yours, the content, above a floor the architecture sets.” Grounded in published research (Liu et al. lost-in-the-middle, Laban et al.) but explicitly one practitioner’s unbenchmarked synthesis — T3.
The diagnosis
Minns splits context-rot into intrinsic (architectural: softmax attention’s fixed budget dilutes signal as context grows; retrieval accuracy is a U-curve worst in the middle) and content rot (stale, contradictory, failed-approach material accumulating and getting reprocessed). He adapts Drew Breunig’s four failure modes — confusion (too many tools/skills), clash (early wrong diagnosis the model won’t drop), distraction (broad searches pulling in look-alike code), poisoning (stale notes outliving the correction). The danger is silent: models build on errors rather than flagging them, so a session looks healthy until output breaks.
Governed context — three phases
- Before the first prompt (curation): keep the always-loaded context minimal and high-signal — ruthlessly
edit CLAUDE.md to only what can’t be inferred from code; move domain knowledge into
skills (dormant until invoked) and rules into hooks (run outside the main context);
disable unused MCP servers/skills (
/mcp,/skills); name specific files with@pathover “related” material; use/planfor multi-file tasks. - During work (hygiene): restate goals at milestones to counter the middle-window blind spot; push verbose
runs (tests, logs, audits) to subagents and keep only conclusions;
externalize durable state to notes files (kept accurate); use the
!shell prefix (!git status,!npm test) to inject real project state instead of recalled state. - When it turns (reset over recover): a two-correction threshold (same point corrected twice → reset);
Ctrl+Cto interrupt,Esc+Escto rewind to a checkpoint; snapshot-and-clear rather than trusting the model to summarize a degraded context; hand off a distilled brief (“tried X, failed because Y”), not the transcript.
The “session as a git tree” workflow
His own framing: a clean main thread orchestrates the primary task; disposable branches
(claude --continue --fork-session) absorb messy investigation/debugging, then are thrown away after the
conclusion is extracted; custom skills /conclude (distil a branch to one file) and /merge (load that
conclusion without the noise). Decompose long/parallel work at verifiable seams (passing tests, compiling
builds), and run reviews from a fresh context (/code-review or a reviewer subagent).
Where it sits
The most complete context-engineering playbook the spoke has. It reframes the token-budget levers (tokenmining, headroom, safe-prompt-pruning) as quality, not just cost, moves, and operationalizes the externalize-state and offload-to-subagents threads as rot control. The reset-over-recover discipline is a concrete instance of verification-is-the-bottleneck applied to the session itself. Pairs with cca-f-lost-in-the-middle (the API-level version).
Related
context-rot · cca-f-lost-in-the-middle · jake-minns · tokenmining · safe-prompt-pruning · agent-memory · agent-orchestration · agents-md · loop-engineering · anthropic