claude-code - 💡(How to fix) Fix [Bug] Claude Code crashes on WSL when Windows interop is disabled — unguarded reg.exe spawn (ENOEXEC) [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#52504Fetched 2026-04-24 06:05:25
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×1subscribed ×1

Error Message

ENOEXEC: unknown error, posix_spawn '/mnt/c/Windows/System32/reg.exe'

Error Messages/Logs

ENOEXEC: unknown error, posix_spawn '/mnt/c/Windows/System32/reg.exe'

Fix Action

Fix / Workaround

Workaround On affected boxes: avoid the native installer; install via npm at a version that predates the feature (users should not have to bisect to find it — documenting the introducing version would help).

Code Example

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)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Environment

  • Host: Windows with WSL2, interop intentionally disabled (/etc/wsl.conf [interop] enabled=false) for security hardening on a build box
  • WSL distro: Ubuntu on x64
  • Claude Code versions tested: 2.1.118 (latest), 2.1.108 (stable) — both crash
  • Bun: v1.3.13 (Linux x64 baseline)
  • Install method: native installer (curl ... install.sh)

Summary Claude Code unconditionally spawns /mnt/c/Windows/System32/reg.exe on startup. On WSL distros where Windows interop is disabled, that path exists on the /mnt/c mount but cannot be executed (binfmt_misc WSLInterop not registered), so posix_spawn returns ENOEXEC and the process crashes before a prompt is shown. The crash also fires inside install.sh when it invokes the freshly-downloaded binary for setup, which makes rollback via the installer impossible.

Repro

  1. WSL2 distro with /etc/wsl.conf containing [interop]\nenabled=false, wsl --shutdown, reopen.
  2. Confirm interop is off: /mnt/c/Windows/System32/cmd.exe /c ver fails with ENOEXEC.
  3. curl -fsSL https://claude.ai/install.sh | bash -s stable → crashes during "Setting up Claude Code...".
  4. Any attempt to launch claude also crashes with the same stack.

Stack trace 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 execFile (node:child_process:59:20) at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:188:1452) at gl6 (/$bunfs/root/src/entrypoints/cli.js:188:1422) 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)

Expected reg.exe (presumably Chrome native-messaging host registration, ref #41625) should be gated behind a runtime check for working WSL interop — e.g. probe /proc/sys/fs/binfmt_misc/WSLInterop for enabled, or wrap the spawn in try/catch and log-and-skip on ENOEXEC/ENOENT. It should not be on the critical startup path, and it should not fail the installer.

Workaround On affected boxes: avoid the native installer; install via npm at a version that predates the feature (users should not have to bisect to find it — documenting the introducing version would help).

Severity Blocks all Claude Code use on security-hardened WSL build/CI environments.

What Should Happen?

Claude should be able to start up as usual

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)

Steps to Reproduce

Have the latest version of Claude 2.1.118 and be using WSL with interop turned off

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.118

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

No response

extent analysis

TL;DR

The issue can be worked around by installing Claude Code via npm at a version that predates the feature causing the crash, as the native installer crashes due to the disabled Windows interop on WSL.

Guidance

  • To verify if Windows interop is disabled, check the /etc/wsl.conf file for [interop] enabled=false and try running /mnt/c/Windows/System32/cmd.exe /c ver to see if it fails with ENOEXEC.
  • The crash occurs because Claude Code unconditionally spawns /mnt/c/Windows/System32/reg.exe on startup, which cannot be executed when Windows interop is disabled.
  • A potential fix would involve adding a runtime check for working WSL interop before attempting to spawn reg.exe, such as probing /proc/sys/fs/binfmt_misc/WSLInterop for enabled.
  • As a temporary workaround, users can install an earlier version of Claude Code via npm to avoid the crashing feature.

Example

No code example is provided as the issue is related to the installation and configuration of Claude Code rather than a specific code snippet.

Notes

The exact version of Claude Code that introduced this feature is not specified, making it difficult for users to determine which version to install via npm to avoid the issue.

Recommendation

Apply workaround: Install Claude Code via npm at a version that predates the feature causing the crash, as this allows users to bypass the native installer issue and use the software on security-hardened WSL environments.

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