Skip to content

Conversation

@KCW89
Copy link

@KCW89 KCW89 commented Dec 9, 2025

Summary

The hookify plugin fails with 'No module named hookify' error on all platforms.

Root Cause

Scripts use absolute imports like 'from hookify.core.config_loader' but PLUGIN_ROOT contains core/ directly, not in a hookify/ subdirectory.

Fix

Change to relative imports: 'from core.config_loader' which correctly resolve since PLUGIN_ROOT contains core/ directly.

Files Changed

  • plugins/hookify/hooks/pretooluse.py
  • plugins/hookify/hooks/posttooluse.py
  • plugins/hookify/hooks/stop.py
  • plugins/hookify/hooks/userpromptsubmit.py
  • plugins/hookify/core/rule_engine.py

Fixes #13426
Fixes #13427

The hookify plugin's Python hook scripts use absolute imports like
`from hookify.core.config_loader` which fail because:

1. PLUGIN_ROOT is added to sys.path (e.g., .../hookify/0.1.0/)
2. Python looks for hookify/core/ inside PLUGIN_ROOT
3. But there's no hookify/ subdirectory - core/ is directly in PLUGIN_ROOT

This causes 'No module named hookify' error on all platforms.

Fix: Change to relative imports `from core.config_loader` which
correctly resolve since PLUGIN_ROOT contains core/ directly.

Files changed:
- hooks/pretooluse.py
- hooks/posttooluse.py
- hooks/stop.py
- hooks/userpromptsubmit.py
- core/rule_engine.py

Fixes anthropics#13426
Fixes anthropics#13427
@ahlblad
Copy link

ahlblad commented Dec 9, 2025

Paste this to Claude Code:
Fix hookify import error by running: cd ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0 && sed -i 's/from hookify.core./from core./g' core/rule_engine.py hooks/*.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hookify plugin: Python import error - 'No module named hookify' [BUG] hookify plugin: Python import error - "No module named 'hookify'"

3 participants