Operates tmux as an agentic multiplexer on shared machines — runs parallel background jobs, coordinates between agents, and manages session lifecycle without disrupting user sessions.
Ships in effective-tmux. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
You already do the basics well — capture-pane -p to read a pane without disrupting it, -F '#{...}' to inventory, detached sessions for parallel work. Don't relearn those. This skill fills the three things agents consistently miss on a shared machine, where the user and other agents already have sessions you must not touch: deterministic ownership, native coordination, and lifecycle.
You are a guest. Make "is this session mine?" a check, not a guess.
cc-<task>-<rand> (e.g. cc-test-7f3). Then yours is exactly tmux ls -F '#{session_name}' | grep '^cc-'. Only ever kill / rename / send-keys to cc- sessions. Everything else is read-only (capture-pane -p is fine; nothing that mutates). On a box other agents share, set CC_TOK=<your-agent-name> so your prefix is cc-<agent>-… and "mine" is scoped to you, not the whole fleet's cc- namespace.tmux -t dev is a start-of-name match, so it silently hits dev-server; pane/window indices renumber when something closes. Use = for an exact match (kill-session -t =cc-test-7f3), or capture the stable id at creation and use that:
pid=$(tmux new-session -d -s cc-test-7f3 -P -F '#{pane_id}' 'your-cmd')
tmux send-keys -t "$pid" 'echo hi' Enter
Pane %, window @, and session $ ids never change for the life of the object — they are the safe target.send-keys is a live keyboard typing into that pane. Only ever send to a %pane_id you created. A wrong target runs your command in the user's shell.The lazy default is sleep-poll + sentinel files. tmux has real events — use them.
wait-for — block on a signal, zero polling. The job signals when it exits; the waiter blocks until then (the signal latches, so there's no race if the job finishes first — verified on tmux 3.6a):
tmux new-session -d -s cc-build-7f3 'go build ./... ; tmux wait-for -S cc-build-7f3-done'
tmux wait-for cc-build-7f3-done # returns the instant the build exits
N parallel jobs → one channel each, wait-for each in turn. Run the waiter through your Bash background/Monitor mechanism so it doesn't hold the turn.@options — a zero-copy status/IPC channel. Don't scrape stdout to learn a job's state; write and read structured status directly:
tmux set -p -t "$pid" @status building # the job/agent writes
tmux display-message -p -t "$pid" '#{@status}' # anyone reads it — no parsing, no copy
This is how agents coordinate through tmux state instead of shuttling text around.cc- prefix is your tracker. Tear down when done:
tmux ls -F '#{session_name}' | grep '^cc-' | xargs -r -n1 -I{} tmux kill-session -t '={}'kill-server — it destroys everyone's tmux. Diagnostic: if a file or port is unexpectedly "busy" / in use (e.g. ETXTBSY overwriting a binary), suspect your own detached session holding it — tmux ls, kill yours, re-check before concluding the binary or code is broken. Confirm the holder is actually yours first (fuser /path or lsof /path → map the PID to a cc- session); if it isn't yours, stop and surface it — never kill a process or session you didn't start.kill-session — don't send-keys C-c/re-run into the user's pane either. Inspect read-only, surface to the user, let them restart it.One command for the whole discipline so you don't hand-roll it — the full job lifecycle:
new <label> <cmd> (namespaced session, prints <session> <%pane_id>, race-free @status + wait channel, survives exit so you can read it) → wait <session> (blocks until the job exits, no polling) → status <session> (running → done:<exitcode>) → out <session> (full output; last line Pane is dead (status N…) is the exit code) → clean [label] (kills only yours). mine lists yours. Set CC_TOK for per-agent isolation. Prefer it over hand-rolling.
To read a finished job's full output by hand, use capture-pane -p -S - — plain -p only shows the visible screen and drops scrolled lines.
scripts/cc-tmux.sh — namespaced create / wait / status / list-mine / clean-mine.references/primitives.md — wait-for, @options IPC, and pipe-pane live-streaming recipes. (Control mode -CC is deferred — reach for it only when orchestrating a fleet of panes needs a machine-readable event stream.)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tmux, terminal-multiplexer, parallel-jobs, agent-coordination
Other plugins' skills for the same job
/effective-tmux:effective-tmuxfrom effective-tmux
npx claudepluginhub human-frontier-labs-inc/human-frontier-labs-marketplace --plugin effective-tmux