tmux
$ tmux Community Med Risktmux manages persistent terminal sessions, windows, and split panes over a client-server socket architecture. Unlike purely interactive TUIs, tmux exposes rich non-interactive control commands (new-session -d, list-sessions -F, capture-pane -p, send-keys) ideal for running and inspecting long-lived dev servers.
brew install tmux Detached session control and tmux capture-pane -p inspection run directly against the local socket faster and cleaner than an MCP wrapper.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Highly scriptable client-server CLI (-d detached sessions, -F format strings, capture-pane -p, send-keys), though there is no native --json flag.
- Detached
-dmode and-Ffield formatting onlist-*commands capture-pane -pprints pane buffers cleanly to stdout
Read-only list-sessions and capture-pane are safe, while send-keys injects arbitrary commands into live shells and kill-server terminates all sessions.
send-keysandkill-session/kill-servercan disrupt active user sessions
Ubiquitous on macOS, Linux, and BSD via Homebrew, apt, dnf, and pacman; Windows requires WSL or Cygwin.
- Pre-installed or single-command install on virtually all Unix hosts
Gold standard for supervising long-running daemons, REPLs, and interactive TUIs from detached agent workflows.
- Persistent detached sessions survive SSH drops and agent turns
Canonical ISC-licensed Unix tool (tmux/tmux) maintained actively by Nicholas Marriott and contributors.
- Decades-long stability and continuous upstream releases
Exhaustive tmux(1) man page and GitHub wiki documenting every target syntax, format variable, and command.
- Complete manual page and wiki reference
Security, Auth & Guardrails
None required; uses local Unix domain sockets in /tmp/tmux-* and config in ~/.tmux.conf.
100% free, offline, and open-source (ISC).
# tmux Agent Rules - ALWAYS pass `-d` to `tmux new-session` so it never tries to attach interactively inside an agent shell. - Use `tmux capture-pane -t <target> -p` to read logs and verify exact target session/pane names before calling `send-keys` or `kill-session`.
Agent-Ready Command Recipes
Safe Read-Only Queries
tmux list-sessions -F "#{session_name}: #{session_windows} windows (attached=#{session_attached})" Queries running session metadata using -F format variables without attaching to a TTY.
tmux capture-pane -t dev-server:0.0 -p -S -100
Prints the last 100 lines of pane dev-server:0.0 directly to stdout via -p non-interactively.
Controlled Writes & Previews
tmux new-session -d -s dev-server "npm run dev"
Launches a persistent detached (-d) session without taking over the caller's TTY.
Strengths for Agents
- + Clean detached execution (
-d), format filtering (-F), and stdout buffer capture (capture-pane -p). - + Ideal for supervising persistent dev servers and interactive REPLs across agent turns.
Caveats & Pitfalls
- ! Calling
new-sessionorattachwithout-dfails or blocks in non-TTY shells. - ! No native
--jsonoutput and no native Windows support outside WSL.