Team-mode session becomes unresponsive after sub-agent shutdown

Resolved 💬 2 comments Opened Feb 7, 2026 by jhf Closed Mar 7, 2026

Bug Report

Description

When using Claude Code in team mode, the team-lead session becomes completely unresponsive after shutting down a sub-agent. If the CLI UI is focused on the shut-down teammate (via Shift+Arrow switching), the UI freezes and no longer processes any keyboard input, requiring the process to be killed externally.

Environment

  • Claude Code version: 2.1.34
  • Platform: macOS (Darwin 25.2.0, arm64, Apple M1 Max)
  • Terminal: macOS Terminal.app (ttys010)

Steps to Reproduce

  1. Start a Claude Code session
  2. Create a team using TeamCreate
  3. Spawn a sub-agent teammate using the Task tool with team_name parameter
  4. Interactively switch input to the teammate to watch progress — using Shift+ArrowUp/Down
  5. Send a shutdown_request to the teammate via SendMessage
  6. Teammate approves shutdown and terminates
  7. Result: The CLI UI, still focused on the shut-down teammate, no longer processes any input. The team-lead session becomes completely unreachable.

Expected Behavior

After a sub-agent shuts down, if the CLI is focused on that agent, the agent selector UI should not be disabled/removed. The user should be able to switch back to the team-lead session using Shift+Arrow or other navigation.

Actual Behavior

The UI freezes on the dead teammate's message prompt:

╭──────────────────────────────────────────────────────╮
│ Shutdown request from team-lead                       │
│ Reason: Thanks for the plan, shutting down now.       │
╰──────────────────────────────────────────────────────╯

❯ Message @plan-caddy-upgrade…
  • The input prompt targets a teammate that no longer exists
  • No keyboard input is processed — typing, Ctrl+C, Escape, Shift+Arrow, /exit, etc. all ignored
  • The Claude process (PID) remains alive with MCP child processes (chrome-devtools-mcp, etc.)
  • The team's task list directory exists but contains no task JSON files (only .lock and .highwatermark)
  • All agent subprocesses have already terminated
  • The session cannot be recovered without externally killing the process (kill <pid>)
  • On kill, the exit output includes 1 MCP server failed and a valid --resume session ID

Additional Context

  • The session had been running for ~14 hours before being killed (started ~16:43, killed next morning)
  • An orphaned Claude process from a different session (no TTY, 848 minutes of CPU time) required kill -9 to terminate — regular kill was insufficient
  • After killing, claude --resume <session-id> can be used to restore the conversation

Process State When Stuck

PID   TTY     TIME      CMD
92209 ttys010 17:10.47  claude

Child MCP server processes were still running under this PID, but all team agent subprocesses had already exited.

View original on GitHub ↗

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