[BUG] One-line fix unlocks PowerShell on macOS and Linux: cross-platform support was always there, just never turned on

Resolved 💬 2 comments Opened Apr 9, 2026 by ocalvo Closed Apr 15, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

There is no reason why PowerShell should be limited to only Windows, when is amiable in both Linux and MacOS

What Should Happen?

PowerShell commands should work in MacOS and Linux just like they do in Windows.

Error Messages/Logs

N/A

Steps to Reproduce

  1. Add to ~/.claude/settings.json:

{
"env": {
"CLAUDE_CODE_USE_POWERSHELL_TOOL": "1"
},
"defaultShell": "powershell"
}

  1. Start a new Claude Code session
  2. Ask Claude to run a PowerShell-native command, e.g. Get-ChildItem

Expected behavior:
A dedicated PowerShell tool is available and executes Get-ChildItem natively, consistent with Windows behavior.

Actual behavior:
No PowerShell tool is exposed. Claude falls back to the Bash tool, and running Get-ChildItem directly fails with command not found. The only workaround is pwsh -Command "Get-ChildItem" via Bash.

Notes:

  • pwsh is cross-platform (macOS, Linux, Windows) — there is no technical reason to restrict this feature to Windows only.
  • The current docs state "Only supported on native Windows, not WSL" with no mention of macOS or Linux.

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

v2.1.98

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Context (macOS Specifics)

Currently running Claude Code on macOS with PowerShell 7.5.3 installed. The lack of a native PowerShell tool creates a real friction point in daily usage.

Concrete pain point

When Claude Code is configured with PowerShell directives (e.g. via CLAUDE_CODE_USE_POWERSHELL_TOOL=1 or a CLAUDE.md that instructs Claude to use PowerShell cmdlets), Claude must escape to Bash and wrap every command:

pwsh -c 'Get-ChildItem'

instead of simply:

Get-ChildItem

This is cumbersome and defeats the purpose of a PowerShell-native workflow.

Why this matters

  • Projects that standardize on PowerShell (cross-platform scripts, PwrDev modules, etc.) want Claude to use native PS cmdlets — not Unix aliases wrapped in pwsh -c.
  • On macOS today, even with "defaultShell": "powershell" in settings.json, Claude still receives a Bash tool, not a PowerShell tool. The setting is effectively ignored.
  • Every PowerShell command requires the pwsh -c "..." escape hatch via Bash, adding noise and making tool-call logs harder to read and review.

Expected behavior on macOS (and Linux)

When pwsh is available on PATH and the user has configured defaultShell: powershell (or CLAUDE_CODE_USE_POWERSHELL_TOOL=1), Claude Code should expose a PowerShell tool backed by pwsh, identical to the experience on Windows — no Bash wrapper required.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗