claude-code - 💡(How to fix) Fix Plugin PreToolUse hooks silently override `bypassPermissions` / `acceptEdits` with no indication to the user [3 comments, 3 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#54972Fetched 2026-05-01 05:49:37
View on GitHub
Comments
3
Participants
3
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×6commented ×3

A plugin can register a PreToolUse hook that forces a confirmation prompt on every matching tool call, and this overrides the user's permission mode (acceptEdits, bypassPermissions) and the user's allowlist entries. The user has no in-session indication that the prompt is coming from a plugin hook rather than from the normal permission system, and no way to tell from the prompt UI which plugin is responsible.

Root Cause

The prompt UI shows only the standard "Do you want to make this edit? [Yes / Yes, allow all edits during this session / No]" — there is nothing identifying that a plugin hook is the source, and clicking "Yes, allow all edits during this session" does not stick because the hook re-fires on the next tool call.

Code Example

{
  "hooks": {
    "PreToolUse": [
      {
        "hooks": [
          { "type": "command", "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py" }
        ],
        "matcher": "Edit|Write|MultiEdit"
      }
    ]
  }
}
RAW_BUFFERClick to expand / collapse

Summary

A plugin can register a PreToolUse hook that forces a confirmation prompt on every matching tool call, and this overrides the user's permission mode (acceptEdits, bypassPermissions) and the user's allowlist entries. The user has no in-session indication that the prompt is coming from a plugin hook rather than from the normal permission system, and no way to tell from the prompt UI which plugin is responsible.

Concrete case

The official plugin security-guidance@claude-plugins-official (file: ~/.claude/plugins/cache/claude-plugins-official/security-guidance/unknown/hooks/hooks.json) registers:

{
  "hooks": {
    "PreToolUse": [
      {
        "hooks": [
          { "type": "command", "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py" }
        ],
        "matcher": "Edit|Write|MultiEdit"
      }
    ]
  }
}

With this plugin enabled, every single Edit, Write, and MultiEdit call triggers a confirmation prompt — even when the user has all of:

  • permissions.defaultMode: "acceptEdits"
  • permissions.allow containing Bash(*), Read, Write, Edit, MultiEdit, NotebookEdit
  • Toggled auto-accept edits (shift+tab) on at the session level

The prompt UI shows only the standard "Do you want to make this edit? [Yes / Yes, allow all edits during this session / No]" — there is nothing identifying that a plugin hook is the source, and clicking "Yes, allow all edits during this session" does not stick because the hook re-fires on the next tool call.

User-visible impact

I spent ~6–7 sessions trying to figure out why acceptEdits had stopped working. I rewrote my settings, added wildcard allowlist entries, switched to bypassPermissions, restarted Claude Code repeatedly — none of it helped, because the prompt was coming from the plugin hook layer, not the permission layer. The cause was only found by greping the plugin cache for hooks.json files.

Suggested fixes

Any of these would be enough on their own:

  1. Surface plugin-originated prompts visually, e.g. label them "from security-guidance plugin" so users know which knob to turn.
  2. Make plugin hooks honor bypassPermissions (or document loudly that they don't, and provide a way to disable plugin hooks for a session — a flag, an /unhook command, etc.).
  3. Make plugin enable/disable state more visible — the user usually doesn't remember which plugins are active or what hooks they registered.
  4. At minimum, document this behavior clearly in the plugin docs and the permissions docs.

Environment

  • Claude Code 2.1.123
  • macOS Darwin 25.5.0
  • Plugin: security-guidance@claude-plugins-official, version unknown per the cache directory name

extent analysis

TL;DR

The issue can be resolved by making plugin hooks honor the bypassPermissions setting or by surfacing plugin-originated prompts visually to inform users of the source.

Guidance

  • To verify if a plugin hook is causing the issue, check the plugin cache for hooks.json files, such as the one in ~/.claude/plugins/cache/claude-plugins-official/security-guidance/unknown/hooks/hooks.json.
  • Consider disabling the security-guidance plugin to see if the confirmation prompts stop appearing for Edit, Write, and MultiEdit calls.
  • Review the plugin documentation and the permissions documentation for any mentions of how plugin hooks interact with user permissions and allowlists.
  • If possible, test the behavior with different permission modes (acceptEdits, bypassPermissions) and allowlist entries to understand how they interact with plugin hooks.

Example

No code snippet is provided as the issue is more related to configuration and plugin behavior rather than code.

Notes

The exact behavior and interaction between plugin hooks and user permissions might depend on the specific version of the security-guidance plugin and Claude Code. The suggested fixes aim to improve transparency and control over plugin-originated prompts.

Recommendation

Apply a workaround by disabling the security-guidance plugin or seeking an update that makes plugin hooks honor bypassPermissions, as this would directly address the user's issue with unwanted confirmation prompts.

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 Plugin PreToolUse hooks silently override `bypassPermissions` / `acceptEdits` with no indication to the user [3 comments, 3 participants]