mirror of
https://github.com/obra/superpowers.git
synced 2026-09-25 22:09:05 +00:00
SessionStart hook freezes terminal on Windows (bash not in PATH) #414
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#414
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?
Bug Report
The superpowers plugin's
SessionStarthook causes Claude Code's terminal to completely freeze on Windows, making the terminal unresponsive to all input including Ctrl+C.Environment
Problem
The
SessionStarthook inhooks/hooks.jsonruns a bash shell script:On Windows,
bashis not in the PATH for hook execution, so this fails with:In many cases this error resolves quickly and Claude Code continues normally. However, intermittently the hook execution hangs instead of failing, which completely locks the terminal — no keyboard input is accepted, and Ctrl+C does not work. The user must kill the terminal process externally.
Reproduction
claudefrom various directoriesEvidence from debug logs
The debug logs consistently show:
Sessions that don't freeze show this error followed by normal REPL mount. Sessions that do freeze appear identical in the logs up to the hook execution point.
Workaround
Disabling the superpowers plugin in
~/.claude/settings.jsonresolves the issue:Suggested Fix
The hook should either:
.cmd/.ps1script)Note: This issue was diagnosed and written by Claude Code (Claude Opus 4.5) during a troubleshooting session with the user. The debug log analysis and reproduction steps reflect what we found together in that session.
Note: This issue was diagnosed and written by Claude Code (Claude Opus 4.5) during a troubleshooting session with the user. The debug log analysis and reproduction steps reflect what we found together in that session.
I haven't been getting this until today, I'm not sure anything updated. I guess I have just been lucky until today.
Windows 11 with PowerShell 7
I haven't been getting this until today, I'm not sure anything updated. I guess I have just been lucky until today.
Windows 11 with PowerShell 7
Additional confirmation — freeze happens even when bash IS in PATH
Our environment has Git Bash properly installed and in PATH (
bash 5.2.37, MSYS2), yet the same freeze occurs on Claude Code v2.1.30. So the problem has at least two triggers:session-start.shscript'sescape_for_jsonfunction does character-by-character iteration in pure bash, which is extremely slow on Windows. This blocks the Ink TUI from entering raw mode for stdin.In both cases, the result is the same: terminal is completely unresponsive.
This is related to #404
Issue #404 reports the same freeze but attributes it to VSCode. It actually affects all Windows terminals — VSCode, Windows Terminal, Git Bash, PowerShell. I'd suggest these two issues be linked or merged, as they share the same root cause: the SessionStart hook running synchronously blocks the TUI.
Two-sided problem
We filed anthropics/claude-code#22934 for the Claude Code side — the core CLI should never freeze when a hook fails or runs slowly. But the plugin side also needs a fix:
"async": trueto the hook definition by default (confirmed working in #404), or.cmd/.ps1alternativeWorkarounds
async: trueto the SessionStart hook inhooks/hooks.json(quick fix, confirmed in #404)"superpowers@claude-plugins-official": falsein~/.claude/settings.jsonfind ~/.claude/projects -name "*.jsonl" -size +10M -delete(reduces hang severity)Related
Additional confirmation — freeze happens even when bash IS in PATH
Our environment has Git Bash properly installed and in PATH (
bash 5.2.37, MSYS2), yet the same freeze occurs on Claude Code v2.1.30. So the problem has at least two triggers:session-start.shscript'sescape_for_jsonfunction does character-by-character iteration in pure bash, which is extremely slow on Windows. This blocks the Ink TUI from entering raw mode for stdin.In both cases, the result is the same: terminal is completely unresponsive.
This is related to #404
Issue #404 reports the same freeze but attributes it to VSCode. It actually affects all Windows terminals — VSCode, Windows Terminal, Git Bash, PowerShell. I'd suggest these two issues be linked or merged, as they share the same root cause: the SessionStart hook running synchronously blocks the TUI.
Two-sided problem
We filed anthropics/claude-code#22934 for the Claude Code side — the core CLI should never freeze when a hook fails or runs slowly. But the plugin side also needs a fix:
"async": trueto the hook definition by default (confirmed working in #404), or.cmd/.ps1alternativeWorkarounds
async: trueto the SessionStart hook inhooks/hooks.json(quick fix, confirmed in #404)"superpowers@claude-plugins-official": falsein~/.claude/settings.jsonfind ~/.claude/projects -name "*.jsonl" -size +10M -delete(reduces hang severity)Related
I can consistently reproduce this in directories with large amounts of files (~8GB data across hundreds of files in a subfolder). If I switch to an empty directory, everything works fine. Disabling the plugin restores functionality in the large directories.
I can consistently reproduce this in directories with large amounts of files (~8GB data across hundreds of files in a subfolder). If I switch to an empty directory, everything works fine. Disabling the plugin restores functionality in the large directories.
Can confirm adding
async: trueto the hook file as suggested in #404 also fixes my use case for large directories.Can confirm adding
async: trueto the hook file as suggested in #404 also fixes my use case for large directories.Partial fix update
The terminal freeze problem reported here has been fixed on main:
async: true(961052e): Hook failures no longer block the TUI, regardless of whether bash is found or notescape_for_json(038abed): ~7x faster, fixes the "bash in PATH but too slow" variantThe path mangling variant (backslash stripping from CLAUDE_PLUGIN_ROOT) is tracked at #420 (upstream at anthropics/claude-code#23204).
Still open here: The "bash not in PATH" problem is a distinct issue — when Windows doesn't have bash available for hook execution, the hook silently fails (now without freezing, thanks to async). This requires either a cross-platform hook approach or upstream CC changes.