[BUG] settings.local.json Overwritten During Tool Execution

Resolved 💬 3 comments Opened Oct 9, 2025 by BR4096 Closed Oct 9, 2025

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:

  1. The .claude/settings.local.json file should remain unchanged
  2. All previously granted permissions should be preserved
  3. 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

  1. 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:*)"
]
}
}

  1. Verify Initial State:

wc -l .claude/settings.local.json # Output: 10 lines
grep -c '"Bash(' .claude/settings.local.json # Output: 5 permissions

  1. Execute Tool Call: Run any bash command using granted permission:

npm run typecheck

  1. Check Result:

wc -l .claude/settings.local.json # Output: 9 lines (reduced!)
cat .claude/settings.local.json

  1. 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_

View original on GitHub ↗

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