Cursor AI global ignore list
1. The purpose of this list
Cursor AI (or similar AI code assistants) can scan your project files to provide contextual code suggestions.
However, some files are sensitive or irrelevant, such as:
- Secrets (API keys, passwords)
- Certificates
- Private keys
- Local environment configs
- Large dependencies (sometimes)
This list ensures Cursor ignores those files, so:
- Sensitive info isn’t exposed in AI suggestions
- AI suggestions remain relevant and safe
- Performance is better because huge or unnecessary files aren’t read
2. Breakdown of patterns
| Pattern | What it ignores | Why |
|---|---|---|
**/.env | Any .env file in any folder | Environment variables with secrets |
**/.env.* | Any .env with suffix, e.g., .env.local | More environment configs |
**/credentials.json | Credential files | API keys, login info |
**/credentials.*.json | Variant credential files | Same as above |
**/secret.json / **/secrets.json | Secret storage | Sensitive config |
**/*.key | Any .key file | Private keys for SSL, SSH, etc. |
**/*.pem | PEM certificate/key files | SSL or crypto keys |
**/*.pfx / **/*.p12 | PKCS12 certificates | Used for encryption or signing |
**/*.crt / **/*.cer | Public certificates | Usually safe, but maybe ignored for consistency |
**/id_rsa / **/id_dsa / **/.ssh/id_* | SSH private keys | Extremely sensitive, should never be shared |
**/.cursor/mcp.json | Cursor’s internal metadata | Not relevant for suggestions |
**/*.fish | Fish shell scripts | Could be ignored if not needed for coding context |
Notes on **:
-
The
**is a glob pattern meaning “match any folder recursively.” -
For example,
**/.envmatches.envin the root or in any subfolder.
3. Key importance
-
Security: Protects sensitive keys, secrets, and credentials.
-
Relevance: Prevents AI from reading unnecessary files, so suggestions stay accurate.
-
Performance: Cursor skips large or irrelevant files (like private keys or config files).
✅ Bottom line:
This is a safety and performance measure. You shouldn’t remove it, unless you specifically want Cursor to read some files (and are aware of the risk of exposing secrets).

No comments: