Why Does CLAUDE.md Keep Growing? Catastrophic Remembering in Agentic Coding· CLAUDE.md 为何不断增长?
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 l
探讨代码代理 README 文件无限制增长的原因与影响。
- 核心方法
- 作者通过分析 247,694 个指令的生命周期和 1,867 个仓库中的数据,发现读取指令的成本较低,但删除指令以防止正确性回归的成本极高,导致 README 文件不断增长。
- 适合谁读
- 研究者 / 工程师
- 要解决的问题
- 论文探讨了像 CLAUDE.md 这样的代码代理 README 文件为何在实际仓库中会持续增长,直至仓库退役或文件被重写。
- 关键实验
- 分析了 247,694 个指令的生命周期数据和 1,867 个仓库中的提交记录,显示代理提示在生命周期中增长超过三倍,每提交增加 4.9 个净指令。
- 主要贡献
- 首次定义了“灾难性记忆”现象,这是持续学习中“灾难性遗忘”的反面,解释了代理 README 文件的无限制增长。
- 意义与局限
- 该研究揭示了代码代理 README 文件增长的内在机制,对持续学习和代码管理具有重要意义。然而,研究主要基于现有数据,未探讨其他可能的解决方案或干预措施。