
Bun's creator completed a full rewrite of the JavaScript runtime from Zig to Rust in 11 days using Claude, Anthropic's AI agent tool.
The migration eliminated memory leaks, shrank the binary by roughly 20%, and improved performance by 2–5%, demonstrating a new workflow for large-scale code migration driven by AI agents and automated testing rather than manual review.
What happened
Jarred Sumner, creator of the Bun JavaScript runtime, used Claude (Anthropic's AI agent tool) to port approximately 535,000 lines of code from Zig to Rust over 11 days. The rewritten Bun 1.4 (Canary) now runs on Rust instead of Zig and passed the full test suite.
Why it matters
The migration eliminates memory leaks, reduces binary size by approximately 20%, and improves performance by 2–5%. Sumner chose Rust for its memory safety guarantees—preventing crashes from memory errors that were harder to catch in Zig—making Bun more stable for users relying on it (including Anthropic, which acquired Bun in December 2025).
What to watch
The work cost approximately $165,000 in Claude API usage and involved dynamic workflows running continuously for 11 days, generating 6,778 commits and peaking at approximately 1,300 lines of Rust code per minute. Sumner used multi-agent adversarial code review and test-driven iteration rather than manual verification, establishing a pattern for large-scale AI-assisted refactoring.
Ask the AI about this article →
Bun, a Node.js-compatible JavaScript runtime, was acquired by Anthropic in December 2025 and serves as the runtime for Claude Code. In May 2026, Sumner began experimenting with migrating the codebase from Zig to Rust; by July 2026, he had completed the full rewrite using Claude as an AI agent orchestrator.
The approach was methodical: Sumner first established porting rules and lifetime annotations by discussing patterns with Claude and creating reference documents. He then deployed dynamic, multi-agent workflows that ran for 11 continuous days, generating code, running tests, and receiving corrections in tight feedback loops. Critically, Sumner used adversarial review agents (at least two per implementation agent) to catch bugs and enforce correctness, treating the test suite and automated review as the source of truth rather than manual code inspection. At peak, the system generated approximately 1,300 lines of Rust per minute across parallel agents, producing 6,778 commits.
The results—elimination of memory leaks, 20% smaller binary, and 2–5% performance gain—suggest that large-scale refactoring can be completed via AI-assisted workflow iteration without traditional line-by-line human review, provided test coverage and adversarial automation are sufficiently robust. For businesses considering large code migrations, this demonstrates a potential cost-benefit: $165,000 in API usage versus the equivalent of three engineers for one year.
For example, today's edition would include:
AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.
Free · takes 30 seconds · unsubscribe anytimeWhat is AIToday? →
Ask AI anything about this article. Q&As are published on this page for other readers too.
Visko raised $10 million in pre-seed funding from Llama Ventures and opened public access to its first foundat…
AI company Runway has unveiled Solaris, the first model in a new category it calls "Interface World Models." I…

Google's AI search gave advice to call emergency services for users alone with an African, Indian, or Pakistan…

John Deere introduced JD, a conversational AI tool that lets farmers ask open-ended questions about their hist…

Nvidia CEO Jensen Huang said on Fox Business that AI is creating 'hundreds of thousands' of jobs, including in…

Israeli startup DataAgent Ltd