Permissions in settings.local.json not respected after Edit tool modifies the file
Bug Description
When Claude (the AI assistant) edits .claude/settings.local.json using the Edit tool during a session, the permission rules in that file stop being respected. The user is repeatedly prompted for commands that are already in the permissions.allow list.
Steps to Reproduce
- Start a Claude Code session in a project that has
.claude/settings.local.jsonwith permissions configured - Have Claude use the Edit tool to modify
.claude/settings.local.json(e.g., adding new permission entries) - After the edit, run a Bash command that matches an existing allow rule (e.g.,
sqlcmd:*) - The user is prompted for approval even though the rule is in the allow list
- User selects "Yes, and don't ask again for: sqlcmd:*"
- The permission is added to the file (confirmed by reading it), but the user is prompted again on the next matching command
Expected Behavior
Permission rules in settings.local.json should be respected regardless of whether the file was modified by the Edit tool or by Claude Code's own permission-saving mechanism.
Actual Behavior
After the Edit tool modifies settings.local.json, the in-memory permission state appears to get out of sync with the file on disk. Even though the file contains the correct Bash(sqlcmd:*) allow rule, the user is repeatedly prompted. Selecting "Yes, and don't ask again" writes the rule to the file (it's already there), but the prompt reappears on subsequent matching commands.
Environment
- Platform: Windows 11 Pro (win32)
- Shell: bash (Git Bash)
- Claude Code version: Latest as of 2026-03-30
Workaround
Stop using the Edit tool to modify settings.local.json and only let Claude Code manage the file through its own permission prompt mechanism. Once Claude stops editing the file, user-approved permissions persist correctly.
Additional Context
The file on disk is correct -- reading it shows the permission rule is present. The issue appears to be that Claude Code's in-memory permission cache doesn't reload after an external (Edit tool) write, or that the Edit tool write triggers a file-watch event that reloads an older cached version.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗