---
title: "CLAUDE.md 为何不断膨胀？Agentic 编码中的灾难性记忆"
source: "arXiv AI/CL/LG（论文）"
source_tier: "t2"
url: "https://arxiv.org/abs/2608.11095v1"
permalink: "https://feed.astralor.com/items/itm_a6643a6e2eb84940166fe46a"
published: "2026-08-11T16:00:55.000Z"
score: 76
channel: "ai"
tags: ["Agentic Coding","Anthropic","CLAUDE.md","IFEval","提示词工程"]
---

# CLAUDE.md 为何不断膨胀？Agentic 编码中的灾难性记忆

## AI 点评

> 这份论文真正值得关注的地方，是把‘提示词膨胀’这种大家都有体感的问题，变成了可量化、可验证、有对策的科学问题。对正在构建长期记忆型 Agent 的工程团队来说，注释作为显式推理痕迹这一招很轻巧，可能比更复杂的记忆压缩机制更容易落地。

## 速览

该论文发现，在真实仓库中，类似 CLAUDE.md 的 Agentic 编码提示词会无限增长，平均膨胀 226%，每次提交净增 4.9 条指令。原因是删除一条指令需要评估与其余所有指令的相互作用，成本极高，导致旧指令几乎无法删除，作者称之为“灾难性记忆”（与灾难性遗忘相对）。通过在提示词中添加注释来编码潜在推理，可将膨胀率从 211.3% 降至 1.4%，并在 WildIFEval 上提升指令遵循能力 23.1%。

## 关键点

- 分析 1,867 个仓库中 247,694 条指令的生命周期，确认提示词无限增长：平均增长 +226%，每次提交净增 4.9 条指令；指令越老，删除概率越低（log-hazard -0.032/提交）。
- 将 IFEval 反演，构造可验证世界并获取最优提示词，证明代码注释编码潜在推理可消除 99.3% 的多余指令（+211.3% → +1.4%）。
- 将同一反演方法应用于 WildIFEval，注释可将真实世界 Agentic 指令遵循能力提升最多 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?

---

引用前请核对原文;本文由星际流动整理:https://feed.astralor.com/items/itm_a6643a6e2eb84940166fe46a
