`.claude/skills/` edits prompt for permission despite being documented as exempt (regression in 2.1.79)
Summary
Since v2.1.79, editing files under .claude/skills/ triggers a permission prompt ("Do you want to make this edit? / Yes, and allow Claude to edit its own settings for this session"), even though the documentation states .claude/skills/ is exempt from .claude/ directory protection.
Steps to Reproduce
- Have
EditandWriteinpermissions.allowinsettings.local.json - Run Claude Code v2.1.79+ in
defaultpermission mode - Ask Claude to edit any file under
.claude/skills/(e.g., a skill'sSKILL.mdor reference file)
Expected: Edit proceeds without prompting (.claude/skills/ is documented as exempt)
Actual: Permission prompt appears with "Yes, and allow Claude to edit its own settings for this session" option
Evidence
Documentation says .claude/skills/ is exempt
From the official docs:
bypassPermissionsmode skips permission prompts. Writes to.git,.claude,.vscode, and.ideadirectories still prompt for confirmation to prevent accidental corruption of repository state and local configuration. Writes to.claude/commands,.claude/agents, and.claude/skillsare exempt and do not prompt, because Claude routinely writes there when creating skills, subagents, and commands.
Binary analysis: .claude/skills missing from exemption list
Extracted from all versions (2.1.77–2.1.80), the exemption function only includes .claude/commands and .claude/agents:
// Same across all 4 versions — .claude/skills is NOT listed
function exemptPaths() {
return [...protectedDirs.filter(d => d !== ".git"), ".claude/commands", ".claude/agents"]
}
v2.1.78 changelog confirms the protection was tightened
Fixed.git,.claude, and other protected directories being writable without a prompt inbypassPermissionsmode
This fix in v2.1.78 was scoped to bypassPermissions mode. However, in v2.1.79 the protection appears to have been extended to default mode with allow-list as well (not mentioned in v2.1.79 changelog).
Session log evidence: behavior changed between versions
| Version | Mode | .claude/ writes per session | Prompting possible? |
|---------|------|------------------------------|-------------------|
| 2.1.78 | default | 110 | No (impossible to approve 110 individually) |
| 2.1.79 | default | max 13 | Yes (sharp drop suggests prompting started) |
Two Issues
- Code-docs mismatch:
.claude/skillsis documented as exempt but is not in the exemption list in code (affects all versions 2.1.77–2.1.80) - Regression in 2.1.79:
.claude/protection now applies indefaultmode withEdit/Writein the allow list, where it previously did not. This is not documented in the 2.1.79 changelog.
Impact
Projects that heavily use custom skills (with files under .claude/skills/) experience frequent permission prompts that block automated workflows. In my case, eval-driven skill development involves dozens of .claude/skills/ file writes per session.
Workaround Attempted
Added Edit(.claude/**) and Write(.claude/**) to the allow list — untested whether this overrides the .claude/ directory protection in 2.1.79+.
Environment
- Claude Code: 2.1.79 / 2.1.80
- Platform: Linux (WSL2)
- Permission mode:
default - Running as: root
10 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Workaround confirmed:
PermissionRequesthookThe
Edit(.claude/**)/Write(.claude/**)allow-list approach mentioned in the issue does not work — the hardcoded protected-directory check fires before the allow-list is consulted (separate layer).What works:
PermissionRequesthookAdded to
settings.local.json:Hook script (
permission-auto-approve.sh):Test results (20/20)
Main agent — PermissionRequest hook (10/10 PASS):
.claude/skills/,.claude/hooks/,.claude/rules/,.claude/agents/— auto-approved.claude/settings*— correctly blocked (prompt still appears).claude/skills/file — no promptSub-agent — Bash writes (10/10 PASS):
PermissionRequesthooks do not fire for sub-agentscat >,sed -i,tee, etc.) instead of Edit/Write.claude/subdirectories writable via Bash without promptsLimitations
| Scope | Works? | Note |
|-------|--------|------|
| Main agent (CLI terminal) | ✅ | PermissionRequest hook |
| Sub-agents | ⚠️ | Bash only (#23983) |
| VS Code extension | ❌ | PermissionRequest hooks don't fire (#35942) |
|
-p(non-interactive) mode | ❓ | Untested |Credit: approach from #36044 (@echthesia).
+1 — Hitting this exact issue. I have an umbrella workspace with multiple Areas, each with their own
.claude/skills/directories (e.g.,~/Documents/Antigravity/Areas/YouTube/.claude/skills/foo/SKILL.md).The
/.claude/path pattern match triggers the protection on every project-level.claude/skills/edit, not just~/.claude/. This makes bypass permissions mode unusable for any workflow that programmatically updates skills.Environment:
bypassPermissionsmode with explicitEdit(.claude/**)andWrite(.claude/**)allow rules — neither overrides the hardcoded protectionThe two issues as I understand them:
.claude/skills/exemption was never implemented (onlycommands/andagents/are exempted)/.claude/anywhere in the path, so project-level.claude/dirs get the same treatment as~/.claude/Both need to be fixed — even if the skills exemption worked, it still shouldn't be protecting project-level
.claude/directories the same way it protects the root config.This issue is preventing the full use of the Skills feature.
There are several types of documents that one might want to update in a collated skill folder, such as JSON state trackers or perhaps other ancillary markdown prompts.
This is blocking significant work and certainly want to stay up-to-date when the
bypassPermissionsfinally actually does indeed _bypass permissions_.This regression is such bullshit. I can't get any combination of hooks and permissions to overwrite this embedded claude code behavior.
The only real fix that I found is just write a script to force overwrite what's in the ~/.claude from what you have somewhere else in version control.
Update: The .claude/ protection is even more aggressive than I thought. It doesn't just block ~/.claude/ — it blocks any path containing .claude/ anywhere in the filesystem.
I just tested ~/dotfiles/test/.claude/test.txt and got two permission prompts (one for Read, one for Edit), despite having Edit(/Users/jameshounshell/dotfiles/**) in my allowlist.
So if you happen to have a directory named .claude/ anywhere in your repo structure — maybe you're version-controlling Claude configs, maybe you're building tooling around Claude, maybe you just like the name — Claude Code will block every read and write operation to any file inside it, regardless of wildcards, regardless of permissions, regardless of common sense.
The only workaround: don't use the name .claude/ anywhere. Ever. For anything. Because apparently it's a reserved keyword for the entire filesystem.
I ran into the same issue trying to let Claude use a temp directory at ~/.claude/tmp to keep claude's scratchwork in one place while working on various things across multiple projects. I naively tried to grant permissions to
~/.claude/tmp/**by adding it to the allow list for the Read and Edit tools only to discover the strict guard against edits to everything within~/.claudethat takes precedence. I also rely on Claude self-enhancing skills, but don't yet have an automated workflow so I hadn't encountered that friction. That said, while I think the higher-level restriction is warranted, users should still be able to override those permission paths at their own peril. I can move my temp directory or experiment with a permission hook, but enabling the ability to self-edit skills should be a simple toggle and merits a mention in the permission docs.Pretty glaring bug but unfortunately it'll be several months before it's even acknowledged ☹️
ai 만드는 회사가 이런 버그도 못 고치다니...
This is still an issue.