Claude Code Cannot Run dotnet Commands On Windows
Environment
- Platform (select one):
- [ X] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other:
- Claude CLI version: 1.0.60
- Operating System: Windows 11
- Terminal: GitBash, Powershell
Bug Description
When claude code tries to run any dotnet command, it gets an error:
Error: /usr/bin/bash: line 1: C:Program: command not found
Claude code tries various variations on the original command to get it to work, but it never succeeds.
Steps to Reproduce
- Setup Windows 11 with dotnet 8 SDK
- Start up claude code
- Ask claude code to run a command like
dotnet --info
Expected Behavior
The dotnet command should run.
Actual Behavior
Claude code always gets errors like
Error: /usr/bin/bash: line 1: C:Program: command not found
Additional Context
I have verified that the commands work correctly in the shell. They only fail when claude code tries to run them.
This could be related to bug: https://github.com/anthropics/claude-code/issues/4223
Do you have CLAUDE_CODE_SHELL_PREFIX set? If so, see https://github.com/anthropics/claude-code/issues/4223#issuecomment-3120247243
@nickamckenna this should be resolved in 1.0.68, let me know if you're still having issues.
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.