Anthropic used Claude Code to migrate Bun from Zig to Rust, producing a million lines of code in less than two weeks. The Rust port shipped inside Claude Code in June with 100% of Bun's existing test suite passing in CI before merge. The company reported that the resulting binary was 19% smaller on Linux and Windows and 2–5% faster across HTTP serving and workloads such as next build and tsc. Nineteen regressions appeared after merge and were subsequently fixed.
Jarred Sumner, Bun's co-founder and a Member of Technical Staff at Anthropic, led the migration. Zig had initially offered C-level performance and simplicity, but its trade-offs had become harder to justify as Bun grew. The article quotes Sumner describing the original project as “writing Bun in 1 year in a cramped Oakland apartment pre-LLM.” The article says Bun's CLI was receiving over 10 million monthly downloads and was used extensively within Claude Code. Previously, a language migration would have meant freezing roadmap work for a multi-quarter project.
The migration retained the codebase's structure. Sumner developed a translation rulebook through conversations with Claude, used eight subagents to review different categories of failure modes, and inventoried gaps between Zig and Rust, including differences in memory management. A preliminary stress test compared translations of three files produced under different instructions. It exposed two critical issues before the approach was expanded across all 1,448 files.
Claude Fable 5 and Claude Opus 4.8 were used in the migration work described by Anthropic. Implementation, adversarial review and fixes ran in loops, with recurring mistakes moved into the rulebook rather than patched independently in every file. For Bun, compilation was deferred to a separate stage: an orchestrator compiled the workspace, fixer agents addressed the resulting errors, and the process repeated. The existing TypeScript test suite provided a language-independent check on the port's behaviour.
The Bun migration consumed 5.9 billion uncached input tokens and 690 million output tokens, equivalent to around $165,000 at API pricing. About 4% of the Rust code remained inside unsafe blocks, mostly single-line pointer operations at C/C++ boundaries. In a benchmark of 2,000 repeated builds, memory use fell from 6,745 MB to 609 after the detectable memory leaks were fixed. The account therefore reports both the operational improvements and the remaining engineering trade-offs, rather than treating passing tests at merge as the only result.