anthropics / anthropics/claude-code
[BUG] hookify plugin fails with "No module named 'hookify'" on every hook invocation
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) 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?
Every hook invocation (PreToolUse, PostToolUse, UserPromptSubmit, Stop) from the hookify plugin fails with an import error: "Hookify import error: No module named 'hookify'". It prints on every single tool call and session event, but doesn't block execution — meaning hookify's rules never actually get evaluated or enforced, silently.
### What Should Happen?
Hookify's hook scripts should successfully import their internal modules and evaluate configured .local.md rules without printing an import error.
### Error Messages/Logs
```shell
Hookify import error: No module named 'hookify'
```
### Steps to Reproduce
1. Install hookify: /plugin marketplace add anthropics/claude-code, then /plugin install hookify@claude-code-plugins
2. Create any rule file in .claude/, e.g. .claude/hookify.test.local.md with a basic "warn on file" rule
3. Trigger any Write, Edit, Bash, or prompt submission
4. Every PreToolUse/PostToolUse/UserPromptSubmit/Stop hook prints "Hookify import error: No module named 'hookify'" instead of evaluating the rule
Root cause (found by inspecting the installed plugin): the hook scripts do `from hookify.core.config_loader import load_rules`, but the actual installed layout is `.../claude-code-plugins/hookify/0.1.0/core/config_loader.py` — there's no `hookify` package directory wrapping `core/`, it sits directly under the versioned `0.1.0` folder. Neither `PLUGIN_ROOT` nor its parent on sys.path makes `hookify.core.config_loader` resolve. Should be `from core.config_loader import load_rules` instead, using PLUGIN_ROOT which is already on sys.path.
The failure is wrapped in a bare exception handler that prints the message and exits 0, so rules are silently never evaluated rather than causing a hard failure.
### Claude Model
None
### Is this a regression?
No, this never worked
### Last Working Version
_No response_
### Claude Code Version
version 2.1.220.
### Platform
Other
### Operating System
Windows
### Terminal/Shell
PowerShell
### Additional Information
Plugin: hookify 0.1.0, installed via the claude-code-plugins marketplace (anthropics/claude-code repo, plugins/hookify). Installed path: ~/.claude/plugins/cache/claude-code-plugins/hookify/0.1.0/
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in plugins/hookify and inspect the hook scripts and core/config_loader.py, focusing on the hookify.core.config_loader import and the existing PLUGIN_ROOT path setup. Reproduce the issue by triggering a hook with a .claude/hookify.*.local.md rule. Done means PreToolUse, PostToolUse, UserPromptSubmit, and Stop hooks import successfully, evaluate the rule, and no longer print the import error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100