Session Persistence

Close the lid and come back later, and rebuilding a fleet of nodes, terminals, and working directories by hand would eat your morning before you’d done anything. TermTree saves the whole cockpit on close and restores it on next launch, including resuming Claude Code sessions with their prior context, so you pick up where you left off instead of reconstructing it.

What gets saved

When you close TermTree, your entire workspace is preserved:

  • Tree structure — All nodes, labels, hierarchy, and collapsed/expanded states.
  • Node status — Error indicators and exit codes are retained.
  • Terminal scrollback — Previous output is displayed above new sessions on restart.
  • Layout — Panel position, zoom level, selected node, theme, and layout type.
  • Recent Files — The list of files you’ve opened in the editor/viewer panel, capped at 15.

Auto-relaunch on startup

Terminals that were running, idle, or blocked awaiting input when you closed TermTree are automatically relaunched on next startup. Each relaunched terminal:

  • Starts a fresh shell session.
  • Inherits the saved working directory.
  • Shows previous scrollback output above the new session (separated by a visual divider).

Terminals that had already exited are not relaunched. A non-zero exit remains red so you can see the failure after restart; a clean exit remains gray IDLE.

Exit code preservation

If a terminal exited with an error (non-zero exit code), the node stays red across restarts. This makes it easy to spot failures from a previous session and investigate.

Claude Code session resume

TermTree has built-in support for Claude Code sessions. If a terminal was running Claude Code before you quit:

  1. TermTree detects the Claude session automatically.
  2. On restart, it resends claude --resume with the saved session ID.
  3. Claude picks up mid-conversation with full context preserved.

This works transparently — no configuration needed. Your AI-assisted workflows survive restarts without losing context.

If you switch Claude sessions mid-flight (e.g., using /resume to continue a previous conversation), TermTree detects the change and updates its tracking automatically. The next restart will resume whichever session was active when you closed the app.

What doesn’t persist

  • Live process state — Running processes are terminated on exit and relaunched fresh on startup. In-flight commands are not resumed.
  • Terminal environment — Shell environment variables set during a session are not carried over. Your shell profile (.bashrc, .zshrc, etc.) runs fresh on relaunch.
  • Per-file view memory — TermTree remembers each open file’s view mode (Editor vs. Preview) and scroll position for the session, but this memory is cleared on restart. See Editor & Viewer.