Skip to content

fix: run Claude Code hooks from a plugin path with a space - #91

Merged
omartelo merged 1 commit into
mainfrom
90-hooks-quebram-quando-claude
Oct 21, 2026
Merged

omartelo merged 1 commit into
mainfrom
90-hooks-quebram-quando-claude

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Fixes #90.

On macOS lich keeps the plugin under ~/Library/Application Support. hooks/hooks.json expanded ${CLAUDE_PLUGIN_ROOT} unquoted, so /bin/sh split it at the space and every hook exited 127. The card got no state, title or touched files. Only the Stop hook showed the error.

  • hooks/hooks.json quotes the script path, as hooks/codex-hooks.json already did.
  • hooks/crush-hooks.json quotes the <lich-plugin> placeholder. A clone path with a space broke in the same way.
  • tests/hooks.test.mjs runs every registration under a plugin root with a space in it (a symlink to the checkout at <tmp>/Application Support). Before the fix, the 11 Claude Code registrations and the 2 Crush ones exited 127 with the error from the issue. The registration's argument is now read off the unexpanded command, so the space in the root does not split it.

Patch: nothing sent that lich's contract did not already accept. node --test tests/*.test.mjs: 452 pass. claude plugin validate passes; its two warnings (root CLAUDE.md, no icon) were already there. Not run on a real macOS install.

@omartelo
omartelo merged commit 1f25f63 into main Oct 21, 2026
2 checks passed
@omartelo omartelo mentioned this pull request Oct 21, 2026
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.

Hooks quebram quando CLAUDE_PLUGIN_ROOT contém espaço (ex.: "Application Support" no macOS)

1 participant