Repository navigation
Description
Describe the feature
When Superset is closed abruptly (machine restart, crash, power loss, app quit), all open terminal tabs running agent sessions (Claude Code, Codex, etc.) are lost. The user has to manually find each session ID and run claude --resume <id> (or prox --resume) to get back.
Since every agent CLI already persists its session to a .jsonl file on disk, and each CLI exposes a resume command, Superset has everything it needs to restore tabs automatically on the next launch.
Proposed behavior
On Superset startup, for every terminal tab that was open in the previous session:
- Remember which agent CLI was running (
claude,codex,prox, etc.) and its session ID / cwd. - Re-open the tab in the same workspace/pane layout.
- Auto-invoke the CLI's resume command (
claude --resume <id>,codex resume, …) instead of a fresh prompt.
If an auto-resume fails (e.g. session file corrupted, Invalid signature in thinking block), fall back to showing the resume command pre-filled in the prompt so the user can tweak flags (e.g. swap claude --resume for prox --resume).
Why this matters
Losing a long agent conversation after an unexpected restart is painful — context, plan state, and in-progress tool output vanish even though the .jsonl is still on disk. For users running many agents in parallel (the core use case of Superset), this happens often enough to erode trust in the tool.
Addressing the obvious objection
"What if the user had 20 tabs open? Auto-resuming all of them is noisy."
That's fine — users can close tabs they don't need, just like any other window-restore behavior (browsers, IDEs, VS Code). Making the user manually resume every session to avoid occasional over-restoration is the wrong trade-off: the cost of losing a conversation is much higher than the cost of closing an extra tab.
Optional: a setting to toggle "auto-resume on startup" (default on) + "max tabs to auto-resume" cap for power users.
Environment
- Superset desktop (macOS)
- Agent CLIs affected: Claude Code (
claude --resume), and any other CLI with a resume command - Session files:
~/.claude/projects/<project-slug>/<session-id>.jsonl
Activity
github-actions commentedon Apr 16, 2026
Triage Summary
This is a feature request, not a bug — there is no broken behavior to reproduce with a test.
Current Architecture
The desktop app already has a cold restore system that partially addresses this:
HistoryWriter/HistoryReader(src/main/lib/terminal-history.ts) persist terminal scrollback to~/.superset/terminal-history/{workspaceId}/{paneId}/scrollback.binwith metadata inmeta.json.meta.jsonexists withoutendedAt, the app knows the previous session ended uncleanly (crash/restart).persistmiddleware, so tab layout survives restarts.The Gap
The metadata currently stored (
SessionMetadatainterminal-history.ts) tracks:Similarly,
SessionInfoandColdRestoreInfoindaemon/types.tshave nocommandfield.Neither stores which command was running (e.g.,
claude,codex) or the agent's session ID. Without this, the cold restore flow has no way to construct a resume command likeclaude --resume <id>.What Would Need to Change
SessionMetadatawith an optionalcommand?: stringfield (the original CLI command that was running)HistoryWriterColdRestoreInfowith the command, so the renderer knows what was runningclaude,codex, etc.) to its resume command formatWhy a Reproduction Test Isn't Feasible
There is no bug to reproduce. The existing cold restore system works correctly for its designed purpose (showing scrollback + offering a fresh shell). The requested feature is new functionality that requires extending multiple interfaces and adding new behavior.
nlatuan187 commentedon Apr 16, 2026
Did a read of
mainto see what already exists so this issue has concrete pointers instead of just being a wishlist. TL;DR: Superset has ~80% of the plumbing; the missing piece is specifically auto-running a resume command in the restored PTY on cold restore.What already works
persist+trpcTabsStorage—apps/desktop/src/renderer/stores/tabs/store.ts:17HOST_SERVICE_LIFECYCLE.mdandpackages/host-service/src/terminal/terminal.ts:444(WS onOpen →replayBuffer)cwdread from disk and shown —apps/desktop/src/main/lib/terminal/daemon/daemon-manager.ts:565attemptColdRestore()initialCommand/commandis already plumbed end-to-end:packages/host-service/src/trpc/router/terminal/terminal.ts:15shellReadyPromise—packages/host-service/src/terminal/terminal.ts:373commandto the daemon —apps/desktop/src/main/lib/terminal/daemon/daemon-manager.ts:374,483useCreateWorkspace,useCreateFromPr,bootstrap-open-worktree). Not cold restore.What's missing (the actual gap)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/hooks/useTerminalColdRestore.ts:168handleStartShell()callscreateOrAttach({ ..., skipColdRestore: true })with preservedcwdbut never passes aninitialCommand→ fresh bare shell, agent state lost even though the.jsonlis still on disk.grep -r "claude --resume\|resumeSession\|\\.jsonl"acrossapps/desktop/srcandpackages/returns one hit total (a codex-wrapper template) — nothing tracks "this pane was runningclaudewith session X".apps/desktop/plans/20260107-1107-terminal-persistence-dx-hardening.mdexplicitly says "The UI should show the saved scrollback and let the user explicitly start a new shell." — this issue proposes raising that ceiling.Minimum-viable integration path
The
initialCommandpipe already exists; the feature is "populate it on cold restore" + "know what to populate it with."updateCwdFromData). Store{ cli: "claude" | "codex" | ..., sessionId }alongsidecwdin the history metadata (terminal-history.ts).sessionIdcan be scraped from the CLI's own.jsonlpath (~/.claude/projects/<slug>/<uuid>.jsonl) matched bycwd+ most-recent mtime as a fallback.daemon-manager.ts:597coldRestoreInfo.set(...)include the resume command. InuseTerminalColdRestore.ts:168handleStartShell()pass it ascommandtocreateOrAttach. Everything downstream already executesinitialCommandaftershellReadyPromise.handleStartShell()on cold-restore mount when a resume command is known, or keep the button but prefill the label ("Resume Claude session abc1234" instead of "Start Shell"). Auto-fire is the win for the restart-recovery use case; the button is fine as a fallback if detection is uncertain.Invalid signature in thinking block). In that case, print the resume command into the PTY without executing it so the user can edit flags (e.g. swapclaude --resumeforprox --resume) and hit enter.Scope boundaries
host-service/terminal.ts—initialCommandis already there.packages/panesor tab persistence — those already survive.Happy to scope this down further or open a PR against a specific slice if maintainers point me at the preferred approach.
kunaldhongade commentedon Jun 12, 2026
Opened draft PR #5246 to implement this for desktop Claude/Codex cold restore. The PR links the durable session-location groundwork from #5126 and adds actual auto-resume on restart.
JasonLandbridge commentedon Jul 7, 2026
Yes please!
feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
2solarmax commentedon Jul 11, 2026
For anyone hitting this before the native fix (#5246) lands — a small userland stopgap: a zsh hook that resumes each restored Superset pane from
host.dbafter a Mac restart. Opt-in, staggered, workspace- and transcript-existence-checked, and it auto-stands-down when #5246 merges (detects the nativeterminal_sessionscolumn + skips if an agent is already running, so no double-resume):https://github.com/2solarmax/superset-session-resume
It uses the same
host.db→terminal_agent_bindingsmechanism #5246 uses. To be clear it's a stopgap, not a replacement — the native PR is the real fix; this just works today while that's in review.feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
feat(terminal): persist command through cold restore for agent sessio…
Rename to pane-resume; document the terminal adapter contract