[BUG] Bash permission patterns fail to match commands with spaces in argument values
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?
Bash permission patterns in settings.local.json fail to match commands when argument values contain spaces, even when the spaces are properly quoted.
What Should Happen?
The pattern Bash(xcodebuild *) should match any command starting with xcodebuild, regardless of whether argument values contain spaces.
Error Messages/Logs
Steps to Reproduce
- Add the following permission pattern to
.claude/settings.local.json:
``json``
{
"permissions": {
"allow": [
"Bash(xcodebuild *)"
]
}
}
- Restart Claude Code to load the new permission.
- Ask Claude to run a command without spaces in argument values:
``bash``
xcodebuild test -workspace MyApp.xcworkspace -scheme "My App" -only-testing:MyTests/SomeTest
Result: Command runs without permission prompt. :white_check_mark:
- Ask Claude to run a command with spaces in argument values:
``bash`
xcodebuild test -workspace MyApp.xcworkspace -scheme "My App" -only-testing:"My - Tests/SomeTest"
Bash(xcodebuild *)` pattern. :x:
**Result**: Permission prompt appears, despite matching the
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.23 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗