claude-code - 💡(How to fix) Fix [Bug] VSCode extension on Windows: spawn rg.exe ENOENT in 2.1.120 — bundled rg.exe dropped during native-binary transition [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53216Fetched 2026-04-26 05:21:24
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1

Error Message

[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

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.

Fix Action

Fix / Workaround

Workarounds

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.

Code Example

[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

---

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

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.

extent analysis

TL;DR

The most likely fix is to bundle rg.exe with the Claude Code extension or use the @vscode/ripgrep module's rgPath as a fallback.

Guidance

  • The issue is caused by the extension relying on the system's PATH to resolve rg.exe, which is no longer bundled with the extension.
  • To verify the issue, check if rg.exe is present in the system's PATH or if the extension's resources/native-binary/ folder contains rg.exe.
  • As a temporary workaround, users can install ripgrep system-wide using scoop install ripgrep or winget install BurntSushi.ripgrep.MSVC.
  • The extension could be modified to use require('@vscode/ripgrep').rgPath instead of relying on the system's PATH.

Example

const rgPath = require('@vscode/ripgrep').rgPath;
// Use rgPath instead of 'rg.exe' in the execFile call

Notes

The community-provided workaround extension, claude-code-rg-patcher, can be used as a temporary solution, but it's recommended to wait for an official fix from the extension authors.

Recommendation

Apply the workaround by using the @vscode/ripgrep module's rgPath as a fallback, as it provides a cross-platform solution and does not require system-wide installation of ripgrep.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING