[BUG] Critical Bug - Claude Code forces non-existent cygpath on Windows, ignoring available shells
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:
- Claude Code Version: 1.0.112 (installed via npm)
- Platform: Windows 10/11 (win32)
- Node Version: v22.18.0
- Available Shells: WSL (installed), Git Bash (installed), PowerShell, CMD
- Cygwin: NOT installed
- Working Directory: C:\Users\13581432
Issue Description:
Claude Code v1.0.112 fails to execute ANY commands on Windows, forcing the use of cygpath (a Cygwin utility) even when:
- Cygwin is NOT installed on the system
- WSL is installed and available
- Git Bash/MSYS is installed and available
- Running FROM within Git Bash terminal
- The same setup worked 3 days ago (before update)
Error Messages:
- When trying to run any bash command:
Error: No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL environment variable set.
- When using file tools (Glob, etc.):
Error: Command failed: cygpath -u 'C:\Users\13581432'
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:915:11)
at execSync (node:child_process:987:15)
at Tk (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:755:1044)
...
status: 4294967295,
signal: null,
pid: 29168,
stdout: <Buffer 49 00 6e 00 76 00 61 00 6c 00 69 00 64 00...>
Steps to Reproduce:
- Install Claude Code on Windows: npm install -g @anthropic-ai/claude-code
- Run claude from PowerShell, CMD, or Git Bash
- Try any command like dir, ls, or use file tools
- Observe cygpath error even though cygwin is not installed
Attempted Solutions (All Failed):
- ✗ Running from PowerShell
- ✗ Running from Git Bash terminal
- ✗ Running from WSL terminal
- ✗ Setting environment variables:
- $env:SHELL = "C:\Windows\System32\wsl.exe"
- $env:SHELL = "/usr/bin/bash"
- $env:MSYS_NO_PATHCONV = 1
- $env:WSL_DISTRO_NAME = "Ubuntu"
- ✗ Running with wsl claude
- ✗ Using Git Bash's MSYS environment
- ✗ Creating fake cygpath.bat (causes path mangling: C:\Users becomes C:\c\Users)
Root Cause:
Claude Code v1.0.112 has hardcoded dependency on cygpath for Windows path conversion without:
- Checking if cygpath/Cygwin exists
- Falling back to WSL's wslpath
- Using Git Bash's MSYS path handling
- Supporting native Windows paths
Comparison:
- Work laptop: Fails with cygpath error (no Cygwin installed)
- Personal laptop: Works (possibly has different version or Cygwin remnants)
- 3 days ago: Worked on same work laptop (before update)
Expected Behavior:
Claude Code should:
- Detect available shells (WSL, Git Bash, PowerShell)
- Use appropriate path conversion for detected environment
- NOT require Cygwin/cygpath when other shells are available
- Fall back gracefully when cygpath doesn't exist
Impact:
Claude Code is completely unusable on Windows systems without Cygwin, making it a showstopper bug for Windows users.
What Should Happen?
Expected Behavior:
Claude Code should:
- Detect available shells (WSL, Git Bash, PowerShell)
- Use appropriate path conversion for detected environment
- NOT require Cygwin/cygpath when other shells are available
- Fall back gracefully when cygpath doesn't exist
Error Messages/Logs
dows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\13581432> export CLAUDE_SHELL="/mnt/c/Windows/System32/wsl.exe"
export : The term 'export' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:2
+ export CLAUDE_SHELL="/mnt/c/Windows/System32/wsl.exe"
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (export:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\13581432> export SHELL="/mnt/c/Windows/System32/wsl.exe"
export : The term 'export' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+ export SHELL="/mnt/c/Windows/System32/wsl.exe"
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (export:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\13581432> export NO_CYGPATH=1
export : The term 'export' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+ export NO_CYGPATH=1
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (export:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\13581432>
PS C:\Users\13581432> $env:SHELL = "C:\Windows\System32\wsl.exe"
PS C:\Users\13581432> $env:BASH = "C:\Windows\System32\wsl.exe"
PS C:\Users\13581432> $env:BASH_PATH = "C:\Windows\System32\wsl.exe"
PS C:\Users\13581432> claude
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Do you trust the files in this folder? │
│ │
│ C:\Users\13581432 │
│ │
│ Claude Code may read, write, or execute files contained in this directory. This can pose security risks, so only use files and bash commands from │
│ trusted sources. │
│ │
│ Execution allowed by: │
│ │
│ • .claude/settings.local.json │
│ │
│ Learn more ( https://docs.anthropic.com/s/claude-code-security ) │
│ │
│ ❯ 1. Yes, proceed │
│ 2. No, exit │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Enter to confirm · Esc to exit
╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code! │
│ │
│ /help for help, /status for your current setup │
│ │
│ cwd: C:\Users\13581432 │
╰───────────────────────────────────────────────────╯
> cwd C:\Users\13581432\OneDrive - Signet Jewelers\Documents\healthcheck
● I'll help you with tasks in the healthcheck directory. What would you like me to do?
> whats in the folder
● Bash(dir)
⎿ Error: No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL
environment variable set.
● Bash(cmd /c dir)
⎿ Error: No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL
environment variable set.
● Let me try a different approach to list the contents:
Error: Command failed: cygpath -u 'C:\Users\13581432'
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:915:11)
at execSync (node:child_process:987:15)
at Tk (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:755:1044)
at XqB (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:2697)
at da (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3698)
at file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3484
at Array.some (<anonymous>)
at nq (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3474) {
status: 4294967295,
signal: null,
output: [
null,
<Buffer 49 00 6e 00 76 00 61 00 6c 00 69 00 64 00 20 00 63 00 6f 00 6d 00 6d 00 61 00 6e 00 64 00 20 00 6c 00 69 00 6e 00 65 00 20 00 61 00 72 00 67 00 75 00 ... 154 more bytes>,
<Buffer >
],
pid: 29168,
stdout: <Buffer 49 00 6e 00 76 00 61 00 6c 00 69 00 64 00 20 00 63 00 6f 00 6d 00 6d 00 61 00 6e 00 64 00 20 00 6c 00 69 00 6e 00 65 00 20 00 61 00 72 00 67 00 75 00 ... 154 more bytes>,
stderr: <Buffer >
}
ERROR Command failed: cygpath -u 'C:\Users\13581432'
node:internal/errors:983:15
- genericNodeError (node:internal/errors:983:15)
- wrappedFn (node:internal/errors:537:14)
- checkExecSyncError (node:child_process:915:11)
- execSync (node:child_process:987:15)
- Tk (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:755:1044)
- XqB (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:2697)
- da (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3698)
- (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3484)
- at Array.some (<anonymous>)
- nq (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3474)
PS C:\Users\13581432> echo '@echo %2' > C:\Windows\cygpath.bat
out-file : Access to the path 'C:\Windows\cygpath.bat' is denied.
At line:1 char:2
+ echo '@echo %2' > C:\Windows\cygpath.bat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], UnauthorizedAccessException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
PS C:\Users\13581432>
PS C:\Users\13581432> echo '@echo %2' > C:\Windows\System32\cygpath.bat
out-file : Access to the path 'C:\Windows\System32\cygpath.bat' is denied.
At line:1 char:3
+ echo '@echo %2' > C:\Windows\System32\cygpath.bat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], UnauthorizedAccessException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
PS C:\Users\13581432> echo '@echo %2' > C:\Windows\cygpath.bat
out-file : Access to the path 'C:\Windows\cygpath.bat' is denied.
At line:1 char:3
+ echo '@echo %2' > C:\Windows\cygpath.bat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], UnauthorizedAccessException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
PS C:\Users\13581432> echo '@echo %2' > C:\Users\13581432\cygpath.bat
PS C:\Users\13581432> claude
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Do you trust the files in this folder? │
│ │
│ C:\Users\13581432 │
│ │
│ Claude Code may read, write, or execute files contained in this directory. This can pose security risks, so only use files and bash commands from │
│ trusted sources. │
│ │
│ Execution allowed by: │
│ │
│ • .claude/settings.local.json │
│ │
│ Learn more ( https://docs.anthropic.com/s/claude-code-security ) │
│ │
│ ❯ 1. Yes, proceed │
│ 2. No, exit │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Enter to confirm · Esc to exit
╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code! │
│ │
│ /help for help, /status for your current setup │
│ │
│ cwd: C:\Users\13581432 │
╰───────────────────────────────────────────────────╯
> do an ls
● Bash(ls)
⎿ Error: No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL
environment variable set.
● Bash(dir)
⎿ Error: No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL
environment variable set.
● Bash(cmd /c dir)
⎿ Error: No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL
environment variable set.
● It seems the shell environment isn't properly configured. Let me use the Glob tool to list the files:
Error: Command failed: cygpath -u 'C:\Users\13581432'
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:915:11)
at execSync (node:child_process:987:15)
at Tk (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:755:1044)
at XqB (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:2697)
at da (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3698)
at file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3484
at Array.some (<anonymous>)
at nq (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3474) {
status: 4294967295,
signal: null,
output: [
null,
<Buffer 49 00 6e 00 76 00 61 00 6c 00 69 00 64 00 20 00 63 00 6f 00 6d 00 6d 00 61 00 6e 00 64 00 20 00 6c 00 69 00 6e 00 65 00 20 00 61 00 72 00 67 00 75 00 ... 154 more bytes>,
<Buffer >
],
pid: 31564,
stdout: <Buffer 49 00 6e 00 76 00 61 00 6c 00 69 00 64 00 20 00 63 00 6f 00 6d 00 6d 00 61 00 6e 00 64 00 20 00 6c 00 69 00 6e 00 65 00 20 00 61 00 72 00 67 00 75 00 ... 154 more bytes>,
stderr: <Buffer >
}
ERROR Command failed: cygpath -u 'C:\Users\13581432'
node:internal/errors:983:15
- genericNodeError (node:internal/errors:983:15)
- wrappedFn (node:internal/errors:537:14)
- checkExecSyncError (node:child_process:915:11)
- execSync (node:child_process:987:15)
- Tk (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:755:1044)
- XqB (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:2697)
- da (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3698)
- (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3484)
- at Array.some (<anonymous>)
- nq (file:///C:/Users/13581432/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:3507:3474)
Steps to Reproduce
Steps to Reproduce:
- Install Claude Code on Windows: npm install -g @anthropic-ai/claude-code
- Run claude from PowerShell, CMD, or Git Bash
- Try any command like dir, ls, or use file tools
- Observe cygpath error even though cygwin is not installed
Attempted Solutions (All Failed):
- ✗ Running from PowerShell
- ✗ Running from Git Bash terminal
- ✗ Running from WSL terminal
- ✗ Setting environment variables:
- $env:SHELL = "C:\Windows\System32\wsl.exe"
- $env:SHELL = "/usr/bin/bash"
- $env:MSYS_NO_PATHCONV = 1
- $env:WSL_DISTRO_NAME = "Ubuntu"
- ✗ Running with wsl claude
- ✗ Using Git Bash's MSYS environment
- ✗ Creating fake cygpath.bat (causes path mangling: C:\Users becomes C:\c\Users)
Root Cause:
Claude Code v1.0.112 has hardcoded dependency on cygpath for Windows path conversion without:
- Checking if cygpath/Cygwin exists
- Falling back to WSL's wslpath
- Using Git Bash's MSYS path handling
- Supporting native Windows paths
Comparison:
- Work laptop: Fails with cygpath error (no Cygwin installed)
- Personal laptop: Works (possibly has different version or Cygwin remnants)
- 3 days ago: Worked on same work laptop (before update)
Expected Behavior:
Claude Code should:
- Detect available shells (WSL, Git Bash, PowerShell)
- Use appropriate path conversion for detected environment
- NOT require Cygwin/cygpath when other shells are available
- Fall back gracefully when cygpath doesn't exist
Impact:
Claude Code is completely unusable on Windows systems without Cygwin, making it a showstopper bug for Windows users.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.0.112 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
12 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I did all of those things and this doesnt resolve the issue it is a bug
please test reproduce and confirm.
On Fri, Sep 12, 2025 at 12:47 PM github-actions[bot] <
@.***> wrote:
SOLUTION FOUND
DIAGNOSIS
SOLUTION
where git.exewinget install --scope machine git.git-> installs to C:\Program Files\Git -> Claude Code can now findThis issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Another solution that I found is to set your "CLAUDE_CODE_GIT_BASH_PATH" environment variable with the installation of where your git bash is. Just run _[Environment]::GetEnvironmentVariable("CLAUDE_CODE_GIT_BASH_PATH", "User")_ to verify that it isn't the same location as _where git_ returns. If they are different, rectify this, git doesn't need to be reinstalled.
I use all the above work around but issue still persists on windows
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
I have this issue too
This solution worked for me. After setting this to "c:\programs files\git\bin\bash.exe", Claude was able to work under windows for me.
Had the same issue on Windows 11. My Claude installation was set to my USER directory, but after ensuring that I have a 'CLAUDE_CODE_GIT_BASH_PATH' environment variable pointing to the correct 'bin\bash.exe' folder in my Git installation, and restarting my terminals, it works fine.
Just be aware that when you do 'where git' to find your Git installation, it will give you the path for git.exe. It may looks like this 'Git\cmd\git.exe'. You need to ensure that your environment variable is adjusted to point to the bash.exe instead., or it will not work.
Like so: CLAUDE_CODE_GIT_BASH_PATH=<yourInstalltionDir>\Git\bin\bash.exe
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.