Coding agent over-editing may be less of a problem than developers assume. A new study of 7,660 resolved agent runs finds that the code these tools write is, on average, about as necessary as the code human developers wrote for the same tasks. The extra lines people complain about are mostly tests and documentation.
How the researchers measured unneeded edits
Agent patches tend to be bigger than developer patches, and many people read that as sloppiness. Size alone can’t say whether the extra edits were needed, what they contain or where they came from. The authors built a method called Delta Residue Attribution, or DRA, to answer those questions.
DRA replays an agent’s run and traces every block of the final patch back to the step that wrote it. It then reverts each block and reruns the task’s tests. If the tests still pass, the block wasn’t needed.
The team applied DRA to 7,660 resolved GitHub Copilot CLI runs from 18 frontier models. Of those, 6,728 came from SWE-bench Verified and 932 from DeepSWE. Developer patches were graded with the same procedure, so the comparison is like for like.
What the extra edits actually are
Coding agent over-editing is real in raw line counts. Agents do change more lines than developers do. The makeup of those lines depends on the benchmark.
- On SWE-bench Verified, 61% of the extra edits add tests and 13% add documentation.
- On DeepSWE, 58% of the extra edits are code.
So the headline difference in patch size reflects what agents choose to add around the fix, not just more code in the fix itself.
Agent code is about as necessary as developer code
The study scores code necessity on a scale where 1.0 means every unit was needed. On SWE-bench Verified, agents averaged 0.887 against 0.864 for developers. Eleven of the 18 models left less unneeded code than the developers did. On DeepSWE the gap was narrower: 0.797 for agents and 0.785 for developers.
Some unneeded code remains. On SWE-bench Verified, 11% of an agent patch’s code units were unneeded on average, and 89% of those changed program behavior. Debugging steps wrote almost none of it.
Necessity varies by model and doesn’t track resolve rate
Models differ a lot in how much unneeded code they write. That difference has little to do with how often they solve tasks. On SWE-bench Verified the two are unrelated. On DeepSWE they move in opposite directions: the correlation is negative (Spearman -0.59, p = 0.01), so the models that resolve more tasks tend to leave more unneeded code behind.
That matters for leaderboards. A ranking built only on resolve rate hides how much cleanup a model’s output may need.
Pruning unneeded code
The authors also tested two ways to trim patches on SWE-bench Verified. The first runs DRA using only the tests the agent can see, meaning its own tests plus the repository’s. It removed most of the unneeded code but also cut some needed code, with 67% recall and 46% precision. Even so, 89% of the pruned patches still resolved the task.
The second approach asks the agent to audit its own diff. It was more precise, at 66%, but it caught less, at 36% recall.
Neither is a finished tool. Test-based pruning is the more thorough of the two, and self-audit is the safer one.
What teams should do about coding agent over-editing
For developers reviewing agent output, the practical point is that test files and docs will account for much of the extra volume, so review time is better spent on the roughly one in nine code units that may not be needed. The study doesn’t say which ones, which is why the pruning results matter.
The authors recommend that benchmarks report code necessity next to resolve rate. They also say the problem should be handled through model training and pruning built into the agent tooling, rather than left to reviewers.
What to watch next
The study was submitted on 25 November 2026, and the results cover resolved runs only. Whether other agent tools show the same split between tests, docs and code is an open question, as is whether model makers will start training against unneeded edits. Benchmark maintainers now have a concrete metric they could add to their reports.
Source: arXiv.org