claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

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

Open cfdude opened this issue 1 month ago • 4 comments

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:

  1. Change imports to relative: from core.config_loader import ...
  2. 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

cfdude avatar Dec 09 '25 02:12 cfdude

Found 1 possible duplicate issue:

  1. 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

github-actions[bot] avatar Dec 09 '25 02:12 github-actions[bot]

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

ahlblad avatar Dec 09 '25 13:12 ahlblad

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 🫶.

felipeTromso avatar Dec 09 '25 13:12 felipeTromso

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

ns-kbhat avatar Dec 10 '25 01:12 ns-kbhat