Context Rot
The progressive degradation of Claude Code's output quality as session length grows, caused by attention dilution across an ever-larger token history.
Key points
- Retrieval accuracy drops from 92% at 256K tokens to 78% at 1M tokens [src-011]
- Analysis of 18K thinking blocks across 7K sessions: thinking depth dropped 67% and "edit without reading" behaviour rose from 6% to 34% in long sessions [src-011]
- One developer tracked 100+ message chats and found 98.5% of tokens were spent re-reading old conversation history — not producing new output [src-011]
- Token cost is exponential: message 30 in a chat can cost 31x more tokens than message 1, because the entire history is re-read each turn [src-011]
- Auto-compaction fires at 95% context use and retains only 20–30% of detail — the worst possible moment (most degraded state) [src-011]
Symptoms
- Model edits files without reading them first
- Contradicts earlier decisions made in the same session
- Vague or repetitive outputs
- Increasing error rate on tasks it handled correctly earlier in the session
Remediation patterns
- Cap Opus sessions at ~120K tokens (12% of 1M window), then summarise and /clear [src-011]
- Use /session-handoff skill to generate a structured context handoff document before clearing [src-011]
- Use /re (rewind) to drop failed attempts that silently pollute future responses [src-011]
- Convert documents to markdown before ingestion (33–90% token reduction) [src-011]
- Use /btw for side questions that don't need to enter conversation history [src-011]
- Session chaining: discovery → planning → execution sessions, each consuming only the prior session's output document [src-011]
Related entities
- Claude Code — the primary environment where context rot occurs
Related concepts
- Context Management — the broader discipline; context rot is its failure mode
- Session Chaining — structural solution
- Adaptive Thinking — zero-reasoning turns (a symptom of context rot) correlate with hallucinations
- Token Economics — cost model underlying the exponential growth
- Markdown Conversion For Token Reduction — preventive measure
Source references
- [src-011] Nate Herk — Claude Code power features cluster (2026-04-20 to 2026-04-27)
Recommended next
Keep reading from this thread
From 500 indexed pages and articles.
- Wiki concept Session Chaining The practice of decomposing a large project into a sequence of specialised Claude Code sessions — discovery, planning, execution — where each session's output Related by 011
- Wiki concept Session Handoff The practice of packaging the useful state from a Claude Code session into a concise handoff document before clearing context or moving work into Related by 011
- Wiki concept Adaptive Thinking Anthropic's dynamic reasoning budget allocation introduced 2026-02-09. The model decides per-turn whether to allocate reasoning tokens based on perceived task complexity, rather than applying Related by 011