Anthropic Demonstrates Feasibility of AI-Powered Code Migrations at Scale: Million-Line Ports Now Possible in Weeks
Key Takeaways
- ▸Bun's million-line Zig-to-Rust migration completed in under 2 weeks using Claude agents, with all tests passing pre-merge and only 19 post-merge regressions (all subsequently fixed)
- ▸Python-to-TypeScript migration of 165,000 lines executed over a weekend using hundreds of agents, eight phase gates, and three adversarial review rounds for quality assurance
- ▸Code migration economics have inverted: formerly $3–4M, multi-year projects now cost $50–500K+ and weeks, fundamentally changing the business case for deferred technical infrastructure work
Summary
Anthropic has published a comprehensive guide on running large-scale code migrations using Claude Code agents, backed by two remarkable real-world examples that reshape the economics of language migration projects. In the most striking case, Jarred Sumner (co-founder of Bun and Member of Technical Staff at Anthropic) used Claude Fable 5 and Claude Opus 4.8 to migrate Bun from Zig to Rust, producing one million lines of code in less than two weeks with 100% of the existing test suite passing in CI before merge. A parallel example saw Mike Krieger migrate a Python codebase to 165,000 lines of TypeScript over a single weekend, employing hundreds of agents, eight phase gates, and three adversarial review rounds with full parity verification.
The methodology shifts the paradigm from multi-year, multi-million-dollar endeavors to weeks-long projects costing tens to hundreds of thousands of dollars. The core insight is architectural: fixing the production loop matters more than fixing individual code segments. Anthropic's published six-step process leverages Claude's capabilities to drastically reduce both the financial and career risk historically associated with such projects. However, token costs remain material—the Bun migration consumed 5.9 billion input tokens and 690 million output tokens, equivalent to roughly $165,000 at current API pricing.
This breakthrough suggests the economics of language migrations have fundamentally changed, making previously deferred projects suddenly feasible. What was once the domain of existential business imperatives—complete rewrites that could freeze a product roadmap for years—can now be justified by chronic bottlenecks, such as the 30-minute build time that drove Mike Krieger's Python-to-TypeScript port. The availability of automated testing, adversarial review loops, and dynamic workflows substantially reduces the risk that has historically deterred such ambitious refactoring efforts.
- Anthropic's published six-step methodology emphasizes that optimizing the feedback loop and production process is more important than perfecting individual code segments
- Dynamic workflows with automated testing and parity verification against original codebases dramatically reduce both technical and career risk for previously high-stakes migration projects
Editorial Opinion
Anthropic's demonstration that a million-line production system can be migrated to a new language in two weeks is a genuine inflection point for software engineering. What seemed impossible a year ago—maintaining code quality and test coverage at this scale—is now repeatable and documented. While the token costs remain substantial, they're a rounding error compared to traditional engineering labor. The real breakthrough is the shift from hero projects to routine capability: migrations are no longer career-defining odysseys, but managed technical exercises. This could accelerate the industry's escape from legacy platforms, though it also raises important questions about whether LLM-driven code transformation might inadvertently entrench hasty architectural decisions or mask deeper system design problems.



