Header Ads

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

PatternWhat it ignoresWhy
**/.envAny .env file in any folderEnvironment variables with secrets
**/.env.*Any .env with suffix, e.g., .env.localMore environment configs
**/credentials.jsonCredential filesAPI keys, login info
**/credentials.*.jsonVariant credential filesSame as above
**/secret.json / **/secrets.jsonSecret storageSensitive config
**/*.keyAny .key filePrivate keys for SSL, SSH, etc.
**/*.pemPEM certificate/key filesSSL or crypto keys
**/*.pfx / **/*.p12PKCS12 certificatesUsed for encryption or signing
**/*.crt / **/*.cerPublic certificatesUsually safe, but maybe ignored for consistency
**/id_rsa / **/id_dsa / **/.ssh/id_*SSH private keysExtremely sensitive, should never be shared
**/.cursor/mcp.jsonCursor’s internal metadataNot relevant for suggestions
**/*.fishFish shell scriptsCould be ignored if not needed for coding context

Notes on **:

  • The ** is a glob pattern meaning “match any folder recursively.”

  • For example, **/.env matches .env in the root or in any subfolder.


3. Key importance

  1. Security: Protects sensitive keys, secrets, and credentials.

  2. Relevance: Prevents AI from reading unnecessary files, so suggestions stay accurate.

  3. 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:

Powered by Blogger.