Agent Token Burn: The $165k Bun Rewrite Was Cheap — New Research Shows Why Coding Agents Quietly Cost 1000x More

Yesterday we watched 64 Claude agents rewrite Bun in Rust for $165k. Today the bill comes due in a different currency: tokens.

A fresh arXiv paper (“How Do AI Agents Spend Your Money?”) drops the first systematic measurement of what actually happens when you let agents loose on SWE-bench Verified. The numbers are brutal.

Close-up stylized computer chip die with glowing neon traces and particle effects representing token burn

The 1000x Reality Check

Agentic coding tasks consume roughly 1000 times more tokens than ordinary code reasoning or chat sessions. Input tokens dominate — not the flashy output you see in the terminal. On the same tasks, runs can swing by 30x in total spend. Higher token counts do not reliably buy higher accuracy; performance often peaks at intermediate budgets and then plateaus or degrades.

The paper tested eight frontier models. Kimi-K2 and Claude-Sonnet-4.5 routinely burned 1.5 million more tokens than GPT-5 on identical work. Human difficulty ratings barely correlate with actual cost. Models themselves are terrible at forecasting their own spend (correlations max out around 0.39) and systematically underestimate.

This is not a “prompt better” problem. It is an architectural one. The stochastic nature of tool-calling loops, context bloat, and repeated verification turns every agent session into an unpredictable lottery.

From Bun’s $165k to Everyday Reality

The Bun rewrite looked expensive until you realize most teams are already hitting similar per-developer monthly figures once they scale beyond toy tasks. Gartner was right: $2k–$20k per dev per month is the new normal when agents run unsupervised.

The practical takeaway is ugly but actionable:

  • Cache aggressively and measure real trajectories, not synthetic benchmarks.
  • Route simple edits to cheaper models; reserve frontier spend for the hard refactors.
  • Build guardrails that kill runaway loops before they eat your quota.

The Open-Weight Escape Hatch

While cloud agents burn cash, a parallel arXiv paper from July 23 shows open-weight models (31–35B) nearly saturating a longitudinal data-preparation benchmark on consumer hardware — 87.9% average task completion with no data leaving the building. The framework is public. Governance-restricted research just got a viable local path.

Floating holographic open-weight model weights and local hardware nodes in a dark void with layered UI planes and orbital data structures

BenchLM’s July 2026 agentic leaderboard still crowns GPT-5.6 Sol at 75.6, but the gap between closed frontier and well-tuned local stacks is shrinking fast on narrow, high-value workflows.

The Spaghetti Takeaway

The $165k Bun experiment proved agents can move mountains. The token paper proves they will also quietly drain your budget unless you instrument everything. Yesterday’s velocity story and today’s cost story are the same story told from opposite ends of the pipe.

The next engineering bottleneck is not capability — it is predictability and cost control. Build the observability layer now or keep writing bigger checks.

Primary sources: arXiv:2604.22750, arXiv:2607.21482, BenchLM Agentic Leaderboard, MorphLLM Coding Agents June 2026, The Decoder AI coverage.

Want this in your inbox every morning? Subscribe to the SpaghettiStories newsletter.

Some links may be affiliate links. If you’re buying hardware to run local models, this affiliate link helps keep the lights on.