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
- Install superpowers under a Windows user whose profile path contains
( (e.g. C:\Users\UserName(External)\).
- Start Claude Code.
- 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.
Summary
SessionStart:startuphook fails on Windows when the user profile path contains a((parenthesis):The error string is truncated exactly at the
(— cmd.exe treats(as a special grouping character, so the pathC:\Users\UserName(External)\...\run-hook.cmdis split andC:\Users\UserNameis parsed as the command.Non-blocking, so the session still starts — but superpowers' SessionStart context injection is silently skipped every session.
Environment
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.cmdwrapper. 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 beforerun-hook.cmdis ever reached. The polyglot wrapper's internal quoting is correct — the failure is at the outer invocation layer, before the wrapper runs.Repro
((e.g.C:\Users\UserName(External)\).SessionStart:startuphook error truncated at the(.Suggested fix
Make the hook invocation robust to cmd.exe metacharacters (
(,),&,^, spaces) inCLAUDE_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.