agent-alchemy icon indicating copy to clipboard operation
agent-alchemy copied to clipboard

hooks.json: unquoted ${CLAUDE_PLUGIN_ROOT} breaks on Windows paths with spaces

Open dairojnl300-collab opened this issue 4 months ago • 0 comments

Summary

Several hooks/hooks.json files reference ${CLAUDE_PLUGIN_ROOT} without wrapping it in double quotes inside the command string. On Windows, when the user's home directory contains a space (e.g. C:\Users\Jane Doe\...), Git Bash word-splits the unquoted variable and the hook fails with:

bash: C:/Users/Jane: No such file or directory

This breaks PreToolUse on core-tools, sdd-tools, and tdd-tools (matcher Write|Edit|Bash), which blocks every Bash/Edit/Write tool call for affected users.

Affected files (as of the installed marketplace + cache copies)

  • claude/core-tools/hooks/hooks.json
    • PreToolUse → auto-approve-da-session.sh
  • claude/sdd-tools/hooks/hooks.json
    • PreToolUse → auto-approve-session.sh
    • TaskCompleted → verify-task-completion.sh
    • SessionStart → resolve-cross-plugins.sh ${CLAUDE_PLUGIN_ROOT} (two unquoted refs)
  • claude/tdd-tools/hooks/hooks.json
    • PreToolUse → auto-approve-session.sh
    • SessionStart → resolve-cross-plugins.sh ${CLAUDE_PLUGIN_ROOT}
  • claude/dev-tools/hooks/hooks.json
    • SessionStart → resolve-cross-plugins.sh ${CLAUDE_PLUGIN_ROOT}
  • claude/plugin-tools/hooks/hooks.json
    • SessionStart → resolve-cross-plugins.sh ${CLAUDE_PLUGIN_ROOT}

Example

Before:

"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/auto-approve-da-session.sh"

After:

"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/auto-approve-da-session.sh\""

Same fix applies to the resolve-cross-plugins.sh ${CLAUDE_PLUGIN_ROOT} invocations — both the script path and the trailing arg need their own quotes:

"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/resolve-cross-plugins.sh\" \"${CLAUDE_PLUGIN_ROOT}\""

Environment

  • Windows 11, Git Bash shell (Claude Code default on Windows without WSL)
  • Affected whenever the Windows username contains a space (very common — e.g. default "First Last" account names)

Suggested fix

Wrap every ${CLAUDE_PLUGIN_ROOT} reference in command strings across all five hooks.json files in double quotes, as shown above. Applied and verified locally; happy to open a PR with this change if useful.

dairojnl300-collab avatar Aug 02 '26 17:08 dairojnl300-collab