arXiv 论文解释 CLAUDE.md 为何不断膨胀并提出注释化对策
Why Does CLAUDE.md Keep Growing? Catastrophic Remembering in Agentic Coding
AI 导读
论文提出灾难性遗忘式膨胀机制,删除指令需冒回归风险、成本随指令数指数增长,导致 CLAUDE.md 等智能体提示词近乎单调增长。基于 1,867 个仓库中 247,694 条指令生命周期的分析显示提示词平均增长 +226%,每 commit 净增 +4.7 条;用反向 IFEval 构建的可验证环境中,编码潜在推理的注释可消除 99.3% 的多余体积,并在真实仓库中将指令遵循提升 17.7%。
推荐理由
论文解释了 CLAUDE.md 等智能体提示词为何持续膨胀,并给出用提示词注释保留潜在推理来抑制增长的可迁移方法。
正文 · 原文
Abstract:Agentic prompts like this http URL grow without bound in real repositories, stopping only when history ends or someone rewrites the file wholesale. We trace this to imperfect recall: appending an instruction is always cheap, but once an instruction's latent reasoning is gone, deleting it without risking a regression costs O(2^|D|) in a prompt of |D| instructions. Successive edits destroy that latent reasoning, additions outrun deletions and prompts grow until agents become non-functional -- catastrophic remembering. First, we characterize this phenomenon across 247,694 instruction lifetimes in 1,867 repositories: agentic prompts grow nearly monotonically, more than tripling over their lifetime (+226%) at +4.7 net instructions per commit. Deletion hazard decays geometrically with instruction age, consistent with imperfect recall and with no other rival we test. Then, we show that prompt comments can halt the growth: in verifiable worlds built by inverting IFEval, comments encoding latent reasoning remove 99.3% of excess size (+211.3% to +1.4%). Finally, we show comments yield smaller real-world and coding-convention prompts than existing context maintainers, grow more effective with model capability and, at small scale, improve instruction-following in real repositories by 17.7%. If English is the new code, why don't we have comments yet?
| Subjects: | Artificial Intelligence (cs.AI); Machine Learning (cs.LG); Software Engineering (cs.SE) |
| Cite as: | arXiv:2608.11095 [cs.AI] |
| (or arXiv:2608.11095v2 [cs.AI] for this version) | |
| https://doi.org/10.48550/arXiv.2608.11095 arXiv-issued DOI via DataCite |
Submission history
From: Kushal Chakrabarti [view email]
[v1]
Tue, 11 Aug 2026 16:00:55 UTC (110 KB)
[v2]
Fri, 20 Nov 2026 08:02:09 UTC (131 KB)
来源:arXiv cs.AI · arxiv.org