mirror of
https://github.com/obra/superpowers.git
synced 2026-09-25 22:09:05 +00:00
Windows: SessionStart hook fails due to Claude Code path handling bug #420
Labels
No labels
antigravity
automated-issue-report
brainstorming
bug
claude-code
codex
copilot
cursor
documentation
duplicate
enhancement
factory
gemini-cli
good first issue
help wanted
hermes
hooks
invalid
kiro
needs-categorization
needs-rebase-to-dev-branch
needs-repro-case
new-harness
no-obvious-human-review
opencode
pi
plans
pr-template-rules-ignored
question
skill:brainstorming
skill:diagnosing-superpowers
skill:dispatching-parallel-agents
skill:executing-plans
skill:finishing-a-development-branch
skill:receiving-code-review
skill:requesting-code-review
skills
skill:subagent-driven-development
skill:systematic-debugging
skill:test-driven-development
skill:using-git-worktrees
skill:using-superpowers
skill:verification-before-completion
skill:writing-plans
skill:writing-skills
stale
subagents
tdd
trae
triage
upstream-bug
windows
wontfix
worktrees
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
skills/obra-superpowers#420
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
filed w/ anthropic @ https://github.com/anthropics/claude-code/issues/23204
Summary
The superpowers SessionStart hook fails on Windows with
"hook error" message. This is caused by a Claude Code
bug (filed at anthropics/claude-code), but documenting
here for visibility and potential workaround.
Root Cause
Claude Code strips backslashes from
${CLAUDE_PLUGIN_ROOT}when substituting the variableon Windows.
Expected path:
C:\Users\Cyril.claude\plugins\cache\claude-plugins-offic
ial\superpowers\4.1.1\hooks\session-start.sh
Actual path passed to bash:
C:UsersCyril.claudepluginscacheclaude-plugins-officialsu
perpowers4.1.1/hooks/session-start.sh
Error
SessionStart:startup hook error
Debug log shows:
/bin/bash: C:UsersCyril.claudepluginscacheclaude-plugins
-officialsuperpowers4.1.1/hooks/session-start.sh: No
such file or directory
Workaround
Replace
${CLAUDE_PLUGIN_ROOT}in hooks.json with ahardcoded Unix-style path:
Adding the async line worked for me from this
Adding the async line worked for me from this
Adding the async line worked for me from this
Adding the async line worked for me from this
Alternative workaround that's more portable
Instead of hardcoding the bash path in
hooks.json, you can add bash to your PATH in Claude Code'ssettings.json:%USERPROFILE%\.claude\settings.json:Benefits:
MSYS_NO_PATHCONV=1prevents path mangling issuesNote: Adjust the Git Bash path if your installation is in a different location.
Alternative workaround that's more portable
Instead of hardcoding the bash path in
hooks.json, you can add bash to your PATH in Claude Code'ssettings.json:%USERPROFILE%\.claude\settings.json:Benefits:
MSYS_NO_PATHCONV=1prevents path mangling issuesNote: Adjust the Git Bash path if your installation is in a different location.
Alternative workaround that's more portable
Instead of hardcoding the bash path in
hooks.json, you can add bash to your PATH in Claude Code'ssettings.json:%USERPROFILE%\.claude\settings.json:Benefits:
MSYS_NO_PATHCONV=1prevents path mangling issuesNote: Adjust the Git Bash path if your installation is in a different location.
Consolidation
This is now the canonical issue for the CLAUDE_PLUGIN_ROOT backslash-stripping bug on Windows.
The following related issues have been closed as duplicates:
Status
${CLAUDE_PLUGIN_ROOT}when substituting the variable on Windows. This is an upstream Claude Code bug.${CLAUDE_PLUGIN_ROOT}in hooks.json with a hardcoded Unix-style pathRelated fixes already shipped
Two other Windows SessionStart issues have been resolved:
961052e: Addedasync: trueto prevent TUI freeze when hook is slow/fails038abed: Replaced O(n²)escape_for_jsonwith O(n) bash parameter substitutionThis issue remains open until the upstream Claude Code fix lands.
Consolidation
This is now the canonical issue for the CLAUDE_PLUGIN_ROOT backslash-stripping bug on Windows.
The following related issues have been closed as duplicates:
Status
${CLAUDE_PLUGIN_ROOT}when substituting the variable on Windows. This is an upstream Claude Code bug.${CLAUDE_PLUGIN_ROOT}in hooks.json with a hardcoded Unix-style pathRelated fixes already shipped
Two other Windows SessionStart issues have been resolved:
961052e: Addedasync: trueto prevent TUI freeze when hook is slow/fails038abed: Replaced O(n²)escape_for_jsonwith O(n) bash parameter substitutionThis issue remains open until the upstream Claude Code fix lands.
Consolidation
This is now the canonical issue for the CLAUDE_PLUGIN_ROOT backslash-stripping bug on Windows.
The following related issues have been closed as duplicates:
Status
${CLAUDE_PLUGIN_ROOT}when substituting the variable on Windows. This is an upstream Claude Code bug.${CLAUDE_PLUGIN_ROOT}in hooks.json with a hardcoded Unix-style pathRelated fixes already shipped
Two other Windows SessionStart issues have been resolved:
961052e: Addedasync: trueto prevent TUI freeze when hook is slow/fails038abed: Replaced O(n²)escape_for_jsonwith O(n) bash parameter substitutionThis issue remains open until the upstream Claude Code fix lands.
@obra Are you considering merging #421 or will you wait for an upstream fix in Claude Code? Let me know if you need anything before merging the PR.
@obra Are you considering merging #421 or will you wait for an upstream fix in Claude Code? Let me know if you need anything before merging the PR.
@obra Are you considering merging #421 or will you wait for an upstream fix in Claude Code? Let me know if you need anything before merging the PR.
+1 — Hitting the same issue on Windows 11, Claude Code 2.1.32, Superpowers 4.1.1.
Error in debug log:
The file exists on disk — it's purely a path resolution issue when Claude Code auto-prepends
bashfor.shfiles on Windows.Local workaround: edit the cached
hooks.jsonto explicitly callbashwith an escaped Windows path:+1 — Hitting the same issue on Windows 11, Claude Code 2.1.32, Superpowers 4.1.1.
Error in debug log:
The file exists on disk — it's purely a path resolution issue when Claude Code auto-prepends
bashfor.shfiles on Windows.Local workaround: edit the cached
hooks.jsonto explicitly callbashwith an escaped Windows path:+1 — Hitting the same issue on Windows 11, Claude Code 2.1.32, Superpowers 4.1.1.
Error in debug log:
The file exists on disk — it's purely a path resolution issue when Claude Code auto-prepends
bashfor.shfiles on Windows.Local workaround: edit the cached
hooks.jsonto explicitly callbashwith an escaped Windows path:@obra Could you please reconsider applying the the fix from #421 while we wait for CC upstream fixes? Windows is not a priority for them. For instance, LSP for C# and TS are broken too for >30 days (https://github.com/anthropics/claude-code/issues/15914#issuecomment-3721465887). The fact that you get a constant stream of reports from different users hitting the same issue is a sign that this is a worthwhile fix.
@obra Could you please reconsider applying the the fix from #421 while we wait for CC upstream fixes? Windows is not a priority for them. For instance, LSP for C# and TS are broken too for >30 days (https://github.com/anthropics/claude-code/issues/15914#issuecomment-3721465887). The fact that you get a constant stream of reports from different users hitting the same issue is a sign that this is a worthwhile fix.
Better workaround:
.cmdwrapper (no hardcoding needed)Instead of hardcoding the path (which breaks on plugin version updates), you can create a small batch wrapper that resolves the path natively on Windows.
1. Create
hooks/session-start.cmdin the superpowers plugin directory:%~dp0resolves to the directory of the.cmdfile itself, so it always findssession-start.shnext to it — no hardcoded paths, no${CLAUDE_PLUGIN_ROOT}backslash issues.2. Update
hooks/hooks.json— change the command from:to:
Claude Code doesn't auto-prepend
bashfor.cmdfiles, so the backslash stripping never happens. Windows runs the.cmdnatively, which then explicitly calls Git Bash with the correct path.Why this is better than hardcoding:
Note: Plugin auto-updates will overwrite both files, so you'll need to re-apply after updates until the upstream Claude Code bug (anthropics/claude-code#23204) is fixed.