Bash tool: echo and shell builtins fail with exit code 1 on Cygwin
Environment
- Claude Code version: 2.1.45
- Platform: Cygwin (CYGWIN_NT-10.0-26200 3.6.6-1.x86_64) on Windows
- Shell:
/usr/bin/bash(Cygwin bash) - Settings:
CLAUDE_CODE_GIT_BASH_PATHset toC:/cygwin64/bin/bash.exe,CLAUDE_CODE_SHELLset to/usr/bin/bash
Problem
Shell builtins like echo, printf, type, and simple commands like date fail with exit code 1 when run via the Bash tool on Cygwin. No stdout or stderr is returned — just Exit code 1.
Commands like git --version work fine.
Steps to Reproduce
- Install Claude Code on Windows with Cygwin
- Configure shell settings as above
- Ask Claude to run
echo "hello"via the Bash tool - Observe: exit code 1, no output
What Was Tried
- Explicit permission rules in
.claude/settings.local.json:Bash(echo:*),Bash(/bin/echo:*),Bash(bash -c 'echo hello'), etc. - Running echo via
bash -c 'echo hello' - Running
/usr/bin/echo hello - Chaining with a working command:
git --version && echo "test"— git runs fine but the overall command returns exit code 1
None of these workarounds resolve the issue. The explicit Bash(echo:*) allow rule in settings has no effect.
Interesting Observation
When running git --version && echo "test passed", git's output appears (twice — once in stdout, once in error output), but exit code is still 1. This suggests the command does partially execute but something in the Bash tool's processing rejects it.
Expected Behavior
echo "hello" should succeed with exit code 0 and return hello on stdout, especially when explicitly allowed via permissions.
Actual Behavior
Exit code 1, no output.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗