GitHub Took 14.5 Weeks to Rewrite Copilot in Rust. Bun Took 11 Days.
Software / analysis
GitHub Took 14.5 Weeks to Rewrite Copilot in Rust. Bun Took 11 Days.
Both companies used AI coding agents to port hundreds of thousands of lines into Rust in 2026, but GitHub shipped in 128 incremental pull requests while Bun ran 64 agents at once and merged the whole thing.

GitHub finished porting the Copilot agent runtime from TypeScript to more than 832,000 lines of production Rust on Aug. 21, 2026, closing out a 14.5-week migration that shipped 128 separate pull requests into main, according to a Sept. 16 post by GitHub engineer Stephen Toub. Five weeks before that, on Aug. 20, the JavaScript runtime Bun shipped its own Rust rewrite, version 1.4.0, the product of a single 11-day sprint that ran up to 64 parallel Claude agents against a 535,496-line Zig codebase, Bun's creator Jarred Sumner has said.
Both companies point to the same underlying capability, coding agents that can hold a large migration in working context across thousands of files, and reached opposite conclusions about how fast to move.
The slow path: 128 pull requests, five models, one runtime
GitHub's Copilot CLI, desktop app and SDK all run on a shared agent runtime that was originally TypeScript on Node.js and V8. Toub's post says the port produced 832,378 lines of production Rust plus 468,689 lines of Rust unit tests, replacing roughly 430,000 lines of the original TypeScript, and did it through 128 pull requests merged incrementally into main rather than one large cutover. During the port, GitHub still shipped 135 public CLI releases, 100 pre-release and 35 stable, a cadence of about 1.3 releases a day.
The work drew on more than one model: Claude Opus 4.8 and 5, GPT-5.6 Sol, Claude Haiku 4.5 and Gemini 3.1 Pro, coordinated through specialized subagents for exploration, task execution, research, code review and a self-described "rubber duck" role, according to the post. GitHub says it traced dozens of regressions to five recurring failure modes: incomplete migrations, state and lifetime bugs, mismatched behavioral contracts, host-boundary errors and incorrect test oracles.
The fast path: 64 agents, 11 days, $165,000
Bun's rewrite ran on a different theory of the case. Sumner has said the port used roughly 50 to 64 parallel Claude Code agents working across separate worktrees over 11 days, generating more than 1 million lines of Rust, 6,500 commits and fixes for around 16,000 compiler errors, at a token cost Sumner put at about $165,000 using public API pricing, journalist Gergely Orosz reported in a July 16 Pragmatic Engineer post after reviewing the numbers with Sumner. The consumption behind that figure, per Orosz's report: 5.9 billion uncached input tokens, 690 million output tokens and 72 billion cached input-token reads.
Sumner said his motivation was memory safety, not speed for its own sake. "A large percentage of bugs from that list are use-after-free, double-free, and 'forgot to free,'" he told Orosz, of the bug list that had accumulated in Bun's Zig codebase. Sumner also estimated the same port would have taken three engineers roughly a year by hand, and said flatly that a year-long, user-facing rewrite was not something Bun would have chosen to do.
| Metric | GitHub Copilot runtime | Bun |
|---|---|---|
| Source lines rewritten | ~430,000 (TypeScript) | 535,496 (Zig) |
| Rust lines produced | 832,378 | 1,000,000+ |
| Timeline | 14.5 weeks | 11 days |
| Approach | 128 incremental pull requests | ~64 parallel agents, single push |
| Known regressions | Dozens, 5 failure modes documented | 19, per Sumner |
Bun's own Aug. 20 release notes report the payoff was real once shipped: idle CPU use for small apps dropped roughly fivefold, memory use across common HTTP frameworks fell 13% to 48%, and startup time on Linux roughly halved, from 10.9 milliseconds to 5.1 milliseconds. The post also says Claude Code itself had already been running on Bun's Rust port for months before the public release, and that Prisma had shipped a product, Prisma Compute, on it as well.
What would make one approach wrong
Orosz's own reporting names the limits on Bun's method before anyone else has to: it required an engineer with deep, specific knowledge of the codebase directing the agents, a test suite thorough enough to catch what the agents got wrong, and a token budget in six figures with no guarantee of success going in. Software engineer Mitchell Hashimoto, quoted in the same piece, framed the approach as suited only to "hard, focused tasks with clear reward functions," not a general recipe for rewrites.
GitHub's incremental method is the more conservative bet, structured so that any single pull request's failure is contained and shipping continued the whole time, which cost five months instead of eleven days. Neither company has published a defect rate for its rewrite measured the same way, so the comparison that would actually settle which approach produced more reliable Rust, matched regression counts per line shipped, does not yet exist. What would change this read is either codebase generating a wave of production incidents in the months after launch that the other avoided; six weeks after Bun's release and about a month after GitHub's, neither has reported one. The pattern instead of the rewrite is likely the bigger story: two large AI coding agent users independently concluded a rewrite once considered too risky to attempt was worth trying, at very different speeds, in the same quarter that GitHub's own trending page shows open-source projects racking up stars for doing far less.
Sources
- Migrating the GitHub Copilot runtime to Rust, using Copilot, The GitHub Blog
- The Pulse: What can we learn from Bun's rapid Rust rewrite with AI?, The Pragmatic Engineer
- Bun 1.4, Bun Blog
Sources
- 03Bun 1.4
More in Software
- 01StarSling's Agents Rewrite GitHub Actions Workflows, and Commenters Ask What Gets DeletedThe YC P25 company reports 3.9x to 36.4x speedups on open-source repos. Every figure is its own, and the thread leaves test weakening unanswered.
- 02Stalwart 1.2.0 Speaks Exchange to Outlook, but the New Outlook Stays Locked OutThe open source mail server added MAPI over HTTP, EWS and ActiveSync on November 23, switched off by default and with no NTLM or Kerberos sign-in.
- 03XNU Linux Loads macOS's Kernel Into Linux and Boots a Desktop in 31 to 48 SecondsThe 1.9k-star project runs Apple's XNU as a kernel module with no hypervisor, but it needs your own macOS 27 install.
- 04OpenAI and Cisco's Shirudo Shields Unpatched Linux, but Needs a Patched Kernel and a TPM 2.0The BSD-licensed eBPF runtime blocks exploits while patches roll out, and its own README calls it pre-release.