Control file access with .cursorignore and .cursorindexingignore
.cursorignore
file in your root directory.
Cursor blocks access to files listed in .cursorignore
from:
.cursorignore
**/.env
, **/.env.*
**/credentials.json
, **/secrets.json
**/*.key
, **/*.pem
, **/id_rsa
.cursorignore
.cursorignore
file in your root directory using .gitignore
syntax.
Cursor Settings
> Features
> Editor
> Hierarchical Cursor Ignore
to search parent directories for .cursorignore
files.
Notes: Comments start with #
. Later patterns override earlier ones. Patterns are relative to file location.
.cursorindexingignore
.cursorindexingignore
to exclude files from indexing only. These files remain accessible to AI features but won’t appear in codebase searches.
.gitignore
and the default ignore list below. Override with !
prefix in .cursorignore
.
Default Ignore List
.gitignore
, .cursorignore
and .cursorindexignore
:!
), you cannot re-include a file if a parent directory is excluded via *.
git check-ignore -v [file]
.