Describe the Bug
Semantic codebase search tool always returns no results if restricted to a certain directory.
Initially, I thought this was an issue with Gemini 2.5 Pro because I noticed that it had a lot more trouble trying to use codebase search tools compared to something like Claude. However, after running the same tests in both Gemini 2.5 Pro and Claude, they both have the same issue. Perhaps due to Claude’s nature, it doesn’t often encounter this problem as much as Gemini 2.5 Pro does.
codebase_search
tool has this issue.grep_search
tool does not this issue.
Steps to Reproduce
- Ask AI to make two identical semantic codebase search tool calls, the only difference being that one is restricted in a certain directory where a file is guaranteed to exist, and another identical tool call with no restricted directory.
- You should see that the search call that restricted it to a directory, even if the file that you’re looking for is in it, will return no results. Whereas the tool call with no restricted directory should be able to find the file that was in the exact directory which the prior tool call was restricted to.
Expected Behavior
Semantic codebase search tool calls that are restricted to a certain directory should correctly return results.
Screenshots / Screen Recordings
Operating System
Windows 10/11
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.2.1 (user setup)
VSCode Version: 1.99.3
Commit: 031e7e0ff1e2eda9c1a0f5df67d44053b059c5d0
Date: 2025-07-03T06:16:02.610Z
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
Does this stop you from using Cursor
No - Cursor works, but with this issue