Agent/Composer Grep tool ignores path parameter in multi-root workspaces, searches all roots instead

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

In a multi-root workspace, Cursor’s internal search/grep tool (used by Agent, Composer, and other AI features) ignores the path parameter and spawns a separate rg (ripgrep) process for every workspace root folder. This makes even simple, tightly-scoped searches extremely slow – often timing out or taking minutes – because every workspace folder is traversed in parallel regardless of the requested search scope. It will also return results from ALL workspace folders rather than the one targeted.

Steps to Reproduce

  1. Open a multi-root workspace in Cursor containing many repositories (e.g., 10+ folders, with multiple large codebases of 7,000+ source files).
  2. Start an Agent or Composer chat session.
  3. Ask the agent to search for a specific string in one particular repository (e.g., “search for SomeClassName in my-repo”).
  4. Observe that the Grep tool call specifies a path scoped to only that one repository folder.
  5. The search either takes minutes or times out/aborts entirely.
  6. For comparison, run the same search manually in a terminal using Cursor’s bundled ripgrep:
    “\resources\app\node_modules@vscode\ripgrep\bin\rg.exe” “SomeClassName” “\my-repo\src” --stats

This completes in approximately 3 seconds as opposed to minutes. (relative to your repositories, of course)

Expected Behavior

When the Grep tool is called with a path parameter pointing to a specific folder or subfolder, only the workspace root that contains that path (or just that subtree) should be searched. Cursor should not fan out across all workspace roots. A search scoped to a single repository should complete in seconds (matching raw rg performance), not minutes.

Operating System

Windows 10/11

Version Information

Cursor IDE 2.5.26

Additional Information

Having multiple large repositories/folders in my workspace is important to my workflow in order to be able to cross references code and documentation that are in different repositories.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the thorough report. It’s really helpful that you traced it back to ripgrep behavior with path scoping.

We’re tracking some related but different multi-root workspace issues, like wrong path resolution Wrong path for added folder to workspace and non-clickable file links Code reference links in chat only resolve against the first workspace folder in multi-root workspaces, so file links for other folders aren't clickable. But the grep tool ignoring the path parameter is a separate issue, and we’ve now logged it.

No ETA yet, but your report helps us prioritize.

Workaround for now: open each large repo in a separate Cursor window. It’s not ideal for cross-referencing, but it should get search performance back to normal.

1 Like