superpowers icon indicating copy to clipboard operation
superpowers copied to clipboard

SessionStart hook fails on Windows: bash cannot resolve path to session-start.sh

Open puneet1409 opened this issue 9 months ago • 1 comments

Bug Description

The SessionStart hook fails on Windows with the error:

/bin/bash: C:/Users/<user>/.claude/plugins/cache/claude-plugins-official/superpowers/4.1.1/hooks/session-start.sh: No such file or directory

This occurs on every session start, resume, clear, and compact event.

Environment

  • OS: Windows 11
  • Claude Code version: 2.1.32
  • Superpowers version: 4.1.1
  • Shell: Git Bash (C:\Program Files\Git\bin\bash.exe)

Root Cause

In hooks.json, the hook command is set to the bare path of session-start.sh:

"command": "C:/Users/<user>/.claude/plugins/cache/claude-plugins-official/superpowers/4.1.1/hooks/session-start.sh"

Claude Code 2.1.x auto-detects .sh files and prepends bash on Windows. However, the resulting invocation fails because /bin/bash (Git Bash) cannot resolve the C:/... forward-slash Windows path in this context.

The file does exist on disk — it's purely a path resolution issue at execution time.

Relevant Debug Log

2026-02-06T00:32:27.743Z [DEBUG] Hook SessionStart:resume (SessionStart) error:
/bin/bash: C:/Users/<user>/.claude/plugins/cache/claude-plugins-official/superpowers/4.1.1/hooks/session-start.sh: No such file or directory

Notes

  • The deprecated run-hook.cmd polyglot wrapper in the hooks directory documents the Claude Code 2.1.x behavior change that caused this.
  • A local workaround is to edit the cached hooks.json to explicitly call bash with a properly escaped Windows path, but this gets overwritten on plugin updates.

🤖 Generated with Claude Code

puneet1409 avatar Feb 06 '26 00:02 puneet1409

Closing as duplicate of #420 — same root cause (Claude Code path handling on Windows).

puneet1409 avatar Feb 06 '26 00:02 puneet1409