fix(hookify): use root-relative imports to fix marketplace install#69698
Open
shrivs4 wants to merge 1 commit into
Open
fix(hookify): use root-relative imports to fix marketplace install#69698shrivs4 wants to merge 1 commit into
shrivs4 wants to merge 1 commit into
Conversation
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
This was referenced Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The hookify plugin is completely broken for marketplace users. When installed,
CLAUDE_PLUGIN_ROOTpoints to a versioned path (e.g.hookify/0.1.0/), soos.path.dirname(PLUGIN_ROOT)resolves tohookify/— which contains no innerhookifypackage.All 4 hook scripts fail silently with:
No user rules are evaluated. The plugin appears installed but does nothing.
Fix
Replace all
from hookify.core.*imports withfrom core.*across 5 files (6 locations). SinceCLAUDE_PLUGIN_ROOTis already insys.path,root-relative imports work regardless of install path.
Files changed
hooks/pretooluse.pyhooks/posttooluse.pyhooks/stop.pyhooks/userpromptsubmit.pycore/rule_engine.pyTesting
Simulated the marketplace directory structure locally (
hookify/0.1.0/with no outer package) and confirmed all 4 hooks return{}with noimport error.
Fixes #69665