claude-code - 💡(How to fix) Fix [BUG] "Yes, and always allow" never persists for edits inside `.claude/` directories [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49262Fetched 2026-04-17 08:46:16
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
1
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When Claude Code prompts for permission to edit a file inside a .claude/ directory (project or global), choosing "Yes, and always allow" does not persist. The prompt re-appears for every subsequent edit to the same path/pattern within the same session and across sessions. The choice is treated as a one-shot "yes" — no rule is written, and the next edit re-prompts.

What Should Happen?

Selecting "always allow" should add a matching Edit rule to ~/.claude/settings.json (or project .claude/settings.local.json) so future edits to the same path are auto-approved.

Error Messages/Logs

Steps to Reproduce

  1. Trigger any edit under .claude/ (e.g. Edit ~/.claude/keybindings.json).
  2. Choose "Yes, and always allow" at the permission prompt.
  3. Trigger another edit to the same file → prompt re-appears.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.111

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • Other Edit always-allow choices (outside .claude/) appear to persist correctly.
  • Suspected cause: .claude/ paths may be filtered out of permission rule writes as a safety guard, but the UI still offers the option.

extent analysis

TL;DR

The issue can be fixed by modifying the code to correctly handle the persistence of "always allow" permissions for edits within the .claude/ directory.

Guidance

  • Investigate the code responsible for writing permission rules to ~/.claude/settings.json or project .claude/settings.local.json to ensure it correctly handles .claude/ paths.
  • Verify that the UI's "always allow" option is properly connected to the underlying permission system, and that the system is not filtering out .claude/ paths as a safety guard.
  • Check the differences in how "always allow" permissions are handled for paths outside of .claude/ to identify potential inconsistencies in the code.
  • Test the permission persistence with different file paths and patterns within the .claude/ directory to ensure the issue is not specific to a particular file or location.

Example

No specific code snippet can be provided without more information about the internal workings of Claude Code, but the investigation should focus on the functions or methods responsible for writing permission rules and handling the "always allow" option.

Notes

The issue may be related to a safety guard or filtering mechanism that prevents certain paths from being written to the permission rules, but without more information about the codebase, it's difficult to provide a more specific solution.

Recommendation

Apply a workaround by manually adding the necessary Edit rule to ~/.claude/settings.json or project .claude/settings.local.json until the underlying issue can be resolved, as the automatic persistence of "always allow" permissions for edits within the .claude/ directory appears to be faulty.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] "Yes, and always allow" never persists for edits inside `.claude/` directories [1 comments, 2 participants]