How Does Cursor Search Your Codebase Now?
Agent finds code itself, using its search tools. Instant Grep handles exact matches and regex with no configuration, and Cursor's course says Agent can also search by meaning when you don't know the exact name. So the main ways to help are excluding junk files, naming exact symbols when you know them, and reindexing if search looks stale.
Before changing anything, tell me how you searched: which exact terms you used, and which files you read. Find where [behavior] is implemented. If [symbol or error string] exists, start with that exact text. If you need a broad search, use a subagent and give me only the findings. List any folder that returned mostly generated or vendored code, so I can add it to .cursorignore.
- 1Your question
- 2Search by meaning
- 3Instant Grep for exact matches
- 4Reads the files
Try it now
- 1Ask Agent where something is, using a name you know, and watch which search steps appear in the chat.
- 2If it can't find a file you know exists, check
.cursorignoreand.gitignore, because either can hide files. - 3Open the command palette with Cmd+Shift+P (Ctrl+Shift+P), search for Reindex, and run it. It worked if the file now appears in results, or attach it directly with
@.
Use it when
Check this when Agent misses files that exist, keeps quoting generated code, or searches slowly in a big monorepo. Otherwise there's nothing to do, since the search tools run automatically.
Skip it when
Don't spend time tuning a small repo where everything is relevant. And don't reach for search at all when you already know the file. An @ mention is more direct, and the agent doesn't need to look for it.
Why it works
Exact matching is the most precise search, and Cursor says Instant Grep outperforms ripgrep on large codebases. It builds and queries its index on your machine, and Cursor says it doesn't upload file paths or code to build it. For broad questions, the course says Agent starts with a codebase search and follows up with grep to trace details. For wide searches, the Explore subagent runs many parallel queries in its own context, so raw results don't fill your main chat. Noise from generated or vendored files reduces accuracy, which is why Cursor's docs list excluding files as a performance step.
Example
Cursor's course compares two questions about payments. One asks for every file importing PaymentService and how each handles PaymentFailedError, which leads to a grep for import.*PaymentService. The other asks how the app deals with failed payments from end to end, which starts with a codebase search and uses grep for the details. The first suits you when you know the names, and the second when you don't.
Going further
Cursor's pages disagree on one point, so don't assume. The Search docs say Cursor doesn't store embeddings of your codebase for search and describe only Instant Grep and Explore. The Learn course still says Agent can search by meaning, and the 3.27 release notes refer to codebase indexing and semantic search. Treat the privacy claim as applying to what that page describes, and check Cursor's data-use page if this matters for compliance. The 3.19 release removed the Index New Folders setting. And note that matched file content can still go to the model, even though the index stays local.
Common mistakes
- Following old guides that say to type
@Codebase. The current @ list covers files, folders, terminals, chats, Git diffs and the browser. - Looking for an Index New Folders toggle, which Cursor removed in version 3.19.
- Assuming a local index means your code stays local. Files Agent opens can still be included in the model request.
- Asking a whole-monorepo question when you mean one package. Name the folder.
Sources
- Search, Cursor Docs
- Understanding your codebase, Cursor Learn
- Agent troubleshooting, Cursor Help
- Release notes, Cursor Docs
- Ignore file, Cursor Docs
- Prompting agents, Cursor Docs
Checked 6 November 2026. Products change often, so confirm details with the vendor.