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

📄 arXiv: 2608.11095v1 📥 PDF

作者: Kushal Chakrabarti

分类: cs.AI, cs.LG, cs.SE

发布日期: 2026-08-11


💡 一句话要点

提出应对代理编码中灾难性记忆问题的解决方案

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 代理编码 灾难性记忆 指令管理 提示注释 持续学习

📋 核心要点

  1. 现有的代理编码方法在指令管理上存在灾难性记忆问题,导致指令数量不断增加,难以维护。
  2. 论文提出通过引入提示注释来解决这一问题,利用反转IFEval构建可验证的世界,从而优化指令管理。
  3. 实验结果表明,使用提示注释可以显著减少冗余指令,提升真实场景下的指令跟随性能,最高提升23.1%。

📝 摘要(中文)

代理编码的README文件如CLAUDE.md在真实仓库中不断增长,直到仓库退役或文件被整体重写。我们将其归因于不完美的记忆:添加指令成本低,但一旦指令的理由消失,删除它而不影响正确性回归的成本为O(2^|D|)。我们称这种偏差为灾难性记忆,正是持续学习中灾难性遗忘的反面。通过对247,694个指令生命周期的分析,我们发现代理提示在其生命周期内不断增长,平均每次提交增加4.9条指令。我们提出使用提示注释来阻止这种增长,并展示了其在真实世界中的有效性。

🔬 方法详解

问题定义:论文要解决的问题是代理编码中指令数量不断增加的现象,称为灾难性记忆。现有方法在删除指令时面临高昂的成本,导致指令无法有效管理。

核心思路:论文的核心思路是通过引入提示注释来改善指令的管理,利用反转IFEval构建可验证的世界,从而降低指令的冗余性。

技术框架:整体架构包括数据收集、指令生命周期分析、提示注释的引入以及性能评估四个主要模块。首先分析指令的生命周期,然后引入注释,最后评估其对指令跟随性能的影响。

关键创新:最重要的技术创新点在于提出了灾难性记忆的概念,并通过提示注释有效减少冗余指令,与现有方法相比,提供了一种新的指令管理思路。

关键设计:在设计中,关键参数包括注释的编码方式和反转IFEval的实现,确保注释能够有效捕捉潜在推理,并在实际应用中验证其有效性。

🖼️ 关键图片

img_0
img_1
img_2

📊 实验亮点

实验结果显示,代理提示在生命周期内平均增加226%,而引入提示注释后,冗余指令减少99.3%,性能提升幅度达到23.1%。这些结果表明,提示注释在改善指令管理方面具有显著效果。

🎯 应用场景

该研究的潜在应用领域包括软件开发、自动化测试和智能代理系统等。通过优化指令管理,能够提高代码的可维护性和执行效率,未来可能对软件工程实践产生深远影响。

📄 摘要(原文)

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?