Hookify plugin cannot import hookify.* from cache directory
Summary
Hookify plugin for Claude Code always prints the message "Hookify import error: No module named hookify" and skips all hooks when it is installed inside the default hashed cache directory. The hook scripts never expose the parent directory (where the real hookify package lives) on sys.path, so the absolute import fails immediately.
Environment
- Claude Code on Linux (WSL2 host)
- Official Hookify plugin from claude-plugins-official
- Plugin cache path: ~/.claude/plugins/cache/claude-plugins-official/hookify/ab2b6d0cad88
Steps to Reproduce
- Install the official Hookify plugin.
- Start any workspace (Claude does not set CLAUDE_PLUGIN_ROOT for these python hooks).
- Submit a prompt or run any tool. Every hook prints {"systemMessage": "Hookify import error: No module named hookify"} to stdout and returns without evaluating rules.
Expected Behavior
The hook python files should be able to import hookify.core.* and evaluate user rules.
Actual Behavior
All hook entry points bail out with the error message above, so no rule ever runs.
Proposed Fix
Before importing hookify.core, add both the plugin root and its parent directory to sys.path and register a ModuleType alias for "hookify" so absolute imports resolve even when the plugin lives under a versioned cache directory. After patching the scripts locally with that change the hooks execute normally, but the change is overwritten every time the plugin updates.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗