Shell Command Parsing Fails with Single-Quoted Arguments Containing Literal Pipe Symbols

Resolved 💬 3 comments Opened Jul 17, 2025 by charles-dyfis-net Closed Jan 5, 2026

Bug Description
Single-quoted shell commands are being misparsed -- perhaps substituted into a single-quoted context? -- in such a way as to generate errors wherein the shell is trying to parse content that should be passed through to the child command as literal data. This looks like a tool implementation error: The same command works correctly when I run it on my own, and it works correctly when Claude Code writes the command to a file and runs the file; it's only running shell commands that require single-quotes in-line that appears to be buggy.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 1.0.53
  • Feedback ID: c12dc966-86ad-4046-b68d-ada2adcbaa80

---

As a concrete example:

⏺ Bash(jq '.invocations | length' enhanced_scoring_test.json)
  ⎿  Error: OK
     jq: error: syntax error, unexpected '/' (Unix shell quoting issues?) at <top-level>, line 1:
     .invocations  < /dev/null |  length
     jq: 1 compile error

The string </dev/null should not be substituted into the jq command.

If the tool wants to prevent stdin from being read, it should perform a redirection for the _entire_ context, akin to the following:

{
    jq '.invocations | length' enhanced_scoring_test.json
} </dev/null

View original on GitHub ↗

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