[BUG] Permission rules with command arguments cause settings.json validation failure
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?
When using permission rules that include command arguments with spaces after the wildcard (e.g., Bash(git reset:* --hard)), the entire settings.json file is marked as invalid and silently ignored by Claude Code.
The Settings tab displays:⚠ Found invalid settings files: ~/.claude/settings.json. They will be ignored.
However, no specific error message explains what's wrong with the file, making it difficult to diagnose the issue.
What Should Happen?
The permission rule should either:
- Work as intended (deny
git resetcommands with--hardflag), OR - 2. Show a clear, specific error message explaining exactly why the rule is invalid, such as:
- - "Permission rules cannot contain command arguments after wildcards"
- - "Invalid pattern in deny rules: Bash(git reset:* --hard)"
This would help users quickly identify and fix the issue instead of silently ignoring the entire settings file.
Error Messages/Logs
⚠ Found invalid settings files: /Users/henrylee/.claude/settings.json. They will be ignored.
Steps to Reproduce
- Create a
~/.claude/settings.jsonfile with the following content:
{
"permissions": {
"deny": [
"Bash(git reset:* --hard)"
]
}
}
- Restart Claude Code
- 3. Check the Settings tab
- 4. Observe: The entire settings.json file is marked as invalid and ignored
Affected patterns:
Bash(git reset:* --hard)- -
Bash(git push:* --force) - - -
Bash(git commit:* --no-verify) - - - -
Bash(git push:* --no-verify)
Working patterns (for comparison):
- ✅
Bash(rm -rf:*)(space before colon) - - ✅
Bash(git reset:*)(no arguments after wildcard)
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.25
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗