In 2025, surveys indicated that 90 per cent of technology professionals used AI at work, while a separate survey found that about 31 per cent of respondents used AI agents at work, some of them infrequently. Yet, despite widespread adoption, software engineering has lacked an instrument to measure what a token actually buys when an agent edits a code repository.

To address this gap, Alán Aspuru-Guzik and Varinia Bernales proposed a framework of software thermodynamics in a November 2026 study titled Where the Tokens Go: Heat, Entropy and Error in Agentic Coding. The core thesis is straightforward: autonomous coding obeys thermodynamic laws, meaning up to 80 per cent of an agent's token budget is consumed as heat rather than useful work. For enterprise leaders funding AI developer tooling, this structural inefficiency directly inflates infrastructure bills and undermines the unit economics of automated development.

Dividing Token Expenditure Into Work and Heat

In software thermodynamics, a model proposes edits to a code repository version while a harness coordinates tool access. The test suite functions as a software Maxwell's daemon, judging each change and allowing only passing code to enter the repository gate.

To measure this dynamic, researchers performed repeated cycles where an agent makes a change to a repository and subsequently undoes it. Because each round trip begins from a stored reference tree and returns the edits to where they started, any tokens spent along the way represent lost energy.

About 80 per cent of the tokens of a successful run are generated in model calls that leave the requested change where it was.

These empty iterations—model calls that leave the requested change where it was—are defined by the authors as heat. The useful energy required to complete a modification is remarkably small by comparison. Using an analogy with the equality of Jarzynski, the free energy of a change is estimated to be only 14 to 22 per cent of the mean cost of a successful coding run. Furthermore, the experiments showed that coding costs 1.1 to 1.5 times as much as uncoding.

How much real capital is lost to these idle cycles? When eight out of ten tokens in a successful run generate zero net architectural progress, compute expenditures scale primarily with stochastic trial-and-error rather than production output. This answers the core operational question: enterprises fund massive amounts of wasted inference exclusively spent on cyclical trial-and-error rather than forward architectural progress.

Imperfect Gates and Infrastructure Costs

The software Maxwell's daemon itself adds another layer of cost. A test suite is not infallible; its verdict varies with its environment. When the test gate inadvertently accepts a broken change, the harness incurs additional token costs to diagnose and remediate the error down the line.

A potential counterargument to this thermodynamic framework is that software tasks vary wildly in complexity, rendering thermodynamic token averages misleading for specific production pipelines. However, the experimental data demonstrates a persistent baseline of waste: regardless of the specific task structure, round-trip edits that return code to its initial state consistently burn the vast majority of generated tokens across runs, confirming that structural trial-and-error remains the dominant cost driver regardless of individual task complexity.

The test suite acts as a software Maxwell’s daemon that judges every coding change.

This continuous consumption of compute resources during circular edit cycles highlights a growing gap between vendor promises and operational outcomes. Autonomous coding agents are routinely marketed as frictionless replacements for manual software development. In practice, current agentic architectures spend up to 80 per cent of their token budget producing thermodynamic heat, leaving enterprise budgets exposed to the high cost of automated trial-and-error.

AI AgentsCoding AI AgentsCompute EconomicsToken Cost OptimizationModel Inference