Repository navigation
fix(hooks): quote ${CLAUDE_PLUGIN_ROOT} so hooks work when the install path has spaces - #54
Merged
Galaxy-Dawn merged 1 commit intoOct 19, 2026
Conversation
When the plugin is installed under a path containing spaces (common on Windows, e.g. C:\Users\First Last\.claude\...), the shell split the unquoted path and node received only the first fragment, so every hook failed with MODULE_NOT_FOUND on each event. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YYpHr4VNP2fCe3H1Bq1Ffw
6 of 13 tasks
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.
Problem
Every command in
hooks/hooks.jsonpasses an unquoted plugin root tonode:When the plugin is installed under a path with spaces (common on Windows, where the home folder is often
C:\Users\First Last\), the shell splits the path and Node receives only the first fragment:All five hooks (
security-guard,session-start,skill-forced-eval,stop-summary,session-summary) fail on every event. Users get a hook error on each Bash/Write/Edit call and each prompt, and features such as forced skill evaluation silently never run.Change
Wrap the path in double quotes in all five commands:
This is the form the Claude Code plugin docs recommend for shell-form hook commands, and
claude plugin validatewarns about the unquoted form. No other files change. Paths without spaces behave exactly as before.Testing
On Windows 11 with Node v24 and a home folder containing spaces:
SessionEnd hook [...] failed: Error: Cannot find module 'C:\Users\...'.security-guard.jsreturns{"continue":true}for a Bash payload, andskill-forced-eval.jsemits the skill list on prompt submit, which I confirmed in a live session.hooks/hooks.json(git blob62d2430). The original matchesmain(d1c932f).Note: several skill docs (
skills/hook-development,skills/command-development,skills/plugin-structure) show the same unquoted pattern in examples. I left them alone to keep this PR to the runtime fix.🤖 Generated with Claude Code
https://claude.ai/code/session_01YYpHr4VNP2fCe3H1Bq1Ffw