← Back to Videos
Cloud Architecture

Claude Just Migrated 750K Lines In 11 Days (Bun Got Rewritten Zig → Rust)

Bun — the JavaScript runtime — was rewritten in a completely different language by Claude in 11 days. 750,000 lines of brand new Rust code. 99.8% test pass rate. 2,188 files. Merge

📅 16 June 20267:02✍️ Rahul Kumar

750,000 Lines of Rust in 11 Days: The Bun Migration That Changes What We Think Is Possible

Bun — the high-performance JavaScript runtime originally written in Zig — was rewritten in Rust by Claude in 11 days. 750,000 lines of brand new Rust code. 2,188 files touched. 99.8 percent test pass rate. Merged to main on May 14. Anthropic acquired Bun in December 2025, and this migration is the first major demonstration of what that acquisition was about. This is the largest known AI-driven codebase migration in history — and it tells us something concrete about what is now possible with enterprise legacy code.

Why Anthropic Acquired Bun

When Anthropic acquired Bun in December 2025, the stated rationale was improving Claude Code's JavaScript execution environment and giving Anthropic a production-grade runtime to use in their own infrastructure. The actual strategic value turned out to be something else: Bun became the test case for demonstrating at scale that AI-driven codebase migration is production-ready.

Bun was ideal for this experiment. It has an exceptional test suite — the Bun team historically prided themselves on test coverage. It is a well-understood, self-contained runtime with clear input-output semantics. And it was written in Zig, a relatively young language that has a smaller talent pool than Rust, making migration attractive on independent merits.

The Architecture That Made It Work: Phase A and Phase B

The migration did not run as a single agent reading and rewriting files. Anthropic used a two-phase architecture with dynamic multi-agent workflows:

  • Phase A — Analysis and decomposition: A set of specialised agents read the entire Zig codebase and produced a structured representation of the system — data structures, interfaces, dependency graphs, and semantic intent documentation. This phase ran first and its outputs became the knowledge base for Phase B.
  • Phase B — Parallel translation: Hundreds of parallel Claude agents consumed the Phase A outputs and wrote Rust implementations. Critically, agents were not translating Zig to Rust line by line — they were implementing the intent documented in Phase A using idiomatic Rust. This is why the output is 750,000 lines of new Rust code rather than mechanical Zig-to-Rust transliteration.

The 99.8 percent test pass rate validates that this approach — analyse intent, then implement — produces correct code at a higher rate than syntactic translation.

What This Means for Enterprise Legacy Codebases

The Bun migration is proof-of-concept at scale. Three concrete implications for enterprise teams:

  • The constraint is test coverage, not code size: Bun's migration worked because the test suite was comprehensive. The tests are what validated 99.8 percent correctness. Legacy codebases with low test coverage cannot be migrated at this confidence level — the tests are the safety net that makes autonomous migration viable.
  • Modular architecture enables parallel migration: Bun's clean module boundaries allowed Phase B to run hundreds of agents in parallel without conflicts. Monolithic codebases with high internal coupling will require decomposition work before AI migration is practical.
  • 11 days at this scale required significant compute: This was not a Claude Code session on a developer laptop. It was coordinated multi-agent infrastructure running at Anthropic's scale. Enterprise teams attempting similar migrations need to plan the compute and orchestration infrastructure, not just the AI model.

The Uncomfortable Question: Is Your Codebase Next?

For software engineers, the honest answer is: parts of it, probably yes. The Bun migration does not mean AI replaces engineers — it means the economics and timelines of specific categories of work are changing rapidly. Migration projects that previously required months of engineering time are becoming weeks-long AI-assisted projects. The engineers who remain valuable are those who can design the migration architecture, validate the outputs, and handle the edge cases that fall outside the 99.8 percent.

3 Things Every Developer Should Do Now

  • Invest in your test suite: Test coverage is not just quality hygiene — it is the prerequisite for AI-assisted migration. If your codebase has low coverage, the investment in tests today creates the optionality for AI-assisted evolution tomorrow.
  • Document module boundaries and intent: Phase A of the Bun migration produced structured intent documentation from the codebase. You can create this ahead of time. Document what each module does in plain language, not just what the code does — this is the input that makes AI-driven migration accurate.
  • Get hands-on with AI-assisted migration on a small scope: Do not wait for a large migration project to learn this capability. Take a small, well-tested module and run an AI-assisted migration to a different language or framework. Understand the workflow, the validation process, and where human judgment is required — before you need it at scale.

Key Takeaways

  • Claude rewrote 750,000 lines of Zig to Rust in 11 days with a 99.8 percent test pass rate — the largest known AI-driven codebase migration in history
  • The two-phase architecture — analyse intent, then translate in parallel — is what enabled both speed and correctness
  • Test coverage is the constraint: the tests are the safety net that makes autonomous migration viable at this confidence level
  • Enterprise legacy migration projects are now fundamentally different in economics and timeline — months becoming weeks for well-structured, well-tested codebases
  • The engineer's role shifts from writing migration code to designing migration architecture, validating outputs, and handling the edge cases AI cannot confidently resolve

Watch on YouTube

▶ Watch Now

Opens in YouTube

Share on LinkedIn

One click — copies a ready-to-post update about this video

About the Author

Rahul Kumar is a Senior Cloud and AI Architect at Microsoft with 13+ years of enterprise experience across Azure, AWS, and GCP.

Book a Discussion