TurnCost: Turns, Not Observations: Cache-Aware Loop Engineering for Coding Agents
Trimming what your tools print back is the obvious way to cut an agent's bill, and on 600 public coding-agent trajectories it is close to the wrong lever: the context is append-only, prefix caching served 98.6% of the input tokens, and so pricing those tokens at the list input rate overstates the real cost about sevenfold. Fitting cost against each candidate driver, turn count explained 84% of the variation and mean observation size 4% — the most expensive runs were simply the longest, not the ones reading the biggest logs. The paper also derives when handing a large tool output to a cheaper model pays for itself, and the horizon is set by what cached reads cost rather than the list price, which is why delegation raised cost in about half the settings tested and plain truncation matched or beat it in all twenty threshold-and-setting combinations. Count turns before you compress logs, and price any cheap-model routing against your cached-read rate.