Tech Current
SoftwareJul 6, 2026

Does code cleanliness affect coding agents? A controlled minimal-pair study

A new controlled study suggests code cleanliness may not change whether a coding agent succeeds, but it does affect how much work the agent has to do.

Published by Tech Current · Publisher Alex Naz
Does code cleanliness affect coding agents? A controlled minimal-pair study
AI-assisted editorial illustration for this article.

What happened

A new arXiv paper asks a practical question for the age of autonomous coding tools: does the cleanliness of a codebase change how well a coding agent can work in it?

The study, titled Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study, argues that prior evaluations of coding agents have mostly focused on whether agents complete tasks while keeping the target codebase fixed. That leaves open a narrower question: if two repositories are functionally equivalent, but one is written in a cleaner style and the other is noisier and more complex, does that affect the agent’s performance?

To test that, the authors introduce a minimal-pair evaluation protocol. In this setup, repositories are matched on architecture, dependencies, and external behavior, but differ in two specific ways: static-analysis rule violations and cognitive complexity. The paper says the pairs are constructed in both directions, using agent pipelines that either degrade a clean repository or clean up a messy one.

The study includes 33 tasks across six such pairs. The tasks are evaluated with hidden tests at the application’s public surface. Across 660 trials using Claude Code, the paper reports that code cleanliness did not change the agent’s pass rate.

But the result does not mean cleanliness is irrelevant. The paper says cleaner code reduced the agent’s operational footprint: agents working on cleaner code used 7% to 8% fewer tokens and revisited files 34% less often.

In other words, the study finds no difference in whether the agent ultimately succeeds, but a measurable difference in how efficiently it gets there.

Why it matters

The result speaks to a gap in how coding agents are often evaluated. Success rates are important, but they do not capture the full cost of getting a result. If two codebases lead to the same completion rate, but one requires fewer tokens and less backtracking, that still matters for real-world use.

For teams adopting autonomous coding tools, the paper suggests that established maintainability practices may still have value even when the “developer” is an AI system. Cleaner code may not guarantee better outcomes in a simple pass/fail sense, but it may reduce the amount of computation and navigation needed to complete the work.

That could matter in several ways:

  • It may affect the cost of using coding agents, especially when token usage is a factor.
  • It may influence how smoothly agents move through repositories when making changes.
  • It suggests that code quality should be considered alongside model choice, harness design, and prompting when evaluating agent behavior.
Illustration for Does code cleanliness affect coding agents? A controlled minimal-pair study
AI-assisted editorial illustration for this article.

The paper’s framing is also notable because it focuses on controlled comparisons. By matching repositories on architecture, dependencies, and external behavior, the authors try to isolate cleanliness as the variable of interest. That makes the claim narrower, but also potentially more useful: it is not just a general statement about “better code,” but a specific attempt to measure whether structural and stylistic quality affects agent navigation and editing.

The takeaway from the abstract is not that code cleanliness suddenly becomes the main determinant of agent success. Rather, it appears to be one factor that changes the path an agent takes, even if it does not alter the final result on hidden tests.

What to watch

The abstract leaves several important questions open.

First, the result is tied to one agent setup: Claude Code. The paper itself suggests code cleanliness is a factor that materially affects agent behavior, but the abstract does not say whether the same pattern holds across other models or agent frameworks.

Second, the study measures behavior through hidden tests at the public surface of the application. That is a useful and practical evaluation method, but it does not fully describe how agents behave on deeper maintenance tasks, larger systems, or more open-ended changes.

Third, the paper’s cleanliness definition is specific. It focuses on static-analysis rule violations and cognitive complexity. Future work may need to test whether other aspects of code quality, such as naming consistency, module boundaries, documentation, or test coverage, affect agents in similar ways.

Finally, the efficiency findings may prove more important in practice than the pass-rate finding. If cleaner code consistently lowers token usage and file revisitation, then maintainability work could have a direct economic effect on AI-assisted development even when correctness is unchanged.

For now, the paper offers a careful but limited conclusion: coding agents may be just as likely to solve tasks in clean and messy repositories, but they appear to work harder in the messier ones. That makes code cleanliness relevant not only to human developers, but also to the systems increasingly assisting them.

Watch next

Flock’s Trust Problem Deepens After Public Reversals Over ALPR Claims
SoftwareJul 21, 2026

Flock’s Trust Problem Deepens After Public Reversals Over ALPR Claims

An ACLU account says Flock Safety has repeatedly given inaccurate or misleading answers about its license-plate readers, data access, and privacy controls — including in a Wisconsin city council meeting that approved and then reversed a contract in one day.

Cursor’s agent swarms point to a new cost curve for AI software work
SoftwareJul 21, 2026

Cursor’s agent swarms point to a new cost curve for AI software work

Cursor says its latest swarm system outperformed an earlier version on a Rust rewrite of SQLite, while using different planner-worker mixes to sharply reduce cost and coordination overhead.

Larry Ellison once struggled to keep the lights on while building software. Now he owns most of a Hawaiian island
SoftwareJul 21, 2026

Larry Ellison once struggled to keep the lights on while building software. Now he owns most of a Hawaiian island

The Oracle co-founder’s early days involved payment trouble, investor rejection and a CIA code name that became a company brand. Decades later, he bought nearly all of Lānaʻi and tied it to a renewable-energy vision.

Sources

Analytics, advertising, and privacy choices

We use analytics and advertising cookies only with your permission. You can change this choice later from the footer.

Privacy policy