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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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
GitHub's standalone terminal coding agent (`copilot`, npm @github/copilot) that plans and edits code, runs commands and works with GitHub from the te…
- Price
- Free + $10/mo
- Gid Score
- 49 #11 in Terminal
AI coding assistant from GitHub offering completions, chat and agent mode in IDEs, a terminal CLI, a desktop app and a cloud agent that works on assi…
- Price
- Free + $10/mo
- Gid Score
- 68 #2 in IDEs
Similar use cases
How three Java Champions use GitHub Copilot for migration, testing and app building
Three experienced Java developers describe how they use GitHub Copilot in IDEs and agent workflows for feature work, a slide-deck migration, UI test reproduction and small apps. T…
As reported by the GitHub Blog (developer quotes): Vlad Mihalcea built an Optimizer event-history web app in two days, a task he expected to take wee…
JustHTML: a Python HTML5 parser built with coding agents that passes html5lib tests
A developer spent his off-hours using Copilot agent mode with several models to build a dependency-free HTML5 parser, and wrote up every stage, including a full restart.
JustHTML is about 3,000 lines of Python with 8,500+ tests passing.
Generate unit and integration tests with GitHub Copilot
GitHub's tutorial uses Copilot Chat to write a unit test suite for a class, then integration tests that mock an external notification service, and then asks what coverage is still…
A unit test suite that covers edge cases, exceptions and data validation.
Guides
Best Claude Code Alternatives in 2026: Open-Source, Cheaper and Multi-Model
The strongest alternatives to Claude Code, grouped by why you are switching: price, model choice, open source or a different workflow. Live usage and prices for each.
How to Start Using a Terminal Coding Agent: Setup, First Tasks and Guardrails
A practical manual for your first week with a command-line coding agent: installing one, running a first session, writing project instructions, setting permissions and keeping costs under control.
Best AI Code Review Tools in 2026: CodeRabbit, Greptile, Graphite, Copilot and Open Source
AI code review agents for pull requests compared: what they check, how they are priced, open-source options and how to roll one out without drowning your team in comments.
AI Coding Agent Pricing Explained: Claude Code, Cursor, Codex and Copilot (2026)
What Claude Code, Cursor, OpenAI Codex, GitHub Copilot and other coding agents really cost: plan prices, usage limits, subscription vs API billing, and how to estimate your monthly bill.