▍ Free local generator · official guidance checked

Keep Claude Code alive with tmux.

Generate the exact tmux compatibility settings, launch command, and reconnect path for a local or always-on host. The important boundary: tmux survives a terminal disconnect, not a sleeping execution host.

No account No command execution Inputs stay in this browser
01 · Choose

Where must the process stay alive?

Execution host
Claude Code workflow
02 · Review

Your reconnectable setup.

Always-on host

The tmux server runs on the remote host, so disconnecting or sleeping your laptop does not stop that host. The remote host itself must remain running and online.

~/.tmux.conf Claude Code terminal compatibility
set -g allow-passthrough on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
Connect and launch Named tmux session
ssh dev-box -t 'tmux new-session -s claude '"'"'claude'"'"''
Reconnect or inspect From your laptop
ssh dev-box -t 'tmux attach-session -t claude'

Press Ctrl-b, release both keys, then press d.

Source boundary

Use Anthropic’s own workflow first.

03 · Decide

Tmux is free. The always-on host is the decision.

Do not buy infrastructure just to learn tmux. Pay only when the host, persistent storage, and cross-device terminal access save more work than they create.

€0 infrastructure

Local tmux

Best when your current computer can remain awake and available.

  • Survives terminal closure
  • Keeps project files local
  • Stops useful work during host sleep
DIY host cost

Your VPS or server

Best when you want root control and are comfortable owning operations.

  • Always-on execution
  • Full server control
  • You secure, update, and recover it
Claude Code + tmux questions

Persistence without magical thinking.

Does tmux keep Claude Code running after I close the terminal?

Yes, while the machine hosting tmux remains running. Detaching or losing an SSH connection does not end the tmux session. Sleeping or shutting down that host stops useful execution.

Does tmux keep Claude Code running after I close my laptop?

Only when tmux runs on another machine that stays awake, such as a home server, VPS, or managed workspace. Tmux on the laptop cannot make a sleeping laptop continue executing.

Can I run Claude Code Remote Control inside tmux?

Yes. Tmux keeps the local terminal process attached when your terminal client disconnects. Anthropic still requires the host process and network connection to remain available, and documents a timeout after an extended network outage.

Why add special settings to .tmux.conf?

Anthropic documents that passthrough and extended-key settings are needed for progress updates, notifications, and Shift+Enter behavior to reach the outer terminal correctly.

When should I pay for a persistent workspace?

Use free local tmux when your existing machine can stay awake. Use a DIY server when you want root control and will operate it yourself. A managed workspace is relevant when you want an always-on host, browser and Terminalbox CLI attachment, and persistent storage without maintaining a VPS.