superpowers icon indicating copy to clipboard operation
superpowers copied to clipboard

Windows: SessionStart hook fails due to CLAUDE_PLUGIN_ROOT path handling

Open puneet1409 opened this issue 10 months ago • 1 comments

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:

  1. Use a relative path if Claude Code supports it
  2. Use a cross-platform approach in the command
  3. 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)

puneet1409 avatar Feb 01 '26 22:02 puneet1409

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.

obra avatar Feb 05 '26 19:02 obra