Global ~/.claude/settings.json allow patterns intermittently not applied in fresh CLI sessions

Resolved 💬 3 comments Opened Feb 26, 2026 by felipekj Closed Mar 3, 2026

Bug Description

Global ~/.claude/settings.json allow patterns are intermittently not applied when launching fresh CLI sessions in project directories. Commands that should be auto-allowed by existing patterns are being prompted for permission.

Environment

  • Claude Code: CLI (not IDE plugin)
  • OS: Linux 6.8.0-101-generic
  • Sessions: Fresh sessions (not resumed), different projects
  • ~/.claude directory: Is a git repository (tracking settings in a remote repo)
  • settings.json size: ~21KB, ~480 allow entries, 600+ lines

Reproduction

  1. Have a pattern like Bash(aws-sso-login-:*) in ~/.claude/settings.json
  2. Start a fresh CLI session in a project directory (e.g., cd ~/projects/myproject && claude)
  3. Run a command that should match the pattern (e.g., aws-sso-login-spdata-production)
  4. Expected: Command runs without permission prompt
  5. Actual: Permission prompt appears as if the pattern doesn't exist

Data Points

Three separate occurrences across different projects and commands:

| Command | Matching Pattern | Project | Pattern Line |
|---------|-----------------|---------|--------------|
| aws-sso-login-spdata-production | Bash(aws-sso-login-:*) | sgh-desktop | 164 |
| mkdir -p /home/user/projects/spdata/github/composite-actions/git/merge-back/v1 | Bash(mkdir:*) | digital-integrator | 457 |
| aws s3api list-buckets --profile spdata-production --query '...' 2>&1 | Bash(aws s3api list-:*) | digital-integrator | 397 |

All three:

  • Were in fresh CLI sessions (not resumed)
  • Had no project-level .claude/settings.json that could override (or only unrelated entries)
  • Had no conflicting deny rules
  • The patterns are correctly formatted with :* syntax

Settings File Details

  • ~/.claude/settings.json is a regular file (not a symlink): -rw------- 1 user user 21240 Feb 25 16:08
  • ~/.claude/settings.local.json also exists with ~34 entries (no conflicting patterns)
  • No project-level settings files that would shadow global settings (verified via glob)

Possible Contributing Factors

  1. ~/.claude is a git repository — the .claude directory is tracked as a git repo. Git metadata (.git/, index files) might interfere with how Claude Code discovers or reads settings.json.
  2. Large settings file — 480+ allow entries / 21KB could hit a parsing limit or timeout during session initialization.
  3. Intermittent nature — these same patterns work correctly in most sessions, suggesting a race condition or timing issue during startup.

Notes

  • This is NOT the known IDE plugin bug (#10026, #5710) — all occurrences are from the CLI
  • This is NOT a settings.local.json loading issue — all patterns are in settings.json
  • The patterns are correctly formatted and work in most sessions

View original on GitHub ↗

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