Persistent Sessions

By default, when you close ServerCC or leave the terminal, your Claude Code/Codex session stops. Persistent Sessions change that — Claude Code/Codex keeps running on your server in the background, and you can reconnect at any time to check progress or continue the conversation.

Requirements

Persistent Sessions require tmux to be installed on your remote server. Most Linux distributions include it by default, or you can install it with your package manager:

# Ubuntu / Debian
sudo apt install tmux

# CentOS / RHEL / Fedora
sudo dnf install tmux

# macOS
brew install tmux

Starting a Persistent Session

The Session Picker has a dedicated Persistent Connection Mode toggle in the Settings section. Switch it on, then tap New Session (or any row in Past Sessions) to start / resume that session persistently.

With persistent mode off, the same rows behave like a normal one-shot session that stops when you leave.

Tip

The Persistent Connection Mode toggle only appears when tmux is installed on the server. The server detail screen shows a Tmux install-status row so you can confirm at a glance.

Reconnecting to a Persistent Session

When a persistent session is running in the background, you'll see a "Resume Persistent Session" banner at the top of the session picker. The banner shows:

  • How long ago the session was started
  • Number of messages exchanged
  • The Git branch (if applicable)

Tap the banner to reconnect. You'll be taken back into the terminal with all previous output visible, and you can continue working with Claude as if you never left.

Leaving a Persistent Session

When you exit the terminal while a persistent session is running, a dialog asks you to choose:

  • Keep Persistent Session — Claude Code continues running on the server. You can reconnect later.
  • Stop Persistent Session — The session is terminated immediately. Claude Code stops running.

You can also end a persistent session without reattaching — swipe left on the Resume Persistent Session row in the session picker to reveal Exit Persistent Session.

Use Cases

Long-running tasks

Start a complex refactoring or feature implementation, then close the app and check back later. Claude will keep working while you're away.

Intermittent connectivity

If your network connection is unreliable, a persistent session ensures Claude's work isn't interrupted by disconnections. Just reconnect when your connection is restored.

Progress monitoring

Leave Claude working on a task, then periodically reconnect to check progress, answer questions, or approve file changes.

Tip

Each workspace is capped at one persistent session at a time — the cap covers the main branch and every worktree together. The Session Picker disables New Session while that cap is in effect, with a hint to resume or swipe to exit the existing one. If a persistent session becomes idle (no running process), it will be automatically cleaned up.

Attach to External Tmux Sessions

ServerCC can also attach to tmux sessions that were started outside the app — for example, from your desktop SSH client or another terminal — as long as they are running claude or codex inside. This lets you take over long-running work from your phone without restarting it.

When you open the server detail screen, ServerCC scans the host for tmux panes running an agent and lists them under Host Tmux Takeover. Each row shows the working directory (the last path component), the detected agent (Claude Code or Codex), and when the pane started.

Tap a row to attach. The terminal view opens on the existing pane with all output intact, and you can keep working as if you had started it from ServerCC.

Daily trial

External tmux takeover is free to try — non-Pro users get 5 attaches per day; Pro users have no limit. The picker shows a "Daily remaining" counter so you always know where you stand.

See also: Sessions for general session management, Background & Parallel for running multiple instances, and Connection History to review past connections.