[BUG] double dash getting stripped from shell commands by bash tool
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?
Double dash getting stripped out of final command executed by the bash/shell tool
Seen in ps aux | grep test
npm test tests/integration/playback-tracking.test.ts
/bin/bash -c -l source /Users/my-user/.claude/shell-snapshots/snapshot-bash-1764944586862-i1rnkf.sh && { shopt -u extglob || setopt NO_EXTENDED_GLOB; } 2>/dev/null || true && eval 'cd /my/project/folder && npm test -- tests/folder/some-test.test.ts' \< /dev/null && pwd -P >| /var/folders/f3/b7rxkff554n2bs9gsg2dwm200000gp/T/claude-19b5-cwd
What Should Happen?
Claude is trying to run the correct version of the command with a -- in it, but it is getting lost by the Shell tool somewhere along the way, so the final command that runs doesn't have it.
Expected command (and start of expected output showing it is working)
npm test -- tests/integration/playback-tracking.test.ts
> test
> vitest run tests/integration/playback-tracking.test.ts
Error Messages/Logs
Steps to Reproduce
Ask claude to run a specific test file in a vitest project with a package script "test": "vitest run" (not sure if that is actually important, but it does reveal the bug since this produces incorrect syntax)
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.59 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Possibly related to #5839
Sorry not sure which version worked, but it has been broken for at least a week, maybe two or three?
I have been able to work around it, but its annoying (and breaks other commands than just this test one, that's just the most common failure)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗