Jarred Sumner, creator of Bun (JS/TS runtime, >22M downloads/month, acquired by Anthropic in December 2025), recounts the complete rewrite of Bun from Zig to Rust in 11 days (May 3→14, 2026), driven by Claude. The motivation is a recurring class of bugs — use-after-free, double-free, leaks — arising from the mix of GC-managed memory (JavaScriptCore) and manual memory (Zig). In safe Rust, these bugs become compile errors with automatic cleanup (Drop/RAII): "a better feedback loop than a style guide."
Against the dogma that "a rewrite is always a bad idea" (a year of bugfix freeze for 3 engineers across 535,496 lines of Zig), Sumner opts for a mechanical port: preserve the architecture, minimize behavior changes, validate against the existing test suite — written in TypeScript, and therefore language-independent (60,624 tests, 1.39M assertions, 0 tests removed, 6 platforms).
The harness: ~50 dynamic workflows in Claude Code, in write → review → apply loops, running continuously. The reliability building block is adversarial review: a second Claude, in a separate context that sees only the diff, tasked with "finding why it's wrong." Ratio of 1 implementer / 2+ reviewers / 1 fixer; the implementer doesn't review their own work. It catches subtle bugs that are syntactically identical but semantically different (a Box dropped before an asynchronous uv_close; an eager unwrap_or that panics). Cardinal principle: "fix the process that generates the code, not the code by hand" — when an anti-pattern appears, the prompt/workflow gets edited.
Careful preparation: PORTING.md (Zig→Rust mapping) and LIFETIMES.tsv (lifetime of each struct field), a trial run on 3 files before the 1,448. Then 4 worktrees × 16 = ~64 Claude instances in parallel, after banning all non-atomic git operations. Peak: 1,300 lines/min, 695 commits/h; 6,502 commits, diff +1,009,272 lines, ~16,000 compile errors treated as a queue (split into ~100 crates, resolving cyclic dependencies).
Cost disclosed: 5.9B uncached input tokens + 690M output ≈ $165,000, versus ~3 engineers for a year — "which we would never have done." Model: a pre-release of Claude Fable 5 (Mythos class). Since the merge: 11 rounds of Claude Code security review, 24/7 fuzzing (100B executions → ~15 PRs), 4% unsafe code, 19 regressions fixed. First release: Claude Code v2.1.181, +10% faster startup on Linux. "This is the bleeding edge of what's possible today."