News ·
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
{"summary": "A practical guide to running AI coding agents like Claude Code in tmux, covering sessions per project, send-keys scripting, capture-pane reading, and where the approach breaks down at four agents.", "description": ["A guide published on Hacker News walks through a wo

{"summary": "A practical guide to running AI coding agents like Claude Code in tmux, covering sessions per project, send-keys scripting, capture-pane reading, and where the approach breaks down at four agents.", "description": ["A guide published on Hacker News walks through a working tmux setup for running Claude Code and other AI coding agents. The core idea: tmux keeps agents in named, detachable sessions that survive closed terminals or dropped SSH connections, because the tmux server owns the pty rather than your terminal window. One window can hold many agents, and tmux can be scripted from outside, letting any shell type into or read from a running agent with no IPC or API work.", "The built-in path comes first: recent Claude Code versions support claude --worktree --tmux, which creates a worktree and tmux session in one command. But --tmux errors without --worktree, and on iTerm2 it uses native panes instead of tmux, so pass --tmux=classic if you want real tmux to script against. The flag doesn't cover multiple agents in one session, pane layouts, scripted input, waiting-agent notifications, or remote boxes over SSH. The guide then covers conventions like one session per repo (names can't contain . or :), per-task windows, pane layouts (tiled and main-vertical), and a config delta including allow-rename off and escape-time 10 for laggy TUIs.", "Scripting an agent uses send-keys, with pitfalls: bare arguments like Enter or C-c are sent as keypresses (use -l for literal

References
- Hacker News · crystl.dev
Read the full story at Hacker News ↗Like, save or discuss on Buzz


