UserPromptSubmit hook failure blocks all input when plugin cache file is missing [Errno 2]

Resolved 💬 0 comments Opened May 31, 2026 by areschen2022-cmyk Closed Jun 1, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Bug Description

When a plugin's hook script file is missing (e.g., after cache is cleared),
the UserPromptSubmit hook fails at the OS level with [Errno 2] No such file
or directory
. Claude Code then blocks all user input, making the application
completely unusable. Restarting does not resolve the issue.

Steps to Reproduce

  1. Install a plugin that registers a UserPromptSubmit hook (e.g., hookify)
  2. Plugin cache files are cleared or lost (e.g., after system cleanup)
  3. Restart Claude Code
  4. Try to type any message

Expected Behavior

When a hook script file does not exist, Claude Code should skip the hook or
show a warning — it should NOT block user input.

Actual Behavior

Every input attempt triggers the missing hook, resulting in:

What Should Happen?

Claude Code becomes completely unusable. The issue persisted for several days
with no workaround except manually editing settings.json to remove the hook.

Root Cause

The hook command python3 "${CLAUDE_PLUGIN_ROOT}/hooks/userpromptsubmit.py"
fails at the OS level before Python even starts. The plugin's internal
try/except and sys.exit(0) error handling never executes. Claude Code
receives a non-zero exit code and blocks UserPromptSubmit entirely.

Environment

  • OS: Windows 11
  • Plugin: hookify (claude-plugin-marketplace-zh-tw)
  • Hook type: UserPromptSubmit

Suggested Fix

Non-zero exit codes from UserPromptSubmit hooks should degrade gracefully
(show a systemMessage warning) rather than blocking all input. This is
especially critical for UserPromptSubmit since a failure completely locks
the user out.

Error Messages/Logs

[Errno 2] No such file or directory: 'C:\Users\User\.claude\plugins\...\hooks\userpromptsubmit.py'

Steps to Reproduce

  1. Install the hookify plugin from claude-plugin-marketplace-zh-tw
  2. Enable the plugin (sets UserPromptSubmit hook in settings.json)
  3. Clear or delete the plugin cache files (e.g., system cleanup or manual deletion)
  4. Restart Claude Code
  5. Try to type any message in the input field

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

  • Claude Code Version: 2.1.143 (Claude Code) - Platform: Windows 11

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗