Skip to content
Hacker News front page

Does Code Cleanliness Affect Coding Agents?

SonarSource researchers ran 660 trials with Claude Code across 33 tasks in minimal-pair repos. Code cleanliness didn't change pass rates, but cleaner code cut token usage by 7–8% and file revisits by 34%. Clean code doesn't decide success, but it materially lowers compute cost and navigation overhead for coding agents.

Why it matters: SonarSource compared task pass rates and execution cost on clean versus dirty repos, and the gains from clean code show up in fewer tokens and fewer repeated file opens.

Read the original ↗Export Markdown