.cursorignore
.cursorignore tells the Cursor editor which files to keep out of AI features — chat, edits, and codebase indexing.
This week: 1% of 499 scanned repos had .cursorignore.See Radar #4 →
What it is
.cursorignore is a gitignore-style file at the root of your project. Cursor uses it to exclude matching files from AI access, so the assistant does not read or index them.
Why use it
It is the most direct way to keep secrets, large assets, and noise out of Cursor’s context. Unlike .gitignore, it is read specifically by the AI features, so it applies even to files that are not in git.
How to set it up
Create a file named .cursorignore in your project root and add one glob pattern per line, just like .gitignore. Cursor picks it up automatically.
.env
.env.*
*.pem
*.key
secrets/What to exclude
Common sensitive categories worth adding to .cursorignore:
FAQ
- How is .cursorignore different from .cursorindexingignore?
- .cursorignore blocks files from all AI features, while .cursorindexingignore only excludes them from background indexing but still allows manual access.
- Does .cursorignore use the same syntax as .gitignore?
- Yes. It uses the same glob and negation (!) syntax, so you can reuse familiar patterns.
Check your own project
158 of 499 repos this week exposed sensitive paths to AI tools. Check yours in seconds:
Run the same local check with Offsend CLI:
brew install --cask offsend/tap/offsend-cli
offsend show
offsend prepare --dry-runEverything runs locally. No file contents are uploaded.