Skip to content

Stop/PreCompact hooks break on paths with spaces (unquoted CLAUDE_PLUGIN_ROOT) #1076

@dogskool

Description

@dogskool

Bug

The Stop and PreCompact hooks in hooks/hooks.json don't quote ${CLAUDE_PLUGIN_ROOT}, which breaks on Windows when the user profile path contains spaces (e.g. C:\Users\Richard M).

Error

Stop hook error: Failed with non-blocking status code: bash: /c/Users/Richard: No such file or directory

Current (broken)

"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/mempal-stop-hook.sh"
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/mempal-precompact-hook.sh"

Fix

Quote the variable:

"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/mempal-stop-hook.sh\""
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/mempal-precompact-hook.sh\""

Reference

The superpowers plugin handles this correctly with quotes:

"command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start"

Environment

  • Windows 11
  • Plugin version: 3.3.0
  • User path contains a space: C:\Users\Richard M

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/hooksClaude Code hook scripts (Stop, PreCompact, SessionStart)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions