How Much Do Coding Agents Over-Edit, and Why? An Empirical Study of Unneeded Edits in Repository-Level Agent Patches
Source
arxiv.org
Author
Aakash Goel, Benjamin Steenhoek, Yu Hu
Date
Why it matters
Agent patches are bigger than developers', but on SWE-bench Verified most of the extra lines are tests (61%) and docs (13%), and agent code is about as necessary as human code. Patch size alone is a poor signal for over-editing.
Key takeaways · AI-distilled
The authors' method, Delta Residue Attribution, replays an AgentA system in which a model repeatedly chooses operations, a harness carries them out, and the results return to the model to inform its next choice.Full definition →'s run, reverts each block of the final patch and reruns the task tests to decide if it was needed. They applied it to 7,660 resolved GitHub Copilot CLI runs from 18 frontier models.
On DeepSWE the pattern differs from SWE-benchThe standard benchmark for AI coding agents: real GitHub issues from real repositories, scored by whether the agent's patch passes the project's own tests.Full definition →: most of the agents' extra edits there (58%) are code, not tests or documentation.
About 11% of an agent patch's code units on SWE-bench Verified are still unneeded, and 89% of those change behavior, so they are not harmless padding. Debug steps write almost none of them.
Code necessity varies by ModelA computational system that uses learned patterns to produce an output from information supplied to it.Full definition → and does not track resolve rate: no relationship on SWE-bench Verified, and a negative correlation on DeepSWE (Spearman -0.59), where models that resolved more tasks tended to leave more unneeded code.
Pruning with only the tests the agent can see removed most unneeded code (67% recall, 46% precision) and 89% of pruned patches still resolved the task. Asking the agent to audit its own diff was more precise (66%) but caught less (36%).
Terms in this piece · Glossary
Agent — A system in which a model repeatedly chooses operations, a harness carries them out, and the results return to the model to inform its next choice.
SWE-bench — The standard benchmark for AI coding agents: real GitHub issues from real repositories, scored by whether the agent's patch passes the project's own tests.
Model — A computational system that uses learned patterns to produce an output from information supplied to it.