Agentic AI
AI Agent Prompts Bloat Uncontrollably—Researchers Find Comments Are the Fix
A study of nearly 250,000 instruction lifespans reveals that agentic coding prompts grow by 226% over their lifetime, but adding comments explaining the reasoning behind instructions can shrink excess growth by 99%.
When AI agents work on code repositories, the instructions they receive—often stored in files like CLAUDE.md—tend to accumulate without end. Researchers at arXiv have now documented this phenomenon and explained why it happens, along with a simple solution.
The Growth Problem#
Analyzing nearly 250,000 instructions across 1,867 repositories, the study found that agentic prompts grow in an almost monotonic fashion, expanding by an average of 226% over their lifetime. On average, four to five new instructions are added per commit, while deletions lag far behind. The prompts keep inflating until the AI agent stops functioning properly—a problem the researchers call "catastrophic remembering."
Why Deletion Is Risky#
The root cause lies in imperfect recall. Adding a new instruction is cheap and fast, but removing an old one is dangerous. Once an instruction has been in place for a while, the latent reasoning behind it—the implicit context that explains why the instruction matters—gradually fades from the system. Deleting such an instruction without that context risks breaking something downstream, making removal exponentially costly to verify. The hazard of deletion decays geometrically with instruction age, favoring accumulation over cleanup.
Comments as a Remedy#
In controlled experiments using inverted IFEval benchmarks, the researchers tested whether adding comments that explicitly encode the reasoning behind instructions could prevent bloat. The result was striking: comments reduced excess growth from +211% down to +1.4%—a 99.3% reduction. Real-world tests confirmed the finding: prompts with comments stayed smaller than those maintained by existing context-management tools and improved instruction-following accuracy by 17.7% in repositories.
Implications for Agentic Development#
As large language models increasingly become the default language for giving instructions to systems, the question becomes urgent: if code needs comments to remain maintainable, shouldn't agentic prompts have them too? The research suggests that treating agent instructions like code—with proper documentation—could unlock more stable, scalable AI workflows.

