Skip to content

fix: quote ${CLAUDE_PLUGIN_ROOT} in plugin hook commands - #79644

Open
rahulrshetty45 wants to merge 1 commit into
anthropics:mainfrom
rahulrshetty45:fix/quote-plugin-root-in-hooks
Open

rahulrshetty45 wants to merge 1 commit into
anthropics:mainfrom
rahulrshetty45:fix/quote-plugin-root-in-hooks

Conversation

@rahulrshetty45

Copy link
Copy Markdown

Fixes #78490

On macOS the plugin root resolves under ~/Library/Application Support/…, which contains a space. Several bundled plugins interpolate ${CLAUDE_PLUGIN_ROOT} unquoted into their hooks.json commands, so the shell word-splits on the space, never finds the script, and the hook fails:

  • hookify — the broken command is on PreToolUse, which blocks every tool call.
  • learning-output-style, explanatory-output-style (SessionStart) and ralph-wiggum (Stop) fail silently.

This quotes the interpolated path in all four hooks.json files, matching the pattern security-guidance already uses (bash "${CLAUDE_PLUGIN_ROOT}/…"). JSON validity confirmed after the change.

Reproduced with a space in the path: unquoted exits 127 (No such file or directory); quoted runs the script.

On macOS the plugin root resolves under ~/Library/Application Support/,
which contains a space. The unquoted path in these hooks.json commands
word-splits, so the hook script is never found and the hook fails --
blocking every tool for hookify's PreToolUse hook, and failing silently
for the SessionStart/Stop hooks. Quote the interpolated path, matching
the pattern security-guidance already uses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unquoted ${CLAUDE_PLUGIN_ROOT} in plugin hooks.json breaks all hooks on macOS (space in path); hookify's PreToolUse hook blocks every tool call

1 participant