Agents & Coding

Tmux Keeps AI Agents Running, but Rivals Question Multi-Agent Fit

Tmux remains a durable multiplexer for AI agents, but alternatives such as Herdr and Jai draw interest, and its multi-agent fit is questioned in a small, partly self-promotional sample.

94 points56 comments

Tmux keeps AI coding agents alive across closed terminals and dropped SSH connections because the tmux server owns the pty, and recent Claude Code versions can create a git worktree and session in one command with claude --worktree --tmux. The guide covers session-per-project naming, send-keys scripting, capture-pane reading, and a status-line monitor that scrapes panes for agent state.

Older Claude Code builds lack the flag, and on iTerm2 it opens native panes instead of tmux unless --tmux=classic is passed, which matters for anyone scripting against the session. Tmux's limits are structural: no native awareness of which agent is parked, brittle screen scraping, no shared state across sessions, and no survival past a reboot.

The recommendation keeps tmux for remote boxes and long-running processes, while positioning crystl as a macOS terminal built for many agents at once.

The bits that matter

  • Claude Code's --tmux flag requires --worktree and uses iTerm2 native panes when available; --tmux=classic forces traditional tmux for scripting.
  • Session names cannot contain . or :, so a shell function replaces dots with hyphens; tmux new-session -A makes attach-or-create safe to repeat.
  • send-keys needs -l for literal text, escaped semicolons, and a short sleep before Enter because agent TUIs debounce paste and can swallow the newline.
  • capture-pane -J joins wrapped lines, while pipe-pane streams raw output to a file; the status-line monitor polls every five seconds and matches strings like 'Do you want' or 'esc to interrupt'.
  • tmux sessions survive terminal closure, detach, and SSH drops, but not kill-session, kill-server, or reboot; scrollback is lost when the server stops.

Discussion analysis

Rival multiplexers target multi-agent coding

Jai and Herdr are pitched as better fits for multi-agent coding than tmux, and thurm.rs is offered as a native terminal with session persistence and remote clients. One self-reported account says tmux did not fit the workflow and Herdr was too buggy, so Jai connects multiple machines, handles multiple agents, and enables agent-to-agent communication. Another says Herdr does everything better out of the box for agentic coding. These are preferences, not comparative benchmarks.

Tmux fit for multi-agent work questioned

Whether tmux is the right tool when several agents run at once is contested. One self-reported account says tmux did not suit the multi-agent workflow, while another says Herdr does it better out of the box and has not found a tmux or Zellij capability missing from Herdr. The disagreement is about workflow fit rather than tmux's core multiplexing and persistence features.

Jai's source availability questioned

A question asks whether Jai is open-source and notes that no GitHub link could be found. That leaves the tool's inspectability, reproducibility, and implementation details unestablished. The question does not assert that Jai is closed-source.

Guide layout hard to read on Retina

The page's text is reported to occupy about 20% of a 15-inch Retina screen, with the rest empty, and resizing the window helps. The complaint concerns the guide's presentation rather than its tmux instructions, but it is a concrete usability issue for readers on that display.