Skip to content

Fix for when CLAUDE_PLUGIN_ROOT contains spaces#169

Merged
dguido merged 3 commits into
trailofbits:mainfrom
VirtualTim:patch-1
May 27, 2026
Merged

Fix for when CLAUDE_PLUGIN_ROOT contains spaces#169
dguido merged 3 commits into
trailofbits:mainfrom
VirtualTim:patch-1

Conversation

@VirtualTim
Copy link
Copy Markdown
Contributor

My Claude is installed under ~/Library/Application Support. Before this change I was getting this error:

Stop hook error: Failed with non-blocking status code: /bin/sh: ~/Library/Application: No such file or directory

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2026

CLA assistant check
All committers have signed the CLA.

GrosQuildu
GrosQuildu previously approved these changes May 20, 2026
Copy link
Copy Markdown
Contributor

@GrosQuildu GrosQuildu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice finding. Thanks.

dguido and others added 2 commits May 27, 2026 15:48
The space-quoting fix to hooks.json is a behavioral change, but clients
only pull plugin updates when the version increases. Bump plugin.json and
the root marketplace.json from 1.0.1 to 1.0.2 (kept in sync) so existing
users actually receive the fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dguido
Copy link
Copy Markdown
Member

dguido commented May 27, 2026

Review Summary

Thanks for the fix — this is a real bug. When CLAUDE_PLUGIN_ROOT resolves to a path containing spaces (e.g. ~/Library/Application Support/...), the shell word-splits the unquoted command string, producing the No such file or directory error you hit. Quoting the path is the correct fix.

I verified the change repo-wide: skill-improver was the only hook command missing quotes — gh-cli and modern-python already quote (via bash "${CLAUDE_PLUGIN_ROOT}/..."), and fp-check uses prompt-type hooks. stop-hook.sh is committed executable (100755) with a #!/bin/bash shebang, so direct quoted execution works.

Findings

# Severity Finding Resolution
1 P1 Unquoted ${CLAUDE_PLUGIN_ROOT} breaks hook when path contains spaces Fixed by author (quoting) — verified correct
2 P2 No version bump — clients only pull plugin updates when the version increases, so existing users wouldn't receive this fix Fixed: bumped plugin.json + root marketplace.json 1.0.1 → 1.0.2 (kept in sync)
3 P3 Other plugins use the bash "..." form rather than direct exec Dismissed: direct exec is correct here (script is executable with a shebang); keeping the author's minimal diff

Verification

  • JSON validity: plugin.json, marketplace.json, hooks.json all valid (jq)
  • Version consistency: both manifests at 1.0.2
  • Codex skills validation: passed (73 skills / 74 entries)

Commit

3e76915 — chore(skill-improver): bump version to 1.0.2 for hooks.json fix

Determination: ready to merge.

Copy link
Copy Markdown
Member

@dguido dguido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix is correct and verified repo-wide; added the version bump (1.0.2) so it ships to users. All required checks green.

@dguido dguido merged commit c94841b into trailofbits:main May 27, 2026
5 checks passed
@VirtualTim VirtualTim deleted the patch-1 branch May 28, 2026 07:15
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.

4 participants