Don't Over-Engineer It: AI Coding Agents Write Too Much Code, and a Short Prompt Reduces It
Jay DesaiFWFanyou WuSSSrinivasan H. Sengamedu
Jay Desai
FWFanyou Wu
SSSrinivasan H. Sengamedu
+3
AI coding agents often return correct but bloated patches, adding unrequested tests, documentation, refactoring and error handling; the authors formalize this as over-engineering and introduce the Over-Engineering Score (OES), which compares an agent patch's size and location with the reference solution. Across 6,790 agent-task pairs from 14 public agents on SWE-bench Verified, over-engineering is pervasive (median OES 0.67–8.20$\times$ reference size), and patches at 1–1.5$\times$ the reference resolve most often (59.6% vs. 34.8% above 10$\times$), even under difficulty controls. A short system prompt demanding minimal changes without unrequested tests, documentation, annotations, error handling or refactoring cuts mean OES by 40% across 14 models (13 of 14; median 43%), mainly by avoiding edits to files the reference fix never touches, though the reduction is only 14% excluding test files. It also lowers input tokens for 13 of 14 models (up to 42%) and mean OES on SWE-bench Multilingual and Pro, with no significant aggregate change in resolution on any benchmark.

arXiv ·
· December 2, 2026