--- title: "Agent sessions" description: "Resuming a conversation after a reboot, forking a live one, and getting at the session id." --- Coding agents keep their own conversation history, addressed by a session id. Because tty7's hooks learn that id, it can do three things with it. ## Resume after a restart When the server goes away — a reboot, a crash, a deliberate restart — the shells go with it. Panes that were running an agent relaunch the conversation on restore instead of coming back to a bare prompt: ```bash claude --dangerously-skip-permissions --resume 8f3c… ``` The original launch flags are replayed, so the pane comes back the way you started it, not the way the defaults would. Supported for every recognised agent except Aider. Turn it off with `restore_agent_sessions: false`. Resume needs the agent's hooks installed, since the session id comes from them. [Installing hooks →](/agents/status) ## Fork a live session Forking branches a running conversation into a second, independent one. The original keeps going untouched; both continue separately from the same history. Right-click a **pane** to fork into a split — the menu offers a placement — or right-click the **tab or sidebar row** to open the fork in a new tab. | Agent | What tty7 runs | |---|---| | Claude Code | `claude --resume --fork-session` | | Codex | `codex fork ` | | TraeCode | `traecli fork ` | | Grok | `grok --resume --fork-session` | | Qoder CLI | `qodercli --resume --fork-session` | | Qoder CN CLI | `qodercn --resume --fork-session` | | OpenCode | `opencode --session --fork` | | Oh My Pi | `omp --fork ` | | Prime Agent | `prime-agent --fork ` | It is the agent's own fork command, run in a new pane — nothing is copied by tty7 itself. A fork duplicates the whole transcript in the agent's session store, so forking repeatedly costs real disk. A pane on a [remote machine](/remote/workspaces) cannot fork, because the command would run against the local agent. ## Copy the session id **Copy Session ID** — in the tab's right-click menu, beside *Copy Working Directory*, and in Search Everywhere — puts the agent's native id on the clipboard. Paste it into `codex resume`, a bug report, or another tool.