Inconsistent results from the grep_search tool

Describe the Bug

The include_pattern parameter behaves oddly. I’m trying to find some text in a .mdx file and the only way to do it seems via * or **/* while other patterns like *.mdx and **/*.mdx do not work.

Request id: b49cb7ba-0591-4665-82a1-ad8e5f6d6e4b

Steps to Reproduce

Create .mdx files and try to look for a text in them.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.3.5 (user setup)
VSCode Version: 1.99.3
Commit: 9f33c2e793460d00cf95c06d957e1d1b8135fad0
Date: 2025-07-30T00:37:52.749Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

After some investigation, I discovered that the issue was caused by having my +personal/ folder in the .gitignore while excluding it in my .cursorignore using !+personal/.

I set it up this way so I can download external repositories, let Cursor index them, and then ask questions or explore the codebase to better understand how things work. This approach significantly speeds up my learning of new libraries.

However, ripgrep (mentioned in the tool description) relies on the .gitignore to exclude files and does not use .cursorignore. Fortunately, ripgrep also supports a .ignore file. I created this file and added the same pattern used in .cursorignore: !+personal/. Now, the grep functionality seems to be working properly.

Another odd thing I noticed is that the codebase_search tool parameter target_directories, which is supposed to restrict the search to a specific directory, does not seem to accept a plain path like +personal/sources/react-complex-tree-main. Instead, it requires a wildcard like +personal/sources/react-complex-tree-main/*. This is problematic because the tool description does not specify this requirement, leading to no results when the agent uses a plain path.

I think these advanced behaviors should be documented and the codebase_search tool description in the system prompt should be fixed.

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