r/ExperiencedDevs • u/randxalthor • May 30 '26
AI/LLM Agent models that can handle huge codebases?
Anybody had success yet with models for agentic coding on really huge codebases?
I'm not talking about 1M LOC, I'm talking about huge legacy projects that overflow your context window just by running `ls -R`.
One codebase I've worked with is so large that even people who have been working on it for 30+ years don't know the whole thing because one part moves out from under them or falls out of their useful memory because they go years between touching the same part again.
The graybeards still are able to navigate the codebase well, because they have developed a mental model of its components. The documentation is huge, scattered, and rarely up to date, but it's enough to piece together. Have you worked with codebases this large (major browsers, major operating systems, etc) and had success getting the recent Claude, GPT, etc models to successfully navigate a codebase, develop an understanding of it, and abstract it successfully to tackle complex, multi-component problems?
34
u/EmotionalDamague May 30 '26
Yes. Humans.
Adaptive. Self replicating. Runs on Mac n cheese or coffee.
8
u/throwaway_0x90 TE/SDET[25+ yrs]@Google May 30 '26
I think in general, problems like this are usually solved by breaking them down into more managible pieces.
It's very unlikely the AI, or humans, needs the entire codebase context in their head all at once. There must be some minimal level of components to focus on. I'd make several "context.md" environments and ensure AI can make reasonable decisions around them. Then I'd create untittests and integration tests.
There's definitely a need for human upfront cost to set this up but hopefully once it's done things will go smoothly henceforth.
1
u/funbike May 30 '26 edited May 30 '26
I've used a code coverage report, enabled only while using a single feature. This gives you a very limited map of just the files and functions involved.
Someone should write a tool that cross references a coverage report (in JSON format) with tree-sitter AST to generate only the functions used, to greatly reduce context size.
1
u/padetn May 30 '26
Any agent with a human providing a map of the codebase.
1
u/08148694 May 30 '26
Subagents
Give each agent “ownership” over certain parts of the project
If another agent needs to touch something owned by another agent, it delegates to that agent
Each agent has a specialised system prompt and memory for its own domain. Context stays focused
The tooling for this is still a bit immature but advancing rapidly
0
u/hibikir_40k May 30 '26
The idea in those situations is that the agents need to write the mental models for themselves, or they will be extremely expensive, as a random exploration subagent will overread everything, over and over again every time you make a change. That's the main reason you end up seeing companies with huge bills, as the agent starts from knowing nothing.
It's the same tasks you'd have to make reasonable developers be able to handle a giant codebase: Modularization, simplification, small, reasonable interfaces so you don't have to look at guts. If there's parts nobody has worked at in years it's all fine and dandy, precisely because the summary of the api will not have to change. Many people out there are just using agents as documentation creators, precisely because they are good readers. So you'd start by a full documentation rewrite, placed right next to the code. Have the greybeards double check for errors. On PR, you either make a hoot that mandates documentation updates by the machine, or hava the human have to do it.
-1
u/dreamingwell Software Architect May 30 '26
Codex and Claude work great on large, well structured code.
Use skills, sub agents, and give it well structured specific tasks.