ccy.dev
/

gtmux / 指南guides / 看住一支舰队watch a fleet

看住一支 agent 舰队Watch a fleet of agents

你手上同时开着五个编码 agent——一个在重构、一个跑测试、一个写文档,散在十几个 tmux 窗口里。问题从来不是它们干得慢,而是你不知道哪个停下来等你了。这篇用雷达把它一眼看清。 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 · 前置:agent 跑在 tmux 里0 · Prerequisite: run your agents inside tmux

gtmux 的雷达扫的是 tmux 里的 pane——agent 必须跑在 tmux 里,才看得到、跳得过去、回得了话(tmux 外的会话只能只读感知)。所以起 agent 的姿势是:先开一个有名字的 tmux 会话,再在里面启动 agent,一个 agent 一个会话: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 — then detach with Ctrl-b d
tmux new -s docs     # next agent, next session
codex

为什么这么建议:tmux 里的会话是持久的——终端关了、SSH 断了、连显示器都没有,agent 都还在跑;每个 agent 有自己的名字和 pane,找得到、认得出;重启电脑后 gtmux restore 能把整套会话连布局一起恢复。跑长任务的 agent,这是最稳的底座。没用过 tmux?看官方的 Getting Started,十分钟够用。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 · 让 agent 上雷达1 · Put your agents on the radar

gtmux 不靠猜——它靠 hook。给你常用的 agent 装一次:gtmux doesn’t guess — it uses hooks. Wire them into your agents once:

gtmux install-hooks

Claude Code、Codex、Gemini、aider 之后每次状态变化(停下、完成、报错)都会实时上雷达。没装 hook 的 agent 不会有信号——这也是它不只支持 Claude 的原因。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 · 打开雷达2 · Open the radar

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

或者装上菜单栏 app(brew install --cask chenchaoyi/tap/gtmux-app),让那块雷达常驻在你屏幕右上角。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 · 读那块雷达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 · 跳到卡住的那个4 · Jump to the blocked one

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

或者在菜单栏面板里点那一行。gtmux 把那个终端窗口和 pane 带到最前,光标就落在它停下的地方——你回一句,它接着跑。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.


接下来:agent 多到自己盯不过来?让中控替你盯全局 → · 出门也想看和管?用手机和网页远程管理 → 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 →