Goal
Never lose work when SSH drops.
What Is tmux?
tmux is a terminal multiplexer. It lets you:
- Keep sessions running after you disconnect
- Split your terminal into panes
- Have multiple windows in one connection
Essential Commands
Start a New Session
bash
tmux new -s myproject
This creates a session named "myproject".
Detach (Leave Session Running)
Press:Ctrl+athend
Your session continues running in the background!
List Sessions
bash
tmux ls
See all running sessions.
Reattach to a Session
bash
tmux attach -t myproject# Or just:tmux a
Attaches to the most recent session.
The Prefix Key
Note
In ACFS, the prefix key is
Ctrl+a (not the default Ctrl+b). All tmux commands start with the prefix.Splitting Panes
Ctrl+a+|
Split verticallyCtrl+a+-
Split horizontallyCtrl+a+h/j/k/l
Move between panesCtrl+a+x
Close current paneWindows (Tabs)
Ctrl+a+c
New windowCtrl+a+n
Next windowCtrl+a+p
Previous windowCtrl+a+0-9
Go to window numberCopy Mode (Scrolling)
Ctrl+a+[
Enter copy modej/k+or arrows
Scrollq
Exit copy modev
Start selectiony
Copy selectionTry It Now
bash
1# Create a session2$ tmux new -s practice34# Split the screen5# Press Ctrl+a, then |67# Move to the new pane8# Press Ctrl+a, then l910# Run something11$ ls -la1213# Detach14# Press Ctrl+a, then d1516# Verify it's still running17$ tmux ls1819# Reattach20$ tmux attach -t practice
Why This Matters for Agents
Your Agents Run in tmux
Your coding agents (Claude, Codex, Gemini) run in tmux panes. If SSH drops, they keep running. When you reconnect and reattach, they're still there!