arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.09802cs.SEcs.AI
收藏

当指令文件过时:编码智能体中的文档债务与隐性成本

When Instruction Files Go Stale: Documentation Debt and Hidden Cost in Coding Agents

North Carolina State University(北卡罗来纳州立大学)

Tural Mehtiyev, Biruk Tadesse, Lawrence Arkoh, Wesley Assunção

AI总结:

该研究分析了编码智能体的过时指令文件(文档债务)的影响,发现智能体有时会遵循过时指令,修正指令可减少无效操作,仅任务成功会掩盖其成本,需评估智能体更多行为。

摘要:

基于大语言模型(LLM)的编码智能体(如Claude Code)由仓库指令文件(也称为上下文文件或智能体配置文件,示例见此处http URL和此处http URL)引导,这些文件会在每次智能体会话中被读取。与任何文档制品一样,这些文件可能落后于代码而过时(例如,测试文件夹已移动,但文件仍指向旧位置)。从技术债务角度来看,这种过时的指令属于文档债务,其“利息”是它给后续每次智能体会话增加的成本。仅检查任务成功的评估可能会忽略这种成本,导致过时文件持续存在。本研究探讨了是什么导致智能体依据过时指令行动、这如何影响其行为及产生何种成本,以及智能体如何恢复。我们深入研究了来自活跃开源仓库的三个真实过时指令,分别对应三种不同类型的引导:测试命令、代码位置和添加组件的流程。我们在每种指令的三个版本(保持过时、修正为当前路径、移除)下,让智能体完成22个维护任务,代码和任务保持固定,并在单个工具调用层面分析了两个模型的732条轨迹。我们发现,当过时指令与智能体的任务相关时,智能体会遵循它,有时甚至在其他地方有正确信息时也会如此。对于过时的测试命令,Claude Sonnet 5.5每次运行需要大约多2次工具调用,比使用修正后的命令多三分之一;在其他情况下,我们未检测到差异。尽管智能体通常能从即时失败中恢复,但没有一个智能体修复了底层的指令文件。修正指令消除了对过时路径的操作,而移除指令则阻止了大部分此类操作。我们的发现表明,仅任务成功本身可能会掩盖文档债务的成本,凸显了需要评估智能体超出最终结果的行为。

英文摘要:

LLM-based coding agents such as Claude Code are guided by repository instruction files (also called context files or agent configuration files) like AGENTS.md and CLAUDE.md, which are read in every agent session. As any documentation artifact, these files can fall behind the code and become stale (e.g., a test folder moves, but the file still points to the old one). In technical debt terms, such a stale instruction is documentation debt, and its interest is the cost it adds to every later agent session. Evaluations that check only task success can miss this cost, and the stale file can persist. In this study, we ask what leads agents to act on a stale instruction, how it affects their behavior and at what cost, and how they recover. We study three real-world stale instructions from active open-source repositories in depth, each a different kind of guidance: a test command, a code location, and a procedure for adding a component. Agents fix 22 maintenance tasks under three versions of each instruction (left stale, corrected to the current path, and removed), with the code and the task held fixed, and we analyze 732 trajectories of two models at the level of individual tool calls. We find that agents follow stale guidance when it is relevant to their tasks, sometimes even when correct information is available elsewhere. On the stale test command, Claude Sonnet 5.5 needed about two extra tool calls per run, a third more than with the corrected command; in the other cases, we could not detect a difference. Although agents generally recovered from the immediate failures, none repaired the underlying instruction file. Correcting the instructions eliminated operations on obsolete paths, while removing them prevented most. Our findings show that task success alone can hide the costs of documentation debt, highlighting the need to evaluate agent behavior beyond final outcomes.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑