[BUG] Bash tool mangles commands with pipe inside command substitution on Windows

Resolved 💬 3 comments Opened Jan 4, 2026 by jae58 Closed Jan 8, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

On Windows, the Bash tool incorrectly escapes commands that contain a pipe | inside command substitution $(). The command is mangled before reaching bash, causing syntax errors.

  • Breaks ralph-wiggum plugin (cancel-ralph command)
  • Breaks any bash script using common patterns like $(grep x | head -1)

What Should Happen?

Command executes normally, outputs TEST

Error Messages/Logs

/usr/bin/bash: eval: line 1: syntax error near unexpected token `('
/usr/bin/bash: eval: line 1: `VAR=\$ ( echo test < /dev/null | tr a-z A-Z ) && echo '''

Steps to Reproduce

This command:

VAR=$(echo "test" | tr 'a-z' 'A-Z') && echo "$VAR"

# Gets mangled to:
VAR=\$ ( echo test < /dev/null | tr a-z A-Z ) && echo ''

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

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