Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling

crystl.dev
October 19, 2026
14 min read
45/100
Summary
tmux can run Claude Code and other AI coding agents in named, detachable terminal sessions that continue after a terminal closes or an SSH connection drops. Claude Code supports `claude --worktree --tmux` to create a Git worktree and a session; `--tmux` requires `--worktree`, and iTerm2 uses native panes unless `--tmux=classic` is specified. tmux sessions can be organized by repository, with task-specific windows and panes for agents that need simultaneous monitoring. The `send-keys` command can submit prompts or interrupts to an agent pane, while `capture-pane` reads visible output, scrollback, or ANSI-colored screen contents. `pipe-pane` can write a pane’s raw output to a log file. tmux activity and silence monitoring can flag output changes or quiet panes, but cannot determine whether an agent is awaiting approval, processing work, or finished. Status-line scripts can infer states by polling and matching text rendered by an agent’s terminal interface. tmux sessions and scrollback persist through client detachment and dropped SSH links but not through `kill-session`, `kill-server`, or a reboot. The source recommends tmux for remote machines and long-running server tasks. Crystl, a macOS terminal, claims to provide agent-specific state, approval cards, structured transcript capture, persistent project history, and Git-worktree-backed isolated sessions for managing multiple agents.
Key Takeaways
- Claude Code can create a Git worktree and a tmux session with `claude --worktree --tmux`; `--tmux=classic` forces traditional tmux on iTerm2.
- tmux `send-keys` can script input to an AI agent and `capture-pane` can retrieve its rendered terminal output, but terminal-screen parsing is vulnerable to interface changes.
- tmux keeps agents running after terminal closures and dropped SSH connections, but its sessions and scrollback do not survive a reboot or server termination.
- tmux does not natively report agent completion, approval waits, or cross-session state; silence and activity alerts are only indirect signals.
- Crystl claims to replace screen scraping with structured agent records and to surface working, waiting, idle, and done states across persistent project sessions.
What the discussion said
The thread quickly moved past the article’s specific tmux recipe and into a broader argument over what an AI-agent workspace should be. Many readers clearly accept the core need: coding agents run for long stretches, spawn subagents, touch remote machines, and need durable sessions that survive a laptop closing or a terminal disappearing. Tmux remains valued as the universal, low-installation fallback, especially on remote hosts, and some people report that Claude’s team features plus tmux already make a capable subagent cockpit. But the practical response was a flood of purpose-built alternatives: agent-oriented terminal multiplexers, GUI harnesses, IDEs, daemon-backed clients, and remote-control setups. Supporters say these tools make an exploding number of agent sessions visible, coordinate agents across machines, and offer recovery, phone access, or agent-to-agent delegation without hand-rolled pane scripting. The praise was tempered by sharp operational objections. One popular dedicated tool is said to crash often enough to interrupt long-running work, while remote control through a vendor cloud was criticized for extending trust into private servers. Several commenters also see screen scraping and synthetic keystrokes as a brittle stopgap; they want agents to be persistent headless services with proper attachable interfaces rather than interactive CLIs trapped inside terminal panes.
Where opinion split
The sharpest dispute is whether tmux-driven interactive CLIs are a sensible foundation for coding agents. Tmux advocates see it as portable, persistent, and immediately useful for steering Claude and subagents on machines where nothing else can be installed. Critics argue that pane scraping and injected keystrokes are fundamentally fragile, and that durable agent daemons with structured clients should replace terminal-centric control entirely.
Coverage & discussions
Hacker News · crystl.dev
Community discussions
Community Sentiment
Positives
- Tmux still earns respect as the dependable lowest-common-denominator home for AI coding agents on remote servers, preserving work even in constrained or antiquated environments.
- Dedicated agent workspaces are making multi-agent coding feel manageable rather than like babysitting a pile of terminal panes, with clearer session visibility and cross-machine coordination.
- Daemon-backed designs promise the workflow coding agents actually need: persistent execution, recoverable transcripts, detachable clients, and the ability to resume or terminate named agent jobs cleanly.
- Claude’s project and team-oriented capabilities are seen as a meaningful step toward agents that coordinate work across sessions instead of acting like isolated command-line chats.
Concerns
- Purpose-built agent multiplexers can undermine their own promise when a crash kills an entire live workspace, forcing manual recovery of long-running agent-adjacent processes.
- Driving coding agents by reading terminal output and sending keystrokes is viewed as a brittle compatibility hack, not a robust interface for automation or supervision.
- Cloud-mediated remote control for Claude Code alarms security-conscious users because giving an AI service access to servers expands the attack surface and leaves persistent trust pathways.
- Interactive CLI-first agent design is criticized as backwards for durable workloads, since agents should continue independently of whichever terminal or laptop happened to launch them.
Related Articles

Agent-Manager: A Tmux TUI for Running Claude Code, Codex and OpenCode
Jul 30, 2026

Parallel coding agents with tmux and Markdown specs
Mar 2, 2026
Orchestrate teams of Claude Code sessions
Feb 5, 2026

Agent - Native Mac OS X coding ide/harness
Apr 16, 2026

Agent-talk: Enabling coding agents to work together
Jul 16, 2026