[BUG]

Resolved 💬 1 comment Opened Jun 4, 2026 by NK-Z Closed Jul 8, 2026

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?

"Crash on Windows: cygpath not found causes unhandled execSync
error" --body "$(cat <<'EOF'
## Bug Description

Claude Code crashes on startup on Windows with an unhandled execSync error when cygpath is not available. The code
unconditionally calls cygpath -u without checking if it exists, and does not catch the error gracefully.

This also affects the Bash tool during an active session — every Bash invocation triggers the same crash.

## Error

ERROR Command failed: cygpath -u 'c:\users\nalzamil'

node:child_process:1010:22

  • genericNodeError (node:child_process:1010:22)
  • checkExecSyncError (node:child_process:470:27)
  • execSync (node:child_process:278:31)
  • iK (B:/~BUN/root/claude.exe:46:3503)
  • QR (B:/~BUN/root/claude.exe:63:418)
  • JoI (B:/~BUN/root/claude.exe:6128:4803)
  • Kg (B:/~BUN/root/claude.exe:6128:8013)
  • (B:/~BUN/root/claude.exe:6128:7781)
  • some (native:1:11)
  • (B:/~BUN/root/claude.exe:6128:7773)

## Environment

  • Platform: Windows (win32)
  • Terminals tested: PowerShell, Git Bash — both crash
  • Claude Code binary: Standalone exe (B:/~BUN/root/claude.exe)

## Suggested Fix

Wrap the cygpath execSync call in a try/catch and fall back to the original Windows path if cygpath is
unavailable, or use Node.js built-in path.posix / path.win32 for path conversion instead of shelling out.
EOF

What Should Happen?

Claude Code should handle a missing cygpath gracefully — either fall back to native Windows paths or provide a clear
error message telling the user what's needed.

Error Messages/Logs

## Error

  ERROR  Command failed: cygpath -u 'c:\users\nalzamil'

  node:child_process:1010:22

  - genericNodeError (node:child_process:1010:22)
  - checkExecSyncError (node:child_process:470:27)
  - execSync (node:child_process:278:31)
  - iK (B:/~BUN/root/claude.exe:46:3503)
  - QR (B:/~BUN/root/claude.exe:63:418)
  - JoI (B:/~BUN/root/claude.exe:6128:4803)
  - Kg (B:/~BUN/root/claude.exe:6128:8013)
  -  (B:/~BUN/root/claude.exe:6128:7781)
  - some (native:1:11)
  -  (B:/~BUN/root/claude.exe:6128:7773)

Steps to Reproduce

  1. Install Claude Code standalone exe on Windows
  2. Open PowerShell or CMD (not Git Bash/WSL)
  3. Run claude to start Claude Code
  4. Claude Code crashes immediately with the cygpath error

Alternative reproduction (Git Bash):

  1. Open Git Bash where cygpath is not on PATH
  2. Run claude
  3. Same crash occurs

In-session reproduction:

  1. If Claude Code does manage to start, attempt to use any Bash tool call
  2. The Bash tool also crashes with the same cygpath error

You can also add this line to help the maintainers reproduce it:

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.1.37

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗