[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:
CLAUDE_PLUGIN_ROOTpoints tohookify/0.1.0/(the versioned directory)- The parent directory
hookify/has no__init__.py, so it's not a valid Python package - Python cannot resolve
hookify.corebecausehookifyis not insys.pathas 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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗