hookify plugin: broken Python imports — ModuleNotFoundError on every hook execution

Resolved 💬 3 comments Opened Mar 11, 2026 by ryan-mt Closed May 21, 2026

Bug

The hookify plugin fails on every hook execution with ModuleNotFoundError: No module named 'hookify'. This affects all hooks (UserPromptSubmit, Stop, PreToolUse, PostToolUse).

Root Cause

The Python scripts in hooks/ import using a package prefix:

from hookify.core.config_loader import load_rules
from hookify.core.rule_engine import RuleEngine

But the plugin's directory structure has core/, hooks/, matchers/, utils/ at the root level — there is no hookify/ wrapper package directory:

plugins/hookify/
  core/
    __init__.py
    config_loader.py
    rule_engine.py
  hooks/
    userpromptsubmit.py  ← imports "from hookify.core..."
    stop.py
    pretooluse.py
    posttooluse.py
  matchers/
  utils/

The CLAUDE_PLUGIN_ROOT env var points to the plugin root, and the scripts add it to sys.path, but Python still can't resolve hookify.core because there's no directory named hookify on the path.

Reproduction

# From the plugin cache directory:
cd ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0

# This fails (what the hooks do):
python3 -c "import sys; sys.path.insert(0, '.'); from hookify.core.config_loader import load_rules"
# ModuleNotFoundError: No module named 'hookify'

# This works (proving the modules themselves are fine):
python3 -c "import sys; sys.path.insert(0, '.'); from core.config_loader import load_rules; print('OK')"
# OK

Visible Symptoms

Every conversation shows these error messages:

Async hook Stop completed
Hookify import error: No module named 'hookify'

Suggested Fix

Either:

  1. Change imports to relative: from core.config_loader import load_rules
  2. Or restructure the plugin directory to include a hookify/ package wrapper with __init__.py

Environment

  • Claude Code (latest)
  • Plugin: hookify@0.1.0 from claude-code-plugins marketplace
  • OS: Arch Linux
  • Python: 3.x

View original on GitHub ↗

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