Conversation
…arts Sessions keep running in the background (local tmux / remote-host tmux) when the app closes; app reattaches to the live process with scrollback on reopen. Covers session handle model, persistence store, spawn flow (local + remote), dedicated tmux config, lifecycle (quit=detach, tab-close=background, end-session=kill), startup auto-reattach + badge, tmux-absent fallback, risks, and 3-phase rollout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…sistence Bite-sized TDD tasks: pure tmux-session.js helpers + tests, tmux detection + isolated conf, persistentSessions store transforms, spawn-in-tmux for local Claude/terminal sessions, detach-on-quit / kill-on-end lifecycle, startup auto-reattach + background-session listing, sidebar badge + setting + no-tmux notice. Remote (Phase 2) and scrollback/mgmt UI (Phase 3) scoped out. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… when tmux unavailable
… notice Task 7 (final): surface tmux-backed persistence to the user. - sidebar: muted-green "bg" badge for sessions in window.__backgroundSessions, mirroring the existing remote-badge insertion/styling. - settings: global "Keep sessions running in the background (tmux)" toggle bound to persistSessions (default on), mirroring the remoteIde toggle. - main.js: one-time terminal-notification when tmux is missing but persistence is desired, local sessions only.
…allback fixes from final review
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.
Session persistence — Phase 1 (local, tmux-backed)
Local Switchboard sessions now keep running in the background when the app is closed, and the app reattaches to the live process on reopen. Closing the app no longer kills your in-flight builds / long-running commands / Claude conversations.
How it works
Each local session runs inside its own tmux server (
tmux -S <per-session socket> new-session -A -s sb_<handle> …). The tmux server is a detached daemon, so it (and the session's process) survive app quit. On startup the app probes each stored session and reattaches to the ones that were open; other still-alive sessions show a● bgbadge. Env is passed via the tmux client's environ (no-e), so secrets never appear in process argv, and each session's env is isolated.Fully gated + graceful fallback: if tmux isn't installed or the new
persistSessionssetting is off, behavior is identical to today (kill on quit;--resumeon reopen). A one-time notice suggestsbrew install tmuxwhen it's missing.Lifecycle
tmux kill-server(actually stops it)Scope
Phase 1 = local sessions only (Claude + plain terminal). Deferred: Phase 2 remote (SSH) persistence via remote-host tmux; Phase 3 full scrollback capture on reattach, background-session management UI + reattach cap, no-tmux-notice toast, socket-file cleanup on abnormal exit.
Quality
Built with subagent-driven development: each of the 7 tasks got an independent spec+quality review, plus a final whole-branch review on the most capable model. Findings fixed before merge:
claude --resumeon the same transcript. Fixed by recordingclaudeSessionIdat session creation.before-quitoverwritingwasOpenfor tab-closed sessions (now mirrorsrendererAttached).persistEnabled(); no empty-store write in pure fallback.Verification
tmux-session.js,session-store.jspure logic; existing suite).CLAUDE_CODE_SSE_PORT) inherited by the pane; no secret in argv.Files
tmux-session.js(new),session-store.js(new),main.js,preload.js,public/{app,sidebar,settings-panel}.js,public/style.css,session-transitions.js, + tests. Design spec & plan underdocs/superpowers/.🤖 Generated with Claude Code