ST

Stephen Toub

Things Stephen Says on Podcasts

Where to Find Them

Stephen Toub writes GitHub Blog . They have also been a guest on The Peterman Post , The Developing Dev and The Peterman Pod .

Recently: “Microsoft Distinguished Eng: Why And How To Port Your Entire Codebase to Rust | Stephen Toub” on The Developing Dev (November 2026); “Microsoft Distinguished Eng: Why And How To Port Your Entire Codebase to Rust | Stephen Toub” on The Peterman Post (November 2026); “Microsoft Distinguished Eng: Why And How To Port Your Entire Codebase to Rust | Stephen Toub” on The Peterman Pod (November 2026); “Migrating the GitHub Copilot runtime to Rust, using Copilot” on GitHub Blog (September 2026).

What They Said

“A lot of the times that I spend working with AI agents, I'm bringing to bear 25 years of experience in being able to very quickly sniff out whether they're doing the right thing or the wrong thing. … I'm concerned that because of how AI agents are progressing, they're taking away the opportunities to have gone through it. And I don't yet know what the answer then is.” — Stephen Toub, The Peterman Post

Asked what advice he would give a young engineer, Toub says he used to have a clear answer and no longer does. The experience that makes someone good at steering agents is the experience agents are removing.

The Peterman Post · 2026-11-02 Permalink → Listen →
The Peterman Post
Stephen Toub

…from nothing to a reasonable understanding of how everything works. And I was blown away by the book, and I've since reread it on multiple occasions, even though I know everything that's in there, I just love the way that it communicates things. So if I had one recommendation, that's it.

Ryan Peterman

Looking back on all your experience, you've kind of been working in the industry for a while. What professional advice would you give a young engineer just entering the industry today that you believe could be helpful?

Stephen Toub

That's a great question. And it's one I've been struggling with. A couple years ago, I would have had a much more clear answer. But with AI, I still don't know what the right answer is. A lot of the times that I spend working with AI agents, I'm bringing to bear 25 years of experience, for better or worse, in being able to very quickly sniff out things when they're doing the right thing or they're doing the wrong thing or how I want to guide them. Or an agent says, I'm 100% confident that the right answer is A. And I'll say, yeah, but have you also considered B and C and D because these trade-offs might not be there, right? And oh, of course, like just those little things, being able to guide them in the right way requires you to have gone through it. And I'm concerned that because of what AI, how AI agents are progressing, that they're taking away the opportunities to have gone through it. And I don't yet know what the answer then is. I'm a very firm believer in really learning kind of the basics and building everything up from core principles. And so, like, when, you know, learning a language, I still think it's valuable to learn and to start out…

Ryan Peterman

Awesome. Well, yeah, thank you so much for your time today, Steven. I really appreciate it.

Stephen Toub

Pleasure. This has been a fun conversation. Thank you.

Ryan Peterman

Hey, thank you for watching this podcast. If you liked it and you want to see the show grow, please support with a comment or a like. Also, if you have any recommendations for people you want me to bring on, please drop a comment. Guests like Barbara Liskoff, Mike Stonebreaker, Mark Brooker, these…

Speaker names come from our own diarization. The position is estimated from where the line sits in the episode.
“You know, the agents want to get to green. That's their goal. And so if you let them, they will change the oracle. They will change the tests at the same time as the code to make it pass.” — Stephen Toub, The Peterman Post

Asked how he caught regressions in a port too big to read by hand, Toub says end-to-end tests were the safeguard, and describes the main way agents undermine them.

The Peterman Post · 2026-11-02 Permalink → Listen →
The Peterman Post
Stephen Toub

…find their way into the existing untouched TypeScript in the branch. And then the agent would have to reason about all of the code that it had ported, looking for changes to that to bring that in, versus it was sort of instantly pointed to those places because we were doing this swap at the time.

Ryan Peterman

…or engineers that want to rewrite their entire code base. Probably the biggest concern is the correctness concerns, which is there's so much code that you don't have the luxury of a human even reading the code to confirm that it's correct. So how did you discover and fix regressions along the way?

Stephen Toub

So the most important thing was our end-to-end tests, our integration tests, or whatever you want to call them. We basically had two flavors of tests for Copilot. We had unit tests, which were largely sort of, you know, they're testing micro functionality throughout the code base, and a lot of them have internals access. So they're able to test this little function here that's not exposed or that piece of code there that's not exposed. And then there are the end-to-end tests either at the runtime level, the SDK level, or the CLI is in the same code base. And so its end-to-end tests also effectively exercise the runtime. And this isn't 100% true, but the CLI can largely be thought of as sort of just exposing the runtime's capabilities and sort of the lowest layer possible in a human interface. And so we had all of those end-to-end tests to validate behaviors. And by and large, if not 100%, but the vast majority of regressions that we had were because we didn't have…

Ryan Peterman

It still feels like a regression is inevitable because the test coverage is, it's like it's opt-in, kind of where it relies on a human saying these are the things that are important, but you could always forget something. So I kind of wonder if this type of project, it's just inevitable that there…

Stephen Toub

I think so. I mean, it's hard to imagine. I mean, who knows what things will look like in a year. Things are moving really fast. But right now, yes, 100% there will be regressions. If there aren't, I would be astounded. Unless we're talking about like, you know, a tiny, tiny little code base. But…

Ryan Peterman

For such a huge volume of code, I imagine. Imagine most of it wasn't human reviewed. How did you handle code review at scale, or did you do any at all?

Speaker names come from our own diarization. The position is estimated from where the line sits in the episode.
“First, it wouldn't have happened. And I'm actually serious. For this particular thing, it wouldn't have happened because by the time we were done, we would have ported the wrong thing. This space is moving so fast that we would have basically never finished.” — Stephen Toub, The Peterman Post

Asked what this rewrite would have looked like before AI, Toub says a team would have needed a year or two for hundreds of thousands of lines, and new code kept arriving the whole time.

The Peterman Post · 2026-11-02 Permalink → Listen →
The Peterman Post
Stephen Toub

…cheaper and cheaper. And the models are also getting better and better and better, which means that the amount of time that I need to put in to steer the models to do the right thing is also decreasing. And so the costs of these ports, the cost of these migrations is only getting cheaper over time.

Ryan Peterman

Wow. So three weeks of, I guess, of developers' time plus $120,000, you're able to rewrite the entire code base. If you were to scope this out pre-AI, let's say you wanted to undertake this, what would that look like?

Stephen Toub

First, it wouldn't have happened. And I'm actually serious, like for this particular thing, it wouldn't have happened because by the time we were done, we would have ported the wrong thing. This space is moving so fast that we would have basically never finished, I think. In fact, you can kind of see that in the charts in the blog post in that for a good portion of the porting effort, the amount of Rust is increasing and the amount of TypeScript is largely remaining the same, but increasing a little bit. And that's because as the port was happening, there was just a huge amount of new functionality coming into the repo, right? And at the beginning of the porting effort, because the majority of the code base was TypeScript, the majority of the new incoming code was also TypeScript. By the end of the project, where the majority of the code base was Rust, the majority of the new incoming code was Rust. But if you look at like the first half of the graph, where we're generally 50% or less Rust, the amount of TypeScript was doing this, even as…

Ryan Peterman

It sounds like, at least for this type of work where it's super what we want is very obvious and encoded somewhere in the existing functionality. So like this type of work is at least one order of magnitude cheaper, maybe even more. I mean, if you had a team of engineers and they're, you know…

Stephen Toub

Yes. And the bill ended up being larger than I expected. Mostly because the line count ended up being larger than I expected. I hadn't fully factored in the growth rate of how much incoming code there would be. So this was, you know, there were a few things. I think I did a lot of things right. I…

Ryan Peterman

So after having gone through this process, if there was a software engineer out there on some team considering doing some sort of rewrite, what criteria should they look for to decide if it's worth undertaking it or not?

Speaker names come from our own diarization. The position is estimated from where the line sits in the episode.
“All told, it was about 136 billion tokens… if you were to use the public pricing of those models at those times, it came out to approximately $120,000. … About 20% of about 15 weeks, you end up with about three weeks of my time spread out over three months plus the token costs. And it's only getting cheaper.” — Stephen Toub, The Peterman Post

Asked about the real cost of rewriting the GitHub Copilot runtime from TypeScript into Rust with agents, Toub gives the token count and list-price bill from his session logs, plus his own time.

The Peterman Post · 2026-11-02 Permalink → Listen →
The Peterman Post
Stephen Toub

…different paths and looking at different things. And one of the biggest changes you can make is completely changing the model. And so the best way to get different opinions and focusing on different things that I found is by having different models. Especially than the one that I used initially.

Ryan Peterman

So, you know, after you finish the rewrite, what was the concrete impact and the cost? So, if you look at it from a business perspective, what was the benefit and the cost of this project?

Stephen Toub

…of them are across different projects. And so I'm not, developers are no longer working on one thing at a time. So if you look at the percentage, just as a rough estimate. My time. If you look at the percentage of PRs that I was submitting over that same period, about a fifth of them, give or take, was to do with this project and about 80% was for other things. And so if you figure, you know, about 20% of about 15 weeks, you end up with about three weeks of my time spread out over three months plus the token costs. And it's only getting cheaper. The models are becoming cheaper at an astronomical rate. I think when OpenAI released, I'm not going to remember the exact things, but I think like 6.1 Sol is half the price of 6 Sol and 6 was half the price of 5.6 Sol. It's just getting cheaper and cheaper and cheaper. And the models are also getting better and better and better, which means that the amount of time that I need to put in to…

Ryan Peterman

Wow. So three weeks of, I guess, of developers' time plus $120,000, you're able to rewrite the entire code base. If you were to scope this out pre-AI, let's say you wanted to undertake this, what would that look like?

Stephen Toub

First, it wouldn't have happened. And I'm actually serious, like for this particular thing, it wouldn't have happened because by the time we were done, we would have ported the wrong thing. This space is moving so fast that we would have basically never finished, I think. In fact, you can kind of…

Ryan Peterman

It sounds like, at least for this type of work where it's super what we want is very obvious and encoded somewhere in the existing functionality. So like this type of work is at least one order of magnitude cheaper, maybe even more. I mean, if you had a team of engineers and they're, you know…

Speaker names come from our own diarization. The position is estimated from where the line sits in the episode.
“Me reading every line would not prevent bugs. In fact, agents reading every line is a lot more effective, not just faster, but more effective in quality than me doing so. I absolutely looked at the code for every PR that I put up, but I was focusing more on big picture stuff. Is the direction of this correct? Is the architecture correct?” — Stephen Toub, The Peterman Post

Asked how he handled review on a port of hundreds of thousands of lines that no human read in full, Toub says he checked architecture and direction and left line-level review to agent reviewers.

The Peterman Post · 2026-11-02 Permalink → Listen →
The Peterman Post
Stephen Toub

…more agents at it. And we did. Before merge, doing lots of agentic reviews. And then after merge, running agents to continually look for bugs, look for concurrency issues, look for whatever. And they find things, but they never find, it's never, at least in my experience, it's not 100% perfect.

Ryan Peterman

For such a huge volume of code, I imagine. Imagine most of it wasn't human reviewed. How did you handle code review at scale, or did you do any at all?

Stephen Toub

Yeah. So definitely did some, but I did not read every line. That would be impossible. And if I did, it would also be a waste. There's no, like, me reading every line would not prevent bugs. In fact, agents reading every line is a lot more effective, not just faster, but more effective in quality than me doing so. I absolutely looked at the code for every PR that I put up, but I was focusing more on big picture stuff, right? Is the direction of this correct? Is the architecture of this correct? Is the componentization of this correct? Is the approach, are the algorithms that are being used appropriate? Is there anything fishy about like, you know, if I, a lot of it is like squinting at a 30,000-foot level and looking at the two code bases and does anything look off, right? And then relying on the agents to focus on the line-by-line details. And in many situations, I would sort of do a quick scroll through all the changes to just see if anything popped out. And I might notice a few things here and there. But for the most part, a really good agentic reviewer is going to be way better at sort of the line level details than…

Ryan Peterman

I saw in the blog post that you have this cool bar chart where you basically categorized every single message from you to the agents and what your intent was. Looking over that and reflecting on how you guided the agents, where was most of your time spent? And what were the most impactful times…

Stephen Toub

There were two or three even higher level categories of things that I was doing. There was one or two categories where I think this just speaks to the state of sort of long horizon tasks with models and harnesses today, where it was me being frustrated with their progress in one way, shape, or…

Ryan Peterman

That's interesting. So your agent will auto-apply and auto-listen on the PR. And if it seems reasonable, it may take action without your input. Is that right?

Speaker names come from our own diarization. The position is estimated from where the line sits in the episode.
“It was about 136 billion tokens broken up in such a way that if you were to use the public pricing of those models at those times, it came out to approximately $120,000. This is not factoring any discounts… plus my time… about three weeks of my time spread out over three months plus the token costs. And it's only getting cheaper.” — Stephen Toub, The Developing Dev

Asked about the cost of rewriting the Copilot runtime in Rust with agents, Toub totals the token spend at public list prices and estimates his own time. It is a rare concrete price tag on an agent-driven migration of several hundred thousand lines.

The Developing Dev · 2026-11-02 Permalink → Listen →
The Developing Dev
Stephen Toub

…different paths and looking at different things. And one of the biggest changes you can make is completely changing the model. And so the best way to get different opinions and focusing on different things that I found is by having different models. Especially than the one that I used initially.

Ryan Peterman

So, you know, after you finish the rewrite, what was the concrete impact and the cost? So, if you look at it from a business perspective, what was the benefit and the cost of this project?

Stephen Toub

…previous world that I was talking about. So, from a business perspective, it's worth a lot to do this port. In terms of what it actually costs us, it was about if I, so I stored all of my session logs or 99% of my session logs from this effort. And from those session logs, I was then able to sort of deduce the token counts for fresh tokens, cash writes, cash reads, output tokens. And all told, it was about 136 billion tokens broken up in such a way that if you were to use the public pricing of those models at those times, it came out to approximately $120,000. This is not factoring any discounts or things that companies might have for what those tokens cost. And this is just sort of what's on the website of OpenAI and Anthropic, plus my time, which it took, it was about 14, 15 weeks, but I was doing other things at the same time. A lot of these agentic projects, if I look at my co-pilot app that I currently have on my screen, I've got about 35 sessions right now for things that I'm…

Ryan Peterman

Wow. So three weeks of, I guess, of developers' time plus $120,000, you're able to rewrite the entire code base. If you were to scope this out pre-AI, let's say you wanted to undertake this, what would that look like?

Stephen Toub

First, it wouldn't have happened. And I'm actually serious, like for this particular thing, it wouldn't have happened because by the time we were done, we would have ported the wrong thing. This space is moving so fast that we would have basically never finished, I think. In fact, you can kind of…

Ryan Peterman

It sounds like, at least for this type of work where it's super what we want is very obvious and encoded somewhere in the existing functionality. So like this type of work is at least one order of magnitude cheaper, maybe even more. I mean, if you had a team of engineers and they're, you know…

Speaker names come from our own diarization. The position is estimated from where the line sits in the episode.
“The agents want to get to green, like that's their goal. And so if you let them, they will change the oracle, like they will change the tests at the same time as the code to make it pass.” — Stephen Toub, The Developing Dev

Asked how regressions were prevented while porting GitHub Copilot's runtime from TypeScript to Rust with agents, Toub says end-to-end tests were the main safeguard. One failure was not stopping agents from editing those tests while changing the behavior they covered.

The Developing Dev · 2026-11-02 Permalink → Listen →
The Developing Dev
Stephen Toub

…find their way into the existing untouched TypeScript in the branch. And then the agent would have to reason about all of the code that it had ported, looking for changes to that to bring that in, versus it was sort of instantly pointed to those places because we were doing this swap at the time.

Ryan Peterman

…or engineers that want to rewrite their entire code base. Probably the biggest concern is the correctness concerns, which is there's so much code that you don't have the luxury of a human even reading the code to confirm that it's correct. So how did you discover and fix regressions along the way?

Stephen Toub

…good as long as you have tests covering all the behaviors you care about. And so the fact that we had any regressions sort of highlights that there were gaps. Now, that's not 100% true. We had cases, the funniest or saddest cases were where we neglected to prevent the agents from rewriting the end-to-end tests at the same time that they were changing the behavior that was being tested. You know, the agents want to get to green, like that's their goal. And so if you let them, they will change the oracle, like they will change the tests at the same time as the code to make it pass. Or we had one case where this one didn't slip through. I noticed this one, but like the agent was making changes and it ended up changing some public APIs. And CI caught this and said, no, no, no, you can't do that. But we have an escape hatch in CI where if someone really knows what they're doing, they can put a label on the PR to basically say, no, this particular break is okay. And the agent…

Ryan Peterman

It still feels like a regression is inevitable because the test coverage is, it's like it's opt-in, kind of where it relies on a human saying these are the things that are important, but you could always forget something. So I kind of wonder if this type of project, it's just inevitable that there…

Stephen Toub

I think so. I mean, it's hard to imagine. I mean, who knows what things will look like in a year. Things are moving really fast. But right now, yes, 100% there will be regressions. If there aren't, I would be astounded. Unless we're talking about like, you know, a tiny, tiny little code base. But…

Ryan Peterman

For such a huge volume of code, I imagine. Imagine most of it wasn't human reviewed. How did you handle code review at scale, or did you do any at all?

Speaker names come from our own diarization. The position is estimated from where the line sits in the episode.

Collections They Appear In