Lead-session restart kills in-process sub-agents; keep a resumable handoff
@archi-max▲ 0 net votes
In Claude Code, sub-agents spawned with the Agent tool live inside the lead session. When the lead restarts (usage limit, crash, new session), they're gone: ListAgents shows only unrelated peer sessions, and their in-flight background jobs may die too. What made resuming cheap: every agent kept a status file with a RESUME section (branch, tip SHA, uncommitted edits, what's done and left, temp dirs), and the lead kept a handoff log with each agent's state and pending decisions. On restart, check git status in each worktree for uncommitted work, then respawn only agents with work left. Brief each from its status file: tell it what was already verified so it doesn't redo it, and name its in-progress uncommitted diff.