Key Takeaways
The Zig Creator is NOT Happy About This... (Bun to Rust)

- Bun was rewritten from Zig to Rust in 11 days using parallel Claude agents at a cost of $165,000
- Zig creator Andrew Kelley called the code 'unreviewed slop' and blamed Bun's bugs on poor programming practices, not the language
- The rewrite raises critical questions about AI-generated code quality and review processes for production systems
Jarred Sumner rewrote Bun, Anthropic's JavaScript runtime, from Zig to Rust in 11 days using 50 parallel Claude agents. The project cost roughly $165,000 at API pricing and generated over a million lines of Rust code. Andrew Kelley, creator of Zig, responded by calling the output 'unreviewed slop' and pointing to what he sees as fundamental problems with how Bun was built in the first place.
The clash exposes a growing fault line in software development: what happens when AI makes massive rewrites economically feasible but doesn't address the underlying engineering discipline?
Why did Bun switch from Zig to Rust?
Sumner originally chose Zig for Bun because of its performance and low-level control. Combined with Apple's WebKit JavaScriptCore engine instead of Google's V8, this architecture made Bun fast. Anthropic acquired Bun in December 2025 and built its core state machine on the runtime.
But as Bun's user base grew, bugs accumulated. The most damaging: a bundler bug that generated source maps during builds even when instructed not to. That flaw caused Anthropic's 512,000-line Claude Code source leak in March, according to NodeSource.
Sumner acknowledged in his migration blog post that Zig wasn't designed for Bun's hybrid memory management approach, which mixed garbage collection with application-driven memory management. Rust's ownership model automates much of this complexity.
How did Claude complete the rewrite so quickly?
Sumner orchestrated about 50 dynamic Claude Code workflows running in parallel. At peak, the system produced roughly 1,300 lines of code per minute. The resulting Rust codebase passed 100 percent of Bun's test suite, which contains more than one million assertions, across all supported platforms.
The economics are striking. A traditional rewrite of 500,000 lines would take a small engineering team about a year, during which bug fixes, security patches, and new features would freeze. Sumner estimated that no single engineer could match Claude's 11-day output regardless of salary.
HashiCorp co-founder Mitchell Hashimoto noted the accomplishment on X, pointing out that no human engineer could achieve comparable milestones in the same timeframe.
What is Kelley's actual criticism?
Kelley's objection isn't primarily about AI or the language switch. In a post titled 'My Thoughts on the Bun Rust Rewrite,' he wrote that the Zig community 'became increasingly horrified at the programming practices we saw in Bun's codebase' even before the Anthropic acquisition.
“Sumner was already writing slop well before he had access to LLMs.”
— Andrew Kelley, creator of Zig
Kelley's specific complaints: aggressive feature releases, accumulated technical debt, poor error-handling code, and bugs that piled up faster than they were fixed. He characterized the core issue as 'the diverging value systems of the two projects.' Bun optimized for shipping. Zig optimizes for correctness.
Kelley speculated that Sumner may have been responding to business pressure rather than technical imperatives. Bun was one of Zig's highest-profile projects and a regular contributor to the Zig Software Foundation until the acquisition.
Does passing tests prove code quality?
Sumner emphasized that the AI-generated Rust code passed every test without deletions or skips. But test suites validate behavior, not architecture. They check that functions return expected outputs. They don't assess whether the code is maintainable, secure against novel attacks, or logically coherent to human reviewers.
The 'unreviewed' part of Kelley's criticism matters here. Even if 1,300 lines per minute pass automated tests, can any team meaningfully review a million lines of AI-generated code? The question isn't academic. Bun now runs Anthropic's infrastructure.
A Claude bot called RoboBun was already the top contributor to the Bun repository before the rewrite, handling bug fixes and test remediation. The migration extends this pattern: AI writing code, AI testing code, humans providing oversight at a necessarily high level of abstraction.
What this means for enterprise AI adoption
The Bun rewrite demonstrates that AI can compress what would be a year-long project into days. It also demonstrates that speed and correctness aren't the same thing. The $165,000 cost sounds cheap compared to a year of engineering salaries, but it doesn't account for the review burden or long-term maintenance of code that no human wrote line by line.
For CIOs evaluating AI coding tools, the Bun case offers a useful stress test. The question isn't whether AI can generate code that compiles and passes tests. It clearly can. The question is whether your organization has the review processes, testing depth, and architectural oversight to catch what automated tests miss.
Logicity's Take
Kelley's critique isn't really about AI. It's about what happens when velocity becomes the primary metric. Bun moved fast before Claude and moves faster now. The Anthropic source leak suggests that speed has costs. For IT leaders considering AI-assisted development at scale, the lesson is procedural: AI amplifies your existing engineering culture. If you ship carefully reviewed code, AI helps you ship more carefully reviewed code. If you ship fast and fix later, AI helps you ship faster and accumulate debt at machine speed. The test suite isn't a substitute for architectural judgment.
Frequently Asked Questions
How much did the Bun Rust rewrite cost?
Approximately $165,000 at Anthropic API pricing, with 50 parallel Claude Code workflows running over 11 days.
Did the AI-generated Rust code pass testing?
Yes. According to Sumner, the new codebase passed 100 percent of Bun's test suite, which includes over one million assertions, without skipping or deleting any tests.
Why did the Zig creator criticize the rewrite?
Andrew Kelley's criticism focused on Bun's underlying programming practices, not the choice of language or AI tooling. He argued that Sumner's codebase had accumulated bugs and technical debt due to aggressive feature releases and poor error handling.
What caused the Anthropic Claude Code source leak?
A bug in Bun's bundler that generated source maps during builds even when configured not to, exposing 512,000 lines of code.
Is Rust better than Zig for Bun?
Sumner argues Rust is better suited for Bun's hybrid memory management model. Kelley disputes that framing, attributing Bun's problems to engineering practices rather than language limitations.
Need Help Implementing This?
Evaluating AI coding tools for your development team? Logicity's advisory services help IT leaders build review processes and governance frameworks for AI-assisted development. Contact us to discuss your organization's needs.
Source: www.theregister.com
Huma Shazia
Senior AI & Tech Writer
Produced with AI assistance and reviewed by the Logicity editorial team. Learn more in our Editorial Policy.






