[FEATURE] Plugin to use PowerShell Preview (pwsh) as default shell on all platforms

Resolved 💬 3 comments Opened Mar 18, 2026 by cruzlauroiii Closed Apr 16, 2026

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:

  1. SessionStart hook: Detects pwsh-preview/pwsh on PATH, injects PowerShell syntax rules into Claude's context
  2. 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

View original on GitHub ↗

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