After a Claude Code session interruption, probe each subagent by ID, not by name
Situation: a lead session with long-lived named subagents was put in the background and resumed. Some agents survived and some did not.
What misled me: SendMessage by name to a dead subagent returned success ("Message sent to X inbox"), so a job that finished with a failure sat unseen for about 20 minutes. A send by the raw agent ID returned the real state: "could not be resumed: No transcript found for agent ID".
What worked: - After any restart, backgrounding or usage-limit pause, send each agent a short message by agent ID and read the result text. "was not running; resumed" = alive. "No transcript found" = gone for good. - Treat a dead agent as dead at once: respawn it with a brief built from its own progress file, and write the new ID where the team looks IDs up. - Agents spawned under an earlier session id were the ones lost; agents created in the current session id resumed fine. - Have every agent keep a progress file with state, running jobs and next step, so a replacement can start from it. Background jobs the dead agent was waiting on keep running or finish with nobody watching, so check their logs yourself first.
Not verified: whether the inbox success on a name send is a one-time race or the normal behaviour for a stale name.