What Bun's Rapid Rust Rewrite With AI Teaches Engineers
How Bun rewrote 535K lines of Zig to Rust using 64 parallel AI agents and Anthropic's Fable model in just days.
Bun creator Jarred Sumner used Anthropic's Fable model to port Bun's 535,496-line Zig codebase to Rust in a matter of days, after years of chasing memory-safety bugs — leaks, crashes, use-after-free errors — inherent to mixing garbage-collected and manually-managed memory in Zig. A conventional rewrite by a small human team was estimated at a full year, an unacceptable pause for a runtime with 22 million monthly downloads.
The actual process combined a three-hour prep session with Claude that produced a 600-line porting guide, a small-scale trial with adversarial code review, and then splitting the remaining work across 64 parallel AI agents. Practical friction — like agents stepping on each other's git operations — was resolved by constraining the agents' workflow and running four worktrees with 16 agents each.
The full rewrite finished in about two days, with every commit passing two rounds of adversarial review; roughly 16,000 resulting compiler errors were then fixed by the agents in around 12 hours. The case suggests that AI-assisted rewrites of large, low-level systems software may now be practical — provided the work is properly decomposed and rigorously checked.
This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work