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

📅 2026-08-11
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work introduces the concept of “catastrophic memory,” referring to the uncontrolled growth of an agent’s prompt file due to the inability to safely remove obsolete instructions. By analyzing the lifecycle of nearly 250,000 instructions, the study uncovers the mechanisms driving prompt redundancy and proposes a novel annotation-based reasoning encoding method to precisely suppress redundant instructions in verifiable environments. Experimental results demonstrate that the proposed approach reduces redundant instructions by 99.3% on synthetic tasks and improves instruction-following performance by 23.1% on real-world tasks, substantially outperforming existing methods.
📝 Abstract
Agentic coding READMEs like CLAUDE.md grow without bound in real repositories, stopping only when the repository retires or someone rewrites the file wholesale. We trace this to imperfect recall: appending an instruction is always cheap, but once an instruction's rationale is gone, deleting it without risking a correctness regression costs O(2^|D|) in a prompt of |D| instructions. We name the resulting divergence catastrophic remembering, the inverse of catastrophic forgetting around which continual learning is organized. First, we characterize this phenomenon across 247,694 instruction lifetimes in 1,867 repositories: agentic prompts grow without bound, more than tripling over their lifetime (+226%), gaining +4.9 net instructions every commit; further, the older an instruction gets, the less likely it is to be deleted (log-hazard -0.032/commit). Then, we show that prompt comments can halt the growth: inverting IFEval yields verifiable worlds whose optimal prompts are known, and there comments encoding latent reasoning remove 99.3% of excess instructions (+211.3% to +1.4%). Finally, applying the same inversion to WildIFEval, we show that prompt comments can improve real-world agentic instruction-following by up to 23.1%. If English is the new code, why don't we have comments yet?
Problem

Research questions and friction points this paper is trying to address.

catastrophic remembering
agentic coding
prompt bloat
instruction retention
continual learning
Innovation

Methods, ideas, or system contributions that make the work stand out.

catastrophic remembering
agentic coding
prompt comments
instruction bloat
continual learning
🔎 Similar Papers
No similar papers found.