How to resume a Claude Code session after a reboot or a server restart
Claude Code keeps every conversation on disk, and claude --resume <session-id> brings one back. The hard part is knowing which id belongs to which task. Spaces records the conversation each pane is running; after a reboot or restart, opening the space starts the pane again with --resume for the right conversation, automatically.
By hand
Claude Code stores transcripts under ~/.claude/projects/<folder>/<session-id>.jsonl. From the same folder, claude --resume lists recent conversations to pick from, and claude --continue takes the most recent one. That works for one agent in one folder. With several agents, or several conversations in the same folder, you are left matching ids to tasks by their first message.
With Spaces
Each Claude Code pane in Spaces runs in a known space and folder, and Spaces watches which conversation it is running: it reads the session file Claude Code writes for each running process and matches it to the pane, so it follows /resume and /clear inside the agent too. The conversation id is stored with the pane.
After a reboot, a crash, or spaces restart:
- Start Spaces (
spaces, or it starts itself if installed as a service withspaces service install). - Open the space. Its stopped panes show as stopped; select the space, or pick Restart from ctrl+k.
- Each Claude Code pane starts again as
claude --resume <its conversation>. If the transcript is gone, it starts fresh instead of failing.
Codex CLI, Gemini CLI, ForgeCode and Pi panes offer their folder's past sessions to resume when you start them; Claude Code is the one that resumes on its own.
When it does not resume
- Windows, before Spaces 1.0.2: the conversation was never recorded, so restarted panes began a new one. Update with
spaces upgrade. - Started outside Spaces: a Claude Code you launched in a plain terminal in the same folder is not a pane, so it is not tracked, and it does not confuse the tracking of the panes either.
- Transcript deleted: Claude Code's own history clean-up removes old transcripts; the pane then starts fresh.
Finding an old conversation
The web app (spaces open) indexes every past Claude Code, Codex, Gemini CLI and Aider session on the machine with full-text search. Find the one where you discussed the migration, and resume it into a pane from there.
Get started
npm install -g @jlongo78/agent-spaces
spaces
Open source, Apache-2.0, no telemetry. Source on GitHub · every feature.