claude-code - 💡(How to fix) Fix permissions.allow rules do not override protected path prompts in bypassPermissions mode [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#47086Fetched 2026-04-13 05:41:52
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

permissions.allow rules with path-specific patterns do not suppress permission prompts for protected paths (.claude/, .git/, etc.), even in bypassPermissions mode. Users who explicitly opt into allowing these paths in their settings are still prompted.

Root Cause

permissions.allow rules with path-specific patterns do not suppress permission prompts for protected paths (.claude/, .git/, etc.), even in bypassPermissions mode. Users who explicitly opt into allowing these paths in their settings are still prompted.

Fix Action

Fix / Workaround

  • This also affects Bash commands targeting protected paths (e.g., rm ~/.claude/...) even with Bash(*) in the allow list
  • The protected path check appears to be a separate enforcement layer that runs independently of and takes precedence over permissions.allow rules
  • Workaround: approve once per session via the prompt (option 2), but this defeats the purpose of bypassPermissions mode
  • --permission-mode auto is not available on Max plans, so bypassPermissions + allow rules is the only path to zero-prompt workflows for Max users

Code Example

{
     "permissions": {
       "allow": [
         "Edit(//.claude/**)",
         "Write(//.claude/**)",
         "Read(//.claude/**)",
         "Edit(//.git/**)",
         "Write(//.git/**)",
         "Read(//.git/**)"
       ]
     }
   }

---

Do you want to make this edit to noice-deployments.yaml?
  1. Yes
  2. Yes, allow all edits during this session (shift+tab)
  3. No
RAW_BUFFERClick to expand / collapse

Description

permissions.allow rules with path-specific patterns do not suppress permission prompts for protected paths (.claude/, .git/, etc.), even in bypassPermissions mode. Users who explicitly opt into allowing these paths in their settings are still prompted.

Steps to Reproduce

  1. Add path-specific allow rules to ~/.claude/settings.json:
    {
      "permissions": {
        "allow": [
          "Edit(//.claude/**)",
          "Write(//.claude/**)",
          "Read(//.claude/**)",
          "Edit(//.git/**)",
          "Write(//.git/**)",
          "Read(//.git/**)"
        ]
      }
    }
  2. Launch Claude Code with --permission-mode bypassPermissions
  3. Attempt to edit a file in .claude/ (e.g., .claude/noice-deployments.yaml)

Expected Behavior

The edit should auto-approve since:

  • The user is in bypassPermissions mode (explicitly accepting all risk)
  • The path is explicitly listed in permissions.allow

Actual Behavior

Claude still prompts:

Do you want to make this edit to noice-deployments.yaml?
  1. Yes
  2. Yes, allow all edits during this session (shift+tab)
  3. No

Environment

  • Claude Code version: latest (April 2026)
  • Plan: Max 20X
  • OS: Ubuntu 24.04
  • Model: Claude Opus 4.6

Additional Context

  • This also affects Bash commands targeting protected paths (e.g., rm ~/.claude/...) even with Bash(*) in the allow list
  • The protected path check appears to be a separate enforcement layer that runs independently of and takes precedence over permissions.allow rules
  • Workaround: approve once per session via the prompt (option 2), but this defeats the purpose of bypassPermissions mode
  • --permission-mode auto is not available on Max plans, so bypassPermissions + allow rules is the only path to zero-prompt workflows for Max users

extent analysis

TL;DR

The issue can be mitigated by approving once per session via the prompt, but a more permanent solution would require re-evaluating the precedence of protected path checks over permissions.allow rules.

Guidance

  • Review the permissions.allow rules to ensure they are correctly formatted and applied to the specific paths in question.
  • Consider the implications of the protected path check taking precedence over permissions.allow rules and how this might be adjusted to achieve the desired behavior.
  • Test the behavior with different --permission-mode settings, if available, to see if there are any variations in how permissions are handled.
  • Evaluate the potential for updating the bypassPermissions mode to properly bypass protected path checks or for adding an additional mode that specifically addresses this issue.

Example

No specific code example is provided as the issue seems to be related to the configuration and behavior of the Claude Code application rather than a code snippet that can be modified.

Notes

The solution to this issue may require changes to the Claude Code application itself, particularly in how it handles protected paths and permissions.allow rules. The current workaround of approving once per session may not be ideal for all users, especially those on Max plans where --permission-mode auto is not available.

Recommendation

Apply workaround: Approve once per session via the prompt, as this is the current available method to mitigate the issue, although it does not fully resolve the problem of achieving zero-prompt workflows with bypassPermissions mode.

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