[BUG] Critical Bug - Claude Code forces non-existent cygpath on Windows, ignoring available shells

Resolved 💬 12 comments Opened Sep 12, 2025 by whatcher1074 Closed Jan 30, 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?

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:

  1. Cygwin is NOT installed on the system
  2. WSL is installed and available
  3. Git Bash/MSYS is installed and available
  4. Running FROM within Git Bash terminal
  5. The same setup worked 3 days ago (before update)

Error Messages:

  1. 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.

  1. 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:

  1. Install Claude Code on Windows: npm install -g @anthropic-ai/claude-code
  2. Run claude from PowerShell, CMD, or Git Bash
  3. Try any command like dir, ls, or use file tools
  4. Observe cygpath error even though cygwin is not installed

Attempted Solutions (All Failed):

  1. ✗ Running from PowerShell
  2. ✗ Running from Git Bash terminal
  3. ✗ Running from WSL terminal
  4. ✗ 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"
  1. ✗ Running with wsl claude
  2. ✗ Using Git Bash's MSYS environment
  3. ✗ 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:

  1. Detect available shells (WSL, Git Bash, PowerShell)
  2. Use appropriate path conversion for detected environment
  3. NOT require Cygwin/cygpath when other shells are available
  4. 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:

  1. Detect available shells (WSL, Git Bash, PowerShell)
  2. Use appropriate path conversion for detected environment
  3. NOT require Cygwin/cygpath when other shells are available
  4. 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:

  1. Install Claude Code on Windows: npm install -g @anthropic-ai/claude-code
  2. Run claude from PowerShell, CMD, or Git Bash
  3. Try any command like dir, ls, or use file tools
  4. Observe cygpath error even though cygwin is not installed

Attempted Solutions (All Failed):

  1. ✗ Running from PowerShell
  2. ✗ Running from Git Bash terminal
  3. ✗ Running from WSL terminal
  4. ✗ 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"
  1. ✗ Running with wsl claude
  2. ✗ Using Git Bash's MSYS environment
  3. ✗ 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:

  1. Detect available shells (WSL, Git Bash, PowerShell)
  2. Use appropriate path conversion for detected environment
  3. NOT require Cygwin/cygpath when other shells are available
  4. 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_

View original on GitHub ↗

This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗