GitHub and Anthropic used their own agents for major Rust rewrites — with very different playbooks

Wait 5 sec.

Rust is seemingly the language of the moment, with open-source projects and companies forming an orderly queue to move core software over to the general-purpose programming lingo. The draw? A pursuit of better memory safety and performance.Now, GitHub has joined the throng. On Wednesday, the company revealed that it has completely rewritten the GitHub Copilot agent runtime — previously built in TypeScript on Node.js and V8 — into more than 800,000 lines of production Rust. Most notably, however, the Microsoft subsidiary says it used its own Copilot coding agents to carry out the switch. In a blog post marking the migration, Microsoft engineer Stephen Toub says the company used the GitHub Copilot app and the Copilot CLI for the rewrite. The work was spread across 128 pull requests that were merged and shipped incrementally, an approach Toub notes allowed the team to catch and fix regressions along the way.“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.”Microsoft engineer, Stephen ToubWhile a major Rust migration is a big deal in its own right, the bigger story here is the leading role that AI played.“AI agents wrote most of the code,” Toub writes, adding that the alternative would have been a much bigger undertaking.“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,” he continues. GitHub, for what it’s worth, is far from alone in its efforts. Bun rusts upBun, the JavaScript runtime Anthropic acquired last December, announced back in July that it was rewriting more than half a million lines of Zig in Rust, with founder Jarred Sumner using a pre-release Claude model to do much of the work. The impetus, ultimately, was stability. Bun had grown from a 2021 “pre-LLM” project Sumner built “in a cramped Oakland apartment,” into a runtime whose CLI now sees more than 22 million monthly downloads. But its growing remit had also brought a persistent crop of memory-management bugs, including leaks and crashes. Sumner was careful not to pin those problems on Zig itself, instead pointing to the particular difficulties Bun faced managing memory across Zig and the JavaScript engine it 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.”“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,” Sumner wrote at the time.Rust offered stronger protections against many of those issues, but switching languages presented a problem of its own. Bun comprised 535,496 lines of Zig, and Sumner reckoned a conventional rewrite would require a small engineering team for about a year — an investment he said would have made the project unrealistic.“It would mean freezing bugfixes, security fixes or feature development for that time,” Sumner wrote.And so Sumner orchestrated multiple Claude Code agents to translate and check different parts of Bun simultaneously, while he monitored their work and intervened when the process went awry. Eleven days after starting, he said the Rust version was passing Bun’s existing tests on all six platforms it supports. The code was then merged, though further review and cleanup continued before release.Same idea, different playbookGitHub makes much the same economic case as Anthropic. Toub notes that a “rewrite this size wasn’t affordable before agents,” estimating that the job would previously have occupied a team for a year or two. But while the two companies arrive at a similar conclusion about what coding agents make feasible, their playbooks are very different.“A rewrite this size wasn’t affordable before agents.”Bun went for an all-at-once port, using large numbers of Claude instances in parallel before bringing the Rust version back into the main codebase. GitHub, on the other hand, chose a slower, incremental route: pieces of the Copilot runtime were converted and shipped as they were completed, across 128 pull requests, while development on the product continued around the migration. The process ran for roughly 14-and-a-half weeks.“Eleven days” versus “14-and-a-half weeks” shouldn’t be read as a Claude-versus-Copilot benchmark. Bun was translating a Zig codebase into another systems language through a highly parallel effort; GitHub was moving a TypeScript and Node.js runtime to Rust while continuing to ship the product throughout. What the two projects have in common is the claim that agents made major rewrites viable, where the cost and disruption might previously have ruled them out.And, of course, both companies have every reason to make that case. Anthropic and GitHub are major vendors of the very coding agents they’re crediting with making these projects possible, making their accounts inherently self-interested.However, there are signs across the industry that the “agents do big Rust migration” phenomenon is gaining steam.AI bites the rustBack in March, Meta engineer Joe Savona led a port of the React Compiler from TypeScript to Rust, noting that this was “majority coded by AI,” though its architecture, testing and migration strategy remained heavily human-directed (by Savona himself). The experiment builds on a broader effort at Meta to replace “decades-old” legacy code with Rust in a core messaging library.And just last Friday, OpenAI quietly disclosed another substantial agent-assisted Rust rewrite. The company said 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.While the company noted that it will reveal further details of this move in the future, it stated that the new Rust service is already “handling 95% of our production requests,” while using six times less CPU and 15 times less memory than its Python predecessor. Moreover, it plans to deprecate the Python version entirely “in the coming weeks.” For now, these various projects remain individual case studies, reported by the companies with the most to gain from demonstrating what coding agents can do on major software rewrites. But there is a clear pattern: Rust was already attracting companies looking to rethink key software, and AI agents are now positioned as pivotal for migrations that may once have been too costly, disruptive or time-consuming to attempt.The post GitHub and Anthropic used their own agents for major Rust rewrites — with very different playbooks appeared first on The New Stack.