🛰️ Daily AI Frontier
‹ back to 2026-08-12

Why Does CLAUDE.md Keep Growing? Catastrophic Remembering in Agentic Coding

arXiv cs.AI LLM Agents Kushal Chakrabarti 2026-08-11

TL;DR - An empirical + methodological study of why agentic coding prompt files (e.g. CLAUDE.md) grow without bound, naming the effect "catastrophic remembering" and proposing prompt comments that encode an instruction's rationale as the fix. It matters because unbounded prompt growth degrades instruction-following and maintainability in real agentic coding workflows.

  • Root cause framing: appending is cheap, but deleting an instruction whose rationale is lost risks correctness regressions at O(2^|D|) verification cost in a prompt of |D| instructions — the inverse of catastrophic forgetting.
  • Large-scale measurement across 247,694 instruction lifetimes in 1,867 repositories: prompts grow +226% over their lifetime, +4.9 net instructions per commit, and older instructions are progressively less likely to be deleted (log-hazard −0.032/commit).
  • Intervention: inverting IFEval creates verifiable worlds with known optimal prompts; adding comments that encode latent reasoning removes 99.3% of excess instructions (+211.3% → +1.4% excess).
  • Real-world transfer: the same inversion applied to WildIFEval shows prompt comments improve agentic instruction-following by up to 23.1%.

view merged work →