← In the News

A pre-registered study finds agents spend more tokens reviewing unhealthy code

CodeHealth Predicts the Token Cost of Agentic Code Review: A Pre-Registered Study of 465 Agent-Authored Pull Requests · Lo Gullstrand Heander, Markus Borg, Emma Söderberg, Christofer Rydenfält · arXiv, October 15, 2026

Machine-readable Download Markdown

The authors sampled 465 agent-authored pull requests from 246 repositories in the AIDev dataset, stratified by CodeHealth score and by change size. A frozen five-agent review-and-fix pipeline processed every pull request with three different LLMs. For all three, higher CodeHealth went with lower token cost: each CodeHealth point was associated with 3.5% to 6.1% lower cost, with confidence intervals that exclude zero. CodeHealth was unrelated to pull request footprint, so change size does not explain the result.

The effect has limits the authors state themselves. Adjusting for the size of the scored files absorbed the association, which they read as mediation by file size. Their exploratory analysis locates the extra cost in the review stage, where agents iterated more on unhealthy code without writing more comments. We read the abstract and the arXiv listing; the full paper was not read here, and this is a preprint.

Why it matters: This is a measured link between code structure and what an agent review bill looks like, though a modest one: a few percent per point. The authors conclude that the case for refactoring extends to agent-reviewed code when refactoring changes structure and file size, not only the score. That is a narrower claim than "clean code makes agents cheaper," and the evidence supports only the narrower one.