Hookify plugin: Python import error - 'No module named hookify'

Resolved 💬 3 comments Opened Dec 9, 2025 by hopeoverture Closed Dec 10, 2025

Bug Description

The hookify plugin fails with No module named 'hookify' error on every prompt submission because the Python import paths are incorrect.

Error Message

UserPromptSubmit says: Hookify import error: No module named 'hookify'

Root Cause

The Python hook scripts (e.g., hooks/userpromptsubmit.py) attempt to import modules using:

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

However, the plugin directory structure is:

.claude/plugins/cache/claude-code-plugins/hookify/0.1.0/
├── core/
│   ├── config_loader.py
│   └── rule_engine.py
├── hooks/
│   ├── userpromptsubmit.py
│   ├── pretooluse.py
│   ├── posttooluse.py
│   └── stop.py
└── ...

When CLAUDE_PLUGIN_ROOT is set to the plugin directory (.../hookify/0.1.0/), the import from hookify.core... fails because there's no hookify subdirectory - the plugin root is the hookify directory.

Fix

Change all 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

Files Affected

  1. hooks/userpromptsubmit.py
  2. hooks/pretooluse.py
  3. hooks/posttooluse.py
  4. hooks/stop.py
  5. core/rule_engine.py

Environment

  • OS: Windows 11
  • Python: 3.14.0
  • Claude Code version: 2.0.45+
  • Hookify plugin version: 0.1.0

Workaround

Users can manually fix the imports by running:

sed -i 's/from hookify\.core\./from core./g' ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0/hooks/*.py
sed -i 's/from hookify\.core\./from core./g' ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0/core/rule_engine.py

---
🤖 Generated with Claude Code

View original on GitHub ↗

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