CLAUDE_CODE_GIT_BASH_PATH causes all commands to use Git Bash instead of parent shell
Resolved 💬 3 comments Opened Jan 22, 2026 by kdbotts Closed Feb 28, 2026
CLAUDE_CODE_GIT_BASH_PATH causes all commands to use Git Bash instead of parent shell
Problem
When CLAUDE_CODE_GIT_BASH_PATH is set, Claude Code uses Git Bash (MSYS2) for all shell commands, not just git-related ones. This prevents access to tools available in the parent shell environment.
Environment
- Windows with Cygwin installed
- Claude Code launched from a Cygwin mintty bash terminal
CLAUDE_CODE_GIT_BASH_PATH="C:\Program Files\Git\bin\bash.exe"is set
Expected Behavior
- Normal commands should run under the parent shell (Cygwin bash in this case)
- Git commands could optionally use Git Bash if
CLAUDE_CODE_GIT_BASH_PATHis set (for its special git integration)
Actual Behavior
All commands run under Git Bash (MSYS2), which has a different/minimal environment:
# In Claude Code subprocess:
bash --version
GNU bash, version 5.2.37(1)-release (x86_64-pc-msys)
# In parent Cygwin terminal:
bash --version
GNU bash, version 5.2.21(1)-release (x86_64-pc-cygwin)
This means Cygwin-installed tools (like python3 at /usr/bin/python3) are not available to Claude Code, even though they're available in the shell where Claude Code was launched.
Suggested Solution
Either:
- Only use
CLAUDE_CODE_GIT_BASH_PATHfor git commands, use parent shell for everything else - Add a separate
CLAUDE_CODE_SHELL_PATHvariable to explicitly set the shell for non-git commands - Default to using the shell from PATH when no explicit override is set
Workaround
Currently none - unsetting CLAUDE_CODE_GIT_BASH_PATH may break git functionality.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗