Claude

How Claude Understands Your Codebase

A question every experienced developer asks early: “How does it understand a codebase it’s never seen, without me uploading the whole thing?” The answer is a small set of tools used deliberately — not magic, and worth understanding so you can help it search well.

The context window, in practical terms

Claude has a limited amount of text it can hold in “working memory” at once — the context window. A large codebase is far bigger than that. So instead of loading everything, Claude reads selectively, the same way you would: it looks for the right file, reads the relevant part, and moves on.

The three exploration tools

Almost all codebase exploration comes down to three tools working together:

  • Glob — finds files by name pattern, e.g. **/*.controller.ts to find every controller in a project regardless of folder depth.
  • Grep — searches file contents for a pattern, e.g. every place a function or string is actually used.
  • Read — opens a specific file, or a specific slice of a large one, once it’s been located.
Globfind candidate filesGrepsearch inside themReadopen the right one
The same three-step pattern behind almost every exploration task, from “where is this bug” to “how does auth work here.”

CLAUDE.md: giving it a head start

Running /init in a project generates a CLAUDE.md file — a short document Claude reads automatically at the start of every session in that project. It typically covers:

  • What the project is and how it’s structured
  • Commands to build, test, and run it
  • Conventions specific to the codebase (naming, folder layout, patterns to follow or avoid)

Think of it as onboarding notes for a new team member — because functionally, that’s what it is. A good CLAUDE.md pays for itself within the first session.

Helping the search along

You’ll get better results faster if you point rather than just describe. Compare:

Weaker: “Fix the login bug.”
Stronger: “Users report the login form doesn’t show an error on wrong passwords — look at the login handler, probably somewhere under src/auth/.”

You don’t need to know the exact file. A rough pointer narrows the search dramatically compared to no pointer at all.

Why this matters for large codebases specifically

On a small project, exploration is nearly instant regardless of technique. On a codebase with hundreds of thousands of lines, the difference between a vague prompt and a well-pointed one can be the difference between a 30-second answer and Claude searching in the wrong direction for several minutes. The investment in a good CLAUDE.md and precise pointers scales with project size.

Next: now that Claude can find and read your code, how do you actually talk to it well? That’s the subject of the next post — the single highest-leverage skill in this entire series.