-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingclaude-codeClaude Code (Anthropic CLI) issuesClaude Code (Anthropic CLI) issueshooksHook system (SessionStart, Stop, etc.)Hook system (SessionStart, Stop, etc.)windows
Description
Description
When the superpowers plugin's SessionStart hook runs alongside other plugins' SessionStart hooks on Windows, Claude Code displays SessionStart:startup hook error in the UI, even though the hooks execute successfully.
Environment
- OS: Windows 11
- Claude Code version: Latest
- Shell: Git Bash (via
C:\Program Files\Git\bin\bash.exe)
Steps to Reproduce
- Install superpowers plugin
- Install another plugin that also has a SessionStart hook (e.g., cc-best)
- Start Claude Code
Expected Behavior
No error message displayed, or both hooks execute without UI error.
Actual Behavior
SessionStart:startup hook error
Debug Log Analysis
From claude --debug, the logs show:
Getting matching hook commands for SessionStart with query: startup
Found 2 hook matchers in settings
Matched 2 unique hooks for query "startup" (2 before deduplication)
...
Hooks: Parsed initial response: {}
Hooks: Initial response is not async, continuing normal processing
Successfully parsed and validated hook JSON output
Hook output does not start with {, treating as plain text
This indicates:
- Two SessionStart hooks are detected (superpowers + another plugin)
- One hook's JSON output is parsed successfully
- The other hook's output is treated as "plain text" (doesn't start with
{)
Root Cause Analysis
The session-start.sh script outputs valid JSON when run directly:
bash /path/to/superpowers/hooks/session-start.sh
# Outputs valid JSON starting with {However, when executed through Claude Code on Windows, something causes the output to not start with {. Possible causes:
- BOM or invisible characters prepended by Git Bash on Windows
- CRLF line ending issues
- Shell environment differences when spawned by Claude Code
Related Issues
- anthropics/claude-code#12671 - SessionStart hook shows 'hook error' despite successful execution
- anthropics/claude-code#16152 - Windows: Hooks fail when user path contains spaces
Workaround
Disabling superpowers plugin eliminates the error message. Other plugins' SessionStart hooks work correctly when superpowers is disabled.
Suggested Investigation
- Check if the bash script outputs any characters before the JSON on Windows
- Consider using a cross-platform approach (Node.js script) instead of bash
- Test with explicit UTF-8 encoding and LF line endings
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingclaude-codeClaude Code (Anthropic CLI) issuesClaude Code (Anthropic CLI) issueshooksHook system (SessionStart, Stop, etc.)Hook system (SessionStart, Stop, etc.)windows