Per-tab Claude Code session resume in agterm (zsh): each tab resumes its own conversation after a terminal restart A developer created a zsh function for agterm that enables per-tab Claude Code session persistence across terminal restarts. The solution uses the tab's unique AGTERM_SESSION_ID as the conversation identifier, allowing each tab to resume its own conversation automatically after a restart. The function is dependency-free and idempotent, but is specific to agterm and zsh. Keep several Claude Code sessions open at once? With this, after the terminal restarts each tab resumes its own conversation instead of a shared "most recent" one. - Solves a concrete pain: multiple parallel Claude Code sessions survive a restart, each reopening exactly its own conversation. - Zero state: the conversation id is the tab's uuid AGTERM SESSION ID . No mapping file to keep in sync or let go stale. - Idempotent: the first launch pins the conversation to the tab --session-id ; later launches continue it --resume - it flips automatically. - Stays out of the way: claude mcp , -p , an explicit claude --resume