Bun’s half-million lines of Zig became Rust in eleven days

GitHub has moved the Copilot agent runtime off TypeScript, Node.js and V8 and onto more than 800,000 lines of production Rust. In a September 16 blog post on the migration, Microsoft engineer Stephen Toub says Copilot’s own agents “wrote most of the code.” GitHub’s roughly 14 and a half weeks and the eleven days Bun took for its Claude-driven Rust port stop at different finish lines. Bun’s count ended when the Rust build passed the existing tests, with review and cleanup still to come before release. GitHub’s covers code shipped to production piece by piece while the product kept growing.
The New Stack, which compared the two projects, warns against reading them as a Claude-versus-Copilot benchmark. Bun was translating Zig into another systems language through a highly parallel effort, while GitHub was moving a TypeScript and Node.js runtime to Rust and shipping the product the whole time. It also points out that Anthropic and GitHub sell the agents they credit for the work, which makes both accounts “inherently self-interested.”
128 pull requests, one main developer
Toub’s team used the GitHub Copilot app and the Copilot CLI. The work went out across 128 pull requests, merged and shipped incrementally, and Toub says that let the team catch and fix regressions along the way. The rewrite was done “primarily by a single developer,” while the rest of the team “continued to greatly expand the runtime’s capabilities and reach.” Without agents, he estimates, the same job would have taken a whole team a year or two. In his words: “A rewrite this size wasn’t affordable before agents.”
Bun: eleven days to passing tests
Bun, the JavaScript runtime Anthropic acquired last December, said in July that it was porting 535,496 lines of Zig to Rust. The reason was stability. As Bun grew into a runtime whose CLI now gets more than 22 million monthly downloads, it kept picking up memory-management bugs, including leaks and crashes. Founder Jarred Sumner put them down to the difficulty of managing memory across Zig and the JavaScript engine Bun embeds, and was careful not to blame Zig itself. “We could have kept fixing these kinds of bugs one-off in perpetuity, but we owe it to our users counting on us to do better than that,” he wrote.
By Sumner’s estimate, a conventional rewrite would have needed a small engineering team for about a year, and it “would mean freezing bugfixes, security fixes or feature development for that time.” So he used a pre-release Claude model for much of the work. Multiple Claude Code agents translated and checked different parts of Bun at once, and he watched them and stepped in when the process went wrong. Eleven days after he started, the Rust version passed Bun’s existing tests on all six platforms Bun supports. The code was then merged, and review and cleanup continued before release.
Claude Code ships on this runtime. Bun’s own blog said when it joined Anthropic that Claude Code ships as a Bun executable: “If Bun breaks, Claude Code breaks.” The method has also been written down. In July, Anthropic’s blog published a six-step loop for porting large codebases with Claude Code by an author named Jarred. In it, parallel agents do most of the translation, with smaller models like Claude Sonnet translating and larger ones kept on adversarial review. The compiler, the test suite and a line-by-line diff serve as the checks.
Meta and OpenAI too
In March, Meta engineer Joe Savona led a port of the React Compiler from TypeScript to Rust. He called it “majority coded by AI,” but the architecture, testing and migration strategy stayed heavily human-directed, by Savona himself. The port builds on a wider Meta effort to replace “decades-old” legacy code with Rust in a core messaging library.
OpenAI disclosed its own case on September 11. Two engineers working with Codex and GPT-5.5 rewrote Habitat, the storage service behind products including ChatGPT, from Python into Rust during the second quarter of 2026. The company said the Rust service is already “handling 95% of our production requests” and uses six times less CPU and 15 times less memory than the Python version. Of the rewrites described here, it is the only one reported with production resource figures.
OpenAI plans to deprecate the Python version of Habitat “in the coming weeks.”
Up next
Ozempic maker adds Claude next to OpenAI’s Rosalind
The maker of Ozempic now has two frontier labs inside R&D: Novo sealed a deal for OpenAI’s GPT-Rosalind in April and partnered with Anthropic on Wednesday, putting Claude Science on scientific reasoning.
Related stories
- Claude’s merge rate outgrew git, so Anthropic built Scion
- Anthropic’s CI buckled after Claude wrote 80% of the code
- Claude Code team hands most code reading to Claude
- Claude went from bug hunt to abuse report on New Year’s Eve
- A Claude session has been rewriting an app in Swift for over two weeks
- An internal Claude tool now lands 65% of the Claude Code team’s product PRs
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

