diff --git a/src/core/tools/codebaseSearchTool.ts b/src/core/tools/codebaseSearchTool.ts index 236b066306..700d1b7c7c 100644 --- a/src/core/tools/codebaseSearchTool.ts +++ b/src/core/tools/codebaseSearchTool.ts @@ -17,7 +17,7 @@ export async function codebaseSearchTool( removeClosingTag: RemoveClosingTag, ) { const toolName = "codebase_search" - const workspacePath = getWorkspacePath() + const workspacePath = (cline.cwd && cline.cwd.trim() !== '') ? cline.cwd : getWorkspacePath() if (!workspacePath) { // This case should ideally not happen if Cline is initialized correctly