coding-agents

Copilot rewrote its own runtime into 800,000 lines of Rust

Promtime

coding-agents

The number to retell is not 800,000, it is 128: one developer, 128 pull requests, roughly fourteen and a half weeks, and more than 800,000 lines of production Rust at the end. As Thenewstack reports, that is the GitHub Copilot agent runtime, rewritten from TypeScript on Node.js and V8, with GitHub's own coding agents writing most of the code.

At a glance

  • Bun took the opposite route: Jarred Sumner pointed multiple Claude Code agents at 535,496 lines of Zig in parallel, and eleven days later the Rust version passed Bun's existing tests on six platforms.
  • Both companies make the same economic claim: Stephen Toub says a rewrite this size wasn't affordable before agents, and Sumner reckoned a conventional port needed a small team for about a year.
  • Anthropic and GitHub both sell the coding agents they credit, and the eleven-days-versus-fourteen-weeks gap measures two different jobs, not two models racing on the same task.

If you missed the earlier round: Bun began in 2021 as a project Sumner built in a cramped Oakland apartment, and its CLI now sees more than 22 million monthly downloads. According to Bun's own account, it started as a line-for-line port of esbuild's JavaScript and TypeScript transpiler from Go to Zig, with the first line of Zig written on April 16, 2021.

GitHub merged the rewrite in 128 pull requests while the product kept shipping

The runtime was TypeScript on Node.js and V8. The GitHub blog post explains that the stack was a respectable choice for a console application and became much less reasonable once the same implementation had to run in environments that wanted fast startup and low memory per server. The move to Rust ran for roughly fourteen and a half weeks.

Microsoft engineer Stephen Toub says the team used the GitHub Copilot app and the Copilot CLI to do the writing, and merged the result in 128 pull requests rather than one drop. Shipping in pieces let them catch and fix regressions along the way, while the rest of the team kept expanding the runtime.

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 translated 535,496 lines of Zig in eleven days

Bun, the JavaScript runtime Anthropic acquired last December, announced its own port back in July: more than half a million lines of Zig into Rust, 535,496 to be exact. Sumner ran multiple Claude Code agents in parallel across different parts of the codebase, monitoring their work and intervening when the process went awry.

The driver was stability. Bun had collected a persistent crop of memory-management bugs, leaks and crashes among them, and Sumner wrote that the team could have kept fixing these one-off "in perpetuity" but owed its users a systematic fix. He was careful not to blame Zig, pointing instead to the difficulty of managing memory across Zig and the JavaScript engine Bun embeds.

Eleven days in, the Rust version passed Bun's existing tests on all six supported platforms and the code was merged, with review and cleanup continuing before release. According to Bun's writeup, Sumner used a pre-release version of Claude Fable 5 for much of the work.

How do you keep a machine translation of that size honest?

With tests, mostly, and with a way to stop two agents from claiming the same job. In both projects the old code's test suite becomes the specification, and the new code has to pass it before anyone trusts it.

Anthropic's own writeup of an earlier experiment describes the plumbing: 16 parallel Claude instances, a shell loop that handed each one the next task the moment it finished, and a git-based file-locking scheme in a current_tasks directory so two agents never picked up the same work. That run took nearly 2,000 Claude Code sessions and $20,000 in API costs to produce a 100,000-line compiler that builds Linux 6.9 on x86, ARM and RISC-V.

Mistral describes a similar discipline on a different job, migrating 40,000 lines of Fortran 77 to C++ for a European energy operator's reservoir simulator that had no test suite and no centralized documentation: build a parity and checkpoint harness first, so migrated modules can be verified numerically against the legacy code. Think of it as renovating a house room by room while you still live in it.

OpenAI says its Rust rewrite already handles 95% of production requests

Last Friday OpenAI disclosed that two engineers, working with Codex and GPT-5.5, rewrote Habitat, the storage service underpinning products including ChatGPT, from Python into Rust during the second quarter of 2026. The company says the Rust service is handling 95% of production requests while using six times less CPU and 15 times less memory than its Python predecessor, which it plans to deprecate entirely in the coming weeks.

Meta got there earlier. In March, engineer Joe Savona led a port of the React Compiler from TypeScript to Rust that he described as majority coded by AI, with architecture, testing and migration strategy still heavily human-directed by him. It sits alongside a broader Meta effort to replace decades-old legacy code with Rust in a core messaging library.

Every one of these accounts comes from a company that sells the agents it credits, and none of them includes outside verification of the resulting code, defect counts or post-migration incident data. In our view the incremental route is the more reusable design choice of the two: 128 pull requests against a live product surface regressions while someone can still tell which change caused them.

When Habitat's Python half disappears OpenAI says it will deprecate the Python version in the coming weeks and reveal further details of the migration later, without naming a date for either. That is the next dated checkpoint, such as it is. The open question is whether any of these teams eventually publishes what none has published so far: bug and incident numbers for the Rust code after it has run in production long enough to be judged.

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.