[BUG] Terminal hangs after approving managed settings when SessionStart hook is configured
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?
When Claude Code prompts for managed (enterprise) settings approval on first launch and the user approves, the terminal hangs indefinitely. The hang occurs even with the simplest possible SessionStart hook (e.g. echo '{"systemMessage": "Hello"}'). Force closing and reopening the terminal resolves it — the approval was persisted, so subsequent sessions start normally with the hook running without issue.
What Should Happen?
After approving managed settings, Claude Code should run the SessionStart hook and start normally without hanging.
Error Messages/Logs
No error output — terminal simply freezes after the approval "yes" response.
Steps to Reproduce
- Configure a SessionStart hook in enterprise-settings.json, e.g.:
"hooks": {
"SessionStart": [
{
"hooks": [
{ "type": "command", "command": "echo '{\"systemMessage\": \"Hello\"}'" }
]
}
]
}
- Start Claude Code in a fresh session where managed settings approval is required
- Approve the managed settings prompt by typing "yes"
- Terminal hangs indefinitely
- Force close and reopen — Claude Code starts normally, approval is saved
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.74
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Related to (but distinct from) https://github.com/anthropics/claude-code/issues/22934. That issue covers SessionStart hooks always freezing on Windows; this bug is specific to the managed settings approval flow — the hook works correctly on all subsequent launches.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗