AI Skill StudioAI Skill Studio
Skill Library
Presets:

.cursorignore generator: keep secrets and build output away from Cursor

Choose what to exclude, add your own patterns, and download .cursorignore for your repo root. Runs in your browser; nothing is uploaded.

Target Standard & File Format

AI Agent Rules & Skills
Context Shields & Privacy (Ignore Files)
Integrations & Machine Documentation
AI Governance & Multi-Agent Planning Suite

.cursorignore Shield

Prevent Cursor AI from indexing secrets, build caches, and bulky lockfiles to save context window tokens:

Full Protection
Tokens Saved / Turn
~190k tokens
Secret Leak Guards
2 Active Guards
Shield Categories
8 of 8 Enabled

Indexing Boundary Categories

Toggle specific categories to mask secrets and exclude heavy artifacts:

Custom Rules & Negate Exceptions

Append repo-specific file globs or re-include allowed files with negation patterns (!path):

.cursorignore: how it works

.cursorignore uses .gitignore syntax to list files Cursor should leave out of codebase indexing and AI features such as chat, Agent, inline edit and @-mentions. Cursor already skips files in .gitignore when indexing, so .cursorignore is for files you track or keep locally but do not want sent to a model: .env files, keys, large fixtures and generated code. Exclusion is best effort: commands the agent runs in the terminal, and MCP tools, can still read ignored files. To keep files out of the index but still usable on request, use .cursorindexingignore.

Where the file goes

  • ./.cursorignoreRepo rootExcludes matching files from indexing and AI features.
  • ./.cursorindexingignoreRepo rootExcludes files from the index only; you can still add them to a request.

What goes in it

SecretsKeep keys and environment files out of prompts. ! re-includes a file a wider pattern excluded.
# Secrets and credentials
.env*
!.env.example
*.pem
*.key
service-account*.json
Generated and bulky filesTracked files a model rarely needs, which only crowd out your source code.
# Build output and generated code
.next/
dist/
coverage/
src/generated/
*.min.js

# Large fixtures
fixtures/**/*.json

Tips

  • Start with secrets: .env* (except .env.example), keys, certificates and service-account files.
  • Add generated code and build output that is tracked in git; .gitignore already covers the rest for indexing.
  • Do not treat it as a security boundary. Keep real secrets out of the repo and out of the agent's shell.
  • Use !pattern to re-include a file that a wider pattern excluded, such as !.env.example.

.cursorignore presets (21)

Each one opens the generator with that file filled in for the stack. Change what you need, then copy or download it.

Not sure .cursorignore is the file you need? Each AI coding tool reads its own file from its own place.

Which file do I need?

Frequently asked questions

Does .cursorignore replace .gitignore?

No. .gitignore decides what git tracks; .cursorignore decides what Cursor's indexing and AI features can use. Cursor already respects .gitignore for indexing, so list only the extra files.

Is a file in .cursorignore hidden from the agent completely?

No. Cursor treats it as best effort: ignored files stay out of indexing, chat context and edits, but terminal commands and MCP tools the agent runs can still read them.

.cursorignore vs .cursorindexingignore?

.cursorignore excludes files from indexing and AI features. .cursorindexingignore only keeps files out of the index, so codebase search skips them but you can still add them to a request.