[FEATURE]
Resolved 💬 3 comments Opened Feb 27, 2026 by rmarlatt-sr Closed Mar 3, 2026
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
- Git Bash (MSYS2) crashes with 0xC0000005 on Windows 11 24H2 build 26200
- PowerShell works fine on the same machine
- Same Git Bash setup works on Windows 10
- Request: option to use PowerShell as the command shell
Proposed Solution
Add a shell setting to allow users to choose their command shell on Windows:
// ~/.claude/settings.json
{
"shell": "powershell"
}
Supported values:
- "gitbash" (default, current behavior)
- "powershell" — uses pwsh.exe (PowerShell 7+) or powershell.exe (Windows PowerShell 5.1)
- "cmd" — uses cmd.exe
Implementation considerations:
- Command translation layer — Claude Code currently generates Unix-style shell commands (forward slashes, /dev/null, && chaining, pipes). A PowerShell backend would need either:
- (A) Thin adapter: Translate a small set of known incompatibilities at command generation time (e.g., > /dev/null → | Out-Null, export VAR=val → $env:VAR = "val"). Most commands (git, npm, node, npx) work
identically in PowerShell.
- (B) Prompt-level hint: Tell the model the active shell is PowerShell so it generates compatible syntax natively. This is simpler and leverages the model's existing knowledge of PowerShell.
- Option B is likely simpler and more maintainable — the model already knows PowerShell syntax and could generate correct commands if informed of the shell type.
- Compatibility surface — The vast majority of commands Claude Code runs are cross-shell compatible (git, npm, node, npx, cd, ls). The main gaps are:
- Redirects: > /dev/null 2>&1 → *> $null
- Environment variables: $VAR → $env:VAR
- Command chaining: && works in PowerShell 7+ but not Windows PowerShell 5.1
- Glob expansion: handled by the tool, not the shell
- Detection/fallback — If pwsh.exe is available, prefer it (PowerShell 7+ supports &&). Fall back to powershell.exe (5.1) if not. Could also auto-detect and warn if MSYS2 crashes are recurring, suggesting
the user switch shells.
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗