0
Fork 0
mirror of https://github.com/obra/superpowers.git synced 2026-09-25 22:09:05 +00:00

Windows: SessionStart hook fails due to CLAUDE_PLUGIN_ROOT path handling #399

Closed
opened 2026-02-01 22:28:49 +00:00 by puneet1409 · 0 comments
puneet1409 commented 2026-02-01 22:28:49 +00:00 (Migrated from github.com)

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)
## 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 ```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)
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
skills/obra-superpowers#399
No description provided.