mirror of
https://github.com/obra/superpowers.git
synced 2026-09-25 22:09:05 +00:00
SessionStart hook fails on Windows due to HCS sandbox blocking bash execution #417
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#417
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?
On Windows with WSL2 installed, the session-start.sh hook fails every startup with:
SessionStart:startup hook error
Debug log shows:
Hook output does not start with {, treating as plain text
Hook SessionStart:startup (SessionStart) error:
Logon failure: the user has not been granted the requested logon type at this computer.
Error code: Bash/Service/CreateInstance/CreateVm/HCS/0x80070569
Root Cause
Claude Code 2.1.x auto-detects .sh files in hook commands and routes them through bash execution, which on Windows triggers the HCS (Hyper-V Host Compute
Service) sandbox. On machines where corporate Group Policy restricts HCS logon types, the sandbox VM creation fails with 0x80070569
(ERROR_LOGON_TYPE_NOT_GRANTED), and the hook returns the Windows error instead of JSON.
The hook script itself is fine — running bash session-start.sh directly from Git Bash works perfectly. The issue is specifically the sandbox wrapper
around bash execution for hooks.
Environment
Suggested Fix
Ship a PowerShell version of session-start.sh (session-start.ps1) and update hooks.json to use it on Windows. PowerShell execution doesn't go through the
bash/HCS sandbox path.
Alternatively, use a .cmd wrapper or node script that avoids the .sh extension entirely, since Claude Code specifically targets .sh files for bash
routing.
This is similar to the approach taken in v4.1.0 where hooks.json was updated to call session-start.sh directly instead of through run-hook.cmd after
Claude Code 2.1.x changed the Windows execution model.
Partial fix update
The terminal freeze that results from hook failures has been fixed on main:
async: true(961052e): Hook failures no longer block the TUIHowever, the HCS sandbox issue itself is distinct and unaffected by our fixes. The hook will still fail on corporate machines where Group Policy restricts Hyper-V sandbox creation — it just won't freeze the terminal anymore.
The CLAUDE_PLUGIN_ROOT path mangling issue is tracked at #420 (upstream at anthropics/claude-code#23204), but this HCS issue is a separate execution path problem.