claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Claude Code Cannot Run dotnet Commands On Windows

Open nickamckenna opened this issue 1 year ago • 4 comments

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

  1. Setup Windows 11 with dotnet 8 SDK
  2. Start up claude code
  3. 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.

nickamckenna avatar Jul 25 '25 10:07 nickamckenna

This could be related to bug: https://github.com/anthropics/claude-code/issues/4223

nickamckenna avatar Jul 25 '25 10:07 nickamckenna

Do you have CLAUDE_CODE_SHELL_PREFIX set? If so, see https://github.com/anthropics/claude-code/issues/4223#issuecomment-3120247243

ant-kurt avatar Jul 25 '25 20:07 ant-kurt

@nickamckenna this should be resolved in 1.0.68, let me know if you're still having issues.

ant-kurt avatar Aug 05 '25 14:08 ant-kurt

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.

github-actions[bot] avatar Aug 13 '25 14:08 github-actions[bot]