CORE JSC

International Technology Partnership

Roo Tools

Fixing Roo Code search_files Tool Failures: The "No Results" Bug and Solutions

A comprehensive guide to diagnosing and fixing the "Could not find ripgrep binary" error in Roo Code's search_files tool, including simplified and technical explanations in both English and Arabic.

Core JSC Team·May 30, 2026
Roo Codesearch_filesTroubleshootingVS CoderipgrepBug Fix
Fixing Roo Code search_files Tool Failures: The "No Results" Bug and Solutions

Fixing Roo Code search_files Tool Failures: The "No Results" Bug and Solutions

Simplified Explanation

The Problem

Imagine you're trying to find a specific word in a huge book, but your bookmark is missing. That's exactly what happened with Roo Code's search_files tool — it couldn't find the "bookmark" (ripgrep) it needs to search through your code files.

Why It Happened

Roo Code uses a tool called ripgrep (rg) to search files. It's like a super-fast search engine for code. But Roo Code was looking for ripgrep in a specific drawer that didn't exist:

  • It looked for @vscode/ripgrep/bin/rg.exe
  • But the actual file was in @vscode/ripgrep-universal/bin/win32-x64/rg.exe

Two things were wrong:

  1. The folder name was different: ripgrep vs ripgrep-universal
  2. There was an extra subfolder: win32-x64

The Quick Fix

We simply told Roo Code the correct path by editing its source code. We added the real path to its search list, and now it finds ripgrep every time.


Technical Deep Dive

Architecture of search_files

The search_files tool in Roo Code relies on the ripgrep (rg) binary for fast regex-based file searching. The tool's implementation is in the extension's bundled JavaScript file at:

C:\Users\Core\.vscode\extensions\rooveterinaryinc.roo-code-nightly-0.0.8179\dist\extension.js

The key function is getBinPath(vscodeAppRoot) (line 87313), which searches for the rg.exe binary in a hardcoded list of paths relative to vscode.env.appRoot.

Root Cause Analysis

Cause #1: Missing/Broken ripgrep Binary The getBinPath function only checks 4 hardcoded paths:

  1. node_modules/@vscode/ripgrep/bin/
  2. node_modules/vscode-ripgrep/bin
  3. node_modules.asar.unpacked/vscode-ripgrep/bin/
  4. node_modules.asar.unpacked/@vscode/ripgrep/bin/

It does NOT search the system PATH environment variable.

Cause #2: VS Code Installation via Scoop VS Code was installed via Scoop (a package manager for Windows), which uses the portable version. The portable version ships with @vscode/ripgrep-universal instead of @vscode/ripgrep.

Cause #3: Cross-Platform Directory Structure The ripgrep-universal package supports multiple platforms:

  • win32-x64/rg.exe — Windows 64-bit
  • linux-x64/rg — Linux 64-bit
  • darwin-x64/rg — macOS Intel
  • darwin-arm64/rg — macOS Apple Silicon
  • linux-arm64/rg — Linux ARM64

Each platform has its own subdirectory under bin/, adding an extra path segment that the old code didn't account for.

Cause #4: VS Code Extension Cache After fixing the path, a VS Code window reload was required for the changes to take effect.

The Fix

The fix was a single-line change in extension.js at line 87318:

Before:

return await checkPath("node_modules/@vscode/ripgrep/bin/")
    || await checkPath("node_modules/vscode-ripgrep/bin")
    || await checkPath("node_modules.asar.unpacked/vscode-ripgrep/bin/")
    || await checkPath("node_modules.asar.unpacked/@vscode/ripgrep/bin/");

After:

return await checkPath("node_modules/@vscode/ripgrep-universal/bin/win32-x64/")
    || await checkPath("node_modules/vscode-ripgrep/bin")
    || await checkPath("node_modules.asar.unpacked/vscode-ripgrep/bin/")
    || await checkPath("node_modules.asar.unpacked/@vscode/ripgrep/bin/");

The new path node_modules/@vscode/ripgrep-universal/bin/win32-x64/ was added as the first search location.

Verification

After the fix, running search_files with query function|class on *.ts files returned 26 results successfully.

Prevention

  • This fix is manual and will be overwritten when the Roo Code extension is updated.
  • The permanent solution is for the Roo Code team to add @vscode/ripgrep-universal paths to the getBinPath function in their source code.
  • Alternatively, users can install @vscode/ripgrep globally or symlink the binary to the expected path.