[hookify plugin] ImportError: No module named 'hookify' - incorrect Python imports

Resolved 💬 3 comments Opened Dec 12, 2025 by mak1jk Closed Dec 16, 2025

Bug Description

The hookify plugin fails to import its modules with error:

Hookify import error: No module named 'hookify'

This error appears on every hook event (UserPromptSubmit, PreToolUse, PostToolUse, Stop).

Root Cause

The hook scripts use from hookify.core.config_loader import ... but:

  1. CLAUDE_PLUGIN_ROOT points to hookify/0.1.0/ (the versioned directory)
  2. The parent directory hookify/ has no __init__.py, so it's not a valid Python package
  3. Python cannot resolve hookify.core because hookify is not in sys.path as a package

Directory structure:

claude-code-plugins/
  hookify/              ← NO __init__.py (not a Python package!)
    0.1.0/              ← CLAUDE_PLUGIN_ROOT points here
      __init__.py
      core/
        __init__.py
        config_loader.py
        rule_engine.py
      hooks/
        userpromptsubmit.py
        pretooluse.py
        posttooluse.py
        stop.py

Affected Files

  • hooks/userpromptsubmit.py (lines 22-23)
  • hooks/pretooluse.py (lines 26-27)
  • hooks/posttooluse.py (lines 22-23)
  • hooks/stop.py (lines 22-23)
  • core/rule_engine.py (lines 10, 278)

Suggested Fix

Change imports from:

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

to:

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

Since PLUGIN_ROOT is already added to sys.path, core/ is directly accessible.

Environment

  • Claude Code version: latest
  • OS: macOS 15.2 (Darwin 25.1.0)
  • Plugin version: hookify 0.1.0
  • Python: 3.x

Workaround

Manually edit the 5 files listed above, replacing from hookify.core with from core.

View original on GitHub ↗

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