VSCode extension crashes with OOM after ripgrep EAGAIN spawn failures

Resolved 💬 6 comments Opened Feb 1, 2026 by mgosha Closed Mar 3, 2026

Description

Claude Code VSCode extension crashes with exit code 1 and "Out of memory" error after repeated ripgrep spawn failures. The ripgrep failures are misreported as "20 second timeouts" when they actually fail immediately with EAGAIN.

Environment

  • Claude Code version: 2.1.27
  • OS: AlmaLinux 9 (RHEL-based)
  • VSCode: Remote SSH session
  • RAM: 31GB (25GB available)
  • Project size: ~30K files, 1.1GB (Node.js monorepo with node_modules)

Steps to Reproduce

  1. Open a medium-to-large Node.js project via VSCode Remote SSH
  2. Start a Claude Code session
  3. Send a message that triggers file search (e.g., "Add these suggestions to the plan document file")
  4. Session crashes with "Claude Code process exited with code 1"

Expected Behavior

Claude should search files without crashing, or gracefully handle spawn failures.

Actual Behavior

  1. Ripgrep spawn fails with EAGAIN error
  2. Retry with single-threaded mode (-j 1)
  3. Immediate ABORT_ERR (not a real timeout)
  4. Misleading "RipgrepTimeoutError: timed out after 20 seconds" even though only milliseconds elapsed
  5. Eventually crashes with "RangeError: Out of memory"

Log Evidence

Ripgrep spawn failure (happens within milliseconds, not 20 seconds):

2026-02-01T08:34:12.115Z [DEBUG] rg EAGAIN error detected, retrying with single-threaded mode (-j 1)
2026-02-01T08:34:12.134Z [DEBUG] rg error (signal=undefined, code=ABORT_ERR, stderr: ), 0 results
2026-02-01T08:34:12.134Z [ERROR] "RipgrepTimeoutError: Ripgrep search timed out after 20 seconds..."

OOM crash:

2026-02-01T08:34:30.523Z [ERROR] "RangeError: RangeError: Out of memory
    at unshift (unknown)
    at KVH (/$bunfs/root/claude:5136:1079)
    at async AC$ (/$bunfs/root/claude:5137:4346)..."

Final crash:

2026-02-01 02:34:31.011 [error] Error from Claude (on channel 50t4z00zad7): Error: Claude Code process exited with code 1

Analysis

  1. EAGAIN spawn failures - The ripgrep process fails to spawn (EAGAIN = "Resource temporarily unavailable"), but this is incorrectly reported as a timeout
  2. Memory leak in retry loop - The repeated spawn/retry cycle appears to leak memory until OOM
  3. Timestamps prove no timeout - The "20 second timeout" errors occur within milliseconds of the EAGAIN errors

Additional Context

  • There was also a plugin marketplace cache corruption: fatal: Cannot rebase onto multiple branches
  • The project has a proper .gitignore excluding node_modules/
  • System has 524288 open file limit and unlimited virtual memory

Workaround

Created a .claudeignore file to reduce scan scope:

node_modules/
dist/
.wrangler/
.git/

And cleaned up corrupted plugin cache:

rm -rf ~/.claude/plugins/marketplaces/claude-plugins-official

View original on GitHub ↗

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