[BUG] CC native on Windows: not really shell aware
Open 💬 16 comments Opened Aug 3, 2025 by 0xeb
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.67
- Operating System: Windows 11
- Terminal: cmd.exe
Bug Description
On Windows native (no WSL), CC still makes a lot of errors trying to run essential commands:
● Bash(move *.md docs\)
⎿ Error: /usr/bin/bash: line 1: move: command not found
● Bash(move /Y *.md docs\)
⎿ Error: /usr/bin/bash: line 1: move: command not found
The above are but a few instances of errors where CC has to retry multiple times in order to re-orient itself and know under which environment it is.
Steps to Reproduce
Start dogfooding CC windows native internally. You will find all sort of errors at tool invocation and shell interaction levels.
Using or having to install Git Bash is out of question.
Expected Behavior
CC should know its environment and shell and work correctly
Actual Behavior
All sorts of shell commands invocation errors:
● Bash(move *.md docs\)
⎿ Error: /usr/bin/bash: line 1: move: command not found
● Bash(move /Y *.md docs\)
⎿ Error: /usr/bin/bash: line 1: move: command not found
etc.
Too many to list. I was not planning to file a bug, but this is too much now.
Additional Context
Please dogfood your own product (CC) on Windows and start to weed out low hanging fruit errors.
16 Comments
...its not you....its me....
● The issue is with Windows path escaping in JSON. Even with cchooks, the core problem remains: Claude Code v1.0.67 on Windows is not triggering hooks consistently.
Summary
We've now tried:
All approaches work when run manually but fail because Claude Code isn't calling the hooks. This is confirmed by:
The issue is not with our hook implementation - it's with Claude Code v1.0.67 not triggering hooks on Windows. Until this bug is fixed by the Claude Code team, manual execution remains the only reliable option.
I've had some luck adding this to
C:\Users\[user]\.claude\CLAUDE.md, but it should be in the default knowledge of the windows version.I also see funny things on Windows like:
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
there are also issues when it attempts to run
findand expects a gnu compatable tool not the windowsfind.exe(which is earlier in the path).worked around with ``
when attempting to runfindyou must use the commandc:\cygwin\bin\findinstead``That's the problem with "Windows Native". It is a sloppy job.
The model should be finetuned to know how to use PowerShell and CMD shell natively. In CC's system prompt, inject the correct OS, so the model knows what tools and how to use them.
Any updates on this? 2.0 release doesn't seem to improve/enhance the Windows native experience with powershell/pwsh in any noticeable way and it makes hooks all but unusable in any non trivial scenario.
Hi, any progress on this? ChatGPT user here, waiting for functional CC in Windows PowerShell 7 to give CC a chance.
This 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.
Claude still breaks often when combining Unix-style commands and Windows path separators, e.g. right now encountered a case when it tried to call
If you use Bash, you should use Bash line separators, and something like
/t/Tempprobably. If you prefer Windows separators then fork to Windows shell.CC is a joke on windows and they dont seem to care. On the other hand they block oauth usage of opencode that doesnt suffer from this symptoms because the devs know how to design propper TUI's.
+1 for please, fix the Claude Code Windows native experience.
I am using Command Prompt inside Windows Terminal and Claude Code is launching itself inside git-bash. These combinations don't workout well.
I would suggest to let Claude Code really run native on Windows. There are enough tools available to solve problems, if - yes, if - Claude Code could use them without running in errors. If it really needs the git-bash tools, it could launch them on demand (if they are available) like it tries now with cmd.exe, but fails to do so because it needs to double escape all the parameters.
Claude itself would highly prefer a clean and real Windows native solution:
Still happening on Windows 11 with Claude Code latest. CLAUDE_CODE_SHELL is set to "pwsh" in ~/.claude/settings.json under the env key. The env var shows up inside the session (echo $CLAUDE_CODE_SHELL returns "pwsh"), but the Bash tool still uses /usr/bin/bash (Git Bash). pwsh is installed and works fine when invoked explicitly.
Workaround: prefixing commands with
pwsh -Commandorpwsh -File -, but the Bash tool itself ignores the setting.Yet another Windows issue introduced: https://github.com/anthropics/claude-code/issues/24855
A fix is available as a Claude Code plugin: powershell-default
Install:
Adds a native Pwsh tool (shows as
Pwsh(...)in the UI). Commands use PowerShell syntax directly. When enabled, Bash tool is blocked. Works on any OS with PowerShell 7+.PR: https://github.com/anthropics/claude-code/pull/35761