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.
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.