claude-code - 💡(How to fix) Fix [Bug] PowerShell commands executed through bash instead of PowerShell [2 comments, 2 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#56452Fetched 2026-05-06 06:27:40
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2subscribed ×1

Code Example

[]

---

Bash(ls "D:\Repo\tais\global-mono-repo-2\commercialization-service" -Force -Recurse -Depth 2 | Where-Object { $_.Name -match "\.yml$" })
RAW_BUFFERClick to expand / collapse

Bug Description Claude is using bash to run PowerShell command and that will fail. When using PowerShell commands, it should not use bash

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.128
  • Feedback ID: 66d0efa4-667e-401b-9c9e-ac530fe2ee1a

Errors

[]

Below is the command that Claude asked permission to run. That whole command is PowerShell and not bash, so it should pick the correct shell based on the commands that it decided to run.

 Bash(ls "D:\Repo\tais\global-mono-repo-2\commercialization-service" -Force -Recurse -Depth 2 | Where-Object { $_.Name -match "\.yml$" })

extent analysis

TL;DR

Remove the Bash prefix from the command to allow the system to automatically choose the correct shell.

Guidance

  • The command provided is a PowerShell command, but it's prefixed with Bash, which is likely causing the issue.
  • Remove the Bash prefix to allow the system to automatically detect the correct shell.
  • Verify that the command runs correctly in a PowerShell environment without the Bash prefix.
  • Consider configuring the terminal to automatically detect the shell based on the command syntax.

Example

ls "D:\Repo\tais\global-mono-repo-2\commercialization-service" -Force -Recurse -Depth 2 | Where-Object { $_.Name -match "\.yml$" }

Notes

The provided command is a PowerShell command, and the Bash prefix is likely the cause of the issue. Removing the prefix should allow the system to automatically choose the correct shell.

Recommendation

Apply workaround: Remove the Bash prefix from the command, as it is not necessary and is causing the system to use the wrong shell.

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