← Tuesday, October 20, 2026AgentsGuide

Tmux keeps Claude Code agents running across disconnects and scripts

crystl.dev 13 min read Editor score 8/10

Preview image for Tmux keeps Claude Code agents running across disconnects and scripts

The guide covers persistent tmux sessions, scripting agents with send-keys and capture-pane, and Claude Code’s built-in worktree-and-tmux option. These patterns help engineers manage long-running coding agents without building orchestration from scratch.

What
Tmux runs coding agents in named, detachable sessions that persist after a terminal closes or an SSH connection drops.
How
A shell can use send-keys to type into an agent and capture-pane to read its screen; recent Claude Code versions can create a worktree and session with one command.
Why it matters
Tmux offers a scriptable way to manage multiple long-running agents without building separate IPC or API plumbing.
command input terminal input terminal outp… screen read output shell agent capture-pane send-keys tmux server
Shell scripts interact with agents in persistent tmux sessions using tmux commands. Sketched from the article's own text.

Discussion

Discussion is not switched on yet. Use Note above to keep your own thoughts on this story.

Headline, summary, brief and diagram are written by a model from the source's own text; the link, byline and numbers come from the source. Read the original before relying on a claim.

Your note

Private to you. Stored in this browser, and synced to your account when you are signed in.