Skip to content

Permissions in settings.local.json not respected after Edit tool modifies the file #41259

Description

@JWDavey

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

  1. Start a Claude Code session in a project that has .claude/settings.local.json with permissions configured
  2. Have Claude use the Edit tool to modify .claude/settings.local.json (e.g., adding new permission entries)
  3. After the edit, run a Bash command that matches an existing allow rule (e.g., sqlcmd:*)
  4. The user is prompted for approval even though the rule is in the allow list
  5. User selects "Yes, and don't ask again for: sqlcmd:*"
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:permissionsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions