[BUG] Managed-settings approval dialog leaves the TUI dead after accept
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?
Summary
When the "Managed settings require approval" dialog renders at startup, pressing Enter internally accepts the policy (settings are saved to disk, hooks become active) but the terminal appears frozen: no further screen ever renders. Only Ctrl+C exits.
Environment
| | |
|---|---|
| Claude Code version | 2.1.144 (Git SHA 32281b6b930f7e2ab4f0b5e2494e263b9c1ffb7e) |
| OS / shell | Debian 13, bash |
| Terminal | Cursor integrated terminal (also reproduced under a stand-alone socat pty) |
| Auth | CLAUDE_CODE_OAUTH_TOKEN bound to an org whose policy pushes a hooks setting via remote-settings |
Steps to reproduce
export CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
rm -rf ~/.claude ~/.claude.json
claude
Dialog appears. Press Enter on "Yes, I trust these settings". Terminal freezes.
Evidence
strace -e trace=write,read -f -tt on a real run, single Enter pressed at t=31.432:
22:14:30.311 write(11, "\33[?2004h", 8) # Ink mounts: bracketed-paste ON
22:14:30.333 write(11, "...Welcome to Claude Code v2.1.144...")
22:14:30.506 write(11, "...managed-settings dialog...")
22:14:31.432 read(0, "\r", 1) # user presses Enter
22:14:31.435 write(11, "\33[?2026h\33[?25h\33[?2026l", 22) # unmount begins
22:14:31.435 write(1, "\33[?1006l\33[?1003l\33[?1002l\33[?1000l", 32)
22:14:31.436 write(1, "\33[>4m", 5) # modifyOtherKeys OFF
22:14:31.436 write(1, "\33[<u", 4) # Kitty KBP OFF
22:14:31.437 write(1, "\33[?1004l", 8) # focus OFF
22:14:31.437 write(1, "\33[?2031l", 8) # colorScheme OFF
22:14:31.437 write(1, "\33[?2004l", 8) # bracketed-paste OFF
22:14:31.437 write(1, "\33[?25h", 6) # cursor ON
22:14:31.437 write(1, "\0337\33[r\338", 7) # save/reset-scroll/restore
22:14:31.438 write(11, "\33[?2004l", 8) # mirror writes on fd 11
...
# NO further writes for 5+ minutes until user hits ^C
Counts across the entire trace:
\e[?2004h(Ink mount-enable): 1\e[?2004l(Ink unmount-disable): 3 (one at dialog accept, two later at^Cexit)
The full terminal-mode-disable burst at t=31.435 is what an Ink instance emits when it unmounts. After that, no further Ink mount happens until ^C — the TUI is dead even though the process is alive.
Concurrent debug log confirms the internal state advanced fine — only the UI is gone:
22:14:31.446 Remote settings: Saved to /home/coder/.claude/remote-settings.json
22:14:31.446 Remote settings: Applied new settings successfully
22:14:31.452 Plugin hooks: skipping reload, plugin-affecting settings unchanged
(no further log entries; process sits in epoll_pwait)
So: the dialog code works, the settings are applied to disk, the org policy is active — but the user sees a frozen screen and assumes the approval failed.
Expected behavior
After Enter, the dialog dismisses and the next setup screen (theme picker / workspace trust / chat UI) renders in the same terminal — the way every other Ink dialog in Claude Code does.
Notes
- Reproduces 100% on fresh state (
rm -rf ~/.claude ~/.claude.json) whenever the org pushes any managed setting that triggers the approval dialog. - Reproduces both inside Cursor's integrated terminal and under a bare
socatpty, so it isn't terminal-specific. - The dialog appears to be rendered with its own Ink instance during the CLI's pre-action phase, before the main onboarding Ink root mounts. The mode-disable burst above is consistent with that instance unmounting on accept; the subsequent onboarding render never produces any output. Maintainers with the original source can confirm — the bundled JS is too minified to point at a specific line confidently.
What Should Happen?
After Enter, the dialog dismisses and the next setup screen (theme picker / workspace trust / chat UI) renders in the same terminal — the way every other Ink dialog in Claude Code does.
Error Messages/Logs
Steps to Reproduce
- export CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
- rm -rf ~/.claude ~/.claude.json
- claude
- press enter to confirm to use the organization settings
- stuck
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.144
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗