As reported by codescene.com, data shows that every single point gained on CodeScene’s code quality index, known as Code Health, correlated with a reduction of 3.5 to 6.1% in token usage.
Agentic AI can speed up velocity, but the gains vanish within months as code complexity grows. In a presentation on AI-friendly code at GOTO Copenhagen, Adam Tornhill demonstrated that superior code quality enhances artificial intelligence performance while reducing token expenses, as covered by infoq.com.
Developing software with agents is significantly harder than writing code manually, Tornhill argued. But with agentic AI, they can complete tasks two to three times faster, he added.

“AI operates in a self-harm mode, often writing code it cannot reliably maintain later,” Tornhill told infoq.com.
Analyzing more than 1,000 open-source repositories revealed that artificial intelligence initially boosted productivity during the opening weeks, though a sharp surge in code complexity entirely wiped out those output gains past the two-month mark.
Code health measures how easy code is to understand, change, and maintain. Research done on human coding shows that if you have healthy code, you can be up to 10 times faster than someone who works on similar problems in unhealthy code, Tornhill said.
While an ideal AI-friendly threshold begins at 9.5, the typical codebase sits at a code health score of 5.15. Technical depth is a bottleneck for enterprise adoption of agentic coding, requiring agentic refactoring, Tornhill argued.
“As a best-case scenario, an agent can fix roughly 50% of the code health issues for lower-health code,” Tornhill told infoq.com.
The findings draw on 465 agent-authored pull requests from 246 repositories using TypeScript, Python, Go, C#, and JavaScript. Researchers evaluated three separate language models through a pipeline of four review agents followed by one fix agent.
| LLM Model | Token Saving Per Point | Total Contrast Range |
|---|---|---|
| deepseek-v4-flash | 6.1% | 35.0% |
| qwen3.6 | 4.8% | 28.9% |
| claude-sonnet-5 | 3.5% | 21.8% |
The hypotheses and analysis plan were pre-registered on OSF in August 2026, codescene.com reported. Adding an MCP with code health data can lead to a 90% to 100% fix rate, Tornhill said.
- How do teams measure code health?
- Code Health combines measures from module level design, function level design, and implementation level design to eliminate accidental complexity.
- How can developers safeguard AI-generated code?
- Safeguarding requires automated linting, code coverage, mutation testing, and Code Health metrics exposed to agents via local MCP servers.
- What drives agentic review token costs?
- Pull request size is the strongest driver of cost, followed by the health of the code the agents have to read.
Hypotheses and analysis plan were pre-registered on OSF in August 2026, codescene.com reported.
Related reading