Quote ${CLAUDE_PLUGIN_ROOT} so hooks work on paths with spaces#171
Merged
JuliusBrussee merged 1 commit intoJuliusBrussee:mainfrom Apr 15, 2026
Conversation
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 JuliusBrussee#157
3 tasks
This was referenced Apr 15, 2026
Closed
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.
Summary
Fixes Hook commands break on paths with spaces #157 — both hook commands in
.claude-plugin/plugin.jsonpassed${CLAUDE_PLUGIN_ROOT}unquoted to the shell. On any system where the plugin root contains a space (e.g./Users/Tyler Laprade/...on macOS), the shell split the expansion on whitespace and Node received a truncated path:Both
SessionStartandUserPromptSubmithooks errored on every session start and every prompt submit, effectively disabling the plugin for those users.Wrapping
${CLAUDE_PLUGIN_ROOT}in double quotes preserves the full path on any POSIX-style shell and is a no-op on paths without spaces.Changes
.claude-plugin/plugin.json— quoted${CLAUDE_PLUGIN_ROOT}in thecaveman-activate.jsandcaveman-mode-tracker.jshook command strings.Test plan
mkdir "/tmp/plugin root with space", copy the plugin in, run a hook → pre-fix errors withCannot find module '/tmp/plugin', post-fix loads correctly.