[2605.20049] Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study
Skip to main content
arXiv is now an independent nonprofit!<br>Learn more<br>×
Search arXiv
Press Enter to search · Advanced search
-->
Computer Science > Software Engineering
arXiv:2605.20049 (cs)
[Submitted on 19 May 2026]
Title:Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study
Authors:Priyansh Trivedi, Olivier Schmitt (SonarSource)<br>View a PDF of the paper titled Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study, by Priyansh Trivedi and 1 other authors
View PDF<br>HTML (experimental)
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.
Subjects:
Software Engineering (cs.SE); Artificial Intelligence (cs.AI)
Cite as:<br>arXiv:2605.20049 [cs.SE]
(or<br>arXiv:2605.20049v1 [cs.SE] for this version)
https://doi.org/10.48550/arXiv.2605.20049
Focus to learn more
arXiv-issued DOI via DataCite
Submission history<br>From: Priyansh Trivedi [view email]<br>[v1]<br>Tue, 19 May 2026 16:06:26 UTC (1,094 KB)
Full-text links:<br>Access Paper:
View a PDF of the paper titled Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study, by Priyansh Trivedi and 1 other authors<br>View PDF<br>HTML (experimental)<br>TeX Source
view license
Current browse context:
cs.SE
next >
new<br>recent<br>| 2026-05
Change to browse by:
cs<br>cs.AI
References & Citations
NASA ADS<br>Google Scholar
Semantic Scholar
export BibTeX citation<br>Loading...
BibTeX formatted citation
×
loading...
Data provided by:
Bookmark
Bibliographic Tools
Bibliographic and Citation Tools
Bibliographic Explorer Toggle
Bibliographic Explorer (What is the Explorer?)
Connected Papers Toggle
Connected Papers (What is Connected Papers?)
Litmaps Toggle
Litmaps (What is Litmaps?)
scite.ai Toggle
scite Smart Citations (What are Smart Citations?)
Code, Data, Media
Code, Data and Media Associated with this Article
alphaXiv Toggle
alphaXiv (What is alphaXiv?)
Links to Code Toggle
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub Toggle
DagsHub (What is DagsHub?)
GotitPub Toggle
Gotit.pub (What is GotitPub?)
Huggingface Toggle
Hugging Face (What is Huggingface?)
ScienceCast Toggle
ScienceCast (What is ScienceCast?)
Demos
Demos
Replicate Toggle
Replicate (What is Replicate?)
Spaces Toggle
Hugging Face Spaces (What is Spaces?)
Spaces Toggle
TXYZ.AI (What is TXYZ.AI?)
Related Papers
Recommenders and Search Tools
Link to Influence Flower
Influence Flower (What are Influence Flowers?)
Core recommender toggle
CORE Recommender (What is CORE?)
Author
Venue
Institution
Topic
About arXivLabs
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs .
Which authors of this paper are endorsers? |<br>Disable MathJax (What is MathJax?)
Major funding support from