Global ~/.claude/settings.json allow patterns intermittently not applied in fresh CLI sessions
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
~/.claudedirectory: Is a git repository (tracking settings in a remote repo)settings.jsonsize: ~21KB, ~480 allow entries, 600+ lines
Reproduction
- Have a pattern like
Bash(aws-sso-login-:*)in~/.claude/settings.json - Start a fresh CLI session in a project directory (e.g.,
cd ~/projects/myproject && claude) - Run a command that should match the pattern (e.g.,
aws-sso-login-spdata-production) - Expected: Command runs without permission prompt
- 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.jsonthat could override (or only unrelated entries) - Had no conflicting deny rules
- The patterns are correctly formatted with
:*syntax
Settings File Details
~/.claude/settings.jsonis a regular file (not a symlink):-rw------- 1 user user 21240 Feb 25 16:08~/.claude/settings.local.jsonalso exists with ~34 entries (no conflicting patterns)- No project-level settings files that would shadow global settings (verified via glob)
Possible Contributing Factors
~/.claudeis a git repository — the.claudedirectory is tracked as a git repo. Git metadata (.git/, index files) might interfere with how Claude Code discovers or readssettings.json.- Large settings file — 480+ allow entries / 21KB could hit a parsing limit or timeout during session initialization.
- 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.jsonloading issue — all patterns are insettings.json - The patterns are correctly formatted and work in most sessions
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗