How Anthropic Used Claude Code to Port Bun From Zig to Rust in 11 Days
Anthropic published a detailed account of how Claude Code handled two large-scale code migrations that would previously have taken years. The headline case: Bun creator Jarred Sumner used roughly 50β64 parallel Claude agent workflows to port over a million lines of Bun's codebase from Zig to Rust in about 11 days, spending roughly $165,000 in API costs while passing 100% of Bun's existing test suite. A second case study covered Mike Krieger porting 165,000 lines of Python to TypeScript in a single weekend. Anthropic framed the results around multi-agent orchestration, adversarial review, and automated compile-test-fix loops as a repeatable methodology, not a one-off stunt.
Sources & Mentions
5 external resources covering this update
Zig creator calls Bun's Claude Rust rewrite 'unreviewed slop'
The Register
Claude Code uses Bun written in Rust now
Hacker News
The Pulse: What can we learn from Bun's rapid Rust rewrite with AI?
The Pragmatic Engineer
AI Porting: Claude Rewrites Bun Codebase in Rust
Heise Online
Bun switches from Zig to Rust with Claude's help
Techzine Global
A Migration That Used to Take Years, Done in Days
Anthropic's blog post lays out how large, previously impractical code migrations became viable with Claude Code, anchored by two real case studies from engineers with direct ties to the company. The most striking is Bun creator Jarred Sumner's rewrite of Bun's core from Zig to Rust: over a million lines of Rust code produced in under two weeks, with 100% of Bun's existing test suite β more than a million assertions β passing before the change merged.
How the Migration Worked
Sumner ran dozens of Claude Code workflows concurrently (reports put the number between 50 and 64), each translating a different segment of the codebase in parallel rather than sequentially. Before writing any code, he spent hours with Claude mapping conversion patterns between Zig and Rust into a rulebook document, which was then applied consistently across thousands of files. Anthropic's write-up frames the underlying method as six repeatable steps: build a rulebook, stress-test the rules, translate, compile, smoke test, and verify behavior β with the existing test suite acting as an objective referee throughout.
Measurable Results
The numbers are concrete and unusually favorable for an AI-driven rewrite: the resulting binary is 19% smaller on Linux and Windows, one benchmark of 2,000 repeated builds saw memory usage drop from 6,745 MB to 609 MB, and real-world workloads like next build and tsc ran 2β5% faster. The full effort consumed 5.9 billion input tokens, priced at roughly $165,000. A second case in the same post β Mike Krieger's port of 165,000 lines of Python to TypeScript β was completed over a single weekend.
Reception Was Not Universally Positive
The story spread well beyond Anthropic's own channels. Sumner's own technical write-up hit the top of Hacker News with over 600 points and hundreds of comments, many questioning whether code produced at that pace can realistically be reviewed and maintained. Zig's creator, Andrew Kelley, publicly pushed back, characterizing the rewrite's justification as resting on Bun's own pre-existing technical debt rather than a fundamental flaw in Zig. The debate over whether this represents a genuine engineering win or a cautionary tale about AI-generated code at scale is very much unresolved.