[Bug] VSCode extension on Windows: spawn rg.exe ENOENT in 2.1.120 — bundled rg.exe dropped during native-binary transition

Resolved 💬 3 comments Opened Apr 25, 2026 by X-15 Closed Apr 29, 2026

What's wrong

On Windows, the Claude Code VSCode extension throws spawn rg.exe ENOENT on every file search (e.g., @-mention completion, list_files_request):

[error]   Ripgrep search failed A system error occurred (spawn rg.exe ENOENT)
[warning] Ripgrep search failed, falling back to VSCode findFiles: Error: spawn rg.exe ENOENT

Falls back to vscode.workspace.findFiles, which is noticeably slower for @-mention completion.

Versions

  • Claude Code extension: anthropic.claude-code-2.1.120-win32-x64
  • VSCode Insiders: 1.118.0-insider (also reproduced on VSCode Stable)
  • OS: Windows 11 Pro 26200, x64
  • Node (extension host): v22.22.1

Root cause

The extension resolves rg with no PATH-search logic and no bundled fallback (function qh4 in extension.js):

let V = process.platform === "win32" ? "rg.exe" : "rg";
try { execFileSync(V, ["--version"], { stdio: "ignore" }); } catch {}
return V;

execFile("rg.exe", ...) relies entirely on Windows CreateProcess PATH resolution. Pre-v2.1.113, the npm package shipped vendor/ripgrep/x64-win32/rg.exe and the path resolved inside the package. After the v2.1.113 transition to the statically-compiled claude.exe native binary, resources/native-binary/ contains only claude.exe, and rg.exe is no longer present anywhere in the VSIX. If the user has no system ripgrep on PATH, every spawn fails.

Reproduction (Windows x64)

  1. Fresh Windows machine without ripgrep installed.
  2. Install VSCode (or Insiders) + Claude Code extension v2.1.113+.
  3. Open the Claude Code panel; type @<prefix>.
  4. Observe Ripgrep search failed ... spawn rg.exe ENOENT in the extension log.
  5. List <extension>/resources/native-binary/ — only claude.exe present.

Workarounds

  • System install: scoop install ripgrep or winget install BurntSushi.ripgrep.MSVC puts rg.exe on PATH; execFile resolves correctly.
  • Use VSCode-bundled rg: as the macOS issue (#52211) notes, VSCode itself ships ripgrep at Microsoft VS Code/resources/app/node_modules/@vscode/ripgrep/bin/rg.exe. The extension could require('@vscode/ripgrep').rgPath instead of relying on PATH.
  • Re-bundle rg.exe: ship rg.exe next to claude.exe in resources/native-binary/ for --target win32-x64 builds, restoring pre-v2.1.113 behavior.

Community workaround (Windows-only)

I built a small VSCode extension that bundles ripgrep 15.1.0 and drops rg.exe into Claude Code's resources/native-binary/ folder when missing. Idempotent, watches for Claude Code updates so the patch survives version bumps, and never replaces an existing rg.exe — so if a future Claude Code release ships a bundled binary, this extension gets out of the way without overwriting it.

Source + signed VSIX release: https://github.com/X-15/claude-code-rg-patcher

Disclosure: I built it. Sharing as a stopgap, not a substitute for the upstream fix.

Related

  • #52211 (open, macOS variant — same root cause, different fix paths)
  • #34595 (closed Mar 2026, Windows-specific — bug clearly persists in 2.1.120; this issue supersedes that one)
  • #30602 (closed Apr 2026 — earlier form, closed)

Expected

The VSCode extension should work out of the box on Windows without requiring a system-wide ripgrep install. Either bundle rg.exe in resources/native-binary/ for win32-x64 targets, or use @vscode/ripgrep's rgPath as a cross-platform fallback.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗