AI Pays a Tax on Bad Code: Generating Tests for 25K Files Costs 35-45% More Tokens

blaizedsouza · x · 2026-11-05

An experiment by CodeScene's research team: a model generated tests for 25,000 files across C++, Java and Python, and needed 35-45% more tokens to complete the same work on lower-quality code — what the author calls "a tax on bad code."

The article, titled "Let the Agents Take the Night Shift," argues that AI coding cost is directly tied to code quality: bad code slows down human developers and inflates AI token spend alike, and autonomous agents are well suited to take over batch-style development work overnight, freeing daytime for humans.

Original post →

More from coding & agent

coding & agent channel →