[BUG] Bash permission patterns fail to match commands with spaces in argument values

Resolved 💬 3 comments Opened Jan 29, 2026 by taichino Closed Feb 2, 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?

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

  1. Add the following permission pattern to .claude/settings.local.json:

``json
{
"permissions": {
"allow": [
"Bash(xcodebuild *)"
]
}
}
``

  1. Restart Claude Code to load the new permission.
  1. 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:

  1. 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"
`
**Result**: Permission prompt appears, despite matching the
Bash(xcodebuild *)` pattern. :x:

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_

View original on GitHub ↗

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