(sessions): persist open sessions and restore them on restart - #80
Merged
Conversation
Switchboard now remembers which Claude sessions were open and re-opens them on the next launch — each is resumed in turn via `claude --resume`, so the conversation is intact. Plain shell sessions are excluded (their process state can't be restored). The open working set is persisted to the `global.openWorkingSet` setting (serialized read-modify-write so it can't clobber other global keys), updated incrementally on open/close/exit/fork rather than only at quit, so it survives a crash. Restore is gated by a new `restoreOnStartup` setting with three options: off / ask (default) / auto. In ask mode a non-modal toast offers to restore; auto restores silently. Restore is strictly sequential to avoid spawning N claude processes at once. Renderer-only change.
JeanBaptisteRenard
force-pushed
the
feat/session-restore
branch
from
June 17, 2026 11:07
c7ac53e to
9309d0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Switchboard now remembers which Claude sessions were open when it last closed, and re-opens them on the next launch. Each is resumed in turn via
claude --resume, so the conversation history is intact (it lives in the JSONL on disk — Switchboard just re-clicks the sessions for you).Configurable via a new global setting Restore Sessions on Startup:
offask(default)autoHow
{sessionId, projectPath, options, active}per open Claude session, in open order) is persisted to theglobal.openWorkingSetsetting._persistChain) so it can't clobber otherglobalkeys (windowBounds,sidebarWidth, …).claude --resumeprocesses at once.Scope & safety
Renderer-only (
public/app.js,public/settings-panel.js,public/style.css) — nomain.js/ native-module changes.Tests
test/session-restore.test.js— 20 tests (jsdom harness): working-set build (order, plain-terminal & closed exclusion, key-preserving RMW),runRestore(sequential ordering proven via deferred promises, skip-missing, skip-open, activate-marked), and mode gating (off/ask/auto + toast button).task checkgreen: 354 pass, 0 fail.