Skip to content
Agents tracked: 479 Releases (7d): 721 Agent status: all upSince last limit reset: Claude 39d · Codex 1d Updated Nov 1, 2026
Case study GitHub

GitHub rewrote its Copilot agent runtime in Rust with Copilot CLI

GitHub moved the agent runtime behind Copilot CLI, the Copilot app and the Copilot SDK from TypeScript on Node.js to Rust, with agents in the Copilot app and Copilot CLI writing most of the code. The port landed as 128 pull requests that replaced one component at a time while the rest of the team kept shipping, and GitHub reports it was done primarily by a single developer in a few months, work it says would have taken a whole team a year or two before agents.

The problem

The runtime was written in TypeScript on Node.js and V8, and the SDK reached it by spawning the CLI as a subprocess and talking JSON-RPC to it. Every SDK consumer in C#, Python, Go, Java and Rust therefore shipped a second language runtime, on the order of 100 MB of working set minimum, paid a process hop on every event and supervised two processes. The initial plan in early May 2026 estimated roughly 130,000 lines of TypeScript, but with code being pushed down from the terminal UI and hundreds of pull requests merging each week, about 430,000 lines of production TypeScript ended up passing through the port.

How they did it

  1. Port in place rather than in a long-lived branch; each pull request replaces one component's TypeScript with a thin shim that calls the new Rust and deletes the old code in the same atomic change, so main stays shippable.
  2. Start with pilot pull requests that set up the Rust workspace, toolchain, lint rules, CI, build pipeline and coding instructions, then port pure-logic helpers that already have strong tests, and work from the leaves inward, leaving the most coupled code for last.
  3. Bridge the languages temporarily with napi-rs so TypeScript can call Rust and Rust can call back into TypeScript, and delete each shim as soon as its caller is ported.
  4. Drive the work from the Copilot app and Copilot CLI; for large files a parent session splits the work and starts child sessions, each with its own branch and worktree, while subagents fan out exploration.
  5. Run a review skill on every port that rebases, then has subagents on different models compare the old TypeScript with the new Rust line by line, and forbid agents from deleting or changing end-to-end tests.
  6. Let agent merge (/pr auto in the CLI) answer review comments, fix CI failures and resolve conflicts, but have a human check how feedback was handled before merging.
  7. Stop parallel sessions from overloading one machine by making a single session the gate that lets one session at a time build and test.

Results

  • More than 800,000 lines of production Rust written, mostly by agents, across 128 pull requests that landed in main, as reported by GitHub.
  • By August 21 the runtime was 100% production Rust, with 832,378 lines of production Rust and 468,689 lines of Rust unit tests, as reported by GitHub.
  • Main shipped 135 releases during the porting window, 100 pre-release and 35 stable, so ported components reached users in small batches, as reported by GitHub.
  • The runtime's performance improved by orders of magnitude, and the few regressions were found and fixed along the way, as reported by GitHub.
  • The project was completed primarily by a single developer in a few months while the rest of the team kept expanding the runtime, as reported by GitHub.

As reported by the source (GitHub blog (engineering)); AgentGid did not measure these figures.

Takeaway. Agents make a large rewrite affordable, but only with an in-place, one-component-at-a-time plan, end-to-end tests the agents are not allowed to touch, and a human who owns the architecture and the merge.
AgentGid's take

This suits a platform team with a large, well-tested codebase, a concrete reason to change language or runtime, and an engineer who can supervise many agent sessions and judge architecture; GitHub says it had to strengthen end-to-end tests first and still shipped regressions. It suits a small team doing ordinary feature work poorly, and a port this size runs up a large token bill. Per AgentGid's GitHub Copilot CLI page (pricing checked Oct 9, 2026), the CLI is included in all Copilot plans: Free $0 (limited), Pro $10 a month, Pro+ $39 and Max $100, with usage metered in GitHub AI Credits shared across chat, agent, code review, cloud agent and the CLI; Business and Enterprise are by contact. GitHub is writing about its own product, and its benchmarks compare whole delivered systems with other changes landing in the same period; read its token bill and regression list before planning a similar port. If you want an open-source terminal agent instead, OpenAI Codex's CLI is Apache-2.0 and free to start, per its AgentGid page (checked Oct 6, 2026).

The agents used here

Similar use cases

Guides