# Research and planning help agents navigate large codebases

Markdown copy of https://realalpha.app/s/research-and-planning-help-agents-navigate-large-codebases/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Mihail Eric](https://realalpha.app/people/mihail-eric/) · Mihail Eric is an adjunct professor at Stanford and head of AI at Monaco.
- Host: [Shawn Wang (swyx)](https://realalpha.app/people/swyx/) · Co-founder, AI Engineer · Wrote “The Rise of the AI Engineer” and founded Smol AI, maker of AI News.
- Host: [Alessio Fanelli](https://realalpha.app/people/alessio-fanelli/) · Founder, Kernel Labs · Partner at Decibel, backing technical founders who build developer tools.
- Show: Latent Space
- Episode: [Will Repos Become Software Factories? — Mihail Eric, Monaco](https://realalpha.app/v/dpY7YzZo4kE/), Nov 8, 2026
- Moment: 32:10 to 36:50 of the episode (5 min), playing on https://realalpha.app/s/research-and-planning-help-agents-navigate-large-codebases/; the episode from there: https://realalpha.app/v/dpY7YzZo4kE/?t=1930

## Quote

> “there is a way to do this that actually does scale out to code bases that are, you know, **millions of lines long**.”
> — [Mihail Eric](https://realalpha.app/people/mihail-eric/) at [34:32](https://realalpha.app/v/dpY7YzZo4kE/?t=2072) · Latent Space

## Takeaways

1. Research unfamiliar repos before choosing an implementation.
2. Have the agent propose alternatives; let a human choose the plan.
3. Fan-out requires deliberate context sharing, compaction and refresh.

## About this segment

Mihail Eric recommends researching an unfamiliar repo, comparing approaches, then having a human choose before implementation. They also discuss splitting and refreshing context across subagents.

From “Will Repos Become Software Factories? — Mihail Eric, Monaco”, Nov 8, 2026. [Watch the full episode](https://realalpha.app/v/dpY7YzZo4kE/)

## Transcript

From the transcript Latent Space publishes with the episode.

[32:16](https://realalpha.app/v/dpY7YzZo4kE/?t=1936) [laughs] And then how do you pull away the over-constraining? Uh, and that's, I think, part of the learning as well. Okay. We too, you're going to talk about context engineering. Repit, I haven't seen, uh, but there's many versions- Mm-hmm...of spectrum and development. Totally. Um, what would you, would you highlight to a broader audience about, uh, what you're putting in here that people should know? Yeah. This is like the, you know, one-hour version of the course. [laughing] Yeah, exactly.

[32:40](https://realalpha.app/v/dpY7YzZo4kE/?t=1960) Like please condense everything. I think after this is going this- [laughing] That's, that's fair. Yeah. That's, uh- Well, no, it's, it's also a trailer, right? It's like, well, if you want more, go to this source. If you're signing up next, next year or next fall for courses, you know, this is your one hour. This is like, this is like almost like the Quibi of the class, you know what I mean? Where, where it's, it's, it's too long to be a trailer, it's too short to be the class. Is this like, what, what, I guess people will double click- And you know the best part?

[33:02](https://realalpha.app/v/dpY7YzZo4kE/?t=1982) If it's a trailer, by the next time you teach it, it'll change again. [laughs] That's true. That's true. That's true. That's true. Yeah. Well, yeah, so, so, okay. So a good call out on that, Andrew, because it's, it's funny. Um, the-- I think that the, the main thing that I just wanna reinforce here is, uh, and I see this even when I'm like interviewing folks, uh, and the very few people in industry even progress beyond like just vanilla prompting, right?

[33:21](https://realalpha.app/v/dpY7YzZo4kE/?t=2001) There's like a vanda- form, like, "Hey, do me the thing," right? Like do, do the thing. And, and that certainly as the models get good, that can carry you a certain distance. But inevitably, you know, and any folk- folks I speak to that are come out of like a Google or some place where there's a massive like code base, the reality is you have to be a lot more thoughtful about how you're like ingesting context, right?

[33:41](https://realalpha.app/v/dpY7YzZo4kE/?t=2021) And so thinking through what are some of those principles and those techniques around how to like point, you know, k- and I sort of like, you know, the Repit framework that I'm sort of describing here is, is functionally similar to like Dex's RPI, right? Or something of that nature, where you have this like re- research kind of proposal and sort of s- a spec, and then, and then you do like, uh, your implementation, and then you kind of tie it together with some testing and whatnot.

[34:01](https://realalpha.app/v/dpY7YzZo4kE/?t=2041) So what I just wanted to reinforce here is that like you should have this step, especially when you're entering unfamiliar code bases, when you're trying to, uh, sort of infuse into the context something that an agent needs to understand about a very large code base. There's value in something that is a research phase. And then in the case of this particular sort of framework that I'm putting forward, it's like also then suggests some proposal where there's a few alternative ways of solving a problem once you've done the research.

[34:25](https://realalpha.app/v/dpY7YzZo4kE/?t=2065) And so this is where I sort of also invite the human in the loop to the sort of be the decision maker on one appr- one approach versus the other. And then you enter the plan, which is kind of the spec. All to say that the, the TLDR is like there is a way to do this that actually does scale out to code bases that are, you know, millions of lines long. Mm-hmm. Um, and it's not just the vanilla prompt.

[34:45](https://realalpha.app/v/dpY7YzZo4kE/?t=2085) Uh, and I think that's what I wanna highlight. If you're gonna go work in these big code bases, you should use something a little bit more, a little bit more involved. Anything to add on context engineering? I think that probably the weirdest thing about how I think about context right now is when you split out to a sub-agent. Mm-hmm. Because sub-agents can benefit from inheriting your entire context of the main thread or not.

[35:11](https://realalpha.app/v/dpY7YzZo4kE/?t=2111) Uh, sometimes, uh, there's a regular disagreement on, on that, and then sometimes you want to condense what the sub-agent does and researchers put it back onto the main thread. And it's very hacky. I don't like anything I'm doing. So I don't have any answers. All I know is like, uh, when you want to fan out work- Mm-hmm...uh, it is not just about you have a big spec and you, you, you know, you do RPI, you do R- Repit, whatever. It is not one agent anymore.

[35:39](https://realalpha.app/v/dpY7YzZo4kE/?t=2139) It is about fanning out work and making sure they all have the right context, and they all have the right guidance. If you have a review agent reviewing all the other works, you have to make that guy have, have everything. And you always go through this phase of expand and contracts. Like- Yeah...oh my god, these guys don't have enough context. I'm gonna give them more context. Okay, great. And then they're gonna overtune to some random one-off comment that you made some t- a while ago, and then make some really stupid mistakes 'cause you, you didn't mean it that way.

[36:03](https://realalpha.app/v/dpY7YzZo4kE/?t=2163) But like [laughs] they took it as the law. Right. Something like that. And so I don't know what, what the word is I'm saying, right? It's just like multi-agent management for context. Yeah. Yeah, yeah. Yeah, that, and that, that's absolutely right. There, there's like some aspect of, uh, this is maybe the part that's more maybe among the most art than science, right? It's like some combination, I think, to your point.

[36:23](https://realalpha.app/v/dpY7YzZo4kE/?t=2183) Yes, the fan-out for the exploration, the fan-out for like the subtasks, and then, and then the consolidation, compaction, whatever, you know, you might wanna call it. I think being thoughtful about refreshing of the context, understanding when things are getting a little bit too bloated. I think, you know, Dex had this concept of like the dumb zone and sort of like being a little bit- Mm-hmm...more thoughtful about the dumb zone. He's good at these equating things. Oh, yeah, yeah.

[36:40](https://realalpha.app/v/dpY7YzZo4kE/?t=2200) I think he's a- The little diagrams. The little di- yeah. Oh, yeah, I mean, he's- Why didn't we have him on? Uh, yeah. Well, I think he's-- I mean, he hel- definitely informed a lot of the, the curriculum here. Yeah.
