论文精选

CLAUDE.md为何不断膨胀?智能体编程中的灾难性记忆

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

精选理由

如果你用CLAUDE.md这类文件,会发现它越写越长不敢删。这篇论文告诉你为什么,还给了个注释技巧,能砍掉99%的冗余指令。

AI 摘要

该研究分析了1,867个仓库中247,694条指令的生命周期,发现智能体提示词无界增长,平均增长226%,每次提交净增4.9条指令。指令越旧越难删除,对数风险为-0.032/提交。通过反转IFEval生成可验证世界,提示注释可移除99.3%的多余指令,将增长率从+211.3%降至+1.4%。在WildIFEval上,提示注释使真实智能体指令遵循率提升23.1%。

原文 · arXiv cs.AI

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

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?