tmux integration for terminal coding agent sessions.
It helps you:
- open a chooser of active coding agent panes
- jump straight to panes waiting on your answer
- show the current pane state plus a background session summary in the status line
- use local plugin and hook state instead of relying only on sqlite or pane heuristics
Today the strongest runtime support is still for opencode, and the project also supports codex, pi, and claude panes for discovery, switching, popup navigation, and status summaries.
This project is being renamed from opencode-tmux to coding-agents-tmux.
In this update:
- preferred public name:
coding-agents-tmux - temporary compatibility aliases:
opencode-tmux,@opencode-tmux-*, andOPENCODE_TMUX_*
The legacy names still work for now, but they are transition aliases and are not intended to stay forever.
Add the plugin to ~/.tmux.conf:
set -g @plugin 'corwinm/coding-agents-tmux'Recommended settings:
set -g @coding-agents-tmux-provider 'plugin'
set -g @coding-agents-tmux-auto-install 'opencode,pi,codex,claude'
set -g @coding-agents-tmux-menu-key 'O'
set -g @coding-agents-tmux-popup-key 'P'
set -g @coding-agents-tmux-waiting-menu-key 'W'
set -g @coding-agents-tmux-waiting-popup-key 'C-w'
set -g @coding-agents-tmux-status 'on'
set -g @coding-agents-tmux-status-style 'tmux'
set -g @coding-agents-tmux-status-position 'right'
set -g @coding-agents-tmux-status-interval '0'Those settings favor the bundled plugin provider, explicitly enable tmux-managed installs for the bundled OpenCode plugin plus the Pi extension and Codex/Claude hooks, and use event-driven status redraws so tmux stops polling Node in the background.
To match your tmux theme, you can also override the status colors:
set -g @coding-agents-tmux-status-color-neutral 'default'
set -g @coding-agents-tmux-status-color-idle 'colour244'
set -g @coding-agents-tmux-status-color-busy 'colour81'
set -g @coding-agents-tmux-status-color-waiting 'colour214'
set -g @coding-agents-tmux-status-color-unknown 'colour240'Using default is a good way to let the segment inherit your existing tmux theme colors.
Then install or reload TPM:
prefix + IRequirements:
- Node 24+ must be installed
- npm 10+ must be installed
- TPM will install CLI dependencies automatically on first load with
npm ci --omit=dev opencodesessions must be restarted after first install so the bundled plugin is loadedcodexsessions must be restarted after first install so newly installed hooks are loadedpisessions must be restarted after first install so the bundled extension is loadedclaudesessions must be restarted after Claude hook installation so new hooks are loaded
With the recommended settings above, the tmux plugin manages the bundled opencode plugin, the Pi extension, and the Codex and Claude hook installs for you.
It installs the bundled opencode plugin by creating these symlinks:
~/.config/opencode/plugins/coding-agents-tmux.ts
~/.config/opencode/plugins/opencode-tmux.ts
The new path is preferred. The legacy path is kept as a temporary compatibility alias.
That plugin publishes normalized session state files under:
~/.local/state/coding-agents-tmux/plugin-state
The runtime also continues reading legacy state under:
~/.local/state/opencode-tmux/plugin-state
On first install, the tmux plugin also bootstraps the CLI runtime dependencies inside:
~/.tmux/plugins/coding-agents-tmux/node_modules
It also installs or updates the bundled Pi extension under:
~/.pi/agent/extensions/coding-agents-tmux/index.ts
The legacy extension path is also kept during the transition:
~/.pi/agent/extensions/opencode-tmux/index.ts
That extension publishes normalized Pi state files under:
~/.local/state/coding-agents-tmux/pi-state
The runtime also continues reading legacy Pi state under:
~/.local/state/opencode-tmux/pi-state
It also installs or updates Codex hook integration under:
~/.codex/config.toml
~/.codex/hooks.json
With the recommended @coding-agents-tmux-auto-install 'opencode,pi,codex,claude' setting, it also installs or updates Claude Code hook integration under:
~/.claude/settings.json
You can disable the automatic symlink step with:
set -g @coding-agents-tmux-install-opencode-plugin 'off'You can disable the automatic Pi extension setup with:
set -g @coding-agents-tmux-install-pi-extension 'off'You can disable the automatic Codex hook setup with:
set -g @coding-agents-tmux-install-codex-hooks 'off'You can disable the automatic Claude Code hook setup with:
set -g @coding-agents-tmux-install-claude-hooks 'off'You can also control all tmux-managed installs together:
set -g @coding-agents-tmux-auto-install 'auto'
set -g @coding-agents-tmux-auto-install 'off'
set -g @coding-agents-tmux-auto-install 'opencode,pi,codex,claude'The explicit opencode,pi,codex,claude list is the recommended README setting because it makes the intended managed installs obvious in your tmux config. When @coding-agents-tmux-auto-install is set, it takes precedence over the individual install toggles.
Default key bindings:
prefix + Oopens the main menu chooserprefix + Popens the main popup chooserprefix + Wjumps to the only waiting session, or opens a waiting-only menu if there are multipleprefix + C-wopens the waiting-only popup chooser
Launcher behavior:
menuuses a tmux menu and is the most reliable optionpopupopens a popup chooser if you prefer a larger interactive view
Inside the popup you can do more than pick a row number:
- type to filter the list by target, session, title, state, or path
- use the up and down arrows or
Ctrl-J/Ctrl-Kto move through the matching panes - use
Ctrl-Gthen1through9to immediately open the matching visible row - press
Enterto switch to the selected pane - press
Escto close the popup orCtrl-Rto refresh the live pane list
You can configure each binding independently:
set -g @coding-agents-tmux-menu-key 'O'
set -g @coding-agents-tmux-popup-key 'P'
set -g @coding-agents-tmux-waiting-menu-key 'W'
set -g @coding-agents-tmux-waiting-popup-key 'C-w'Set any of them to off to disable that binding.
When enabled, the status line shows two views at once:
- the current pane state
- a compact summary of the remaining detected coding-agent panes
Example output:
| idle |
| busy |
| new | none
You can also replace the default icon with your own label or a different Nerd Font icon:
set -g @coding-agents-tmux-status-prefix ''This means:
| idle | means the focused pane is idle and the background panes are waiting, busy, and idle in target order | busy | means the focused pane is busy and more than eight background panes are shown in compact symbol mode | new | nonemeans the focused pane is newly started and there are no other detected coding-agent panes
If your active pane is not a detected coding-agent pane, the status line uses the strongest detected coding-agent pane in the current tmux window. Other panes are counted as background work.
Background pane symbols are shown in a stable target order:
waitingbusyidlenewunknown
By default the status line adds spaces between background pane symbols for readability. If there are more than eight background panes, it automatically switches to a compact no-space form.
Enable or tune the status line with:
set -g @coding-agents-tmux-status 'on'
set -g @coding-agents-tmux-status-style 'tmux'
set -g @coding-agents-tmux-status-position 'right'
set -g @coding-agents-tmux-status-interval '0'By default the plugin uses manual mode so your theme can place the segment itself.
With the bundled plugin provider, 0 makes the status line event-driven: session events and tmux navigation hooks trigger redraws instead of polling on a timer. If you switch to the sqlite or server provider, set a positive interval if you still want periodic background refreshes.
For Catppuccin, use the renamed module export:
set -g @coding-agents-tmux-status 'on'
set -g @coding-agents-tmux-status-mode 'manual'
set -g status-right "#{E:@catppuccin_status_session}"
set -ag status-right "#{E:@catppuccin_status_directory}"
set -ag status-right "#{E:@catppuccin_status_agents}"For other themes, use the tone-aware inline export:
set -g @coding-agents-tmux-status 'on'
set -g @coding-agents-tmux-status-mode 'manual'
set -ag status-right " #{@coding-agents-tmux-status-inline-format}"If you want to fully control the wrapper yourself, use the plain text export instead:
set -ag status-right " #[fg=colour81] #[default]#{@coding-agents-tmux-status-text}"manual mode is the default. #{E:@catppuccin_status_agents} gives Catppuccin users a native-looking module, #{@coding-agents-tmux-status-inline-format} gives other themes a tone-aware inline segment, and #{@coding-agents-tmux-status-text} gives a plain live summary text export for fully custom wrappers. append mode restores the old behavior and appends automatically.
@catppuccin_status_opencode still works as a compatibility alias for now.
Available tmux options:
@coding-agents-tmux-menu-keymain menu chooser key, defaultO@coding-agents-tmux-popup-keymain popup chooser key, defaultP@coding-agents-tmux-waiting-menu-keywaiting-only menu chooser key, defaultW@coding-agents-tmux-waiting-popup-keywaiting-only popup chooser key, defaultC-w@coding-agents-tmux-install-opencode-pluginonoroff, defaulton@coding-agents-tmux-install-pi-extensiononoroff, defaulton@coding-agents-tmux-install-codex-hooksonoroff, defaulton@coding-agents-tmux-install-claude-hooksonoroff, defaultoff@coding-agents-tmux-auto-installauto,off, or a comma-separated list likeopencode,pi,codex,claude; when set, it overrides the individual install toggles@coding-agents-tmux-providerauto,plugin,sqlite, orserver, defaultplugin@coding-agents-tmux-server-mapJSON object or JSON file path for explicit server endpoints@coding-agents-tmux-popup-filterone ofall,busy,waiting,running,active@coding-agents-tmux-popup-widthpopup width, default100%@coding-agents-tmux-popup-heightpopup height, default100%@coding-agents-tmux-popup-titlepopup title, defaultCoding Agent Sessions@coding-agents-tmux-statusonoroff, defaulton@coding-agents-tmux-status-styleplainortmux, defaulttmux@coding-agents-tmux-status-modeappendormanual, defaultmanual@coding-agents-tmux-status-positionrightorleft, defaultright@coding-agents-tmux-status-intervaltmuxstatus-interval, default0@coding-agents-tmux-status-prefixlabel shown before the status summary, default@coding-agents-tmux-status-color-neutraltmux color for the prefix and separators, defaultcolour252@coding-agents-tmux-status-color-idletmux color for idle state, defaultcolour70@coding-agents-tmux-status-color-busytmux color for busy state, defaultcolour220@coding-agents-tmux-status-color-waitingtmux color for waiting state, defaultcolour196@coding-agents-tmux-status-color-unknowntmux color for unknown/none state, defaultcolour244
Legacy @opencode-tmux-* tmux options still work for now as transition aliases.
Recommended provider:
pluginfor the best waiting/running/idle detection in normal localopencodesessions, and the default tmux integration provider
Provider modes:
autouses plugin state when available, then server endpoints, then sqlitepluginuses only plugin state filessqliteuses the localopencodesqlite databaseserveruses explicitopencode serveendpoints from@coding-agents-tmux-server-map
Example:
set -g @coding-agents-tmux-provider 'plugin'pi panes are detected from the live tmux pane command and common title patterns, so they show up in list, switch, popup, and status alongside opencode, codex, and claude panes.
Use --agent opencode, --agent codex, --agent pi, --agent claude, or --agent all on list, switch, popup, popup-ui, and status when you want to narrow mixed tmux environments.
For the best Pi runtime fidelity, let the tmux plugin install the bundled Pi extension automatically. It is linked into:
~/.pi/agent/extensions/coding-agents-tmux/index.ts
That extension publishes pane-aware Pi state under:
~/.local/state/coding-agents-tmux/pi-state
Pi runtime support is intentionally minimal and extensible:
- with the bundled Pi extension loaded, Pi panes can report
new,running,idle, and best-effortwaiting-input - without the extension,
coding-agents-tmuxfalls back to pane preview heuristics when possible - if preview is inconclusive, Pi falls back to a coarse
runningstate when apiprocess is still detected in the tmux pane - Pi has no built-in permission or plan mode integration here yet, so those states are not modeled specially
After first install or update, restart Pi sessions in tmux so they load the bundled extension.
codex panes are detected from the live tmux pane command, so they show up in list, switch, popup, and status alongside opencode, pi, and claude panes.
Use --agent opencode, --agent codex, --agent pi, --agent claude, or --agent all on list, switch, popup, popup-ui, and status when you want to narrow mixed tmux environments.
Default Codex runtime support is intentionally coarse:
- if a tmux pane is running a
codexprocess, it is classified asrunning - waiting, question, and idle distinctions are still
opencode-specific until a stronger Codex-local state source is added
To enable higher-fidelity Codex state with Codex hooks:
- Let the tmux plugin install the global Codex config automatically, or run it manually:
./bin/coding-agents-tmux install-codex- Optionally generate an additional repo-local hooks file:
mkdir -p .codex
./bin/coding-agents-tmux codex-hooks-template > .codex/hooks.json- Restart
codexsessions in tmux so they begin publishing hook-backed state.
With hooks enabled, coding-agents-tmux can mark Codex panes as idle or waiting-input between turns instead of showing every Codex pane as continuously running.
claude panes are detected from the live tmux pane command and common title patterns, so they show up in list, switch, popup, and status alongside opencode, codex, and pi panes.
Default Claude Code runtime support is intentionally coarse:
- if a tmux pane is running a
claudeprocess, it is classified asrunning - waiting, question, and idle distinctions become higher fidelity when Claude hooks are installed
To enable higher-fidelity Claude Code state with hooks:
- Install or update the global Claude hook config manually:
./bin/coding-agents-tmux install-claude- Or let the tmux plugin manage it by setting either:
set -g @coding-agents-tmux-install-claude-hooks 'on'or the shared selector:
set -g @coding-agents-tmux-auto-install 'opencode,pi,codex,claude'- Optionally inspect the managed hook template before merging it into project or user Claude settings:
./bin/coding-agents-tmux claude-hooks-template- Restart
claudesessions in tmux so they begin publishing hook-backed state.
With hooks enabled, coding-agents-tmux can mark Claude panes as idle, waiting-question, or waiting-input between turns instead of showing every Claude pane as continuously running.
prefix + Oorprefix + Pdoes nothing: make surenodeandnpmare installed and reload tmux- first TPM load feels slow: the plugin may be running
npm ci --omit=devto bootstrap dependencies - new panes show stale state: restart the
opencodesession so it reloads the plugin - waiting detection seems wrong: use the
pluginprovider and confirm the bundled plugin symlink exists at~/.config/opencode/plugins/coding-agents-tmux.ts - Pi still looks busy or unknown: confirm the bundled extension exists at
~/.pi/agent/extensions/coding-agents-tmux/index.tsand restart the Pi session so it loads the extension - Codex still always looks busy: confirm
~/.codex/config.tomlhascodex_hooks = true,~/.codex/hooks.jsonexists, and restart the Codex session - Claude still always looks busy: confirm
~/.claude/settings.jsoncontains the managedclaude-hook-statehook command and restart the Claude Code session - status looks stale with
sqliteorserver: set@coding-agents-tmux-status-intervalto a positive value because event-driven refreshes are centered on the bundled plugin provider - TPM install changed but tmux still looks old: run
prefix + Iortmux source-file ~/.tmux.conf
If you edit this repo outside ~/.tmux/plugins/coding-agents-tmux, tmux will still be using the TPM-installed copy until you sync it.
Useful commands:
npm run sync-tmux
npm run sync-tmux -- --reload
npm run sync-tmux -- --bootstrap --reloadsync-tmuxcopies this checkout into~/.tmux/plugins/coding-agents-tmux--reloadrunstmux source-file ~/.tmux.confafter syncing--bootstrapreinstalls production dependencies in the synced plugin copy whenpackage.jsonchanged
The repository also includes a CLI for debugging and manual inspection.
Useful commands:
./bin/coding-agents-tmux list --provider plugin
./bin/coding-agents-tmux list --agent codex
./bin/coding-agents-tmux list --agent pi
./bin/coding-agents-tmux list --agent claude
./bin/coding-agents-tmux list --provider plugin --waiting
./bin/coding-agents-tmux inspect <target> --provider plugin
./bin/coding-agents-tmux status --provider plugin --style tmux
./bin/coding-agents-tmux tmux-config --provider pluginThe legacy ./bin/opencode-tmux alias still works for now during the rename transition.