claude -r / Agent View hangs indefinitely and stops responding to keyboard input (Esc included) after "trust this folder" confirmation

Resolved 💬 2 comments Opened Jul 8, 2026 by ilsd Closed Jul 8, 2026

Description

claude -r (and the Agent View it opens) hangs indefinitely and stops responding to keyboard input, including Esc. The only way out is kill <pid> from another terminal.

Environment

  • Claude Code version: 2.1.204
  • OS: macOS (Darwin 25.5.0)
  • Install path: /Users/ila/.local/bin/claude (/Users/ila/.local/share/claude/versions/2.1.204)
  • Terminal: standard macOS Terminal.app, zsh

Steps to reproduce

  1. Run claude -r in any directory.
  2. The Agent View dashboard opens (Needs input / Working / Completed sections, > describe a task for a new session prompt).
  3. Reproduced twice:
  • Plain claude -r: the dashboard itself becomes unresponsive to all keys, including Esc.
  • claude -r --bare: a "Yes, I trust this folder" / "No, exit" prompt appears over the dashboard. Arrow keys move the selection, and Enter visibly checks "Yes, I trust this folder ✓" — so keyboard input is reaching the UI — but nothing happens afterward. Esc no longer does anything either.

In both cases the process must be killed from a second terminal to recover; closing the terminal window otherwise leaves it stuck.

Diagnostics collected

ps aux | grep claude while hung shows the foreground claude -r process plus a per-session "transient" daemon and background spare/pty-host processes, e.g.:

ila   5803  claude -r
ila   5821  /Users/ila/.local/bin/claude daemon run --origin transient --spawned-by {"label":"claude","cwd":"/Users/ila","pid":5803}
ila   5839  claude bg-spare --bg-spare /tmp/cc-daemon-502/<id>/spare/63340ab8.claim.sock
ila   5835  claude bg-pty-host --bg-pty-host /tmp/cc-daemon-502/<id>/spare/63340ab8.pty.sock 200 50 -- .../versions/2.1.204 --bg-spare ...

~/.claude/daemon.log shows a repeating pattern where the daemon claims a pre-warmed "spare" background session and spawns its PTY host, but the matching "settled" event that should follow is either very slow (up to ~3 minutes in successful runs) or never appears (in the hung run):

[...] [bg] bg claimed-spare 8b4b1f06 (spare)
[...] [bg] bg spare spawned host pid=4432
[... ~3 min gap in a "successful" run, or nothing at all in the hung run ...]
[...] [bg] bg settled 8b4b1f06 (killed)

sample <pid> 3 on the hung foreground process shows all threads (main thread, HTTP Client thread) idle in kevent64, i.e. genuinely blocked waiting for an event rather than spinning — consistent with the process waiting forever on a response from the daemon/spare-host handshake ("settle") that never arrives.

This reproduced consistently across multiple separate invocations, in a fresh directory (~, not a git repo) with no unusual load on the machine (no other claude-related process using significant CPU).

Expected behavior

claude -r opens the resume picker / Agent View and responds normally to Esc and other keys. Confirming "trust this folder" should immediately proceed (attach to the session or return to the list), not hang.

Workaround

From a second terminal: ps aux | grep claude, find the PID of the specific hung claude -r process, kill <pid>. This frees the terminal but the same hang reproduces on the next claude -r call.

View original on GitHub ↗

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