# Agent Grep/Glob tools return zero results for nested Git repository directories while Read, Shell rg, and editor Find in Files all work

**URL:** <https://forum.cursor.com/t/agent-grep-glob-tools-return-zero-results-for-nested-git-repository-directories-while-read-shell-rg-and-editor-find-in-files-all-work/157610>\
**Category:** Bug Reports\
**Tags:** indexing, context\
**Created:** [April 14, 2026, 10:54am UTC](https://forum.cursor.com/t/agent-grep-glob-tools-return-zero-results-for-nested-git-repository-directories-while-read-shell-rg-and-editor-find-in-files-all-work/157610 "2026-04-14T10:54:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vojtech1010](https://avatars.discourse-cdn.com/v4/letter/v/9dc877/32.png) [@Vojtech1010](https://forum.cursor.com/u/Vojtech1010)\
**Post date:** [April 14, 2026, 10:54am UTC](https://forum.cursor.com/t/agent-grep-glob-tools-return-zero-results-for-nested-git-repository-directories-while-read-shell-rg-and-editor-find-in-files-all-work/157610/1 "2026-04-14T10:54:00Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

When a workspace contains a nested Git repository (a subdirectory with its own .git), the Agent’s built-in Grep and Glob tools cannot find any files or content inside that directory.

The Read tool, terminal rg, Ctrl+Shift+F, and codebase indexing all work correctly for the same paths.

### Steps to Reproduce

1. Create a workspace root that is itself a Git repo.
2. Inside it, have a subdirectory (e.g. implementation/) that is a separate Git repo (has its own .git/).
3. The subdirectory is not in any .gitignore or .cursorignore.
4. Open a multi-root .code-workspace that includes both the parent and the nested repo as folder entries.
5. Confirm Ctrl+Shift+F finds content inside the nested repo.
6. Confirm Cursor Settings \> Indexing & Docs \> View included files lists files from the nested repo.
7. In Agent (Cmd+I or chat), ask it to search for a known string inside the nested repo.

### Expected Behavior

Agent Grep/Glob find matches in the nested repo, same as editor search and indexing.

### Operating System

Windows 10/11

### Version Information

Version: 3.1.10 (user setup)  
VSCode Version: 1.105.1  
Commit: dacbe9b31599a253763e4910eb6ab38704653320  
Date: 2026-04-13T11:39:16.806Z  
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: Windows\_NT x64 10.0.26100

### Additional Information

Tested with both single-root and multi-root .code-workspace — same result.

### Does this stop you from using Cursor

Yes - Cursor is unusable

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [April 14, 2026, 11:10am UTC](https://forum.cursor.com/t/agent-grep-glob-tools-return-zero-results-for-nested-git-repository-directories-while-read-shell-rg-and-editor-find-in-files-all-work/157610/5 "2026-04-14T11:10:16Z")

</div>

Hey, thanks for the detailed report. This is a known issue. Agent Grep and Glob build their search off the git tree, and nested git repos that aren’t registered as submodules with no entry in `.gitmodules` end up invisible to these tools. That’s why Read, terminal `rg`, and `Ctrl+Shift+F` work since they scan the filesystem directly, but Grep and Glob don’t.

I’ve passed this to the team. For now, a workable workaround is to add a rule in `.cursor/rules` so the agent uses the terminal for search:

```plaintext
When searching for files in this project, prefer using terminal commands (find, grep, rg)
instead of the built-in glob/grep tools, as this workspace contains nested git repositories
which the glob/grep tools currently don't handle correctly.

```

Not ideal, but it unblocks you. Let me know if you need anything else.

---

<div class="post-metadata">

**Author:** ![Gdela\_P72](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/gdela_p72/32/105339_2.png) [@Gdela\_P72](https://forum.cursor.com/u/Gdela_P72)\
**Post date:** [April 24, 2026, 11:39am UTC](https://forum.cursor.com/t/agent-grep-glob-tools-return-zero-results-for-nested-git-repository-directories-while-read-shell-rg-and-editor-find-in-files-all-work/157610/8 "2026-04-24T11:39:22Z")

</div>

I have exactly the same problem. My application consists of several modules - each of them is a separate git repository, but the development standards are the same across them. I thus have created a top-level git repo to store our Cursor rules and skills for this application, checked it out locally, and checked out into this folder all the modules as subfolders (note: these are not git submodules, just separate git repos). This works great except the fact that the built-in **Glob** and **Grep** tools do not see the files in subfolders. Only the **SemanticSearch** tool sees them.

I did the workaround, i.e. added rule to use (find, grep, rg) instead of built-in **Glob** and **Grep** , but this is cumbersome when used without auto-run, i.e. with the “Ask Every Time” mode. So it would be great if Cursor fixed the build-in tools to work correctly in such a setup.

BTW, is there a better way to share rules and skills across many highly-related git repos?

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [April 28, 2026, 6:37am UTC](https://forum.cursor.com/t/agent-grep-glob-tools-return-zero-results-for-nested-git-repository-directories-while-read-shell-rg-and-editor-find-in-files-all-work/157610/9 "2026-04-28T06:37:52Z")

</div>

Hey, thanks for confirming. Your setup matches the same case we’re seeing (nested git repos, not submodules). We’re tracking the bug, but I can’t share an ETA for a fix yet. I agree that using a rule with “Ask Every Time” is awkward. Once there’s an update, I’ll reply in the thread.

On sharing rules or skills across repos, here are a few options:

1. User Rules (Cursor Settings \> Rules \> User Rules) apply globally to all projects. This is a good fit for shared dev standards that don’t depend on a specific repo.
2. Project rules in the meta-repo: what you’re already doing, keeping `.cursor/rules/*.mdc` in the top-level repo. This works, but it currently runs into the Grep/Glob bug.
3. Symlink `.cursor/rules` from a shared location into each repo (if you want each module to work as a standalone workspace).

More on rules: [Rules | Cursor Docs](https://cursor.com/docs/rules)

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [August 26, 2026, 7:21am UTC](https://forum.cursor.com/t/agent-grep-glob-tools-return-zero-results-for-nested-git-repository-directories-while-read-shell-rg-and-editor-find-in-files-all-work/157610/13 "2026-08-26T07:21:00Z")

</div>

Hey @Vojtech1010, @Gdela_P72 - I wanted to follow up with an update on this thread.

The issue is still happening and it’s still on our radar: Agent Grep and Glob build their search from the git tree, and nested git repos that aren’t registered as submodules with no entry in `.gitmodules` are invisible to these tools. Updating to the latest version won’t change anything here, the behavior is still the same. I can’t share an ETA for a fix right now.

The working workaround is still the same, a rule that tells the agent to search via the terminal:

```plaintext
When searching for files in this project, prefer using terminal commands (find, grep, rg)
instead of the built-in glob/grep tools, as this workspace contains nested git repositories
which the glob/grep tools currently don't handle correctly.

```

I get that this is annoying with Ask Every Time mode, I agree it’s not ideal. As soon as I have an update, I’ll post it here.

For sharing rules and skills across repos, here are the options as a reminder: User Rules in Cursor Settings \> Rules \> User Rules apply globally to all projects, project rules in the meta repo at `.cursor/rules/*.mdc`, or a symlink for `.cursor/rules` from a shared location into each repo if you need modules to work as separate workspaces. More details: [Rules | Cursor Docs](https://cursor.com/docs/rules)

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [October 1, 2026, 2:53pm UTC](https://forum.cursor.com/t/agent-grep-glob-tools-return-zero-results-for-nested-git-repository-directories-while-read-shell-rg-and-editor-find-in-files-all-work/157610/14 "2026-10-01T14:53:39Z")

</div>

Good news: I re-tested this on 3.23.13 with a nested git repo (no .gitmodules) inside a git workspace, and the agent’s Grep and Glob tools now find files inside the nested repo. If you update and still see misses, please reply with your layout and I’ll take another look.
