Lightning Jar - Web Studio Lightning Jar Wordmark
Skip to main content
Reading List

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

Priyansh Trivedi and Olivier Schmitt
arXiv 2026-05-19

Summary:

Researchers at SonarSource ran a controlled minimal-pair experiment: pairs of codebases identical in architecture and behavior but differing only in cleanliness metrics, run through an autonomous coding agent across 660 trials with Claude Code. Code cleanliness did not change task completion rates, but it substantially lowered cost, with agents on cleaner code using 7 to 8 percent fewer tokens and revisiting files 34 percent less often. The takeaway is that traditional maintainability principles still pay off in an AI-assisted workflow, shaping agent efficiency alongside model choice and prompting.

Excerpt:

"Cleaner code did not make the coding agent more likely to succeed, but it made the agent meaningfully cheaper: fewer tokens, fewer repeated file reads."
#LLMs#Coding Agents#Code Quality#Software Engineering
Read Full Source