set -g allow-passthrough on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'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.
Where must the process stay alive?
Your reconnectable setup.
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.
ssh dev-box -t 'tmux new-session -s claude '"'"'claude'"'"''ssh dev-box -t 'tmux attach-session -t claude' Press Ctrl-b, release both keys, then press d.
Use Anthropic’s own workflow first.
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.
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
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
Managed persistent workspace
Best when you want the running shell without maintaining a general-purpose VPS.
- Browser terminal plus SSH
- 2 vCPU · 4 GB RAM · 50 GB workspace
- Your Claude subscription remains separate
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.