In fact, the two are in a sense at odds with each other: refactoring things sometimes means explicitly _disobeying_ the user prompt to "get things done", and going on a side-quest to clean things up. You could manually prompt the LLM to go out and refactor things, but doing that requires _you_ to read the code and identify places that seem suboptimal.
I frequently use LLMs in a VS Code workspace with around 40 repos, consisting of microservices, frontends, nuget and npm packages, IaC, etc. altogether its many millions of lines of code. and I can ask it questions about anything the codebase and it has no issues managing context. I do not even add files manually to context (this is worse actually because it puts the entire file into context even if it’s not all used). I just refer to the files by name and the LLM is smart enough to read them in as appropriate. I have a couple JSON files that are megs of configuration, and I can tell it to summarize / extract examples out of those files and it’ll just sample sections to get an overview.
Isn't that what we mean by 'learning' a codebase? I know my ability is supercharged compared to most devs, but most colleagues have it to some extent and I've met some devs with an even more impressive ability for it than me so it's not like I'm a magic unicorn. Ironically, I have a terrible memory for a lot of other things, especially 'facts'.
You can sorta make a crappy version of that for AI agents with agent files and skills.
Because they are human, intuition is a human trait, not an LLM code grinder trait.
The quality is general good for what we're doing, but we review the heck out of it.
One practical question: presumably your codebase is much larger than an LLM's context window. How do you handle this? Don't the LLMs need certain files in context in order to handle most PRs? E.g. in order to avoid duplicating code or writing something in a way that's incompatible with how it will be used upstream.