[BUG] Bash tool fails when pipe character appears in quoted arguments
Resolved 💬 9 comments Opened Jul 2, 2025 by mchrisman Closed Jan 26, 2026
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: Claude Code
- Claude CLI version: 1.0.40
- Operating System: macos 14.7.4
- Terminal: iTerm2
Bug Description
When Claude uses the Bash tool, this usually times out:
rg -n $'transform:rotate|target.style.background' . --type ts
But this works fine
rg -n -e "transform:rotate" -e "target.style.background" . --type ts
And the original command works fine for me too when executing outside Claude cli.
A bit of experimentation makes me think that the pipe character is the culprit
> Claude, try: echo "foo|bar"
⏺ Bash(echo "foo|bar")
⎿ foo < /dev/null | bar
⏺ This is very revealing! The output shows foo < /dev/null | bar instead of the expected foo|bar.
Steps to Reproduce
- <!-- First step -->
- <!-- Second step -->
- <!-- And so on... -->
Expected Behavior
<!-- What you expected to happen -->
Actual Behavior
<!-- What actually happened -->
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗