claude-code - 💡(How to fix) Fix [BUG] .claude/** writes still prompt for permission despite explicit Write(.claude/**) and bare Write allowlist entries [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#49378Fetched 2026-04-17 08:42:49
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

There's a reasonable secondary read of this report as a scope question: even if .claude/** patterns are intentionally excluded for some safety reason (preventing prompt-injection-driven self-modification?), the bare Write rule should still cover it — and if Claude Code is going to special-case .claude/ writes, that exception should be documented and ideally configurable, not silent.

Error Messages/Logs

Code Example

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

---

(no errors — the prompt itself is the unexpected behaviour)

---

{
     "permissions": {
       "allow": [
         "Write",
         "Write(.claude/**)",
         "Write(**/.claude/**)"
       ]
     }
   }
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?

Writes (and edits) to files inside a project-local .claude/ directory still trigger a manual Do you want to create test-permission.md? permission prompt, even when the user-level permissions.allow list explicitly grants them.

In my ~/.claude/settings.json I have all of the following entries (deliberately overlapping to be sure I covered the case):

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

Despite this, when Claude tries to create .claude/commands/test-permission.md inside a project, the prompt still appears:

Permission prompt screenshot

The prompt offers Yes / Yes, allow all edits during this session / No — i.e. Claude Code is treating this write as if no relevant rule were configured. The bare Write rule alone should be sufficient; the two .claude/** patterns should make this iron-clad. Neither matches.

What Should Happen?

When the user has any of:

  • Write (bare, allow-all)
  • Write(.claude/**) (matches project-relative path)
  • Write(**/.claude/**) (matches anywhere)

…in their permissions.allow list, file creation/edit inside <project>/.claude/ should proceed silently without a permission prompt.

There's a reasonable secondary read of this report as a scope question: even if .claude/** patterns are intentionally excluded for some safety reason (preventing prompt-injection-driven self-modification?), the bare Write rule should still cover it — and if Claude Code is going to special-case .claude/ writes, that exception should be documented and ideally configurable, not silent.

Error Messages/Logs

(no errors — the prompt itself is the unexpected behaviour)

Steps to Reproduce

  1. In ~/.claude/settings.json add (or confirm) the following permissions allow entries:
    {
      "permissions": {
        "allow": [
          "Write",
          "Write(.claude/**)",
          "Write(**/.claude/**)"
        ]
      }
    }
  2. Open Claude Code in any project directory (no .claude/ need exist yet).
  3. Ask Claude to create a file at .claude/commands/test-permission.md with any content.
  4. Observed: a Do you want to create test-permission.md? prompt appears.
  5. Expected: the file is created silently, since multiple rules in the allowlist explicitly grant the operation.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.111

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

  • Tested on Ubuntu 25.10, KDE Plasma, Konsole, Claude Code 2.1.111.
  • Both .claude/** and **/.claude/** are present in the allowlist as a belt-and-braces precaution; neither suffices.
  • The bare Write rule (which has no path scope and should match everything) also does not cover this — which is what makes me think .claude/ is being special-cased in the matcher rather than this being a glob-pattern bug.
  • If the special-casing is intentional, please consider documenting it and exposing an opt-out — for users who use Claude Code heavily for managing their own Claude scaffolding (commands, skills, agents, hooks), the per-file prompts add a lot of friction.

extent analysis

TL;DR

The issue can be resolved by re-examining the permission rules in the ~/.claude/settings.json file, specifically focusing on how the .claude/ directory is handled, as the current rules seem to not apply as expected.

Guidance

  • Review the documentation for Claude Code to see if there are any specific rules or exceptions for the .claude/ directory that might explain why the current permissions are not being applied as expected.
  • Consider testing with a different directory or path to see if the issue is specific to .claude/ or if it's a more general problem with the permission system.
  • Check for any updates to Claude Code that might address this issue, as the version being used (2.1.111) might have known issues or limitations with permission handling.
  • If the special casing of .claude/ is intentional, look for configuration options or workarounds that might allow for silent writes to this directory without prompting.

Example

No specific code example is provided as the issue seems to be related to configuration and permission rules rather than code implementation.

Notes

The exact cause of the issue is not clear without more information about how Claude Code handles permissions internally, especially regarding the .claude/ directory. The steps to reproduce are well-documented, which should help in diagnosing the issue.

Recommendation

Apply a workaround by either finding a configuration option to opt-out of the special casing for .claude/ or by using a different directory for files that need to be written without prompting, if such an option is available and documented. This approach is chosen because the current behavior seems to be unexpected and might be due to an undocumented feature or bug in Claude Code's permission handling.

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] .claude/** writes still prompt for permission despite explicit Write(.claude/**) and bare Write allowlist entries [1 comments, 2 participants]