anagnorisis.cloudSign in

← Hourlies

Hourly ·

Bun Rewrites Entire Runtime from Zig to Rust Using 64 Claude Instances

The Bun JavaScript runtime completed a massive rewrite from Zig to Rust, processing 6,502 commits over 11 days using 64 parallel instances of Anthropic's Claude Fable 5 — a project founder Jarred Sumner estimates would have taken three engineers a year to do manually.

Bun Rewrites Entire Runtime from Zig to Rust Using 64 Claude Instances

The Bun JavaScript runtime — a fast all-in-one toolkit for JavaScript and TypeScript — has been completely rewritten from Zig to Rust, founder Jarred Sumner announced in a detailed technical retrospective published July 8.

The rewrite, internally codenamed "Project Upgrade," ran 64 parallel Claude instances for 11 days straight, producing 6,502 commits and touching over 780,000 lines of Rust. Sumner, who disclosed that Bun was acquired by Anthropic in December 2025, used a pre-release version of Claude Fable 5 for much of the work. The total API cost came to roughly $165,000 at current pricing.

The result: Bun v1.4.0 fixes 128 bugs that reproduced in the previous Zig-based v1.3.14, with reduced memory usage thanks to Rust's Drop trait for automatic cleanup. At post time, about 4% of Bun's Rust sits inside unsafe blocks — around 13,000 keywords across 27,000 lines — mostly for JavaScriptCore interop. The team has already completed 11 rounds of security review and deployed 24/7 coverage-guided fuzzing across every parser in Bun, which has executed the parsers 100 billion times so far.

The port introduced 19 known regressions, all since fixed. Several stemmed from subtle semantic differences between Zig and Rust — like debug_assert! erasing side effects in release builds, or Rust's bounds checks surfacing off-by-one bugs that Zig's ReleaseFast mode silently ignored — 0 tests were skipped or deleted across the entire rewrite.

Zig creator Andrew Kelley published a candid response, acknowledging Sumner's appreciation for Zig while criticizing the venture-capital-driven development culture at Oven, Sumner's management style, and the code quality of the original Zig codebase. Kelley described the rewrite as inevitable given what he saw as "slop" engineering practices in Bun's Zig era.

The rewrite represents the largest publicly documented AI-assisted code migration to date and a striking demonstration of what frontier coding models can accomplish when paired with orchestration frameworks like Claude Code's dynamic workflows.

Sources: Rewriting Bun in Rust (Bun Blog), My Thoughts on the Bun Rust Rewrite (Andrew Kelley), Hacker News discussion

More Hourlies Stories

Content on Anagnorisis is summarized, paraphrased, and editorialized from publicly available sources for length and clarity. Original sources are linked where available. All trademarks belong to their respective owners.

More from Anagnorisis