[BUG] hookify plugin: Python import error - "No module named 'hookify'"
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The hookify plugin fails with import errors when hooks execute: Stop says: Hookify import error: No module named 'hookify'
What Should Happen?
UserPromptSubmit:Callback hook succeeded: Success
Error Messages/Logs
Stop says: Hookify import error: No module named 'hookify'
Steps to Reproduce
Root Cause:
The Python scripts in hooks/ use imports like: from hookify.core.config_loader import load_rules from hookify.core.rule_engine import RuleEngine
But the plugin cache structure is: ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0/ ├── core/ │ ├── init.py │ ├── config_loader.py │ └── rule_engine.py ├── hooks/ │ ├── stop.py │ └── ...
There's no hookify/ subdirectory, so Python can't resolve the imports.
Workaround:
Create a symlink in the plugin root: cd ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0 ln -s . hookify
Suggested Fix:
Either:
- Change imports to relative: from core.config_loader import ...
- Or restructure the plugin to include hookify/ package directory
Environment:
- macOS
- Claude Code (latest)
- hookify v0.1.0
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.0.62
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
No response
Found 1 possible duplicate issue:
- https://github.com/anthropics/claude-code/issues/13427
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
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
Thank you very much, @ahlblad . I followed your instructions and it worked for me. You live in my heart and you don't pay rent 🫶.
if you don't want to modify code from existing hooks, you could try below:
cd ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0
ln -s . hookify