Submit a toolSubmit

Cursor Agent can't find your files. Check ignore rules, then reindex

When Cursor Agent can't find a file, check .cursorignore and .gitignore first: both can block Agent, search, and @ mentions. Then @-attach the path, and if a gitignored file still never appears in Instant Grep results, turn off Index Repositories for Instant Grep and reload. Short answer: 5 steps. 1) Check .cursorignore in the project root; 2) Check .gitignore and Cursor's default ignore list; 3) Attach the file with @; 4) If a gitignored path must be searchable, adjust Instant Grep; 5) Trim ignore rules that starve useful source.

Last updated: · This page is the decision checklist; the tools list for “Fix Cursor Agent when it can't find files” is a separate URL.

The problem: When Cursor Agent can't find a file, check .cursorignore and .gitignore first: both can block Agent, search, and @ mentions. Then @-attach the path, and if a gitignored file still never appears in Instant Grep results, turn off Index Repositories for Instant Grep and reload.
Official docs: cursor.com, cursor.com

How do I fix this: Cursor Agent can't find your files?

  1. Check .cursorignore in the project root

    Open .cursorignore at the repo root. Patterns use .gitignore syntax and block Agent, Tab, Inline Edit, codebase search, and @ mentions for matching paths. A too-broad rule (for example src/** or *.ts) will hide the file you expect Agent to open. Docs: https://cursor.com/docs/reference/ignore-file

  2. Check .gitignore and Cursor's default ignore list

    Cursor also ignores paths in .gitignore, plus a built-in list (node_modules/, .env*, lockfiles, many binaries and media types). If the file is under an ignored folder, Agent will not discover it through normal search. Agent troubleshooting: https://cursor.com/help/troubleshooting/agent-issues

  3. Attach the file with @

    In Agent chat, type @ and the filename (or folder) so the path is forced into context. Cursor's troubleshooting checklist ends with this after the ignore checks. Prefer a specific @ path over hoping search finds a buried file.

  4. If a gitignored path must be searchable, adjust Instant Grep

    Instant Grep indexes from git-visible files. A ! negation in .cursorignore cannot always bring a .gitignore-excluded file into that index while Index Repositories for Instant Grep is on. Turn that setting off in Cursor Settings > Indexing & Docs, reload the window, or add the folder as a separate workspace root so Agent can read it directly.

  5. Trim ignore rules that starve useful source

    Keep generated folders and secrets in .cursorignore for safety and noise reduction, but do not ignore the source trees Agent must edit. Hierarchical Cursor Ignore (Settings > Indexing > Ignore Files) also walks parent .cursorignore files when enabled—turn that off if a parent folder is hiding this project. https://cursor.com/docs/reference/ignore-file

Which tools are best to fix Cursor Agent when it can't find files?

Agent troubleshooting

Official steps when Agent doesn't pick up files: ignore checks and @ attach.

Ignore file reference

.cursorignore syntax, default ignored paths, and negation limits.

Cursor Rules

Standing project guidance so Agent knows which folders matter after files are visible.

Cursor forum: Instant Grep

Staff note on gitignored files vs Instant Grep and the Index Repositories toggle.

All tools for “Fix Cursor Agent when it can't find files” →

Related fixes

See also AI tools launched today on the daily board.