Broken plugin hook blocks Edit/Write tools - missing cache file causes complete tool failure

Resolved 💬 3 comments Opened Jan 7, 2026 by jacopone Closed Jan 11, 2026

Bug Report: Broken plugin hook blocks Edit/Write tools

Description

When a plugin hook references a file that doesn't exist in the cache, all Edit/Write/MultiEdit tool operations are blocked with an error. The user cannot proceed with any file modifications until the session is restarted with the plugin disabled.

Error Message

PreToolUse:Callback hook blocking error from command: "callback": /run/current-system/sw/bin/python3: can't open file '/home/guyfawkes/.claude/plugins/cache/claude-plugins-official/security-guidance/6d3752c000e2/hooks/security_reminder_hook.py': [Errno 2] No such file or directory

Steps to Reproduce

  1. Have a plugin installed that registers a PreToolUse hook (e.g., security-guidance@claude-plugins-official)
  2. The plugin cache gets corrupted/deleted, or the plugin version changes leaving stale references
  3. Try to use Edit, Write, or MultiEdit tools
  4. All operations are blocked with "No such file or directory" error

Expected Behavior

  • Claude Code should gracefully handle missing hook files (log warning, skip the hook)
  • OR disabling the plugin in settings.json should take effect immediately without requiring session restart

Actual Behavior

  • Tool operations are completely blocked
  • Disabling the plugin in settings.json has no effect until session restart
  • User is stuck and cannot make any file edits

Environment

  • Claude Code version: Latest
  • OS: NixOS Linux
  • Plugin: security-guidance@claude-plugins-official

Workaround

  1. Disable the plugin in ~/.claude/settings.json:

``json
"enabledPlugins": { "security-guidance@claude-plugins-official": false }
``

  1. Exit and restart Claude Code session

Suggested Fix

  1. Wrap hook execution in try-catch and gracefully handle missing files
  2. Validate hook file existence before attempting to execute
  3. Allow runtime plugin enable/disable without requiring restart

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗