Jarred Sumner rewrote the Bun JavaScript runtime from Zig to Rust and published a detailed account of the process. The conversion relied heavily on agent-like automated workflows and used Bun's existing TypeScript test suite as a language-independent conformance target; human oversight and adversarial code review were used to refine the outputs.
What happened
Sumner had been promising this write-up since May 9th and explains his Zig→Rust rewrite in depth. He praises Zig for enabling Bun's earlier progress but highlights persistent memory-management bugs—use-after-free, double-free, and missed frees on error paths—that motivated a move to Rust, where such issues become compile-time errors and are mitigated by RAII/Drop-style automatic cleanup.
How the port was done
A key enabler was that Bun's test suite is written in TypeScript, allowing it to function as a conformance suite across languages. That made it possible for an agent harness to automate much of the initial port from Bun to Rust, initially as an experiment using an earlier model version (now available as Mythos/Fable).
Sumner reports that he did not expect success at first, but within a few days a high percentage of the test suite passed and the new Rust code aligned closely with the original Zig codebase. The active porting effort lasted roughly 11 days, during which Sumner monitored workflows, manually inspected outputs for issues, and prompted Claude to adjust the loop to fix problems.
Reviewing large LLM-authored diffs
The post addresses how to review a pull request that adds over one million lines of code. Their approach combined a language-independent test suite with roughly a million assertions, adversarial code review, and a practice of fixing the code-generation process rather than hand-patching generated code when errors appeared.
Deployment and performance
The Rust implementation has been live in Claude Code for nearly a month: Claude Code v2.1.181, released June 17th, and later versions use the Rust port of Bun. On Linux startup time improved by about 10%; otherwise the change was mostly unnoticeable—Sumner notes that ‘boring is good.’
Model usage and estimated cost
Working at Anthropic meant internal runs did not require paying for tokens, which is significant given the scale. Pre-merge, the porting process consumed 5.9 billion uncached input tokens, 690 million output tokens, and 72 billion cached input token reads — which at API pricing would amount to roughly $165,000.
Why this matters
The Bun rewrite is a concrete case study in applying coordinated, parallel agents and large language models to an ambitious engineering task normally considered too risky for a full rewrite. The combination of an existing language-agnostic test suite and Rust's memory-safety model made the port feasible and gave the team measurable confidence to merge large amounts of LLM-generated code.
Closing note
Sumner thanks Zig for getting Bun to its earlier state while explaining that Rust was chosen to reduce memory-management bugs. The detailed post provides insight into agentic engineering practices, adversarial review, and large-scale model usage in complex software rewrites.



