Bun rewrites 535k lines of Zig in Rust with an LLM-driven harness
Bun’s team ported 535,496 lines of Zig to Rust in 11 days using roughly 50 Claude Code dynamic workflows: four worktree shards, 64 agents in parallel, compiler errors as a work queue, and separate adversarial reviewers that only inspected diffs. The existing TypeScript suite supplied more than a million assertions, and no tests were skipped or deleted.
The rewrite fixed 128 bugs from Bun 1.3.14, including use-after-free and leak classes. A 2,000-build in-process bundling test plateaued at 609 MB instead of 6.7 GB, while HTTP throughput improved 2–5%. The team also reports 19 semantic regressions caught and fixed, 11 security-review rounds, and continuous parser fuzzing.
The interesting engineering result is the harness: plan the translation, serialize lifetime and porting guides, parallelize mechanical work, isolate implementation from review, and improve the workflow when agents fail. It is still a mechanically translated codebase with about 4% unsafe Rust, not a claim that generated code is self-validating.