Bun Rewritten in 11 Days by Claude: A Million‑Line AI Project—Is It Stable?
The Bun JavaScript runtime, originally built in Zig, was completely rewritten in Rust within 11 days using Anthropic’s Claude Fable 5, generating a million lines of code at a $165 k API cost, sparking Andrew Kelley’s criticism, community debate over stability, unsafe code blocks, and the long‑term viability of AI‑driven development.
Bun is a high‑performance JavaScript/TypeScript runtime written in Zig, marketed as a faster, modern replacement for Node.js. In December last year Anthropic acquired Bun to use it as infrastructure for its AI programming tools Claude Code and Claude Agent SDK.
The original Zig implementation suffered from numerous memory‑safety bugs such as use‑after‑free, double‑free, and leaked allocations. These issues could only be mitigated by coding conventions in Zig, whereas Rust’s borrow checker would surface them as compile‑time errors. Additionally, the Zig community enforces a zero‑tolerance policy for AI‑generated code, making long‑term maintenance of Bun costly.
In May, Bun founder Jarred Sumner announced a complete rewrite of Bun’s roughly one‑million lines of code in Rust, performed in just 11 days with Anthropic’s then‑unreleased Claude Fable 5 model and the dynamic workflow capabilities of Claude Code. The AI generated the entire Rust codebase.
The rewrite reportedly consumed $165 000 of Claude API usage. Compared with the original development timeline of about a year, the AI‑driven effort reduced cost to roughly one‑tenth and time to under two weeks.
"Bun claims that the one‑million‑line Rust code written by AI is safe because it has test cases; if the tests are truly comprehensive, why didn’t the Zig version catch those annoying bugs?"
Andrew Kelley, creator of Zig, responded with a scathing blog post, blaming Sumner’s engineering habits, patch‑on‑patch style, and lack of architectural refactoring. He questioned the safety claims and highlighted the Zig version’s buggy history. The tech community reacted sharply: some accused Sumner of betraying the Zig ecosystem, while others defended Kelley’s stance as a defense of pure engineering quality, likening his tone to that of Linus Torvalds.
Technical concerns remain. The AI‑generated Rust code contains about 27 000 lines marked unsafe, and the rewrite lacks human‑led architectural redesign. Critics warn that the cognitive and debugging costs of maintaining such a massive AI‑generated codebase may eventually outweigh the upfront savings.
The project is described as an "epic agentic workflow test" and has been used by Anthropic as a benchmark for dynamic workflows. Whether it becomes a milestone for AI‑augmented programming or a future technical‑debt volcano will only be determined over time.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
