Skip to content

bypassPermissions mode still prompts for edits to ~/.claude/ files #37253

Description

@William-1776

Description

With claudeCode.initialPermissionMode set to "bypassPermissions" in VS Code User settings, edits to files under ~/.claude/ (e.g. ~/.claude/commands/*.md, ~/.claude/rules/*.md) still trigger the "Make this edit to [file]?" confirmation dialog.

Edits to files outside ~/.claude/ (e.g. project files under ~/Documents/) are correctly auto-approved — no prompt.

Expected behavior

bypassPermissions should bypass all permission checks, including edits to ~/.claude/ files. If this directory is intentionally protected, this should be documented, and ideally there should be a way to opt out.

Steps to reproduce

  1. Set "claudeCode.initialPermissionMode": "bypassPermissions" in VS Code User settings.json
  2. Open a Claude Code session in VS Code
  3. Ask Claude to edit any file under ~/.claude/ (e.g. a custom command/skill file in ~/.claude/commands/)
  4. Observe the "Make this edit?" confirmation dialog appears
  5. Ask Claude to edit a file outside ~/.claude/ — no dialog appears

Environment

  • Claude Code v2.1.81 (VS Code extension)
  • macOS 15 (Darwin 25.3.0)
  • VS Code (latest stable)

Activity

  1. github-actions commented on Mar 21, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. Bypass permissions mode still prompts for edits to ~/.claude/settings.json #37029
    2. acceptEdits mode still prompts for files in .claude/ directory (workspace root) #37107
    3. [BUG] bypassPermissions v2.1.81: .claude/skills/ not exempt from protected directory prompt despite documentation #37157

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. yurukusa commented on Mar 22, 2026

    @yurukusa

    The `~/.claude/` directory is intentionally protected — it's a hardcoded exception in the permission system to prevent the model from modifying its own settings, hooks, and rules (which would be a security concern).
    This is by design, not a bug. Even `bypassPermissions` won't bypass this protection because:

    • Hooks in `~/.claude/hooks/` control what Claude can do
    • Settings in `~/.claude/settings.json` define permissions
    • If Claude could modify these, it could escalate its own permissions
      Workaround: Use a PreToolUse hook that auto-approves edits to specific `~/.claude/` subdirectories you trust:
      ```bash
      INPUT=$(cat)
      TOOL=$(echo "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null)
      FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null)
      [[ "$TOOL" != "Edit" && "$TOOL" != "Write" ]] && exit 0
      case "$FILE" in
      /.claude/commands/|/.claude/rules/)
      jq -n '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow","permissionDecisionReason":"custom commands/rules auto-approved"}}'
      exit 0
      ;;
      esac
      exit 0
      ```
      This selectively allows edits to `commands/` and `rules/` while keeping `hooks/` and `settings.json` protected.
  3. saidelike commented on Mar 23, 2026

    @saidelike

    @William-1776 Yes it is on purpose as described in https://code.claude.com/docs/en/permissions#permission-modes

    You could maybe add:

      "permissions": {
        "allow": ["Edit(/.claude/path/to/what/you/want/**)"]
      },

    if that is really what you want.

  4. mikestankavich commented on Mar 24, 2026

    @mikestankavich

    Seeing a related but potentially distinct issue on v2.1.81 Linux. In my case, the file being created is inside the project working directory (not inside .claude/): commands/csw:cleanup.md. Bypass permissions is active per the status bar but the creation prompt still fires. The colon in the filename (csw:cleanup.md) may be a separate trigger — the namespace:command.md naming convention is common for slash commands. Happy to file separately if this is a different code path.

    Image Image Image
  5. saidelike commented on Mar 25, 2026

    @saidelike

    Seeing a related but potentially distinct issue on v2.1.81 Linux. In my case, the file being created is inside the project working directory (not inside .claude/): commands/csw:cleanup.md. Bypass permissions is active per the status bar but the creation prompt still fires. The colon in the filename (csw:cleanup.md) may be a separate trigger — the namespace:command.md naming convention is common for slash commands. Happy to file separately if this is a different code path.
    Image Image Image

    Yes it is different.

  6. ryotamurakami2fb commented on Apr 2, 2026

    @ryotamurakami2fb

    Same issue on CLI (not just VS Code)

    Experiencing the same behavior on Claude Code CLI with bypassPermissions mode.

    Reproduction

    settings.json:

    {
      "permissions": {
        "allow": ["Bash"],
        "defaultMode": "bypassPermissions"
      },
      "skipDangerousModePermissionPrompt": true
    }

    Action: Bash(rm agent.md ...) inside ~/.claude/commands/sc/

    Result:

    "Claude requested permissions to edit /Users/.../.claude/commands/sc/agent.md which is a sensitive file."

    The Bash tool is already in permissions.allow, and bypassPermissions is active — yet the "sensitive file" guard still fires.

    Workaround

    Adding PermissionRequest hooks for all three tools that touch files:

    "PermissionRequest": [
      { "matcher": "Edit",  "hooks": [{ "type": "command", "command": "echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PermissionRequest\",\"decision\":{\"behavior\":\"allow\"}}}'" }] },
      { "matcher": "Write", "hooks": [/* same */] },
      { "matcher": "Bash",  "hooks": [/* same */] }
    ]

    This defeats the purpose of bypassPermissions — you shouldn't need to manually re-bypass permissions that are already supposed to be bypassed.

    Environment

    • Claude Code CLI (not VS Code)
    • macOS 15 (Darwin 25.4.0)
    • defaultMode: "bypassPermissions" in ~/.claude/settings.json
  7. chopoalc commented on Apr 4, 2026

    @chopoalc

    Same issue here.

    macOS 15, VS Code latest, Claude Code extension latest.
    bypassPermissions configured in:

    • VS Code User Settings
    • VS Code Workspace Settings (.vscode/settings.json)
    • ~/.claude/settings.json (defaultMode: dontAsk)
    • .claude/settings.json (project, defaultMode: dontAsk)

    Still getting "Make this edit to [file]?" dialog when editing files inside .claude/skills/.

    This is very disruptive when using Claude Code for automated workflows — every skill edit requires manual approval despite full bypass configuration.

  8. michiglueck commented on Apr 12, 2026

    @michiglueck

    This being on purpose does NOT make sense at all for memory file edits though... whats the point of having a living memory system if it will need permissions constantly in order to stay up to date... same for skills

  9. mdikcinar commented on Apr 26, 2026

    @mdikcinar

    This is the second most important annoying issue after this #24726 i guess.

  10. github-actions commented on May 28, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  11. coverboy commented on Jun 14, 2026

    @coverboy

    ai 만드는 회사가 이런 버그도 못 고치다니...

  12. github-actions commented on Aug 16, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  13. locked as resolved and limited conversation to collaborators on Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:permissionsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSplatform:vscodeIssue specifically occurs in VS Code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions