aiqbench analysis
Research indicates that AI agents operating on unhealthy codebases consume 35-45% more tokens and generate lower-quality outputs compared to those working on maintainable code in C++, Java, and Python. This inefficiency stems from increased model confusion when processing code with high defect density, leading to higher operational costs and reduced task success rates. Establishing workflows that enforce code health metrics is essential for optimizing AI agent performance and reducing unnecessary inference spend.
Unhealthy Code is Burning Your Token Usage - Here's the Data

Our research across C++, Java, and Python shows that agents working on unhealthy codebases consume 35-45% more tokens to complete the same tasks. That’s in addition to the increased defect risk covered in earlier research. You're not just getting worse output. You're paying significantly more for it. Knowing that your unhealthy code burns excess tokens is useful. Having a workflow that prevents it from getting worse with every agent commit is what changes the outcome.
Our research across C++, Java, and Python shows that agents working on unhealthy codebases consume 35-45% more tokens to complete the same tasks. That’s in addition to the increased defect risk covered in earlier research. You're not just getting worse output. You're paying significantly more for it. Knowing that your unhealthy code burns excess tokens is useful. Having a workflow that prevents it from getting worse with every agent commit is what changes the outcome. To benchmark token consumption, CodeScene's research team analyzed two tasks: single-prompt test case…
Excerpt shown under the publisher's RSS terms · 88 words · full text and figures are on the publisher's site
Related coverage

Announcement: Deterministic PR Refactoring Agents
CodeScene · May 28, 2026

Presentation: The Five Stages of AI Maturity in Engineering Organizations - Where and Why Teams Get Stuck
InfoQ · Aug 4, 2026
[AINews] Modal’s $1B ARR, $16B Series D makes it NYC’s newest AI Infra Decacorn, 3x usage and 3x valuation in 5 months, 15x in 1 yr
Latent Space · Oct 15, 2026

[AINews] Reality Checks on AI News (Yegge shuts down Gas Town, Databricks’ +60% Astra cost)
Latent Space · Sep 17, 2026