Codebase indexing
Codebase indexing is the process an AI editor uses to build a searchable representation of your repository, usually by splitting files into chunks and storing vector embeddings so it can retrieve code by meaning rather than exact text match.
It is what lets you ask about "the auth middleware" without naming the file. The index maps your description to code that resembles it semantically.
It has limits worth knowing. Indexes go stale between updates. Similarity is not the same as relevance, so a chunk that talks about authentication may surface even when the actual logic lives elsewhere under a different name. And code with poor naming indexes poorly, because there is less signal to match against.
What this means in practice
Cursor and Windsurf both index; Claude Code searches live instead. When a search-based tool finds something an indexed one missed, stale or shallow indexing is usually why. Re-indexing after a large refactor is worth doing deliberately.
Prompts for the tools this applies to
Related terms
- Context retrieval
Context retrieval is how an AI coding tool decides which parts of your codebase to read for a given request.
- Repo map
A repo map is a compressed outline of a codebase — its files, key symbols, and how they relate — given to a model so it understands the shape of a project without reading every file.
- Context engineering
Context engineering is the practice of deciding what information an AI model sees for a given task — which files, which conventions, which prior results — and in what form.