Permissions array gets completely overwritten instead of appending new permissions
Resolved 💬 3 comments Opened Aug 9, 2025 by ggdayup Closed Aug 10, 2025
Bug Description
When approving a new command permission in Claude Code, the entire permissions.allow array in .claude/settings.local.json gets replaced with only the newly approved permission, losing all previously configured permissions.
Steps to Reproduce
- Have multiple permissions configured in
.claude/settings.local.json - Run a new command that requires permission approval in Claude Code
- Approve the permission
- Check
.claude/settings.local.json- all previous permissions are gone
Expected Behavior
The new permission should be appended to the existing permissions.allow array, preserving all previously configured permissions.
Actual Behavior
The entire permissions.allow array is replaced with only the newly approved permission, causing data loss.
Example
Before approving WebFetch(domain:github.com):
{
"permissions": {
"allow": [
"Bash(npm run build:*)",
"Bash(curl:*)",
"Bash(git:*)"
]
}
}
After approving WebFetch(domain:github.com):
{
"permissions": {
"allow": [
"WebFetch(domain:github.com)" // All previous permissions lost\!
]
}
}
Impact
- Users lose all their previously configured permissions
- Have to manually restore from backups
- Disrupts workflow as previously approved commands need re-approval
- Security implications as users might approve broader permissions to avoid repeated approvals
Workaround
Currently backing up .claude/settings.local.json before each session.
Environment
- Claude Code version: Latest
- OS: macOS
- Project: Local project with
.claude/settings.local.json
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗