<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/github-used-copilot-to-rewrite-its-own-agent-runtime-in-rust-and-the-agents-started-collaborating-without-asking-lgfcimdym" -->

---
title: GitHub used Copilot to rewrite Copilot in Rust, and the...
description: GitHub rewrote the entire Copilot agent runtime, over 800,000 lines of TypeScript/Node.js code, into production Rust using Copilot itself as the porting agent....
canonical: https://daily.dev/posts/github-used-copilot-to-rewrite-copilot-in-rust-and-the-agents-started-collaborating-without-asking-lgfcimdym
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: GitHub used Copilot to rewrite Copilot in Rust, and the agents started collaborating without asking | daily.dev
og:description: GitHub rewrote the entire Copilot agent runtime, over 800,000 lines of TypeScript/Node.js code, into production Rust using Copilot itself as the porting agent....
og:url: https://daily.dev/posts/github-used-copilot-to-rewrite-copilot-in-rust-and-the-agents-started-collaborating-without-asking-lgfcimdym
og:image: https://api.daily.dev/og/posts/LGFCimDYm.png
og:image:alt: GitHub used Copilot to rewrite Copilot in Rust, and the agents started collaborating without asking
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub used Copilot to rewrite Copilot in Rust, and the agents started collaborating without asking

**[Trends](https://daily.dev/sources/trends)** · 2 min read · 29 upvotes · 9 comments

## Summary

GitHub rewrote the entire Copilot agent runtime, over 800,000 lines of TypeScript/Node.js code, into production Rust using Copilot itself as the porting agent. The 14.5-week migration shipped 135 releases mid-flight and produced 128 merged pull requests, mostly agent-authored. The new Rust runtime exposes a C ABI with 19 functions so SDKs in C#, Python, Go, Java, Rust, and TypeScript can embed it in-process via FFI instead of spawning Node subprocesses for JSON-RPC. Prompt-cache hit rates reached 96.22%, and most rustc errors were ordinary type/name issues rather than borrow-checker fights. The most talked-about detail: two concurrent porting sessions autonomously discovered each other's overlapping work and merged it together without human instruction, a form of cross-session agent coordination GitHub's Martin Woodward says has no clean precedent.

## Content

GitHub just shipped 800,000 lines of production Rust rewritten from TypeScript by AI agents, and the story is less "look how great AI is" and more "look how strange this is getting."

The setup: the Copilot agent runtime, the shared engine behind the CLI, VS Code extension, SDKs, and more, was stuck on Node.js/V8. Every SDK consumer in C#, Python, Go, or Java had to spawn a subprocess just to talk JSON-RPC. The new Rust runtime exposes a C ABI with 19 exported functions, letting SDKs embed it in-process via FFI. That's a real architectural win.

The numbers are genuinely impressive. 15.9x throughput improvement. Memory down roughly 10x. 430,000 lines of TypeScript became 800,000 lines of Rust across 128 merged PRs, 135 releases, over 14.5 weeks, while the rest of the team kept shipping features. Total cost: around $120,000 in AI tokens plus about three weeks of one developer's time. (Bun did something similar moving from Zig to Rust for $165,000, so apparently this is a price point now.)

But here's where it gets interesting. The agents used GPT-5.6 Sol and Claude Opus 4.8, hit a 96.22% prompt-cache hit rate, and spent far more time reading and searching than actually editing, which tracks with how good engineers work. More striking: two concurrent porting sessions autonomously discovered each other's work and merged it without human involvement. That's either impressive coordination or a preview of something nobody has a good mental model for yet.

Microsoft engineer Stephen Toub flagged the part worth paying attention to: the Rust compiler is not an infallibility oracle. The migration introduced dozens of regressions. Code that compiles is not code that's correct, and AI agents are very good at producing the former while missing the latter. The borrow checker caught memory issues; it didn't catch semantic ones.

Martin Woodward called the headline "kinda click-bait enough" in a tweet that Brendan Eich and others amplified, which suggests even the people involved know the real story is weirder than "AI rewrites codebase." The real story is that agents are now coordinating with each other mid-task, the economics of large rewrites have a new ceiling, and "it compiles" is no longer a meaningful bar.

## Questions this post answers

### How did GitHub rewrite the Copilot agent runtime from TypeScript to Rust?

GitHub used Copilot itself to port over 800,000 lines of production TypeScript/Node.js code to Rust over 14.5 weeks, shipping 135 releases during the migration. The effort produced 128 merged pull requests, mostly authored by AI agents, covering the shared engine behind Copilot CLI, VS Code, Visual Studio, Code Review, and the SDK.

_Engineers weighing agent-driven rewrites can follow real-world migration outcomes like this one on daily.dev._

### How does the new Rust-based Copilot runtime expose its API to different language SDKs?

The Rust runtime exposes a C ABI with 19 exported functions, letting SDKs in C#, Python, Go, Java, Rust, and TypeScript embed the runtime in-process via FFI. This replaces the old approach where every SDK consumer had to spawn a separate Node.js subprocess and communicate over JSON-RPC.

_Developers building multi-language SDKs can track FFI and embedding patterns like this via daily.dev._

### Did AI agents coordinate with each other without human instruction during the Copilot Rust rewrite?

Yes, two concurrent porting sessions autonomously discovered they were working on overlapping parts of the codebase and merged their work together without any human directing them to coordinate. GitHub's Martin Woodward noted this cross-session coordination, achieved with no shared memory between the agents, has no clean precedent and is arguably more notable than the rewrite itself.

_Anyone assessing how far autonomous coding agents can go can follow cases like this on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@akkitto** · 8 upvotes

> #RewriteEverythingInRust 🦀

**@shad001** · 5 upvotes

> And when it breaks, they will be forced to use agents to "fix" it. Because nothing with a pulse knows how the F it works.
>
> I don't like AI. Good books were physically destroyed to make bad models.
>
> I'd rather have the eggs than the omelette.

**@theace92** · 4 upvotes

> #RustWillFixTheBug

**@pdfopsdev** · 3 upvotes

> the 19-function C ABI is the part i'd want to read, not the port. who frees a returned string and what happens when a callback lands on a thread the host language didn't create is where embedding a runtime in six SDKs usually gets ugly.

**@id10terr0r** · 1 upvotes

> WOW! That sounds fun.

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#github](https://daily.dev/tags/github), [#rust](https://daily.dev/tags/rust)

[View this post on daily.dev](https://daily.dev/posts/github-used-copilot-to-rewrite-copilot-in-rust-and-the-agents-started-collaborating-without-asking-lgfcimdym)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"GitHub used Copilot to rewrite Copilot in Rust, and the agents started collaborating without asking","url":"https://daily.dev/posts/github-used-copilot-to-rewrite-copilot-in-rust-and-the-agents-started-collaborating-without-asking-lgfcimdym","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/github-used-copilot-to-rewrite-copilot-in-rust-and-the-agents-started-collaborating-without-asking-lgfcimdym"},"datePublished":"2026-09-17T17:38:50.831Z","dateModified":"2026-09-19T21:15:51.089Z","description":"GitHub rewrote the entire Copilot agent runtime, over 800,000 lines of TypeScript/Node.js code, into production Rust using Copilot itself as the porting agent....","isAccessibleForFree":true,"articleSection":"Trends","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Trends","logo":"https://media.daily.dev/image/upload/s--ZfSp3asX--/f_auto,q_auto/v1780996004/logos/trends?_a=BAMAMiWQ0","url":"https://daily.dev/sources/trends"},"commentCount":9,"discussionUrl":"https://daily.dev/posts/github-used-copilot-to-rewrite-copilot-in-rust-and-the-agents-started-collaborating-without-asking-lgfcimdym","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":29},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":9}],"keywords":"ai-agents,github,rust","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Trends","item":"https://daily.dev/sources/trends"},{"@type":"ListItem","position":3,"name":"GitHub used Copilot to rewrite Copilot in Rust, and the agents started collaborating without asking"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/github-used-copilot-to-rewrite-copilot-in-rust-and-the-agents-started-collaborating-without-asking-lgfcimdym","comment":[{"@type":"Comment","text":"#RewriteEverythingInRust 🦀","datePublished":"2026-09-17T18:06:09.696Z","url":"https://daily.dev/posts/LGFCimDYm#c-otYVYU8Gk","author":{"@type":"Person","name":"Daniel","url":"https://daily.dev/akkitto","image":"https://media.daily.dev/image/upload/s--FtwJqX4c--/f_auto/v1754900041/avatars/avatar_29TCpY2hJR72V3BlxPXzX?_a=BAMClqZW0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8}},{"@type":"Comment","text":"And when it breaks, they will be forced to use agents to “fix” it. Because nothing with a pulse knows how the F it works.\nI don’t like AI. Good books were physically destroyed to make bad models.\nI’d rather have the eggs than the omelette.","datePublished":"2026-09-18T19:16:21.475Z","dateModified":"2026-09-18T19:16:50.642Z","url":"https://daily.dev/posts/LGFCimDYm#c-zqQEQm2Ri","author":{"@type":"Person","name":"Shad","url":"https://daily.dev/shad001","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5}},{"@type":"Comment","text":"#RustWillFixTheBug","datePublished":"2026-09-17T21:26:22.383Z","url":"https://daily.dev/posts/LGFCimDYm#c-GBkaIrZ68","author":{"@type":"Person","name":"Theace","url":"https://daily.dev/theace92","image":"https://avatars.githubusercontent.com/u/211419990?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"the 19-function C ABI is the part i’d want to read, not the port. who frees a returned string and what happens when a callback lands on a thread the host language didn’t create is where embedding a runtime in six SDKs usually gets ugly.","datePublished":"2026-09-18T18:06:42.963Z","url":"https://daily.dev/posts/LGFCimDYm#c-FzXgvAsCN","author":{"@type":"Person","name":"PDFops","url":"https://daily.dev/pdfopsdev","image":"https://media.daily.dev/image/upload/s---8isRBKc--/f_auto/v1782922291/avatars/avatar_orjMeK8QKaaVZwGq7ScPz?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"WOW! That sounds fun.","datePublished":"2026-09-18T06:12:35.959Z","url":"https://daily.dev/posts/LGFCimDYm#c-SBvj3MPl9","author":{"@type":"Person","name":"Dwain Botha","url":"https://daily.dev/id10terr0r","image":"https://media.daily.dev/image/upload/s--UVo2nK8X--/f_auto,pg_1/v1790921201/avatars/avatar_7BpZkLtcVFtfH6cuoS4pu?_a=BAMAMiiw0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/github-used-copilot-to-rewrite-copilot-in-rust-and-the-agents-started-collaborating-without-asking-lgfcimdym#faq","mainEntity":[{"@type":"Question","name":"How did GitHub rewrite the Copilot agent runtime from TypeScript to Rust?","acceptedAnswer":{"@type":"Answer","text":"GitHub used Copilot itself to port over 800,000 lines of production TypeScript/Node.js code to Rust over 14.5 weeks, shipping 135 releases during the migration. The effort produced 128 merged pull requests, mostly authored by AI agents, covering the shared engine behind Copilot CLI, VS Code, Visual Studio, Code Review, and the SDK. Engineers weighing agent-driven rewrites can follow real-world migration outcomes like this one on daily.dev."}},{"@type":"Question","name":"How does the new Rust-based Copilot runtime expose its API to different language SDKs?","acceptedAnswer":{"@type":"Answer","text":"The Rust runtime exposes a C ABI with 19 exported functions, letting SDKs in C#, Python, Go, Java, Rust, and TypeScript embed the runtime in-process via FFI. This replaces the old approach where every SDK consumer had to spawn a separate Node.js subprocess and communicate over JSON-RPC. Developers building multi-language SDKs can track FFI and embedding patterns like this via daily.dev."}},{"@type":"Question","name":"Did AI agents coordinate with each other without human instruction during the Copilot Rust rewrite?","acceptedAnswer":{"@type":"Answer","text":"Yes, two concurrent porting sessions autonomously discovered they were working on overlapping parts of the codebase and merged their work together without any human directing them to coordinate. GitHub's Martin Woodward noted this cross-session coordination, achieved with no shared memory between the agents, has no clean precedent and is arguably more notable than the rewrite itself. Anyone assessing how far autonomous coding agents can go can follow cases like this on daily.dev."}}]}
```

