From 1556f10bc6eddaf66147fc7d32f45d56b2e4d5e4 Mon Sep 17 00:00:00 2001 From: Abbas Pardawala Date: Fri, 12 Jun 2026 16:53:53 -0700 Subject: [PATCH] fix: use CLAUDE_PLUGIN_ROOT in hooks.json, drop duplicate manifest hooks hooks/hooks.json used ${PLUGIN_ROOT}, which Claude Code never defines, so the literal resolved against the hook process cwd and SessionStart/UserPromptSubmit failed with 'Cannot find module'. Switch to ${CLAUDE_PLUGIN_ROOT} (and %CLAUDE_PLUGIN_ROOT% for the Codex commandWindows variant); Codex aliases CLAUDE_PLUGIN_ROOT so both hosts resolve. Drop the duplicate inline hooks block from .claude-plugin/plugin.json so hooks load from a single canonical source. --- .claude-plugin/plugin.json | 26 -------------------------- hooks/hooks.json | 8 ++++---- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index d57c879..c4ffe67 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -5,31 +5,5 @@ "author": { "name": "Dietrich Gebert", "url": "https://github.com/DietrichGebert" - }, - "hooks": { - "SessionStart": [ - { - "hooks": [ - { - "type": "command", - "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/ponytail-activate.js", - "timeout": 5, - "statusMessage": "Loading ponytail mode..." - } - ] - } - ], - "UserPromptSubmit": [ - { - "hooks": [ - { - "type": "command", - "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/ponytail-mode-tracker.js", - "timeout": 5, - "statusMessage": "Tracking ponytail mode..." - } - ] - } - ] } } diff --git a/hooks/hooks.json b/hooks/hooks.json index 534f8fa..dc0eece 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -6,8 +6,8 @@ "hooks": [ { "type": "command", - "command": "node \"${PLUGIN_ROOT}/hooks/ponytail-activate.js\"", - "commandWindows": "node \"%PLUGIN_ROOT%\\hooks\\ponytail-activate.js\"", + "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/ponytail-activate.js\"", + "commandWindows": "node \"%CLAUDE_PLUGIN_ROOT%\\hooks\\ponytail-activate.js\"", "timeout": 5, "statusMessage": "Loading ponytail mode..." } @@ -19,8 +19,8 @@ "hooks": [ { "type": "command", - "command": "node \"${PLUGIN_ROOT}/hooks/ponytail-mode-tracker.js\"", - "commandWindows": "node \"%PLUGIN_ROOT%\\hooks\\ponytail-mode-tracker.js\"", + "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/ponytail-mode-tracker.js\"", + "commandWindows": "node \"%CLAUDE_PLUGIN_ROOT%\\hooks\\ponytail-mode-tracker.js\"", "timeout": 5, "statusMessage": "Tracking ponytail mode..." }