Skip to content

Invest1 publisher3 min readPublished

Bun's million-line Rust port ran $165,000 through Anthropic's API meter

Of the ten code migrations Anthropic says finished in a month, only one carries a dollar figure: 5.9 billion input tokens and 690 million output tokens, a million lines of Rust, about 16.5 cents a line.

The Investor · Invest desk

Illustration accompanying Bun's million-line Rust port ran $165,000 through Anthropic's API meter

What happened

  • Anthropic says individual developers there migrated ten code packages in the last month, each tens to hundreds of thousands of lines, using Claude Fable 5, Claude Opus 4.8 and dynamic workflows.
  • Jarred Sumner, Bun's co-founder and a member of Anthropic's technical staff, used Claude Code to produce a million lines of Rust from Bun's Zig codebase in less than two weeks.
  • All of Bun's existing test suite passed in CI before the merge, and nineteen regressions surfaced afterwards, which Anthropic says have all been fixed.
  • Mike Krieger, co-lead of Anthropic Labs, ported a Python codebase to 165,000 lines of TypeScript over a weekend using hundreds of agents, eight phase gates and three adversarial review rounds.

Compiled by The InvestorSomething wrong?How this is made

Why it matters

  • decision At 16.5 cents a line, a port becomes a discretionary spend an engineering manager can approve, where Anthropic says the multi-quarter version needed a roadmap freeze and an existential reason.
  • constraint The verification loop closes only where correctness is executable, so a team without Bun's CI coverage is paying for roughly 690 output tokens a line of translation that nothing can check before merge.
  • cost The $165,000 is list-price API revenue to the company publishing the case study and an internal inference cost to Anthropic, so an outside team pays cash for what Anthropic pays at cost.
  • precedent A published per-line cost from a staff-run port becomes the figure outside teams get measured against, and the one with a dollar number attached was run by the engineer who wrote the original codebase.

At $165,000 for 6.59 billion tokens, the Bun port ran about $25 per million blended [1]. Per line of shipped Rust that is 16.5 cents [2]. Anthropic's own baseline for a million-line migration, $3m to $4m of engineering over four years [7], works out at $3 to $4 a line [3]. The fall is somewhere between eighteen and twenty-four times [4]. The 690 million output tokens spread across a million lines is 690 output tokens for every line that survived to merge [5]. Against them, the 5.9 billion uncached input tokens are roughly 8.6 read for each one written [6].

The metered half of that comparison is solid and the other half is an estimate. The $165,000 came off an API bill; the $3m-to-$4m four-year figure appears in Anthropic's post without a calculation behind it [18]. Both numbers come from the same party. There is less to work with outside the post: the Rust port shipped inside Claude Code in June [5], and Bun's CLI is doing over 10 million downloads a month [12]. Nineteen post-merge regressions across a million lines is one per 52,600 lines [7], on Anthropic's count [4].

Ten packages in a month is a small sample drawn from favourable conditions [1]. Anthropic engineers, Anthropic models, and in Bun's case a codebase the migrator wrote himself. The post attributes Sumner's original choice of Zig to the C-level performance and simplicity it offered a solo founder "writing Bun in 1 year in a cramped Oakland apartment pre-LLM" [13]. He also had a test suite complete enough that all of it passed in CI before the merge [3]. None of the ten was a team porting code nobody on staff wrote, gated by partial coverage.

Krieger's figures sit oddly beside Sumner's. The main portion of his Python-to-TypeScript port was 27 million tokens for 165,000 lines [8][9], which is 164 tokens a line against Bun's 6,590 [9][10], a gap of about forty times [11]. At Bun's blended rate, 27 million tokens is about $676 [8]. Anthropic calls it the main portion, so the full number is higher, and the jobs differ: one crossed Python to TypeScript, the other Zig to Rust at six times the line count [2].

What that port bought was a build. Krieger's team was waiting about eight minutes per platform and 30 minutes across the build matrix on every release, and the ported toolchain compiles in about two seconds [10]; the binary starts six times faster and a separate deployment pipeline is gone [11]. Anthropic describes the change in risk this way: "Now, the worst case scenario is you delete the branch and try again." [14]

I think the cheap number holds where correctness is executable, and that the binding constraint has moved from engineer-years to test coverage. The loop Anthropic describes ("you don't fix the code. You fix the process (loop) that produced the code" [15]) closes only when something can tell an agent it is wrong. The counter-argument is in the nineteen. A post-merge regression count counts what surfaced, and the defect CI cannot reach is the one a systems port tends to create. If Bun's fix volume keeps rising through next year, the two weeks moved cost into maintenance instead of removing it.

What to watch

  • Whether Anthropic publishes token bills for the other eight migrated packages, or only for the two it wrote up.
  • Whether any team outside Anthropic reports a per-line cost near 16.5 cents on a codebase none of its own staff wrote.
  • Whether the six-step process described in the post turns up as a priced product.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories