[BUG] Windows: sandbox bash ignores CLAUDE_CODE_SHELL and sandbox.enabled: false (v2.1.59)
Resolved 💬 3 comments Opened Feb 26, 2026 by jmperez0 Closed Mar 26, 2026
Bug Description
On native Windows 11, Claude Code v2.1.59 uses a bundled sandbox bash (/usr/bin/bash.exe, linux-gnu build) regardless of configuration. Both CLAUDE_CODE_SHELL and sandbox.enabled: false are ignored.
The sandbox bash lacks standard Unix utilities (ls, grep, head, tail, awk, sed, cat, find, which), making shell commands that pipe through these utilities fail. Core tools like cargo and git work since they are Windows executables on PATH.
Steps to Reproduce
- On native Windows 11 (not WSL), install Claude Code v2.1.59
- Set
CLAUDE_CODE_SHELLto Git for Windows bash:
- Via
setx CLAUDE_CODE_SHELL "D:\Program Files\Git\usr\bin\bash.exe"(persistent user env var), and/or - Via
settings.json:
``json``
{
"env": {
"CLAUDE_CODE_SHELL": "D:\\Program Files\\Git\\usr\\bin\\bash.exe"
},
"sandbox": {
"enabled": false
}
}
- Restart Claude Code
- Run any bash command — observe it uses
/usr/bin/bash(sandbox) not Git bash
Evidence
$ echo "SHELL=$SHELL"
SHELL=/usr/bin/bash.exe
$ echo "bash=$0"
bash=/usr/bin/bash
$ echo "version=$BASH_VERSION"
version=5.2.37(1)-release # linux-gnu build, not Git for Windows
$ echo "CLAUDE_CODE_SHELL=$CLAUDE_CODE_SHELL"
CLAUDE_CODE_SHELL=D:\Program Files\Git\usr\bin\bash.exe # env var IS set, just ignored
$ type ls
/usr/bin/bash: line 1: type: ls: not found # no Unix utilities available
Expected Behavior
sandbox.enabled: falseshould disable the sandbox bash entirely on WindowsCLAUDE_CODE_SHELLshould select which bash binary is used- On native Windows (where sandbox docs state "Native Windows support is planned"), the sandbox should not be active at all
Environment
- OS: Windows 11 Pro 10.0.26200
- Claude Code: v2.1.59
- Shell: Git for Windows bash at
D:\Program Files\Git\usr\bin\bash.exe(v2.53.0) - Platform: Native Windows (not WSL)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗