Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
The Agent’s Grep and Glob tools silently return zero results inside any Cursor-managed worktree (Agents Window worktrees). The same Agent, same repo, same query works fine when opened as a regular checkout of main. The failure is silent: there is no error, just “No matches found” / “0 files found”, so agents proceed as if the code doesn’t exist and propose duplicate or wrong implementations.
Why this is high-impact
- The failure mode is silent: zero matches looks identical to “the thing genuinely isn’t there”, so the agent commits to the wrong conclusion and proceeds without retrying. There’s no signal for the agent (or the user) that something is wrong.
- It affects every Cursor user who uses Worktrees, i.e. exactly the workflows Cursor is actively pushing.
- Sub-agents inherit the broken state, so
Task(...)doesn’t escape it. - For exploration-heavy or refactor sessions, it leads to confidently wrong answers (missed call sites, duplicate code) and partial-coverage refactors with no warning to the user.
Likely related reports
- Upstream Claude Code issue with the same behavior on macOS git worktrees: anthropics/claude-code #29794
- Cursor forum thread covering a different trigger but the same symptom: Agent Grep/Glob tools return zero results for nested Git repository directories. My setup is not nested independent repos; I’m hitting the same symptom via the Cursor-managed worktree path.
Steps to Reproduce
- Pick any non-trivial repo. Open it as a regular checkout (not a worktree) in Cursor and start an Agent chat.
- Ask the Agent to
Grepfor any string that exists multiple times in the repo (e.g. an exported constant, a function name). It returns the matches correctly. Same forGlob. - Now create a Cursor worktree of the same repo via the Agents Window.
- In an Agent chat opened against the worktree, ask the Agent to
Grepfor the same string, orGlobfor a known filename pattern. → “No matches found” / “0 files found”, every time. - Confirm the files exist via
Read(works) and shellgrep -rn <string> .(works). So the files are physically present and readable; onlyGrep/Globare blind. - Spawn a sub-agent (e.g.
Task(subagent_type="explore")) inside the same worktree and have it run the sameGrep/Globcalls. → Same zero-result behavior. The bug is workspace-scoped, not session-scoped.
Expected Behavior
Grep and Glob should return the same matches inside a worktree as they do in a regular checkout of the same repo, since the file contents are identical and the working directory is correctly set to the worktree path.
Actual behaviour:
Grep returns No matches found and Glob returns 0 files found, silently and consistently, for any pattern in any worktree. Re-running and waiting for indexing to “warm up” does not fix it; I confirmed it stays broken 15+ minutes after the worktree is created. Read, shell grep/find, and the editor’s “Find in Files” all work normally on the same files in the same worktree, which is what makes me confident this is a tool-side issue rather than a filesystem or ignore-rule issue.
Operating System
MacOS
Version Information
Version: 3.3.30
VSCode Version: 1.105.1
Commit: 3dc559280adc5f931ade8e25c7b85393842acf30
Date: 2026-05-09T18:28:42.332Z
Layout: glass
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 24.6.0
For AI issues: which model did you use?
Opus 4.7 Extra High
For AI issues: add Request ID with privacy disabled
Request ID: 8f85e9a3-49f0-4e51-a269-76fff5338d18
Does this stop you from using Cursor
No - Cursor works, but with this issue