PowerShell Tool on Win32: standard git flags with double dash (e.g. --ignore-all-space) trigger "Command uses stop-parsing token (--%)" false positive
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?
Summary
In Claude Code Win32 with the PowerShell Tool enabled (CLAUDE_CODE_USE_POWERSHELL_TOOL=1), standard git commands with flags using the double-dash convention (e.g. --ignore-all-space, --no-color, --cached) trigger the error:
Command uses stop-parsing token (--%)
The command itself does NOT contain the --% PowerShell stop-parsing token; it only contains a flag with a double dash. The parser appears to incorrectly classify any consecutive double dash as a stop-parsing token.
Environment
- Claude Code: Win32 standalone installer (not MSIX/Microsoft Store)
- OS: Windows 11
- PowerShell Tool: enabled via
CLAUDE_CODE_USE_POWERSHELL_TOOL=1in.claude/settings.json - Reproducible: 100% — every invocation of
git diff --ignore-all-space ...triggers it
Impact
This affects every workflow that uses standard git commands with these flags, which is virtually every code review or diff comparison task. Workarounds (escaping, splitting commands) are not viable because the flags are part of git's documented API. Currently each occurrence requires manual user approval, breaking automation flows like custom playbooks/commands.
Workaround attempted
User-side hooks (PreToolUse) cannot rescue this case because the parser blocks the command before the hook runs. Tested with extended approve-safe-compounds.js style hooks; no effect.
Related issues
This is in the same family as #28240, #28784, #29491, #30832 (compound command + permission edge cases on Win32 PowerShell Tool), but specifically about the --% false positive for double-dash flags, which I haven't found in any open issue.
What Should Happen?
Expected behavior
The parser should distinguish between the --% stop-parsing token (which must be its own token, with no following text on the same line) and arguments that happen to contain consecutive dashes (--flag-name). Standard CLI flags with double-dash should not trigger the false positive.
Error Messages/Logs
Steps to Reproduce
Reproduction
In a session of Claude Code Win32 with the PowerShell Tool active, ask Claude to run any of these commands inside a git repository:
\``powershell``
git diff --ignore-all-space develop -- .claude/CLAUDE.md
\
\``powershell``
git log --oneline -5 origin/develop
\
\``powershell``
git diff --no-color HEAD~1
\
Each will produce a permission stop with the message "Command uses stop-parsing token (--%)" requiring manual approval, even though the commands are syntactically valid PowerShell and contain no actual --% token.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.119
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗