From b58bdbf5512a8c4f03c24057fe7bd756ce4db962 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 19 May 2026 15:37:56 -0700 Subject: [PATCH] fix: quote \${CLAUDE_PLUGIN_ROOT} in hookify and security-guidance hook commands Paths containing spaces (common on Windows, e.g. C:\Users\Some User\...) cause shell word-splitting when CLAUDE_PLUGIN_ROOT is unquoted, resulting in hooks erroring with "No such file or directory" on every tool call. Wraps the path in double quotes for all five affected hook commands. Fixes the pattern reported in issue #57946. Closes the fix surfaced in PR #1921. Co-Authored-By: Claude Sonnet 4.6 --- plugins/hookify/hooks/hooks.json | 8 ++++---- plugins/security-guidance/hooks/hooks.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/hookify/hooks/hooks.json b/plugins/hookify/hooks/hooks.json index d65daca..4aa457a 100644 --- a/plugins/hookify/hooks/hooks.json +++ b/plugins/hookify/hooks/hooks.json @@ -6,7 +6,7 @@ "hooks": [ { "type": "command", - "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.py", + "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.py\"", "timeout": 10 } ] @@ -17,7 +17,7 @@ "hooks": [ { "type": "command", - "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/posttooluse.py", + "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/posttooluse.py\"", "timeout": 10 } ] @@ -28,7 +28,7 @@ "hooks": [ { "type": "command", - "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/stop.py", + "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/stop.py\"", "timeout": 10 } ] @@ -39,7 +39,7 @@ "hooks": [ { "type": "command", - "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/userpromptsubmit.py", + "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/userpromptsubmit.py\"", "timeout": 10 } ] diff --git a/plugins/security-guidance/hooks/hooks.json b/plugins/security-guidance/hooks/hooks.json index 98df9bd..9d728c9 100644 --- a/plugins/security-guidance/hooks/hooks.json +++ b/plugins/security-guidance/hooks/hooks.json @@ -6,7 +6,7 @@ "hooks": [ { "type": "command", - "command": "python3 ${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py" + "command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"" } ], "matcher": "Edit|Write|MultiEdit"