[BUG] Permission rules with command arguments cause settings.json validation failure

Resolved 💬 6 comments Opened Oct 22, 2025 by u88803494 Closed Jan 11, 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?

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:

  1. Work as intended (deny git reset commands with --hard flag), OR
  2. 2. Show a clear, specific error message explaining exactly why the rule is invalid, such as:
  3. - "Permission rules cannot contain command arguments after wildcards"
  4. - "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

  1. Create a ~/.claude/settings.json file with the following content:
{
  "permissions": {
    "deny": [
      "Bash(git reset:* --hard)"
    ]
  }
}
  1. Restart Claude Code
  2. 3. Check the Settings tab
  3. 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_

View original on GitHub ↗

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