Skip to content

fix(hookify): use root-relative imports to fix marketplace install#69698

Open
shrivs4 wants to merge 1 commit into
anthropics:mainfrom
shrivs4:fix/hookify-marketplace-imports
Open

fix(hookify): use root-relative imports to fix marketplace install#69698
shrivs4 wants to merge 1 commit into
anthropics:mainfrom
shrivs4:fix/hookify-marketplace-imports

Conversation

@shrivs4

@shrivs4 shrivs4 commented Jun 20, 2026

Copy link
Copy Markdown

Problem

The hookify plugin is completely broken for marketplace users. When installed, CLAUDE_PLUGIN_ROOT points to a versioned path (e.g.
hookify/0.1.0/), so os.path.dirname(PLUGIN_ROOT) resolves to hookify/ — which contains no inner hookify package.

All 4 hook scripts fail silently with:

Hookify import error: No module named 'hookify'                                                                                                 

No user rules are evaluated. The plugin appears installed but does nothing.

Fix

Replace all from hookify.core.* imports with from core.* across 5 files (6 locations). Since CLAUDE_PLUGIN_ROOT is already in sys.path,
root-relative imports work regardless of install path.

Files changed

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

Testing

Simulated the marketplace directory structure locally (hookify/0.1.0/ with no outer package) and confirmed all 4 hooks return {} with no
import error.

Fixes #69665

  When installed from the marketplace, CLAUDE_PLUGIN_ROOT points to a
  versioned directory (e.g. hookify/0.1.0/) so dirname(PLUGIN_ROOT) is
  hookify/ — which contains no inner hookify package. All four hook scripts
  and rule_engine.py were using 'from hookify.core.*' which broke silently.

  Switch to 'from core.*' since CLAUDE_PLUGIN_ROOT is already in sys.path,
  making imports self-contained regardless of install path.

  Fixes anthropics#69665
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] hookify plugin: 'No module named hookify' on every hook event when installed from marketplace

1 participant