superpowers
superpowers copied to clipboard
Windows: SessionStart hook fails due to CLAUDE_PLUGIN_ROOT path handling
Description
The SessionStart hook fails on Windows because Claude Code strips backslashes from ${CLAUDE_PLUGIN_ROOT} when passing it to bash.
Error
Hook SessionStart:startup (SessionStart) error:
/bin/bash: C:Userspunee.claudepluginscacheclaude-plugins-officialsuperpowers4.1.1/hooks/session-start.sh: No such file or directory
Root Cause
This is a Claude Code bug (reported at https://github.com/anthropics/claude-code/issues/22449), but a workaround in the plugin would help Windows users until it's fixed.
Suggested Workaround
The session-start.sh script already correctly derives its location using BASH_SOURCE. The hooks.json could potentially:
- Use a relative path if Claude Code supports it
- Use a cross-platform approach in the command
- Add documentation about the Windows issue
Current hooks.json
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume|clear|compact",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"
}
]
}
]
}
}
Environment
- Claude Code version: 2.1.29
- superpowers version: 4.1.1
- OS: Windows 11
- Bash: GNU bash 5.2.37 (Git Bash)
Closing as duplicate of #420, which is now the canonical issue for the CLAUDE_PLUGIN_ROOT backslash-stripping bug on Windows. See #420 for full status and upstream tracking.