Rg and Glob tools failing on directory search for gitignored paths

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I have a gitignored path that i use to save external repos to let Cursor easily get source references and docs.

I’ve been using this trick for the past year and always worked fine.

The trick is to gitignore a path and then use .cursorignore to un-ignore the same path, so the path is ignored by git but theorically cursor should not ignore it.

Today i’ve noticed that all folder wide tool calls are returning 0 results.

Steps to Reproduce

  1. Add a path to .gitignore eg: +personal/
  2. Add the same path to .cursorignore eg: !+personal/
  3. Also add it to an .ignore file for ripgrep eg: !+personal/

Expected Behavior

Cursor tools should be able to access the files like in any other regular folder.

Operating System

Windows 10/11

Version Information

Version: 2.5.16 (system setup)
VSCode Version: 1.105.1
Commit: 28d8e0b9dedf48f994d5222de1b516f94a48b470
Date: 2026-02-16T13:05:55.280Z
Build Type: Stable
Release Track: Early Access
Electron: 39.3.0
Chromium: 142.0.7444.265
Node.js: 22.21.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: add Request ID with privacy disabled

1f45d47a-c1cd-46f7-a49a-fe13af9434e6

Does this stop you from using Cursor

No - Cursor works, but with this issue

Thanks for the detailed report! The agent’s rg/glob tools respect .gitignore directly, and .cursorignore negation patterns may not fully override that for these terminal-based tools - even though negation works for other Cursor features like Tab, semantic search, and @ mentions. Since you mentioned this worked before, I’ve shared this with the team as a possible regression.

In the meantime, a couple of alternative approaches that should work well for your use case:

  1. Add as a workspace folder: Instead of placing external repos inside your gitignored path, use File > Add Folder to Workspace to add the external repo directory separately. This way it’s a proper workspace root and won’t be subject to your project’s .gitignore rules at all.

  2. Clone outside your project: Place the reference repos somewhere outside your project tree (e.g., a sibling directory or /tmp), then add that folder to your workspace using the method above. This keeps your project clean while giving the agent full directory-wide search capability over those reference sources.

Either approach avoids the gitignore/cursorignore conflict entirely. More on ignore file behavior here: Ignore Files docs

1 Like

In 2.5.17 (7b98dcb824ea96c9c62362a5e80dbf0d1aae4770), I’ve found

  • Semantic search tool respects .cursorignore globs
  • Grep tool does not respect .cursorignore globs
  • Adding a glob to a .ignore file seems to work correctly for both the grep tool and rg in agent terminal. So files can be un-ignored via a .ignore file.

Might want to highlight that in the Ignore files docs.

1 Like

Great findings @Guillaume_Jones ! I’ve passed along the docs suggestion as well.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.