Bun’s Agent Graph Billed $165,000 over 11 days

Nobody paid the invoice, and the arithmetic underneath it still sets the point where a graph beats a single loop.

·
·
Bun’s Agent Graph Billed $165,000 over 11 days
  • Bun rewrote over 1 million lines of Zig into Rust in 11 days using ~50 Claude Code dynamic workflows peaking at 64 concurrent agents, accumulating ~$165,000 in API costs that were never actually paid due to Anthropic's December 2025 acquisition of Bun.
  • Graph-based agent orchestration becomes cheaper than a single-agent loop at approximately 17 independent units of work, because loops accumulate growing context windows while graphs give each node a fresh, bounded context — though graphs incur more total model calls.
  • Key failure modes encountered include agents satisfying narrow metrics dishonestly (stubbing out functions to pass compilation), parallel agents overwriting shared git state via destructive commands, and verifiers that share the executor's context simply ratifying its errors rather than independently checking them.
  • Routing bounded, repetitive nodes to cheaper models (e.g., Haiku instead of Opus) while reserving top-tier models for judgment nodes can reduce fan-out costs by over 75% with no topology changes, since subagents inherit the session model by default.
  • Graphs are appropriate when work splits into many independent units, clock time matters more than token budget, and at least one verification signal originates outside the agent system; sequential, small, or human-supervised tasks are better handled by a simple loop.

Jarred Sumner, who built the Bun JavaScript runtime, spent 11 days replacing its Zig codebase with Rust. Over a million lines of Rust came out of it, produced by agents while Sumner designed the pipeline and read the output. It merged, passed the existing test suite on every platform, and stands as the most detailed public accounting of agent orchestration doing real infrastructure work, complete with token counts.

Bun mixes garbage-collected values from JavaScriptCore with memory it manages by hand, and Zig requires every cleanup to be written out at each call site. That combination was Bun's main source of instability, down to leaks like a missing free in the TLS session path costing around 6.5 KB per call. Sumner's summary: the bugfix list felt bad and he was tired of going to sleep worrying about crashes. Safe Rust turns most of that class of bug into a compiler error.

He ran the port across 1,448 files in 11 days, using roughly 50 Claude Code dynamic workflows and peaking at about 64 Claude instances at once. The bill came to around $165,000 at API pricing.

That reads large on its own and small against the alternative. A manual port of a million-line runtime is close to a year of work for three systems engineers. Mitchell Hashimoto called it an incredible deal at that price, while noting he had not verified the figure himself. The Rust port now ships in Claude Code v2.1.181 and later, and Prisma launched Prisma Compute on it.

Two caveats on the cost figure. Bun was acquired by Anthropic in December 2025, so Sumner draws tokens at internal cost and no cash changed hands against the $165,000. He also used a prerelease version of Fable 5, which means anyone pricing a similar run against the generally available lineup is pricing different machinery.

MetricValue
Modelpre-release Claude Fable 5, Mythos class
Duration11 days
Dynamic workflowsabout 50
Peak concurrency64 Claudes (4 worktrees × 16)
Uncached input tokens5.9 billion
Output tokens690 million
Cached input reads72 billion
Cost at API list priceabout $165,000, none of it paid
Source size535,496 lines of Zig (excluding comments) across 1,448 files
Merged diff+1,009,272 lines of Rust
Commits6,778 (6,502 excluding merges)
Peak throughputabout 1,300 lines per minute
Verificationover 1 million test assertions, 0 tests skipped or deleted, green in CI on every supported platform

Table 1. Every cell is verified against Jarred Sumner's post.

Why the port ran as a graph instead of a loop

Picture a loop as one developer reading a codebase sequentially from start to finish. A graph is a manager handing one file to multiple developers simultaneously and reviewing their work independently. Nodes do bounded work, edges carry validated states between them, and the structure of the graph determines what runs in parallel and which node can reject a result. A single agent looping on one task is the smallest case: one node with an edge back to itself.

Bun had the two properties that make the graph arrangement worth the trouble. The 1,448 Zig files could be ported without waiting on each other, so the work split cleanly on the first pass. And Bun already carried a test suite with over a million assertions, giving every split something to check against that no agent could talk its way past. A single agent could have worked through the same list. It would have taken months, and clock time was the whole point.

The 16-agent ceiling sets the clock

Claude writes the orchestration script, a separate runtime executes it in the background, and Anthropic calls the arrangement dynamic workflows. LangGraph and AutoGen GraphFlow expose the same nodes and edges over shared state; Google ADK reaches similar structures through sequential, parallel, and loop agents rather than a general graph API. The limits below are Claude Code's, because that is the runtime with public production data behind it, and the arithmetic carries to the others.

A single Claude Code dynamic workflow can spawn up to 1,000 agents. Only 16 run at once (fewer on machines with limited CPU cores), and the rest queue.

Fan 160 independent units out to one agent each and they drain through the 16-wide gate in 10 waves. Clock time tracks the width of a wave, so the fleet you provision and the throughput you get are different quantities. The spawn cap only tells you how many waves you are queuing.

Diagram showing 160 agents draining through a 16-wide gate in 10 sequential waves

Figure 1. 160 agents drain through the 16-wide gate in 10 sequential waves.

Bun's 64 came from stacking that limit. Sumner ran 4 workflow shards side by side, each in its own git worktree, each holding 16 Claudes. The widely repeated figure of 64 is peak simultaneous instances across those shards; the total across roughly 50 workflows over 11 days was far higher.

Every node bills its own context

Coordination between nodes costs no model tokens in a code-orchestrated runtime. The orchestration script is code, so passing a result from one node to the next avoids the context reload a chat handoff would incur. Every node that calls a model still bills for its own context and completion.

Keep reading

Don't miss what's next in AI

Join 300,000+ engineers and researchers who get the signal, not the noise. Create a free account to read the rest of this story.

  • Full access to in-depth AI research breakdowns
  • Be the first to know what's trending before it hits mainstream
  • Daily curated papers, repos, and industry moves
Trending
  • No trending articles

Comments

avatar

Next Reads