Study: Code Cleanliness Doesn't Affect Coding Agent Success Rates but Reduces Token Usage by 8% and File Revisits by 34%
By
[Submitted on 19 May 2026]
Summary
This research paper investigates whether code cleanliness (structural and stylistic quality) affects the performance of autonomous coding agents. Using a controlled minimal-pair evaluation protocol with 33 tasks across six repository pairs and 660 trials with Claude Code, the study finds that code cleanliness does not change agent pass rates but significantly alters operational efficiency: agents on cleaner code use 7-8% fewer tokens and reduce file revisitations by 34%. The findings suggest maintainability principles remain relevant in AI-driven development, affecting computational cost and navigational efficiency.
Source
Key quotes
· 4 pulledCode 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.
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.
You might also wanna read
Why AI coding agents favor token-efficient open source software
AI coding agents (like Claude Code and OpenAI Codex) favor software that is easy to install, run, change, and verify, operating within token
Four Advanced Techniques for Maximizing Claude Code and Codex Coding Agents
The article presents four advanced techniques for maximizing productivity when using Claude Code and Codex coding agents. The author shares
Building a Software Factory with Claude Code: From AI-Assisted Coding to Agentic Development
This article provides a comprehensive guide on building a software factory using Claude Code and other AI coding tools. It covers the evolut
Sipcode: A context hygiene tool for Claude Code that reduces noise and improves AI response quality
Sipcode is a tool for Claude Code that improves context hygiene by capping verbose tool outputs and deduplicating same-session re-reads, all
Boosting Claude Code Performance Through Automated Testing
This article discusses how to improve Claude Code's performance when programming, with the key technique being automated and more effective
Verification Becomes the Harder Problem for Advanced Coding Agents
This paper challenges the classical intuition that verifying a solution is easier than producing one, arguing that for modern coding agents,

Comments
Sign in to join the conversation.
No comments yet. Be the first.