fleetlayer-tmux
The session manager plugin for tmux. It puts the Claude Code, Codex and other agents
running in your tmux panes in the fleet: with their status, messages and webhooks, blocked prompts answered from
anywhere, sessions started and closed from anywhere in the fleet, and fleetlayer attach on their panes.
It uses only tmux’s own command line (list-panes, capture-pane, send-keys, paste-buffer, new-window -d) and
never attaches a tmux client, so your tmux keeps working exactly as before: no extra client in list-clients, no
window resized to fit Fleetlayer, nothing in your status line, no layout or name changed, and no window taking focus.
Install tmux (apt install tmux, brew install tmux), then add the plugin to node.yaml. fleetlayer up adds it for
you on a fresh setup when it finds tmux.
plugins: - name: tmux command: fleetlayer-tmux config: program: /usr/bin/tmux # the full path, so a service PATH can't hide it (default: tmux) # socket: work # a named server, as `tmux -L work` (default: your default server) # socket_path: /run/t.sock # or a socket path, as `tmux -S` takes it # session: fleetlayer # the tmux session new agents open in, made when it isn't there # shell: /bin/zsh # the login shell new agents start through (default: $SHELL) # claude_dir: ~/.claude # where Claude Code keeps its session registryThe node runs as a service, so it reaches the tmux server of its own Unix user at tmux’s default socket
(/tmp/tmux-<uid>/default, or under $TMUX_TMPDIR when you set one). If you start tmux with -L or -S, give the
plugin the same socket or socket_path. No tmux server running is fine: the plugin lists no sessions until one
starts, and it never starts one except to open a session you asked for.
Run it beside the Claude Code plugin (fleetlayer-claude-code): messages to Claude Code then arrive through Claude
Code’s own messaging channel, labelled with who sent them, and its hooks report what a blocked session is asking. This
plugin types a message in only for agents with no channel of their own (Codex, for instance).
What it does
Section titled “What it does”- Sessions. A pane whose process, or a process under it, is an agent (
claude,codex,opencode,gemini,aiderand others) is a session: the nearest one, so aclaude -pa tool call started isn’t a second session. Agents under another session manager inside a pane (herdr run in tmux) are left to that manager’s plugin, so nothing is listed twice. A Claude Code session is known by its own session ID, from Claude Code’s session registry; a Codex session by the ID in the transcript it has open (on Linux); other agents go by their pane (@p12for%12). - Names. A session’s name in the fleet (
planning@laptop) is the name you gave the Claude Code session (claude --name planning, or/rename); else the window’s name when you named it (rename-window,new-window -n); else the tmux session’s name, or<session>:<window>when that session runs several agents. Two agents in one window add.<pane>, as tmux’s own targets do. Its workspace is the tmux session. - Status. Claude Code writes its state to its session registry:
working,idle, andblockedwhile it waits on a person (a permission prompt, a question, a dialog). Other agents are read off the screen:workingwhile they offer “esc to interrupt”,blockedon Codex’s approval menus, otherwiseidle; an agent whose screen the plugin doesn’t know is only everworkingorunknown, so nothing is typed into a screen it can’t read. A turn that finishes while nobody can see the pane (its session isn’t attached, or another window is showing) isdoneuntil someone looks. The plugin reads tmux once a second (tmux has no event stream that doesn’t attach a client). - Messages. Pasted into the pane through a tmux buffer of the plugin’s own (never your paste buffers), as a bracketed paste so a message of several lines stays one message, then Enter. Nothing is typed into an agent that’s blocked on a person, a pane someone is scrolling in (copy mode), or a pane whose agent has exited back to a shell.
- Blocked prompts and commands. The node answers a prompt (
fleetlayer session answer), types an allowed slash command (fleetlayer session command) or what a person said from the dashboard by reading the pane’s screen and pressing keys in it, with the same checks as everywhere: only into the prompt that’s showing, only into an empty input line. - Starting and closing.
fleetlayer session startopens a new window in thesessiontmux session (made, detached, when it isn’t there) withnew-window -d, so no client switches to it. The agent starts through your login shell, so it finds what’s on your PATH, with its arguments passed as they are, never spliced into shell text. The plugin waits until the agent is ready (up to a minute), then types the first prompt. Closing a session closes its pane, and its window when that was the last pane. Interrupting presses Esc. - Terminals.
fleetlayer attachreads the pane withcapture-pane -ea few times a second and sends the screen when it changed, with the cursor where the pane has it.--observeonly watches (and reads scrollback); typing goes in withsend-keys. The pane keeps its size in your layout in every mode: a resize from the attaching terminal is ignored, and the frames carry the pane’s real size. - Who’s watching. A session shows
humanAttachedwhen a client has its tmux session open.
Security
Section titled “Security”It sees every pane on its user’s tmux server (session and window names, folders, the process tree under each pane,
the screen when you attach or the node reads a prompt) and types into a pane only to deliver a message or a first
prompt, answer a prompt, or when someone attaches without --observe, all under the access policy. It runs tmux
and ps with argv, never through a shell. Anyone who can run commands as the node’s Unix user can drive that user’s
tmux already: the plugin adds no access of its own.
Testing it
Section titled “Testing it”cargo test -p fleetlayer-tmux runs the plugin against a real tmux: a private server (its own socket, no
~/.tmux.conf, a throwaway HOME), agents that are a fake claude writing Claude Code’s session registry, and the
plugin driven over JSON-RPC as the node drives it. It checks listing, names and status, delivery, done, a refused
message to a blocked agent and to a pane in copy mode, answering a prompt with keys, fleetlayer attach through the
terminal helper, opening a session with a first prompt, closing it, an agent exiting back to its shell, and that the
person’s own session gained no client or window. It’s skipped where tmux isn’t installed, except in CI.
Fleetlayer is source-available under FSL-1.1-ALv2: use it for anything except a competing product or service, and each release becomes Apache 2.0 two years after it ships.