claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Malformed permission pattern causes entire settings.json to be silently rejected

Open ChadNedzlek opened this issue 1 month ago • 3 comments

Description

When a permission pattern in settings.json has an incorrect format (e.g., "Bash(mkdir*)" instead of "Bash(mkdir:*)"), the entire settings file is silently rejected. Claude Code either keeps using the previous/cached version of settings, or uses no settings at all. There is zero indication that the file failed to load.

Steps to Reproduce

  1. Start with working settings.json containing valid permissions
  2. Verify permissions load correctly with /permissions command
  3. Modify the file to add a malformed pattern: "Bash(mkdir*)" (missing the : before *)
  4. Save the file
  5. Check /permissions again
  6. Observe that the old settings are still in effect - the file changes were completely ignored

Expected Behavior

One of:

  • Parse Bash(mkdir*) as valid (if intended to support this syntax)
  • Show clear error: "Error loading settings.json: Invalid permission format 'Bash(mkdir*)' at line X - expected 'Bash(command:*)'"
  • Display warning in UI/logs indicating settings file was rejected
  • Refuse to start until settings.json is fixed
  • At minimum: LOG the error somewhere

Actual Behavior

  • Entire settings.json is silently rejected
  • Claude Code continues using old/cached settings (or defaults)
  • No error message anywhere (UI, logs, stderr)
  • File changes appear to be ignored
  • User has no indication anything is wrong

Impact

CRITICAL - Users can spend hours:

  • Adding new permissions that never take effect
  • Modifying settings that are silently ignored
  • Debugging phantom issues (permissions not working, settings not applying)
  • Assuming file watchers are broken or there are hard limits

All because of a single-character typo that produces zero feedback.

Root Cause

Pattern identified in testing: "Bash(mkdir*)" instead of "Bash(mkdir:*)" in settings.json caused complete file rejection.

Environment

  • Platform: Windows
  • Claude Code version: 2.0.54 (latest)

Fix Applied

Changed "Bash(mkdir*)" to "Bash(mkdir:*)" - all 183 permissions then loaded correctly.

Severity

Critical - Silent failure of critical configuration file with no user feedback

ChadNedzlek avatar Nov 26 '25 12:11 ChadNedzlek