diff options
Diffstat (limited to 'plugins/hookify/hooks/userpromptsubmit.py')
| -rwxr-xr-x | plugins/hookify/hooks/userpromptsubmit.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/hookify/hooks/userpromptsubmit.py b/plugins/hookify/hooks/userpromptsubmit.py index 28ee51fd..6f54585b 100755 --- a/plugins/hookify/hooks/userpromptsubmit.py +++ b/plugins/hookify/hooks/userpromptsubmit.py @@ -9,18 +9,14 @@ import os import sys import json -# CRITICAL: Add plugin root to Python path for imports +# Add plugin root to Python path for imports PLUGIN_ROOT = os.environ.get('CLAUDE_PLUGIN_ROOT') -if PLUGIN_ROOT: - parent_dir = os.path.dirname(PLUGIN_ROOT) - if parent_dir not in sys.path: - sys.path.insert(0, parent_dir) - if PLUGIN_ROOT not in sys.path: - sys.path.insert(0, PLUGIN_ROOT) +if PLUGIN_ROOT and PLUGIN_ROOT not in sys.path: + sys.path.insert(0, PLUGIN_ROOT) try: - from hookify.core.config_loader import load_rules - from hookify.core.rule_engine import RuleEngine + from core.config_loader import load_rules + from core.rule_engine import RuleEngine except ImportError as e: error_msg = {"systemMessage": f"Hookify import error: {e}"} print(json.dumps(error_msg), file=sys.stdout) |
