Claude CodeClaude Code 2.1 · terminal and VS Code · macOS, Linux, Windows
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
32 small wins to finish your pathNext lesson →

Codebase search

Codebase search is how Claude Code locates code: it runs a plain-text search and reads files on demand, with no prebuilt index of your project.

Last updated: 29 Sep, 2026 · Claude Code

Asking what a project is about · from the Complete Claude Code Course In 2 Hours For Developers · 38:40 to 40:12

In the video the project has no CLAUDE.md yet, so Claude Code knows nothing about it. Asked to say what the project is all about, it lists the directories, reads the README and the markdown files, and asks permission to run a command to look inside the folders. The video approves it. The command was written for PowerShell and fails in bash with exit code 127, so Claude reads the notebooks directly instead, which is the loop checking its result and trying another way. Then it answers: a hands-on tutorial repository for the new LangChain APIs, create_agent and the middleware system.

Permission prompts since the video. Since v2.1.283 an interactive session starts in auto mode when you have not set a permission mode, and a classifier reviews commands like that one instead of asking you, so you may not see the prompt the video answers. Press Shift+Tab once to switch to manual mode and approve each action yourself (permission modes).

There is no index anywhere. It finds code the way you would, with search and reading, and that explains a surprising amount of its behaviour.

The capture in the agent-loop lesson is the evidence. The first thing it did was grep. It used a plain text search, run in your shell against your files when needed, rather than an embedding index or a symbol database.

bash
grep -r "short" /tmp/linkshort --include="*.py" | head -20

Then it read the one file that looked right. Two steps, and it had what it needed.

What follows from it

  • Nothing is stale. There is no index to rebuild, so it always sees the file as it is on disk right now.
  • Nothing was uploaded. Only the parts it read go to the model, not your repository.
  • Names matter. A function called next_code is findable. One called helper2 is not.
  • Big repositories cost more. Searching is cheap, reading is not, and reading is what fills the context window.

The last point is the one that turns into a bill. A question that makes it read fifteen files costs more than one that makes it read two, and the large-codebases lesson is about working in a repository too large to read.

Helping it find things

You can point it directly at a file, which skips the searching entirely.

bash
claude -p "explain next_code in shorten.py"

Inside a session you can do the same with @ followed by a path, and it will read that file before answering. It is the cheapest way to make an answer better: tell it where to look when you already know.

The same thing that helps people
A project that is easy for a new colleague to search is easy for Claude Code to search, for exactly the same reasons. Clear file names, one job per file, and words in the code that match the words people use for them.
Try it yourself
  • Ask about something whose name appears nowhere in the code and watch how it hunts for it.
  • Ask the same question again, this time naming the file, and compare how long it takes.
PreviousAgent loop

Slow is fine. Stopping is the only problem.