Skip to content

anthropic

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

Claude News

Eleven days, half a million lines of Zig, and a pre-release Claude doing most of the typing; fourteen and a half weeks, 128 pull requests, and Copilot agents doing most of the typing. As The New Stack sets it out, Anthropic's Bun and GitHub's Copilot runtime both landed in Rust on the back of coding agents, by opposite routes.

At a glance

  • GitHub says its Copilot agent runtime, once TypeScript on Node.js and V8, is now more than 800,000 lines of production Rust, written mostly by GitHub's own Copilot coding agents.
  • Bun took the opposite route: parallel Claude Code agents ported 535,496 lines of Zig at once, and eleven days in, the Rust build passed Bun's existing tests on six platforms.
  • Every account here comes from a company that sells the coding agents it credits, and none of them puts a number on the human review, correction or cleanup the merges required.

If you missed the earlier chapters: Bun started in 2021 as one person's project in a cramped Oakland apartment, and Anthropic bought it last December. Bun's own blog ties the rewrite to a bug class, use-after-free and double-free crashes plus memory leaks. GitHub's runtime had a different itch: per The GitHub Blog, TypeScript on Node was respectable for a console CLI and much less so once the same runtime sat inside VS Code, Visual Studio, Copilot Studio and Office apps.

GitHub shipped 800,000 lines of Rust across 128 pull requests

On Wednesday, GitHub said the Copilot agent runtime, previously built in TypeScript on Node.js and V8, is now more than 800,000 lines of production Rust. Microsoft engineer Stephen Toub writes that the team used the GitHub Copilot app and the Copilot CLI for the job, and that "AI agents wrote most of the code."

The work landed in 128 pull requests, merged and shipped incrementally. Toub says that approach let the team catch and fix regressions along the way, while the rest of the team kept expanding what the runtime could do. The whole run took roughly 14 and a half weeks.

A project that would have taken a whole team of developers a year or two before agents was now completed primarily by a single developer, in only a few months, all while the rest of the team continued to greatly expand the runtime's capabilities and reach.

Bun's 535,496 lines of Zig moved in eleven days

Bun announced its move in July. The motivation was stability: the CLI now sees more than 22 million monthly downloads, and growth had come with a steady supply of memory-management bugs, leaks and crashes. Sumner did not blame Zig, pointing instead to the difficulty of managing memory across Zig and the JavaScript engine Bun embeds.

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, and systematically prevent these kinds of bugs from recurring.

A conventional rewrite, he reckoned, would need a small engineering team for about a year and would freeze bugfixes, security fixes and feature work for that time. So he ran multiple Claude Code agents in parallel on different parts of the runtime, watching and stepping in when the process went wrong. Eleven days later the Rust version passed Bun's existing tests on all six supported platforms; it was merged, with review and cleanup continuing before release.

How do you check half a million translated lines?

The existing TypeScript test suite, according to Dennis Morello's analysis, was never tied to the implementation language, so it could judge the Rust code the same way it judged the Zig code. Morello describes the work as a mechanical port done one .zig file at a time, with the Rust kept deliberately near-identical: same function names, same scoping, same comments.

Think of retyping a manual in another alphabet with the page numbering intact, so any real difference is visible at a glance. Idiomatic Rust is a separate refactor planned for after the port.

Bun's own blog says Sumner used a pre-release version of Claude Fable 5 for much of the rewrite; Morello puts the scale at roughly 50 Claude Code workflows, run a few at a time, and cites one before-and-after number: an in-process build loop that ballooned to 6.7 GB in 1.3.14 levels off at 609 MB in 1.4.

OpenAI says its Rust rewrite handles 95% of production requests

The pattern is not confined to those two. In March, Meta engineer Joe Savona led a port of the React Compiler from TypeScript to Rust, described as majority coded by AI, with architecture, testing and migration strategy still human-directed.

Last Friday OpenAI disclosed that 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 Rust service is handling 95% of production requests while using six times less CPU and 15 times less memory than its Python predecessor.

Both accounts come from companies selling the agents they credit, and neither puts a figure on human review. According to Dennis Morello's analysis, Sumner and Zig creator Andrew Kelley are publicly arguing over what actually changed: the claimed 2–5% speed gain and roughly 20% smaller binary are attributed to cross-language LTO, ICU trimming and linker work that could have shipped in Zig. Oddly, for a move argued on memory safety, the public numbers are mostly about speed and size.

When Habitat's Python side goes dark OpenAI says the Python version is due to be deprecated in the coming weeks and that it will publish more detail on the migration later; no date is attached to either. Bun's cleanup toward idiomatic Rust, per Morello, is still ahead. The open question for the rest of us is whether a team that does not sell coding agents can post the same numbers.

Related stories

  1. Anthropic's CI buckled after Claude wrote 80% of the code
  2. Claude went from bug hunt to abuse report on New Year's Eve
  3. A Claude session has been rewriting an app in Swift for over two weeks
  4. An internal Claude tool now lands 65% of the Claude Code team's product PRs
  5. Anthropic's six-step playbook for migrating code with Claude Code
  6. Claude recovers 41 TB of BTRFS data

Comments

No comments yet. Be the first.

Join the conversation

Sign in with Google to leave a comment. Your name and avatar come from your Google profile, and the comment appears after moderation.

We only use your name and avatar from Google. We never store your email address.