One-click restore of the exact set of Claude Code sessions that were open last time — reopened as Windows Terminal tabs, each automatically resumed with claude --resume.
Close your terminal (or have it crash), come back, double-click one shortcut, and every conversation is back where you left it.
Windows + Windows Terminal + PowerShell. Claude Code conversations are auto-saved by Claude itself; this tool just tracks which ones were open and reopens them.
Claude Code already persists every conversation under ~/.claude/projects/, and claude --resume <id> reopens any one of them. What's missing is a record of which sessions were open so you can bring them all back at once. Terminals can't "freeze" running processes, but they don't need to — the conversations are on disk; you only need the list.
This tool keeps that list fresh and replays it.
every 2 min (scheduled task) on demand (desktop shortcut)
┌───────────────────────────┐ ┌──────────────────────────────┐
│ claude-snapshot.ps1 │ │ claude-restore.ps1 │
│ reads running claude │ writes │ reads snapshot, opens one │
│ processes' --resume <id> ├──> snapshot ─┤ WT tab per session: │
│ (+ registry for cwd) │ .json │ wt new-tab -d <cwd> │
│ writes ONLY if ≥1 open │ │ ... claude --resume <id> │
└───────────────────────────┘ └──────────────────────────────┘
claude-snapshot.ps1— every 2 minutes, records the currently-open interactive sessions to~/claude-open-snapshot.json. It reads each runningclaude.exeprocess's command line (--resume <id>) so background tabs are captured immediately, and falls back to~/.claude/sessions/<pid>.jsonfor cwd and for freshly-started sessions. It only writes when at least one session is open, so closing everything never clobbers the last good list.claude-restore.ps1— reads the snapshot and opens one Windows Terminal tab per session, each runningclaude --resume <id>in that session's original working directory.
git clone https://github.com/SnowSky1/claude-session-restore.git
cd claude-session-restore
powershell -ExecutionPolicy Bypass -File .\install.ps1install.ps1 registers a scheduled task (snapshot every 2 min) and creates a "Restore Claude Sessions" desktop shortcut. It does not require admin.
- Restore: double-click the Restore Claude Sessions desktop shortcut.
- Preview without opening:
powershell -File .\claude-restore.ps1 -DryRun - Freeze right now (e.g. just before shutdown):
powershell -File .\claude-snapshot.ps1
Uninstall with powershell -ExecutionPolicy Bypass -File .\uninstall.ps1 (keeps your scripts and snapshot; only removes the task, shortcut, and generated launcher).
- Restores conversations, not processes. A session that was running a dev server reopens in the right folder, but you restart the server yourself.
- The list updates on a ~2-minute cadence, so a tab opened seconds before shutdown might miss the last snapshot. Run
claude-snapshot.ps1manually to capture immediately. - Junk/greeting sessions are restored too if they were genuinely open — the tool restores what was open, not what mattered. Close what you don't want and the next snapshot drops it.
A few non-obvious things this handles, learned the hard way:
- Snapshot from process command lines, not just the registry. Background WT tabs are slow to write
~/.claude/sessions/<pid>.json(ConPTY defers rendering), so a registry-only snapshot silently dropped them and they vanished on the next restore. Reading--resume <id>off the process command line captures every tab instantly. - Quoting for
wt. PowerShell 5.1'sStart-Process -ArgumentList <array>does not quote array elements that contain spaces, so a session titled e.g.agent guide demobroke the--titleargument and Windows tried to launch the second word as a program (error 0x80070002).claude-restore.ps1builds one quoted command string instead, quoting only values that need it and doubling trailing backslashes so a-d "D:\"doesn't turn\"into an escaped quote. - Never clobber on empty. The snapshot writer exits without writing when nothing is open, so a crash (or a clean shutdown) leaves the last good list intact.
MIT