[BUG] SessionStart hooks hang indefinitely on Windows
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Bug Description
SessionStart hooks cause Claude Code to hang indefinitely on Windows. Even the simplest possible hook
(echo hello) causes the freeze. Other hook types (UserPromptSubmit, Stop, Notification, etc.) work
correctly.
What Should Happen?
Expected Behavior
The hook should execute and Claude should start normally, especially with "timeout": 5 set.
Actual Behavior
Claude freezes indefinitely. The "timeout" setting has no effect.
Environment
- Claude Code version: 2.1.34
- OS: Windows 11
- Shell: Git Bash (C:\Program Files\Git\bin\bash.exe)
- Platform: win32
Workaround
Remove SessionStart hooks entirely. The event can be approximated by emitting from a UserPromptSubmit
hook on first prompt instead.
Error Messages/Logs
Steps to Reproduce
Reproduction Steps
- Add a SessionStart hook to ~/.claude/settings.json:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "echo hello",
"timeout": 5
}
]
}
]
}
}
- Launch claude in any git repository
- Claude hangs and never shows the prompt
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.34
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗