ccy.dev
/

gtmux / 指南guides / 看住一支 agent 舰队 Watch a fleet of agents

Watch a fleet of agents

You’ve got five coding agents going at once — one refactoring, one running tests, one writing docs — scattered across a dozen tmux windows. The problem is never that they’re slow; it’s that you don’t know which one stopped to wait on you. This walks through seeing that at a glance, with the radar.

0 · Prerequisite: run your agents inside tmux

The radar scans tmux panes — an agent has to run inside tmux to be seen, jumped to, and replied to (sessions outside tmux are sensed read-only). So the way to start an agent is: open a named tmux session first, then launch the agent inside it, one agent per session:

tmux new -s api      # a named session for this agent
claude               # start the agent inside it
tmux new -s docs     # next agent, next session
codex

Why we recommend this: tmux sessions are persistent — close the terminal, drop the SSH, unplug the display, and the agent keeps running; each agent has its own name and pane, so it can be found and told apart; and after a reboot, gtmux restore brings the whole set back, layout included. For long-running agents there is no steadier base. New to tmux? The official Getting Started covers what you need in ten minutes.

1 · Put your agents on the radar

gtmux uses agent hooks. Wire them into your agents once:

gtmux install-hooks

After this, Claude Code, Codex, Gemini, and aider report every state change (stop, finish, error) to the radar live. An agent with no hook has no signal — which is exactly why gtmux isn’t Claude-only.

2 · Open the radar

gtmux agents --watch      # a live dashboard in your terminal

Or install the menu-bar app (brew install --cask chenchaoyi/tap/gtmux-app) and keep the radar in the top-right corner of your screen.

3 · Read it

One color language, identical everywhere: red = waiting on you, teal = working, green = idle/done, gray = running. The ones that need your input sort to the top — the red rows are what you’re looking for.

4 · Jump to the blocked one

gtmux focus %7            # bring that pane's window + pane to the front

Or click that row in the menu-bar popover. gtmux brings that terminal window and pane to the front, cursor right where it stopped — you reply, it keeps going.


Next: too many agents to watch yourself? Let HQ watch the fleet for you → · Away from the desk? Manage from your phone and the web →

看住一支 agent 舰队

管理散在十几个 tmux 窗口里的不同 agent,随时感知并掌控工作动向,支持远端并且分享协同,甚至在笔记本电脑合盖后仍能继续驱动。

0 · 前置
跑在 tmux 里

gtmux 管理的 agent 必须跑在 tmux 里(tmux 外的会话只能只读感知)。所以起 agent 的姿势是

tmux 会话,再在里面启动 agent:

tmux new -s api      # 给这个 agent 一个有名字的 tmux 会话
claude               # 在里面启动 agent
tmux new -s docs     # 下一个 agent,下一个会话
codex

为什么建议使用 tmux

里的会话是持久的——终端关了、SSH 断了、连显示器都没有,agent 都还在跑;每个 agent 有自己的名字和 pane,找得到、认得出;重启电脑后 gtmux restore 能把整套会话连布局一起恢复。跑长任务的 agent,这是最稳的底座。没用过 tmux?看官方的 Getting Started,十分钟够用。

1 · 让 agent 上雷达

gtmux 靠 agent hook。给你常用的 agent 装一次:

gtmux install-hooks

Claude Code、Codex、Gemini、aider 之后每次状态变化(停下、完成、报错)都会实时上雷达。没装 hook 的 agent 不会有信号——这也是它不只支持 Claude 的原因。

2 · 打开雷达

gtmux agents --watch      # 终端里的实时仪表盘

或者装上菜单栏 app(brew install --cask chenchaoyi/tap/gtmux-app),让那块雷达常驻在你屏幕右上角。

3 · 读取雷达

一套颜色,三处一致:红=等你青=在干活绿=空闲/完成、灰=运行中。需要你输入的 agent 会话永远排在最上面。

4 · 跳到卡住的那个

gtmux focus %7            # 把指定 pane 的窗口和 pane 带到最前

或者在菜单栏面板里点那一行。gtmux 把那个终端窗口和 pane 带到最前,光标就落在它停下的地方。


接下来: agent 多到自己盯不过来?让可自我迭代的中控替你掌控全局 → · 出门也想管理?用手机和网页远程管理 →