Index Repositories for Instant Grep - .cursorignore regression

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The docs state that you can override .gitignore and default ignore list exclusions with negations in .cursorignore. But when “Index Repositories for Instant Grep” is enabled, the negations in .cursorignore cannot override .gitignore exclusions. I have not tested overriding the default ignore list exclusions.

I was using this behaviour to leave certain specs, docs, etc. available for location/inclusion in context by the agent while not committing them to the project. The agent doesn’t always automatically fallback to searching with the shell, nor should it have to.

Steps to Reproduce

Have a .gitignore with:

testfile

a .cursorignore with:

!testfile

and “Index Repositories for Instant Grep” enabled. The agent can’t find testfile using the Grep or Glob tools.

Turn that setting off and reload the window. The agent is able to find testfile using the Grep/Glob tools.

Expected Behavior

Regardless of whether “Index Repositories for Instant Grep” is enabled or disabled, the agent must be able to find the negated exclusions (testfile above) using the Grep/Glob tools.

Operating System

MacOS

Version Information

Version: 3.15.19
VS Code Extension API: 1.128.0
Commit: de07bee81cefe43461ebf4f40c3d2d78d15052a0
Date: 2026-08-11T05:22:54.627Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 25.6.0

For AI issues: which model did you use?

Model name: Auto, Grok 4.6

Additional Information

This worked prior to the introduction of local indexing/replacement of server-side embeddings/indexing

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. The repro steps really helped.

Confirmed: this isn’t intended behavior, and it’s not something in your config. The documented behavior for ! negations in .cursorignore works for the regular search path, but when “Index Repositories for Instant Grep” is enabled, the indexing path doesn’t respect it yet. That’s why turning the setting off fixes it. We’re tracking this issue. I can’t share an exact ETA yet, but I’ll reply here once there’s an update.

For now, your workaround is solid: turn off “Index Repositories for Instant Grep” and reload the window. As an alternative, if you don’t want to lose instant grep, you can add the folder you need as a separate workspace folder. Then its files are available to the agent directly.

Let me know if neither option works for your setup.

I can confirm that the issue is also present on the most recent Windows version:

Version: 3.16.29 (system setup)
VS Code Extension API: 1.128.0
Commit: 6246455961129c32969845e00aa25d87ae926ec0
Date: 2026-08-18T01:26:26.285Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.26200

Hey @deanrie, any update on this issue?

Hey @danielfinke, thanks for the ping.

No change on status yet. We’re still tracking the issue, but I don’t have an exact ETA and I won’t promise timelines. As soon as I have an update, I’ll reply here in the thread.

The workaround is the same and still works: turn off Index Repositories for Instant Grep and reload the window. Or, if you don’t want to lose instant grep, add the folder you need as a separate workspace folder, then its files are available to the agent directly.

If neither option fits your setup, let me know and we’ll see what else we can do.

@deanrie

Neither of those options are acceptable workarounds. I clearly don’t want to lose the speed benefits of instant grep.

Regarding your other suggestion, consider, for example, a node_modules folder. It needs to stay in its given project so the code runs, but we don’t want it committed to a repository. So your workaround would require us to copy that node_modules to a separate folder, doubling its footprint and adding the burden of keeping the contents of the two folders in-sync. Even if we did set all that up, consider what the AI agent will do: It’s going to want to look in the node_modules folder that’s part of the project, not in some other, unrelated location. It just doesn’t work.

For completeness, the bug is still present on the most recent version:

Version: 3.22.12 (system setup)
VS Code Extension API: 1.128.0
Commit: 3a92974361033b2051526321308c2740fe5912c0
Date: 2026-09-26T04:55:12.125Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.26200

@deanrie @danielfinke — sharing what works on my setup (may be a different angle than the OP repro).

Environment

  • Version: 3.23.12 (system setup)
  • VS Code Extension API: 1.128.0
  • Commit: 2d29876d567da1607532b23bbf2cd5ddbca496f0
  • Date: 2026-10-01T04:41:16.627Z
  • Layout: IDE
  • Build Type: Stable
  • Release Track: Default
  • Electron: 42.10.0
  • Chromium: 148.0.7778.280
  • Node.js: 24.18.1
  • V8: 14.8.178.38-electron.0
  • xterm.js: 6.1.0-beta.291
  • OS: Windows_NT x64 10.0.28000

Workspace

  • Opened with File → Open Folder on apps/ (single folder — not a .code-workspace)
  • Hierarchical Cursor Ignore: ON
  • Index Repositories for Instant Grep: ON
  • Multi-repo bench: 21 git repos under one workspace (Frappe / ERPNext / HRMS + custom apps)

Problem I was solving

  • Huge tree (~90k files on disk). I needed fast agent Grep/Glob on framework source only, without disabling Instant Grep and without copying folders to a second workspace root.

What works for me: allowlist .cursorignore (single root file)

One file only: apps/.cursorignore — no per-app copies.

Policy:

  1. Deny everything (*), allow directory traversal (!*/)
  2. Allow only these extensions (Frappe stack):
    py, js, html, css, json, vue, md, yml, po, csv, jinja, txt, scss
  3. Hard-block noise paths (even if extension matches):
    **/.git/, **/node_modules/, **/public/dist/, **/public/frontend/

Example (abbreviated):

.vscode/
*
!*/
!**/*.py
!**/*.js
!**/*.html
!**/*.css
!**/*.json
!**/*.vue
!**/*.md
!**/*.yml
!**/*.po
!**/*.csv
!**/*.jinja
!**/*.txt
!**/*.scss
**/.git/
**/node_modules/
**/public/dist/
**/public/frontend/

Do you have any .gitignores in the sub-repos that are negated by the .cursorignore?

I think this is a bit different, though, as my issue isn’t a workspace or folder of multiple repos - it’s present for a single repo

Hey, thanks for continuing to dig into this. There’s an important distinction here that’s worth calling out.

Status-wise, no change yet. We’re still tracking this issue. I can’t give an ETA and I don’t want to promise a timeline, but I’ll post here as soon as I have an update.

@Leland_Hepworth, your point about node_modules is fair. A separate workspace folder isn’t a universal fix, and I get not wanting to lose Instant Grep speed. Right now, the only reliable workaround is to turn off “Index Repositories for Instant Grep” and reload the window, but I can see that this isn’t workable for your setup.

@danielfinke, your intuition in the last message is right. These really are different cases. The key point is that the Instant Grep index is built from files that git can see.

  • In your case, with one repo, testfile is excluded via .gitignore, so git can’t see it and it never makes it into the index at all. !testfile in .cursorignore can’t bring it back into indexed paths. That’s exactly the issue we’re tracking.
  • @Abdelrahman’s allowlist approach works because those files are git-tracked, not gitignored. He’s narrowing the scope inside the git-visible tree that already exists, not bringing back files that git itself excluded. That’s why .cursorignore negations work for him, but your case, where a gitignored file is re-included, does not.

So Abdelrahman’s allowlist is a good solution for his use case, filtering inside the git-tracked tree, but it doesn’t cover your case where a gitignored file needs to be re-included.

If none of the current options work for your setups, let us know and we can see what else might help.