← In the News

A three-sentence prompt cuts the extra code agents write

Don't Over-Engineer It: AI Coding Agents Write Too Much Code, and a Short Prompt Reduces It · Jay Desai, Fanyou Wu and Srinivasan H. Sengamedu, Amazon · arXiv, December 2, 2026, accepted at the AAAI-27 AgenticSE workshop

Machine-readable Download Markdown

Across 6,790 agent and task pairs from 14 public agents on SWE-bench Verified, the median patch ran from 0.67 to 8.20 times the size of the reference fix, depending on the agent. Patches at 1 to 1.5 times the reference resolved at 59.6%; patches above 10 times resolved at 34.8%. The authors treat this as an association and say it does not prove extra code causes failure. They then prepended a constraint that opens "Make the MINIMAL change needed to solve the problem" and rules out unrequested tests, documentation, type annotations, error handling and refactoring. Their over-engineering score fell 40% on average across 14 models from 7 providers, for 13 of the 14, and input tokens per task fell for 13 of 14 models, by up to 42%. Most of what the instruction removed was unrequested test code; excluding test files, the reduction was 14%. Resolution did not change significantly in aggregate, and per model it moved both ways: after correction, GPT-5.4 regressed and Sonnet 4.6 gained 6.4 points.

Why it matters: This costs one paragraph of system prompt to try, and under it the share of patches more than twice the reference size fell from 23.3% to 9.1%, which is less code for someone to review. The authors recommend A/B testing it per model rather than shipping it everywhere. Their main agent also had no shell, so the instruction was never tested on an agent that runs its own tests.