[BUG] Terminal hangs after approving managed settings when SessionStart hook is configured

Resolved 💬 3 comments Opened Mar 12, 2026 by harald-voca Closed Apr 13, 2026

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

  1. Configure a SessionStart hook in enterprise-settings.json, e.g.:

"hooks": {
"SessionStart": [
{
"hooks": [
{ "type": "command", "command": "echo '{\"systemMessage\": \"Hello\"}'" }
]
}
]
}

  1. Start Claude Code in a fresh session where managed settings approval is required
  2. Approve the managed settings prompt by typing "yes"
  3. Terminal hangs indefinitely
  4. 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗