[BUG] settings.local.json Overwritten During Tool Execution
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The .claude/settings.local.json file is being completely overwritten during tool execution, replacing all granted permissions with only the permission(s) for the tool just executed. This causes loss of all previously granted automation permissions and requires manual restoration multiple times per session.
What Should Happen?
When a tool is executed using a granted permission:
- The .claude/settings.local.json file should remain unchanged
- All previously granted permissions should be preserved
- If a new permission is needed, it should be appended to the existing list
Error Messages/Logs
No error msgs
Steps to Reproduce
Environment
- OS: macOS (Darwin 24.6.0)
- Project: React + TypeScript + Vite + Supabase
- Settings File: .claude/settings.local.json with 87 granted permissions
- Session Duration: ~2 hours of active development
Steps to Reproduce
- Setup: Create .claude/settings.local.json with multiple permissions:
{
"permissions": {
"allow": [
"Bash(npm run *)",
"Bash(git status:*)",
"Bash(wc -l:*)",
"Bash(grep -c:*)",
"Bash(echo:*)"
]
}
}
- Verify Initial State:
wc -l .claude/settings.local.json # Output: 10 lines
grep -c '"Bash(' .claude/settings.local.json # Output: 5 permissions
- Execute Tool Call: Run any bash command using granted permission:
npm run typecheck
- Check Result:
wc -l .claude/settings.local.json # Output: 9 lines (reduced!)
cat .claude/settings.local.json
- Observe: File now contains ONLY "Bash(npm run typecheck:*)", all other permissions lost
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.12 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗