"Choose your tech stack carefully. Once you commit, you can't change it." From startups to enterprises, this was treated as gospel.

Then in May 2026, Bun broke that rule. The JavaScript runtime Bun rewrote roughly 1 million lines of code from Zig to Rust in just 6 days. Not by a team of engineers — by an AI coding agent (Claude Code).

Quick Summary
Language = permanent decision Bun: 1M lines, 6 days AI-made reversibility New rules for tech stack decisions

The conventional wisdom

Tech stack decisions were heavy because the stakes were real. Switching languages meant rewriting all your code, retraining the whole team, and migrating your library ecosystem. McKinsey data shows 70% of Fortune 500 software is over 20 years old. Migration costs are so high that companies simply can't touch it. Language choice was the poster child for "irreversible decisions."

Mitchell Hashimoto, creator of Vagrant, on the shift

"Programming languages used to be LOCK IN, and they're increasingly not so."

But the data tells the opposite story

On May 14, 2026, Bun modified approximately 2,188 files, added over 1 million lines of Rust code, and said goodbye to its Zig codebase. The community called it the largest publicly visible AI-driven code conversion ever recorded.

99.8%
Existing test pass rate
6 days
Time to migrate 1M lines
3–8MB
Binary size reduction

Bun founder Jared Sumner said after the migration: "We haven't been typing code ourselves for many months now." Claude Code writes the code, runs the tests, and drives the bug-fix loop.

Context matters here. After Anthropic acquired Bun in December 2025, Zig's no-AI policy clashed with Bun's AI-first development approach. Rather than maintain a Zig fork, Bun moved fully to Rust — and AI agents did the work. Claude Code rewrote the very runtime that Claude Code ships on.

It's happening elsewhere too. Simon Willison spoke with a developer at a mid-sized tech company who used AI coding agents to completely rewrite their legacy iOS and Android apps in React Native. When asked why React Native, the answer was simple: "If we don't like it later, we can just port back to native." Treating tech choices as reversible — that's the before-and-after of the AI era.

Pre-AI MigrationAI Agent Migration
TimelineMonths to yearsDays to weeks
Cost (20k lines)Months of team bandwidth~$150
RiskHuman error, burnoutAutomated test validation loop
ReversibilityPractically impossibleReversible — re-migrate anytime

What actually changes for your tech strategy

Hashimoto on Rust: "Rust is expendable. It's useful until it's not, then you throw it out." You can now treat your tech stack as "the best tool right now" rather than "a lifelong partner."

This shift is driven by the economics AI coding agents created. A well-designed multi-agent system compresses code migration from months to days. Codebase analysis, test fixture generation, code conversion with validation, and refactoring — run in parallel by specialized agents — eliminate the cognitive load that used to make migrations prohibitive.

Here's the key insight: AI code migration isn't just translation. In the Bun case, Rust's memory safety automatically eliminated entire bug categories — use-after-free, double-free, and similar issues. The AI didn't just rewrite the code; it absorbed the advantages of the target language. Migration becomes an upgrade that inherits language-level improvements.

How to start an AI code migration

  1. Scope by module, not full rewrite
    Don't try to change everything at once. Handing a complex codebase to a single agent produces broken behavior, missing features, and bugs. Define scope around modules with clear inputs/outputs, and prepare tests for each module first.
  2. Build a 4-stage agent pipeline
    ① Codebase analysis agent (map dependencies and call chains) → ② Test fixture agent (capture real input/output) → ③ Conversion agent (unit + regression validation) → ④ Refactoring agent (code standards alignment). Every stage needs automated verification.
  3. Set test pass rate as the only gate
    Bun merged at 99.8% test pass rate. "Seems to work" isn't a gate. Set a number, and don't advance until you hit it.
  4. Do the cost math
    AI migration cost for 20,000 lines is roughly $150. The same work done manually takes months of engineering time. Run that comparison before your next tech decision.
  5. Make reversibility a selection criterion
    In your next tech stack decision, add "how long would it take to AI-migrate away from this?" as a factor. Clear module boundaries and solid test coverage make today's choice a changeable choice tomorrow.

Real limits exist

AI migration isn't magic. Handing a complex rewrite to a single agent fails. Performance optimization, security hardening, and maintainability are not automatic guarantees. There's also legitimate skepticism about Bun's massive single commit — hard to review, likely contains hidden bugs. Well-designed pipelines and human validation remain essential.