arXiv · 2612.04613
Don't Over-Engineer It: AI Coding Agents Write Too Much Code, and a Short Prompt Reduces It
Abstract
AI coding agents routinely produce correct solutions that include far more code than necessary, adding unrequested tests, documentation, refactoring and error handling beyond what the task requires. We formalize this phenomenon as over-engineering and introduce the Over-Engineering Score (OES), a family of metrics comparing the size and location of an agent's patch with the reference solution. Analyzing 6,790 agent--task pairs from 14 public agents on SWE-bench Verified, we find that over-engineering is pervasive (median OES between 0.67 and 8.20$\times$ the reference size, depending on the agent) and that a "Goldilocks zone" of 1--1.5$\times$ the reference has the highest resolution rate (59.6% vs. 34.8% for patches above 10$\times$), an association that persists under difficulty controls. A short system-prompt constraint that tells the agent to make the minimal change and not to add tests, documentation, type annotations, error handling or refactoring unless asked reduces mean OES by 40% across 14 models from 7 providers (13 of 14 models; median per-model reduction 43%), mostly by stopping edits to files the reference fix does not touch. Much of what it removes is unrequested test code: excluding test files, the reduction is 14%. It also cuts input tokens per task for 13 of 14 models, by up to 42%, and mean OES also falls for every model on SWE-bench Multilingual and Pro. Resolution does not change significantly in aggregate on any benchmark, and per-model effects go both ways.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Jay Desai, Fanyou Wu, Srinivasan H. Sengamedu. 2026-12-02. Don't Over-Engineer It: AI Coding Agents Write Too Much Code, and a Short Prompt Reduces It. https://searcharxiv.org/abs/2612.04613
Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.