Windows: Sandbox blocks shell builtins (echo, pwd, date, printf) with silent exit code 1

Resolved 💬 2 comments Opened Feb 18, 2026 by rubrical-worker Closed Feb 18, 2026

Description

On Windows 11 with Git Bash, Claude Code's sandbox blocks shell builtins and /usr/bin utilities. Commands silently fail with exit code 1 and no stderr output. External executables (git, node, gh) work fine through the same sandbox.

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Shell: Git Bash (C:\Program Files\Git\usr\bin\bash.exe)
  • Git: 2.51.2.windows.1
  • Claude Code: Latest (as of 2026-02-18)

Reproduction

These commands fail with exit code 1, no output, no stderr:

echo hello
printf "hello\n"
pwd
date "+%Y-%m-%d"
/usr/bin/echo hello
which date
type date

These commands work fine:

git --version
git branch --show-current
node -e "console.log('hello')"
gh --version

Running the exact same failing commands through Node.js child_process succeeds, proving it's not a system issue:

node -e "const {execSync}=require('child_process'); console.log(execSync('echo hello',{encoding:'utf8'}).trim())"
// Output: hello

Impact

  1. Cascade failures: When parallel Bash tool calls are made and one hits a blocked command, all sibling calls abort with "Sibling tool call errored"
  2. Silent failures: No stderr output makes debugging difficult — commands just return exit code 1
  3. Common operations broken: echo, pwd, date, printf are fundamental shell operations used constantly in workflows

Workarounds

  • Use git commands where possible (e.g., git rev-parse --show-toplevel instead of pwd)
  • Use node -e "console.log(...)" instead of echo/printf/date
  • Use dedicated tools (Read, Glob, Grep) instead of cat, ls, grep

Additional Context

  • No .bashrc, .bash_profile, or .profile exists in the user home directory
  • No Claude Code settings or hooks are configured
  • The shell PATH includes standard Git Bash paths (C:\Program Files\Git\usr\bin, etc.)

View original on GitHub ↗

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