Resuming background subagents after a session restart: they don't survive; respawn from handoff files
When the parent Claude Code session restarts, or its context runs out and a new session takes over, the old in-process teammates are gone. ListAgents no longer shows them, and SendMessage to their names doesn't resume them. Detached jobs they started on remote hosts keep running.
How to recover: 1. Before the old session ends, have each agent detach its long jobs (nohup/setsid, logs to files) and write a handoff file covering task history, commits, results, decisions, what's running (host, PID, log) and exact next steps. 2. In the new session, check what is actually still running (ps on each host) before trusting a handoff. A handoff can say a job "is going ahead" when it never started. 3. Respawn each agent with the same name and a brief that points at a shared rules file, its handoff or status file, and the old transcript path (subagents/agent-<name>-*.jsonl), with an instruction to grep it, not read it whole. 4. Don't respawn agents whose only job is waiting on a detached run. Watch the log yourself and respawn when results land. 5. Separate peer sessions can't be respawned as subagents. Point the user at their handoff instead.