[FEATURE] Plugin to use PowerShell Preview (pwsh) as default shell on all platforms
Problem
Claude Code's Bash tool uses bash/zsh as the shell on all platforms. On Windows this runs inside Git Bash where PowerShell commands fail due to shell interpretation conflicts — quoting issues, $_ expansion, backslash paths. Even on macOS/Linux, users who prefer PowerShell have no way to make it the default.
Current behavior: Claude attempts powershell.exe -Command (fails), then pwsh -Command with inline script (fails due to bash expanding $_), then finally pwsh -NoProfile -File script.ps1 (works). This wastes 2-3 attempts per command.
Proposed solution
A Claude Code plugin (powershell-default) that uses hooks to make PowerShell Preview the default:
- SessionStart hook: Detects
pwsh-preview/pwshon PATH, injects PowerShell syntax rules into Claude's context - PreToolUse hook on Bash: Blocks
powershell.exe(5.1), blocks backslash paths, enforces correct patterns
This works on any OS with PowerShell 7+ installed:
- Windows:
winget install Microsoft.PowerShell.Preview - macOS:
brew install powershell/tap/powershell-preview - Linux:
snap install powershell-preview --classic
Implementation
PR: #35761
Related
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗