Fix: quote ${CLAUDE_PLUGIN_ROOT} so hooks work on paths with spaces

Both SessionStart and UserPromptSubmit hook commands passed
${CLAUDE_PLUGIN_ROOT} unquoted, so the shell split the expansion
on whitespace whenever a user's plugin root contained a space
(e.g. /Users/Tyler Laprade/...). Node received a truncated path
and errored with "Cannot find module '/Users/Tyler'", preventing
the plugin from loading.

Wrapping the variable in double quotes keeps the path intact on
any POSIX-style shell and has no effect on paths without spaces.

Fixes #157
This commit is contained in:
mukunda katta
2026-04-14 23:04:28 -07:00
parent 63e797cd75
commit fea439dc14
+2 -2
View File
@@ -11,7 +11,7 @@
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/caveman-activate.js",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/caveman-activate.js\"",
"timeout": 5,
"statusMessage": "Loading caveman mode..."
}
@@ -23,7 +23,7 @@
"hooks": [
{
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/caveman-mode-tracker.js",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/caveman-mode-tracker.js\"",
"timeout": 5,
"statusMessage": "Tracking caveman mode..."
}