Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study

Authors: Priyansh Trivedi (SonarSource), Olivier Schmitt (SonarSource)

AI-generated keywords: Code Cleanliness

AI-generated Key Points

⚠The license of the paper does not allow us to build upon its content and the key points are generated using the paper metadata rather than the full article.

  • Study title: "Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study"
  • Authors: Priyansh Trivedi and Olivier Schmitt from SonarSource
  • Research focus: Impact of code cleanliness on autonomous coding agents
  • Innovative evaluation protocol: Using minimal pairs of repositories to isolate the effect of code cleanliness from agent capability
  • Findings:
  • Code cleanliness does not significantly impact the agent's pass rate
  • Cleaner code leads to agents using 7 to 8% fewer tokens and reducing file revisitations by 34%
  • Implications:
  • Traditional maintainability principles are still relevant in AI-driven development
  • Code cleanliness influences computational cost and navigational efficiency of coding agents alongside other factors like model choice, harnessing techniques, and prompting strategies
Also access our AI generated: Comprehensive summary, Lay summary, Blog-like article; or ask questions about this paper to our AI assistant.

Abstract: As autonomous coding agents see rapid adoption, their evaluation has primarily focused on task completion rates holding the target codebase fixed. This leaves a critical question unanswered: does the structural and stylistic quality, or ``cleanliness'' of the underlying code affect an agent's ability to navigate and modify it? To isolate the effect of code cleanliness from agent capability, we introduce an evaluation protocol built around minimal pairs: repositories that match on architecture, dependencies, and external behaviour, but differ on static-analysis rule violations and cognitive complexity. The pairs are constructed in both directions, by agent pipelines that either degrade a clean repository or clean a messy one. We author 33 tasks across six such pairs, evaluated through hidden tests at the application's public surface. Across 660 trials with Claude Code, code cleanliness does not change the agent's pass rate. However, it substantially alters the agent's operational footprint: agents working on cleaner code use 7 to 8% fewer tokens and reduce file revisitations by 34%. Our findings suggest that traditional maintainability principles remain highly relevant in the era of AI-driven development, shaping the computational cost and navigational efficiency of coding agents. Code cleanliness joins model choice, harness, and prompting as a factor that materially affects agent behaviours.

Submitted to arXiv on 19 May. 2026

Tools for this paper

Explain it differently 3 free rewrites left today
Export BibTeX · RIS (Zotero, Mendeley, EndNote) · Markdown (Notion, Obsidian) · Premium
Citation alerts Premium
Journal club Slides to present it Premium
For journalists Press kit and hype check Premium

Ask questions about this paper to our AI assistant

You can also chat with multiple papers at once here.

⚠The license of the paper does not allow us to build upon its content and the AI assistant only knows about the paper metadata rather than the full article.

AI assistant instructions?

Results of the summarizing process for the arXiv paper: 2605.20049v1

⚠This paper's license doesn't allow us to build upon its content and the summarizing process is here made with the paper's metadata rather than the article.

  • Comprehensive Summary
  • Key points
  • Layman's Summary
  • Blog article
, , , , In their study titled "Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study," authors Priyansh Trivedi and Olivier Schmitt from SonarSource explore the impact of code cleanliness on autonomous coding agents. The existing evaluation of these agents has primarily focused on task completion rates while holding the target codebase constant. However, a critical question remains unanswered: does the structural and stylistic quality, or "cleanliness," of the underlying code influence an agent's ability to navigate and modify it? To address this question, Trivedi and Schmitt introduce an innovative evaluation protocol centered around minimal pairs of repositories. These pairs are designed to match in terms of architecture, dependencies, and external behavior but differ in static-analysis rule violations and cognitive complexity. By creating pairs in both directions – one with a clean repository degraded by agent pipelines and another with a messy repository cleaned up by agents – the researchers aim to isolate the effect of code cleanliness from agent capability. The study includes 33 tasks distributed across six pairs, which are evaluated through hidden tests at the application's public surface. Over 660 trials conducted with Claude Code, it is found that code cleanliness does not significantly impact the agent's pass rate. However, it does have a substantial effect on the agent's operational footprint: agents working on cleaner code use 7 to 8% fewer tokens and reduce file revisitations by 34%. These findings highlight the continued relevance of traditional maintainability principles in AI-driven development. They demonstrate that code cleanliness plays a crucial role in shaping the computational cost and navigational efficiency of coding agents alongside factors like model choice, harnessing techniques, and prompting strategies. Overall, this study sheds light on how code cleanliness influences agent behaviors in software development environments.

Assess the quality of the AI-generated content by voting

Score: 0

Why do we need votes?

Votes are used to determine whether we need to re-run our summarizing tools. If the count reaches -10, our tools can be restarted.

Similar papers summarized with our AI tools

Navigate through even more similar papers through a

tree representation

Disclaimer: The AI-based summarization tool and virtual assistant provided on this website may not always provide accurate and complete summaries or responses. We encourage you to carefully review and evaluate the generated content to ensure its quality and relevance to your needs.