Permission Rules Should Merge Instead of Override
Feature Request: Permission Rules Should Merge Instead of Override
Problem
When selecting "Allow and remember" (允许并记住) for a permission request, the tool writes the permission rule to the local settings.local.json file, which completely replaces the global permissions configuration.
Current Behavior
Global permissions: [A, B, C]
User adds local: [D, E, F]
Result: [D, E, F] ❌ Completely overrides global
Expected Behavior
Global permissions: [A, B, C]
User adds local: [D, E, F]
Result: [A, B, C, D, E, F] ✅ Merge global + local
Or at least keep global as the baseline and only add new rules.
Why This Matters
- Global permissions are designed as a baseline for all projects
- Local configurations should be extensions, not replacements
- Current behavior defeats the purpose of having a robust global permissions setup
- Every time "Allow and remember" is used in a new project, global permissions get clobbered
Example Use Case
User has these global permissions:
Bash(git:*)ReadBash(python3:*)Bash(npm:*)
In a new project, encountering Bash(pip3 install), user selects "Allow and remember".
Current result: Local permissions now only contain Bash(pip3 install), losing git:*, Read, python3, npm - breaking existing workflows.
Expected result: Local permissions should be git:*, Read, python3, npm, Bash(pip3 install).
Suggested Solution
When "Allow and remember" is selected:
- If
settings.local.jsondoesn't exist, create it with the new permission - If
settings.local.jsonexists and containspermissions, merge instead of replace:
- Keep all global permissions
- Add new permission if not already present
- Optionally allow local to override specific permissions if explicitly configured
Workaround
Currently, users must manually edit ~/.claude/settings.json after each "Allow and remember" action, which is:
- Tedious
- Easy to forget
- Counter to the tool's "remember" UX intent
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗