Hidden Features

Indexing

How Cursor reads your codebase — and how to help it.

Cursor indexing

How Cursor reads your codebase

Indexing is how Cursor understands a project you have not explicitly described: it builds a searchable map of your files so the AI can find and pull in the right code on its own. This is what lets the agent reference a module you did not mention, or generate code that fits a pattern elsewhere in the repo. Without a good index, Cursor is working half-blind, which is the root of many off-target edits. With one, it can reason about your codebase as a whole rather than a single open file.

Keep the index fresh

An index is only useful if it reflects the current state of the code. After large changes, new files, or a big pull, make sure the index is up to date so the AI is not reasoning from a stale map. If Cursor keeps missing obviously relevant files, a stale or incomplete index is a likely cause. Treat indexing as the foundation it is — when it is healthy, everything built on top of it, from generation to the agent, gets noticeably more accurate.

Frequently asked
What is Cursor's codebase indexing?

Indexing builds a searchable map of your project so Cursor's AI can find and pull in relevant files on its own, letting it reason about the whole codebase rather than one open file.

Why does keeping the index fresh matter?

An out-of-date index means the AI reasons from a stale map, causing it to miss relevant files. Refreshing it after big changes keeps generation and the agent accurate.

How do I know if indexing is the problem?

If Cursor keeps missing obviously relevant files or produces off-target edits, a stale or incomplete index is a likely cause. Updating it often resolves the issue.