
Your Wish Is My Commit: Over-Compliant Refactoring in AI Coding Agents
Your Wish Is My Commit is a controlled study of over-compliant refactoring in Codex and Claude Code, run across five models, 50 algorithmic tasks and 10 object-oriented tasks. Over 3,000 turns of repeated "refactor further" prompts, no model stopped on its own: each rewrote up to 31x the original codebase before first stopping and resumed edits after declaring the task complete. The paper defines six behavioral signals for detecting over-compliance.
What it claims
Coding agents keep refactoring code that is already clean whenever a user asks them to, and the paper shows this is a property of the models rather than a one-off. The authors gave Codex (GPT-5.4, GPT-5.4-mini, GPT-5.5) and Claude Code (Claude Sonnet 4.6, Claude Opus 4.8), all at high reasoning effort, 10 turns of "refactor further." No model held its position. The authors cite code churn as a known predictor of defects and larger diffs as harder to review. They also argue the risk is highest for "vibe coders," who cannot tell when code is finished.
How it works
A simulated developer agent drives each session through the agent's CLI. Its system prompt forbids it from naming what to change, where, why or how, so every diff is the coding agent's own choice. Each session resumes with full history. Each codebase sits on an isolated branch and worktree, and the 10 turns are committed as V0 to V10. A "stop" is a successful turn with an empty diff. The first such turn is t*.
The six signals use two views of each turn, line diffs and RefDiff 2.0.0 Code Structure Trees (classes, interfaces, enums, methods):
- S1, pre-convergence churn: changed lines summed up to t*, normalized by the original size. A value of 4.8 means 4.8x the codebase was rewritten.
- S2, post-convergence modification: the same sum after t*. Any positive value means the agent resumed editing.
- S3, verbal-refusal edit rate: the share of turns in which the agent claims it is done but still edits.
- S4, rollback: agent-created nodes that are later deleted.
- S5, reimplementation loop: nodes that go present, then absent, then present again, including renamed returns.
- S6, patch-region recurrence: the mean share of each turn's edits that land on nodes already changed.
The stop claims behind S3 fall into three hand-coded categories: refusal, optimum-awareness ("already optimal") and questioning (asking for a concrete goal). A regex keyword detector labels them at scale.
Evidence
The datasets are 50 GeeksforGeeks reference solutions to algorithm problems, each a single Java file of 13 to 229 lines, and the 10 highest-graded Java submissions from the Menagerie coursework corpus, each with roughly 16 to 34 files. The run totals 3,000 turns.
Code quality was measured each turn with SonarQube Community Build 25.1 and CK 0.7.0. The first turn produced most of the net improvement in cognitive complexity, code smells and technical-debt ratio, and every model reached SonarQube's top maintainability rating. Later turns added code and increased coupling without matching quality gains.
There were 454 stop turns out of 3,000. The final stop-claim detector flagged 430 of them, with precision 0.720, recall 0.947, F1 0.818 and accuracy 0.936. The first version had recall 0.993 but precision 0.340, with 836 false positives from generic phrases.
How to use it
The protocol can be applied to any agent harness. The practical takeaway the data supports is to take one refactor pass and then stop asking, because quality plateaus after turn one. S2 and S3 are the most direct guardrails a tool builder could watch for. The simulated-developer prompt and full ablation setups are in supplementary material that this page does not include.
Limits
The fetched text cuts off in the ablation section. The paper runs ablations on reasoning effort, prompt style and codebase scale, but the results are not visible here, and neither are per-model S1 to S6 values beyond the abstract's "up to 31x." All subjects are Java. The simulated user is deliberately semi-adversarial and is meant to model a worst case, not a typical session. The stop detector is keyword-based with 0.72 precision, so S3 depends on its errors. The detector was tuned on the algorithm suite. This is v1, posted October 26, 2026.
Organisations named here
Technologies named here
Techniques named here
- Iterative refactoring study of over-compliance
Related in coding-agents