Why Claude Code struggles in a large codebase
Out of the box, Claude Code finds code by running grep and reading whole files into the context window. On a small project that is fine. On a large codebase or a monorepo it falls apart: a single grep can dump thousands of lines, the same files get re-read on every turn, and the context window fills until auto-compact throws away detail the agent still needed.
The result is the two complaints developers post most often about Claude Code — it gets slow and expensive on big repos, and it loses track of context right when the task gets hard.
- grep / glob brute-force search returns noise, not the code that answers the question
- whole-file reads and re-reads inflate token usage every single turn
- the context window hits 100% and auto-compact silently drops earlier context
- more files in the repo means slower, pricier, less accurate sessions