Bash tool used instead of PowerShell tool for shell commands on Windows

Resolved 💬 1 comment Opened Jun 1, 2026 by cveld Closed Jun 1, 2026

Summary

On Windows, Claude Code sometimes uses the Bash tool to run PowerShell/pwsh commands instead of the dedicated PowerShell tool. This causes unnecessary friction because the Bash tool is intended for POSIX/bash scripts, not Windows PowerShell cmdlets.

Expected behavior

When the environment is Windows with PowerShell as the primary shell, Claude should default to the PowerShell tool for all shell operations.

Actual behavior

Claude Code uses the Bash tool for PowerShell commands (e.g. git status, dotnet run, etc.) even when a dedicated PowerShell tool is available and the platform is win32.

Environment

  • Platform: Windows 11
  • Shell: PowerShell (pwsh)
  • Claude Code version: latest

Suggestion

The model should be guided (via system prompt or tool selection logic) to prefer the PowerShell tool over the Bash tool when platform === 'win32' and the user's shell is PowerShell.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗