Skip to content

Windows: SessionStart:startup hook fails when plugin path contains a parenthesis '(' (regression variant of #51, repro on 6.1.1) #1918

Description

@PavelFischerCoupa

Summary

SessionStart:startup hook fails on Windows when the user profile path contains a ( (parenthesis):

⎿ SessionStart:startup hook error: 'C:\Users\UserName' is not recognized as an internal or external command, operable program or batch file.

The error string is truncated exactly at the ( — cmd.exe treats ( as a special grouping character, so the path C:\Users\UserName(External)\...\run-hook.cmd is split and C:\Users\UserName is parsed as the command.

Non-blocking, so the session still starts — but superpowers' SessionStart context injection is silently skipped every session.

Environment

  • Superpowers: 6.1.1
  • OS: Windows 11 Pro 10.0.26100
  • Home dir: C:\Users\UserName(External)\ (contains a parenthesis)

Relation to #51

#51 covered a space in the path and was closed as fixed by the v3.6+ polyglot run-hook.cmd wrapper. This is a distinct trigger — the parenthesis — and it still reproduces on 6.1.1. A path with no space but with ( breaks.

Root cause

hooks/hooks.json:

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

Although ${CLAUDE_PLUGIN_ROOT} is quoted in the JSON, once it is expanded and handed to cmd.exe the ( in the path is still interpreted as a special character, breaking the command before run-hook.cmd is ever reached. The polyglot wrapper's internal quoting is correct — the failure is at the outer invocation layer, before the wrapper runs.

Repro

  1. Install superpowers under a Windows user whose profile path contains ( (e.g. C:\Users\UserName(External)\).
  2. Start Claude Code.
  3. Observe the SessionStart:startup hook error truncated at the (.

Suggested fix

Make the hook invocation robust to cmd.exe metacharacters ((, ), &, ^, spaces) in CLAUDE_PLUGIN_ROOT. Options: escape/quote-harden the expanded path before it reaches cmd.exe, or invoke the wrapper in a way that isn't parsed by cmd.exe's command tokenizer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions