claude-code - 💡(How to fix) Fix Bash tool on Windows Git Bash cannot find common binaries (git, task, ls) after 2.1.x update [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49377Fetched 2026-04-17 08:42:51
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×5

Fix Action

Workaround

None clean. Absolute unix-path invocation works for a subset (/mingw64/bin/git, /usr/bin/ls). Space-containing Windows paths need shell quoting and only sometimes resolve.

RAW_BUFFERClick to expand / collapse

Environment

  • OS: Windows 11 (10.0.26200)
  • Shell: Git Bash (bash from C:\Program Files\Git)
  • Claude Code version: reproduces on latest 2.1.x at time of filing
  • Regression: Yes — worked ~2 days ago, broke after a recent update

Symptoms

Inside Claude Code's Bash tool, common binaries are not resolvable on the PATH, even though they exist and work from a normal PowerShell / Git Bash terminal on the same machine:

  • gitcommand not found
  • taskcommand not found
  • ls, grep, find, wc, which, wherecommand not found
  • powershell.execommand not found

echo $PATH inside the Bash tool prints the Windows PATH (;-separated) prepended to a handful of :-separated unix-style plugin-cache entries. Bash treats the whole string as :-separated, so only the tail of the string resolves — effectively nothing from the system PATH works.

What still works

  • Shell builtins (echo, cd, pwd)
  • Binaries invoked by absolute unix path that land inside MSYS:
    • /mingw64/bin/git works
    • /usr/bin/ls works
  • Binaries invoked by absolute Windows-style unix path inside Program Files:
    • "/c/Program Files/GitHub CLI/gh.exe" works (with quoting)
  • BUT: some Windows-side binaries under C:\Users\<user>\go\bin\ are unreachable from either form (/c/Users/.../task.exe errors with No such file or directory, even when the file exists — verified by /usr/bin/ls on the parent directory).

Repro

  1. Windows 11, Git Bash as the Claude Code shell
  2. Fresh session
  3. Ask Claude to run git status or task --version in a project
  4. Observe command not found

Impact

Cannot run task, git, or any CI/test tooling from inside Claude Code via the bare command name. Work that relies on Claude running its own verification (task ci:all, git status before commits, go test, etc.) is blocked — the user must shell out manually. Absolute-path workarounds help for a few tools but are brittle (spaces, drive-letter translation, missing paths).

Workaround

None clean. Absolute unix-path invocation works for a subset (/mingw64/bin/git, /usr/bin/ls). Space-containing Windows paths need shell quoting and only sometimes resolve.

extent analysis

TL;DR

The issue can be mitigated by modifying the PATH environment variable to correctly separate Windows and Unix-style paths.

Guidance

  • Verify that the PATH variable is being set correctly in the Claude Code Bash tool by running echo $PATH and checking for any incorrect separators or formatting.
  • Try setting the PATH variable manually before running commands, using the correct separator for the shell (e.g., export PATH=/usr/bin:/bin:/mingw64/bin:$PATH for Unix-style paths).
  • Use absolute Unix-style paths to invoke binaries, as this is currently working (e.g., /mingw64/bin/git instead of just git).
  • Investigate why some Windows-side binaries under C:\Users\<user>\go\bin\ are unreachable, as this may be a separate issue related to path resolution or permissions.

Example

No code snippet is provided, as the issue is related to environment variable configuration and path resolution.

Notes

The issue seems to be related to the way the PATH variable is being set and interpreted by the Claude Code Bash tool. The fact that absolute Unix-style paths work suggests that the issue is with the path resolution mechanism. Further investigation is needed to determine the root cause and a permanent fix.

Recommendation

Apply workaround: Modify the PATH environment variable to correctly separate Windows and Unix-style paths, and use absolute Unix-style paths to invoke binaries until a permanent fix is found. This is because the current workaround using absolute paths is brittle and may not work for all tools, and modifying the PATH variable may provide a more reliable solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING