[BUG] Bash tool launches WSL window on Windows despite defaultShell: "powershell"

Resolved 💬 2 comments Opened Mar 24, 2026 by JoshLesterVRU Closed Mar 26, 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?

On Windows 11, the Bash tool opens a wsl.exe window to execute commands instead of using PowerShell. The WSL window pops up
separately and the output is not captured back into Claude Code.

Settings (~/.claude/settings.json):
{
"env": {
"SHELL": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
},
"defaultShell": "powershell"
}

Environment:

  • OS: Windows 11 Enterprise (10.0.22631)
  • WSL is installed
  • Shell: PowerShell v1.0

Additional context:

  • Also tried setting COMSPEC env var to PowerShell — no effect
  • Both defaultShell and SHELL env are correctly set but appear to be ignored by the Bash tool's shell resolution
  • This is a brand-new install. I tried both the script and winget installation methods.

What Should Happen?

Commands should run in PowerShell and output should be returned inline.

Error Messages/Logs

A separate wsl.exe window opens. Command output is not visible in Claude Code (commands return exit code 127 or 1).

Steps to Reproduce

Open claude and run any command. I've been using "! $env" as a test.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.81 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

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