# AI Context rot AI context rot is the gradual degradation of AI context quality over time. It occurs when the instructions, rules, memory, and knowledge that AI agents rely on become stale, inaccurate, or misaligned with the current state of a project, codebase, or workflow. It is the AI equivalent of [[Bit rot]], but applied to the contextual information that shapes AI behavior rather than to stored data. Just as [[Link rot]] breaks references on the Web, context rot breaks the assumptions AI operates under. ## How it happens AI context rot emerges naturally as projects evolve: - **Code changes, instructions don't**: CLAUDE.md files, system prompts, and [[AI Agent Skills]] reference functions, files, patterns, or conventions that no longer exist - **Memory drift**: AI memories (e.g., [[Claude Code Memory]]) accumulate entries that were true at one point but are now outdated or contradictory - **Convention shifts**: Team practices change but the context files still describe the old way of doing things - **Scope creep in rules**: Rules and instructions pile up without pruning, leading to contradictions and bloat that dilute the signal - **Tool and API evolution**: Referenced tools, endpoints, or integrations change or get deprecated This follows the [[Law of staleness]]; the value of context information declines as it ages unless actively maintained. ## Why it matters Context rot silently degrades AI output quality. The AI confidently follows outdated instructions, producing results that look correct but are subtly wrong. Unlike a compiler error, there's no clear signal that something is broken. The failure mode is insidious: things mostly work, but with increasing friction and decreasing relevance. This is a form of [[Technical debt]] specific to AI-augmented workflows. The more sophisticated the context setup (higher [[Levels of AI Context Management]]), the more surface area there is for rot to accumulate. ## Mitigation - **Periodic review**: Treat context files like code; they need maintenance, not just creation - **Version control**: Keep AI context in version-controlled files (CLAUDE.md, skills, memory) so changes are visible and reversible - **Freshness signals**: Timestamp context entries so staleness is detectable. This aligns with [[Context Engineering]] principle: stale information is worse than no information - **Pruning discipline**: Regularly remove outdated entries rather than just adding new ones - **Validation loops**: Use AI itself to flag inconsistencies between its context and the current state of the project - **Tight coupling with source of truth**: Keep context close to the code/knowledge it describes, reducing the gap between reality and instructions ## The tension There is a [[Natural tension between compression and context]] at play. Compressing context too aggressively loses nuance; keeping everything leads to bloat and contradictions. Context rot is what happens when this tension is left unmanaged. The [[AI context is finite with diminishing returns]], so rotting context actively wastes that finite budget. ## References - ## Related - [[Bit rot]] - [[Link rot]] - [[Law of staleness]] - [[Technical debt]] - [[Context Engineering]] - [[Levels of AI Context Management]] - [[Types of Context for AI Agents]] - [[AI context is finite with diminishing returns]] - [[Natural tension between compression and context]] - [[Claude Code Memory]] - [[AI Agent Harness]] - [[AI Agent Skills]] - [[AI Agents]] - [[Progressive Disclosure]] - [[Prompt Lazy Loading AI Design Pattern (PLL)]] - [[Context Drift]] - [[Context Bloat]] - [[Context Hygiene]] - [[Knowledge Decay]] - [[Configuration Drift]] - [[Context Window]] - [[Context Anchoring]] - [[AI Instruction Drift]] - [[Context Poisoning]] - [[Context Distraction]] - [[Context Confusion]] - [[Harness Engineering]] - [[Personal Context Management (PCM)]] - [[AI Context Governance]] - [[Context-as-Code]] - [[Agentic Context Engineering]] - [[Obsidian Starter Kit - Tutorial - Managing AI sessions]] - Operational guidance to prevent context rot in OSK sessions