[BUG] WSL2: Claude Code 2.1.118 crashes on startup - ENOEXEC when spawning reg.exe
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
- OS: WSL2 Ubuntu (kernel 5.15.153.1-microsoft-standard-WSL2)
- Windows: Windows 10/11
- Claude Code version: 2.1.118
- Bun version: 1.3.13 (Linux x64 baseline)
What happens
Claude Code 2.1.118 crashes immediately on startup with ENOEXEC when
trying to spawn reg.exe using its absolute Windows path. The previous
version 2.1.117 works fine.
Error message
ENOEXEC: unknown error, posix_spawn '/mnt/c/Windows/System32/reg.exe'
path: "/mnt/c/Windows/System32/reg.exe",
syscall: "posix_spawn",
errno: -8,
code: "ENOEXEC"
at spawn (node:child_process:667:35)
at spawn (node:child_process:14:39)
at execFile (node:child_process:59:20)
Expected behavior
Claude Code should handle gracefully the case where reg.exe cannot be
executed in WSL2, instead of crashing. Version 2.1.117 handled this correctly.
Workaround
Downgrade to 2.1.117:
npm install -g @anthropic-ai/claude-code@2.1.117
What Should Happen?
Claude Code should handle gracefully the case where reg.exe cannot be executed in WSL2 (catch the error silently and continue startup), instead of crashing immediately. Version 2.1.117 handled this correctly.
Error Messages/Logs
ENOEXEC: unknown error, posix_spawn '/mnt/c/Windows/System32/reg.exe'
path: "/mnt/c/Windows/System32/reg.exe",
syscall: "posix_spawn",
errno: -8,
code: "ENOEXEC"
at spawn (node:child_process:667:35)
at spawn (node:child_process:14:39)
at execFile (node:child_process:59:20)
at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:188:1452)
at new Promise (1:11)
at gl6 (/$bunfs/root/src/entrypoints/cli.js:188:1422)
at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:188:1602)
at $W$ (/$bunfs/root/src/entrypoints/cli.js:188:1822)
at Ql6 (/$bunfs/root/src/entrypoints/cli.js:188:1861)
Bun v1.3.13 (Linux x64 baseline)
Steps to Reproduce
- Install WSL2 with Ubuntu on Windows
- Ensure Windows PATH is accessible from WSL2 (default behavior)
- Confirm reg.exe is visible: which reg.exe → /mnt/c/Windows/system32/reg.exe
- Install Claude Code 2.1.118: npm install -g @anthropic-ai/claude-code@2.1.118
- Run: claude
- Claude Code crashes immediately with ENOEXEC error
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.117
Claude Code Version
2.1.118
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
- reg.exe is accessible via WSL2 interop at /mnt/c/Windows/System32/reg.exe
- Claude Code calls reg.exe using its absolute Windows path directly (not via PATH),
so workarounds like PATH manipulation or fake wrappers don't work
- Workaround: downgrade to 2.1.117
npm install -g @anthropic-ai/claude-code@2.1.117
- The error also occurs during installation (curl -fsSL https://claude.ai/install.sh | bash)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗