Cursor Agent can’t open a file. Check .cursorignore, .gitignore, and the default ignore list
If Agent, Tab, or @ can’t see a path, `.cursorignore`, `.gitignore`, a default ignore, or a global ignore is hiding it. Negate it with `!` or narrow the rule. Short answer: 5 steps. 1) Prove the path is ignored; 2) Read .cursorignore and .gitignore; 3) Check Cursor’s default ignore list and global ignores; 4) Fix negation patterns the gitignore way; 5) Unblock Agent access, keep secrets out.
Last updated: · This page is the decision checklist; the tools list for “Unblock files Cursor Agent ignores” is a separate URL.
How do I check .cursorignore, .gitignore, and the default ignore list?
Prove the path is ignored
In the project root, run `git check-ignore -v path/to/file` (works for `.gitignore` and helps debug ignore rules). Try `@`-mentioning the file in Agent chat. If Cursor blocks it while the file exists on disk, treat it as an ignore problem—not a missing file. Official ignore reference: https://cursor.com/docs/reference/ignore-file
Read .cursorignore and .gitignore
Open the project `.cursorignore` and `.gitignore`. Cursor respects `.gitignore` automatically; `.cursorignore` adds more exclusions. Broad patterns like `src/**`, `*.md`, or `config/` often hide the exact files Agent needs. Comment out or narrow the pattern, then retry the `@` mention.
Check Cursor’s default ignore list and global ignores
Cursor also ignores a built-in set (for example `.env*`, `.git/`, lockfiles, `node_modules/`, many binaries and media types). Override a default or gitignore exclusion with a `!` negation in `.cursorignore` (for example `!important.env.example`). Global ignore patterns in Cursor Settings apply to every project—clear or narrow those if a path is blocked everywhere. Help: https://cursor.com/help/customization/ignore-files
Fix negation patterns the gitignore way
You cannot re-include a nested file if a parent directory was excluded with a directory pattern. Prefer `public/assets/*` plus `!public/assets/style.css` over excluding all of `public/` then trying to un-ignore a deep file. Enable Hierarchical Cursor Ignore in Settings → Indexing → Ignore Files if parent-folder `.cursorignore` files should apply.
Unblock Agent access, keep secrets out
After the needed source file is visible to `@` and Agent tools, leave real secrets ignored. Remember: Terminal and MCP tools used by Agent are not governed by `.cursorignore`, so a shell `cat` can still read ignored files—don’t rely on ignore alone as a security boundary. Prefer `@` path for specific files once ignore rules are fixed.
Which tools are best to unblock files Cursor Agent ignores?
Ignore file reference
What .cursorignore blocks, default ignore list, negation limits, hierarchical ignore.
Ignore files help
Short guide: .cursorignore vs .gitignore and why to exclude secrets and build output.
Agent search tools
How Agent finds code with Instant Grep / search when files are visible.
Cursor Agent troubleshooting
Broader Agent checklist when tools fail for reasons other than ignore rules.
Open: 1 spot per week
One labeled sponsor for this topic each week; this week's spot is open. See open weeks →
All tools for “Unblock files Cursor Agent ignores” →
Related fixes
- Stop a Cursor agent loopHow to fix a Cursor agent loop (same edit, or work after Stop)Fix →
- Claude Code vs Codex vs Cursor ~$20 plansClaude Code vs Codex vs Cursor $20 plan limits: how to pick without burning the weekFix →
- Scan a vibe-coded app for leaked API keysCheck a vibe-coded app for leaked API keys before you share itFix →
- Add an MCP server to Claude Code, Cursor, or CodexHow to add an MCP server to Claude Code, Cursor, or CodexFix →
See also AI tools launched today on the daily board.
NewAIToolsToday Daily
Top 3 AI launches, one model or news item that matters, and one simple fix. A 5-minute read, every weekday.