Your Wish Is My Commit: Over-Compliant Refactoring in AI Coding Agents
Haocong Jiang, Sadra Sabouri, Sepand Haghighi, Souti Chattopadhyay
Key points
From the paper's conclusion- We hypothesized that a capable agent would stop once it recognized an optimized codebase; none did.
Abstract
Large language models are known to be sycophantic, over-complying with users even when doing so is unproductive. When these models act as coding agents, this can be costly: an agent that keeps editing after no edit improves the code writes churn, technical debt, and review burden into the codebase. Yet the consequences of sycophancy in software engineering remain largely understudied. To understand them, we run a controlled study of iterative refactoring, an open-ended task with no stopping criterion, where any edit an agent makes once the code is already clean reflects compliance rather than improvement. Across algorithmic (n=50) and object-oriented (n=10) suites, we repeatedly ask two widely used agents, Codex and Claude Code, to refactor further across five models. Over 3,000 turns, we define six behavioral signals of over-compliance. We hypothesized that a capable agent would stop once it recognized an optimized codebase; none did. Every model kept editing, rewriting up to 31x the original codebase before first stopping and resuming edits even after declaring the task complete. Over-compliance is a costly, multi-turn behavior that compounds with every turn, and our six signals give developers and tool builders a way to detect and curb it.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- AgentSWE: Can Coding Agents Build the Agent You Actually Want?arXiv · 2026
- Opera: A Verbal Critic Framework for Long-horizon Coding AgentsarXiv · 2026
- Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written CodearXiv · 2026
- To Run or Not to Run: Analyzing the Cost-Effectiveness of Code Execution in LLM-Based Program RepairProceedings of the ACM on software engineering. · 2026
- Agentic Refactoring: An Empirical Study of AI Coding AgentsACM Transactions on Software Engineering and Methodology · 2026
- Understanding Regression in Code Self-Refinement: A Study of Refinement Protocols Without Execution FeedbackAI · 2026