Guide shows how to run Claude Code agents in tmux sessions
Original title: Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Recent Claude Code can create a worktree and session with two flags; classic tmux is required to script it.
A guide explains running Claude Code agents in named tmux sessions that survive a closed terminal or dropped SSH link. Recent Claude Code can create the worktree and session with claude --worktree --tmux, but that does not cover several agents, scripted send-keys, or a remote SSH setup. The page then shows per-repo sessions, window and pane layouts, and a short agent-oriented tmux config.
- The --tmux flag errors unless --worktree is also set.
- On iTerm2, --tmux uses native panes unless --tmux=classic is passed.
- Percentage main-pane-width values need tmux 3.2 or newer.
From the original article
12 min read at crystl.dev
tmux runs your AI coding agents in named, detachable sessions that survive a closed terminal or a dropped SSH connection. You get one window holding many agents, send-keys to type into any of them from a script, and capture-pane to read one back. That combination is why people use it.
By ankitg12 · crystl.dev
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.