[Bug] claude --resume hangs on stale background-agent registry entry, leaving session permanently unresuable

Status Fixed / completed
Reported on v2.1.223
Maintainer reply None cached
Activity 2 comments · opened Aug 14, 2026 · closed Aug 25, 2026

Bug Description
Title: claude --resume / agents-view attach hangs on stale background-agent registry entry Environment: Claude Code 2.1.223, Linux, reproduced in both Warp and plain gnome-terminal (not terminal-specific). Repro steps: 1. Have a named background agent session (mine: "Bench-tester"). 2. Attach to it via the agents view (/resume <name> → "go to agents view" → select the agent). 3. TUI wedges completely — no response to input, Ctrl+C does nothing. Diagnosis: - The foreground claude -c/TUI process is not deadlocked computationally: ps shows it parked in epoll_wait (state S, WCHAN=ep_poll), 0% recent CPU, no misbehaving children. - Reproduced 3 times in a row across 2 different terminal emulators — each time a fresh --agent claude background process was spawned on attach, and the foreground TUI wedged waiting on it. - After killing the stuck foreground process each time, claude --resume <session-id> subsequently refused with: "Session ... is currently running as a background agent (bg). Use claude agents to find and attach to it, or add --fork-session to branch off a copy." — even though ps confirmed no process anywhere held that session ID. The long-running daemon (claude daemon run, up since session start) has stale internal bookkeeping marking the session as still "running" after the attach hang + kill cycle, permanently blocking normal resume. - Workaround: claude --resume <session-id> --fork-session succeeds and preserves context, since it doesn't check the stale "running" flag the same way. Impact: Once a session hits this state, it can never be resumed normally again (only forked) unless the daemon is restarted, and the daemon restart would drop all other in-flight background agents/spare pools system-wide.

Environment Info

  • Platform: linux
  • Terminal: WarpTerminal
  • Version: 2.1.223
  • Feedback ID: 11473f81-b183-4b94-8879-dc4429bec0c6

Errors

[]

View original on GitHub ↗

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