Glob and Grep tools cannot search gitignored directories, even with explicit path parameter

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The Glob and Grep tools respect .gitignore exclusions even when explicitly targeting gitignored directories. This makes these tools unusable for workspaces where .gitignore is used to protect sensitive data from version control, but that data is the primary working content.

Steps to Reproduce

Steps to Reproduce:

Create a workspace with a directory like customers/ that contains working files
Add customers/ to .gitignore (to prevent accidental commits of sensitive data)
Use Glob to search: customers/**/*.md → Returns 0 results
Use Glob with explicit target_directory parameter pointing to the gitignored path → Works
Use Grep with explicit path parameter pointing to the gitignored path → Still fails

Expected Behavior

.gitignore should control version control scope, not search scope
.cursorignore negation patterns (e.g., !customers/) should override .gitignore directory exclusions
Glob/Grep with explicit path parameters should search the specified location regardless of .gitignore

Operating System

MacOS

Version Information

Version: 3.1.15 (Universal)
VSCode Version: 1.105.1
Commit: 3a67af7b780e0bfc8d32aefa96b8ff1cb8817f80
Date: 2026-04-15T01:46:06.515Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.4.0

For AI issues: which model did you use?

Doesn’t matter … the problem is the glob tool

For AI issues: add Request ID with privacy disabled

Also doesn’t matter… the problem is the glob tool

Additional Information

Actual Behavior:

Glob ignores gitignored directories unless target_directory is explicitly set
Grep fails on gitignored directories even with explicit path parameter
.cursorignore negation (!customers/) does NOT override .gitignore directory exclusions (confirmed after restart/reindex)
SemanticSearch works correctly on gitignored directories (inconsistent behavior)
Workarounds Found:

Glob: Use target_directory parameter with absolute path
Grep: None (broken even with explicit path)
SemanticSearch: Works as expected
Impact:

This breaks workflows where .gitignore protects sensitive data (customer records, personal notes) from version control, but that data needs to be searchable by the agent. Removing directories from .gitignore is not an option as it would expose them to template merge operations and accidental commits.

Environment:

Cursor version: [your version]
OS: macOS
Workspace has .gitignore with directory-level exclusions
Suggested Fix:

Either:

Add a setting to disable .gitignore respect for Glob/Grep tools
Make .cursorignore negation patterns actually override .gitignore for directory-level exclusions
Fix Grep to respect explicit path parameter regardless of .gitignore

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Thanks for the detailed report here. It is indeed not the desired behavior. The issue is that .cursorignore allowlist / negation patterns were not taking precedence over .gitignore for these tools the way they should. That’s why Glob only worked when you explicitly set target_directory, while Grep could still fail even with an explicit path.

We’ve merged a fix for this, but it’s not yet in the public release builds quite yet.

It should make its way into 3.2.x release builds.

Thanks!