hookify plugin: broken Python imports - 'No module named hookify'

Resolved 💬 3 comments Opened Dec 29, 2025 by filter-tiago Closed Jan 2, 2026

Summary

The hookify plugin's Python hook scripts fail with No module named 'hookify' because the import statements don't match the package structure.

Steps to Reproduce

  1. Install hookify plugin via marketplace
  2. Create any hookify rule (e.g., in .claude/hookify.pretooluse.local.md)
  3. Trigger any hook event (PreToolUse, PostToolUse, Stop, UserPromptSubmit)
  4. Observe error: Hookify import error: No module named 'hookify'

Root Cause

The hook scripts use absolute imports like:

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

But the package structure has core/ directly in the plugin root:

plugins/hookify/
├── core/           # ← directly here
├── hooks/
├── utils/
└── ...

For the imports to work, the structure should be:

plugins/hookify/
├── hookify/        # ← package folder needed
│   ├── __init__.py
│   ├── core/
│   ├── utils/
│   └── ...

Affected Files

All hook scripts have this issue:

  • hooks/stop.py
  • hooks/pretooluse.py
  • hooks/posttooluse.py
  • hooks/userpromptsubmit.py

Also core/rule_engine.py imports from hookify.core.config_loader.

Workaround

Create a symlink in the plugin directory:

cd ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0
ln -sf . hookify

Suggested Fix

Either:

  1. Restructure: Move modules into a hookify/ subfolder
  2. Or use relative imports: Change from hookify.core... to from core... (with appropriate sys.path setup)

Environment

  • macOS
  • Claude Code (latest)
  • hookify plugin v0.1.0 (installed via marketplace)

View original on GitHub ↗

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