Codebase Indexing
How Cursor learns your codebase for better understanding
Cursor indexes your codebase by computing embeddings for each file. This improves AI-generated answers about your code. When you open a project, Cursor starts indexing automatically. New files are indexed incrementally.
Check indexing status at: Cursor Settings
> Indexing & Docs
Configuration
Cursor indexes all files except those in ignore files.
Click Show Settings
to:
- Enable automatic indexing for new repositories
- Configure which files to ignore
Ignoring large content files improves answer accuracy.
View indexed files
To see indexed file paths: Cursor Settings
> Indexing & Docs
> View included files
This opens a .txt
file listing all indexed files.
Multi-root workspaces
Cursor supports multi-root workspaces, letting you work with multiple codebases:
- All codebases get indexed automatically
- Each codebase’s context is available to AI
.cursor/rules
work in all folders
PR search
PR search helps you understand your codebase’s evolution by making historical changes searchable and accessible through AI.
How it works
Cursor automatically indexes all merged PRs from your repository history. Summaries appear in semantic search results, with smart filtering to prioritize recent changes.
Agent can fetch PRs, commits, issues, or branches into context using @[PR number]
, @[commit hash]
, or @[branch name]
. Includes GitHub comments and BugBot reviews when connected.
Platform support includes GitHub, GitHub Enterprise, and Bitbucket. GitLab is not currently supported.
GitHub Enterprise users: The fetch tool falls back to git commands due to VSCode auth limitations.
Using PR search
Ask questions like “How are services implemented in other PRs?” and Agent will automatically fetch relevant PRs into context to provide comprehensive answers based on your repository’s history.
FAQ
Where can I see all indexed codebases?
Where can I see all indexed codebases?
No global list exists yet. Check each project individually by opening it in Cursor and checking Codebase Indexing settings.
How do I delete all indexed codebases?
How do I delete all indexed codebases?
Delete your Cursor account from Settings to remove all indexed codebases. Otherwise, delete individual codebases from each project’s Codebase Indexing settings.
How long are indexed codebases retained?
How long are indexed codebases retained?
Indexed codebases are deleted after 6 weeks of inactivity. Reopening the project triggers re-indexing.