TRANSMISSION // 2612.04613v1
A short prompt helps coding agents write less extra code
Source published
A study of coding-agent benchmarks finds that patches often exceed reference fixes. A minimal-change instruction reduced patch size, but did not significantly change overall resolution rates.

AI coding agents can fix a bug and still make many changes the task never asked for. Researchers compared agent patches with human reference fixes and tested whether a short instruction to keep changes minimal would help.
A coding agent may fix a bug correctly, yet also add tests, rewrite documentation or change files unrelated to the requested repair. Those additions can make a patch harder to review, but standard benchmark scores often treat it just like a smaller patch if both pass the tests. A new preprint asks how common this extra work is—and whether a simple prompt can reduce it without making agents less successful.
Jay Desai, Fanyou Wu and Srinivasan H. Sengamedu studied agent patches on SWE-bench, a set of software issues paired with human-written fixes and tests. They call changes beyond the minimum needed for a task “over-engineering.” To measure it, they introduced the Over-Engineering Score (OES), which compares the lines an agent changes with the lines changed in the human reference fix. Some versions of the score also distinguish edits in files touched by the reference from edits elsewhere.
That comparison is a yardstick, not a verdict on code quality. A human reference is one accepted solution, not necessarily the only good one. An agent could solve an issue with a different but valid approach and receive a high score because its edits differ in size or location. The researchers therefore assessed correctness separately, using each benchmark’s tests.
Extra work is common, but size alone does not explain success
The researchers first analyzed 6,790 agent–task pairs from 14 public agents on SWE-bench Verified. Across agents, the median patch ranged from 0.67 to 8.20 times the size of the reference fix. The range reflects differences between agents; it does not mean every patch was oversized. Eleven of the 14 agents had a median above the reference size.
Patch size and task success showed an inverted-U pattern: patches between one and 1.5 times the reference size had the highest observed resolution rate, 59.6%. For patches more than ten times the reference size, the rate was 34.8%. The association persisted in analyses that accounted for task difficulty. But this was observational evidence. It cannot show that extra code caused failures: task complexity and agent ability, among other factors, may influence both patch size and success.
A prompt reduced patch size, mostly by narrowing the work
Next, the team compared a baseline system prompt with one that explicitly told agents to make the minimal change and not add tests, documentation, type annotations, error handling or refactoring unless asked. The instruction was tested with 14 models from seven providers across three SWE-bench variants.
On SWE-bench Verified, mean OES fell by 40% across models, with reductions for 13 of 14. The main change was not simply shorter edits to the same files: agents more often stopped modifying files that the reference fix did not touch. Much of that extra work was test code. When the researchers excluded test-file changes, the reduction was 14%, rather than 40%.
The prompt also reduced input tokens per task for 13 of 14 models. However, the study found no significant change in resolution rates overall on any of the three benchmarks. Results varied by model: some resolved more tasks with the instruction, others fewer. In particular, a minimality constraint can push some agents toward patches that are too small or no patch at all. The researchers’ conclusion is therefore not that less code is always better, but that explicit limits can reduce unnecessary edits without a demonstrated aggregate change in success in these tests.
What the evidence can—and cannot—tell us
The findings come from benchmark issue-fixing tasks, not from observing developers and agents working in production. The main experiments used a simplified agent setup with limited tools and no shell access; only one model was tested in a separate, shell-equipped SWE-agent setup. Each model-and-condition comparison was a single run, and the authors note that model outputs are not fully deterministic. The benchmark’s human fix is also an imperfect measure of what was necessary, and the study did not ask people to judge whether patches would be merged or how long they would take to review.
The paper suggests that a short instruction can make benchmark patches smaller and more focused. It does not establish that the approach improves code quality or is suitable for every task: refactoring or broader changes may be exactly what a developer requests. The authors also describe a possible explanation—that models may have learned to favor thoroughness—but say they did not test that idea.
This is a preprint, so its findings should be treated as provisional rather than as settled evidence. The authors’ analysis offers a way to measure patch size relative to a reference, but that score is not a direct measure of necessity, maintainability or correctness. In practice, the prompt’s effects may depend on the model, tools and work being done.
- AI coding agents
- software engineering
- over-engineering
- SWE-bench
- prompting
- code patches
Reviewed cross-references
These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.
Do AI Coding Agents Change More Code Than Needed?
Supporting evidence: Both studies identify tests as a substantial part of extra patch content in SWE-bench Verified: Desai et al. report that the prompt reduced test-file edits, while Goel et al. find that tests made up 61% of agents’ extra edits. This supports the bounded observation that tests contribute materially to patch excess, not that the studies measure the same kind of excess: one compares patches with a reference and tests a prompt intervention; the other assesses edit necessity in resolved Copilot CLI trajectories.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2612.04613v1 — Original paper
Excerpt reference:
static/papers/2612.04613v1.md:979-1051
Basis: Paper text
Source file SHA-256:b6293896745360b0df98577b82a85be91e61c93c6d8bcf6908d115c48deb1c0a2611.34875v1 — Original paper
Excerpt reference:
static/papers/2611.34875v1.md:80-166
Basis: Paper text
Source file SHA-256:87bc89a33fb7b09212201ac9b078403c2b57b2d0998f3b99ed0882dc0107f20d
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
Do AI Coding Agents Change More Code Than Needed?
Source published
Shared keywords: ai coding agents, code patches, software engineering, swe bench
A staged training recipe for AI software repair
Source published
Shared keywords: ai coding agents, swe bench
A change-cost view of software complexity
Source published
Shared keywords: ai coding agents, software engineering
ProgramGen turns real code repositories into training grounds for AI agents
Source published
Shared keywords: ai coding agents, software engineering
Why Passing Tests May Not Prove an AI Patch Is Correct
Source published
Shared keywords: ai coding agents