[BUG] Model emits fish-syntax to Bash tool when login shell is fish
Resolved 💬 3 comments Opened Jun 25, 2026 by alexisLefebvre Closed Jun 26, 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 a machine where the login shell is fish (/usr/bin/fish), Claude emitted fish-style command substitution to the Bash tool:
readlink -f (which claude)
The Bash tool executes /bin/bash, so this fails:
/bin/bash: eval: line 1: syntax error near unexpected token `('
What Should Happen?
The correct bash form is readlink -f "$(which claude)".
Commands sent to the Bash tool should always be POSIX/bash syntax, independent of the user's login shell.
Error Messages/Logs
Error: Exit code 2
/bin/bash: eval: line 1: syntax error near unexpected token `('
/bin/bash: eval: line 1: `readlink -f (which claude)'
Steps to Reproduce
Unsure, but here is a transcript:
❯ bundle check?
● Locating install first.
● Bash(readlink -f (which claude))
⎿ Error: Exit code 2
/bin/bash: eval: line 1: syntax error near unexpected token `('
/bin/bash: eval: line 1: `readlink -f (which claude)'
Thought for 3s (ctrl+o to expand)
● Fish syntax leaked. Bash here.
● Bash(readlink -f "$(which claude)")
⎿ Interrupted · What should Claude do instead?
❯ fish syntax?
Thought for 6s (ctrl+o to expand)
● Tool runs /bin/bash, not your fish login shell. My first call mistakenly used fish-style (which claude) → bash syntax error. Second call $(which claude) is correct bash. That's the one you rejected.
Re-run the bash version?
readlink -f "$(which claude)"
✻ Churned for 7s
❯ why you tried fish syntax?
Thought for 5s (ctrl+o to expand)
● Mistake. Env block says Shell: /usr/bin/fish, so I pattern-matched to fish command-sub (...). Wrong — the Bash tool always executes via /bin/bash no matter your login shell. Should've used $(...) from the start. My error, not yours.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.191
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
Environment
- Claude Code 2.1.191
- Login shell: fish 4.x
- OS: Linux (Debian 13)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗