CLAUDE_CODE_SHELL environment variable not respected on Windows

Resolved 💬 3 comments Opened Jan 23, 2026 by richard-scott Closed Jan 23, 2026

Description

The environment variable set in is not being respected. The Bash tool continues to use a Unix bash shell instead of PowerShell.

Steps to Reproduce

  1. On Windows (no WSL installed), add to :
  1. Restart Claude Code
  1. Ask Claude to run a simple command like

Expected Behavior

The command should run in PowerShell and return Windows directory listing.

Actual Behavior

The Bash tool invokes , resulting in errors:

Note: Backslashes are stripped from the path (bash interprets them as escape characters).

Workaround

Explicitly invoke PowerShell or cmd:

  • Microsoft Windows [Version 10.0.26200.7623]

(c) Microsoft Corporation. All rights reserved.

C:\Users\Richard>

Environment

  • OS: Windows 11
  • Claude Code version: Latest (npm)
  • Node.js: v24.13.0
  • WSL: Not installed

View original on GitHub ↗

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