[BUG] cygpath: command not found error when running Claude Code in PowerShell/Windows Terminal
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?
Description
Claude Code fails to execute in PowerShell and Windows Terminal on Windows due to attempting to use the cygpath command, which is only available in Git Bash/MINGW/Cygwin environments. The tool works
correctly in Git Bash but crashes in native Windows shells.
Environment
- OS: Windows 10/11 (MINGW64_NT-10.0-26100)
- OS Version: MINGW64_NT-10.0-26100 3.6.3-7674c51e.x86_64
- Platform: win32
- Claude Code Version: [check with claude --version if available]
- Claude Code Executable Path: B:/~BUN/root/claude.exe
- Node.js Version: [if known]
Shells Tested
- ✓ Git Bash (MINGW64): Works correctly
- ✗ PowerShell: Fails with error
- ✗ Windows Terminal: Fails with error
Working Directory
C:\Projects_POC\adw_mcp\adw_mcp (Git repository)
Steps to Reproduce
- Open PowerShell or Windows Terminal (not Git Bash)
- Navigate to any directory (tested with a Git repository)
- Run claude command to start Claude Code
- Observe the error
What Should Happen?
Expected Behavior
Claude Code should work in all Windows shell environments (PowerShell, CMD, Windows Terminal, Git Bash) without requiring Cygwin-specific utilities.
Actual Behavior
Claude Code crashes with the following error:
Sublimating… (esc to interrupt)
- /usr/bin/bash: line 1: cygpath: command not found
-
- genericNodeError (node:child_process:1010:22)
- checkExecSyncError (node:child_process:470:27)
- execSync (node:child_process:278:31)
- wY (B:/~BUN/root/claude.exe:54:3338)
- Gb (B:/~BUN/root/claude.exe:70:418)
- tpI (B:/~BUN/root/claude.exe:4530:25154)
- pk (B:/~BUN/root/claude.exe:4530:28328)
- <anonymous> (B:/~BUN/root/claude.exe:4530:28096)
- some (native:1:11)
- <anonymous> (B:/~BUN/root/claude.exe:4530:28088)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: Command failed: cygpath -u 'c:\projects_poc\adw_mcp\adw_mcp'
/usr/bin/bash: line 1: cygpath: command not found
at genericNodeError (node:child_process:1010:22)
at checkExecSyncError (node:child_process:470:27)
at execSync (node:child_process:278:31)
at wY (B:/~BUN/root/claude.exe:54:3338)
at Gb (B:/~BUN/root/claude.exe:70:418)
at tpI (B:/~BUN/root/claude.exe:4530:25154)
at pk (B:/~BUN/root/claude.exe:4530:28328)
at <anonymous> (B:/~BUN/root/claude.exe:4530:28096)
at some (native:1:11)
at <anonymous> (B:/~BUN/root/claude.exe:4530:28088)
Root Cause Analysis
The error indicates Claude Code is attempting to execute:
cygpath -u 'c:\projects_poc\adw_mcp\adw_mcp'
The cygpath utility is only available in Cygwin/MINGW/Git Bash environments and is used to convert Windows paths to Unix-style paths. When running in native Windows shells (PowerShell, CMD, Windows
Terminal), this command is not available, causing the crash.
Expected Fix
Claude Code should:
- Detect the current shell environment
- Only use cygpath when running in Cygwin/MINGW/Git Bash
- Use native Windows path handling in PowerShell/CMD/Windows Terminal
- Or use Node.js built-in path utilities (path.resolve(), path.normalize()) that work cross-platform
Current Workaround
Use Git Bash instead of PowerShell or Windows Terminal when running Claude Code on Windows.
Additional Context
- Git is installed and available in PATH
- The repository is a valid Git repository
- All operations work correctly when using Git Bash
- The issue appears to be related to shell environment detection/path conversion logic
Error Messages/Logs
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: Command failed: cygpath -u 'c:\projects_poc\adw_mcp\adw_mcp'
/usr/bin/bash: line 1: cygpath: command not found
at genericNodeError (node:child_process:1010:22)
at checkExecSyncError (node:child_process:470:27)
at execSync (node:child_process:278:31)
at wY (B:/~BUN/root/claude.exe:54:3338)
at Gb (B:/~BUN/root/claude.exe:70:418)
at tpI (B:/~BUN/root/claude.exe:4530:25154)
at pk (B:/~BUN/root/claude.exe:4530:28328)
at <anonymous> (B:/~BUN/root/claude.exe:4530:28096)
at some (native:1:11)
at <anonymous> (B:/~BUN/root/claude.exe:4530:28088)
Steps to Reproduce
Steps to Reproduce
- Open PowerShell or Windows Terminal (not Git Bash)
- Navigate to any directory (tested with a Git repository)
- Run claude command to start Claude Code
- Observe the error
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.15
Claude Code Version
2.1.15
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
The version is the same thing, the error started occurring when I switched from the npm installation to the claude native installation. I got a popup stating I should switch to the native installation following the new version release. Once I ran claude install and switched to the native installation, I started getting errors like the following:
<img width="1809" height="680" alt="Image" src="https://github.com/user-attachments/assets/8dbad0fd-8beb-4781-9c71-369cf265ffe5" />
<img width="898" height="332" alt="Image" src="https://github.com/user-attachments/assets/8643331b-e930-4d5b-abed-d334ed374e0f" />
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗