using-tmux-agent-tools
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseusing-tmux-agent-tools
使用tmux-agent-tools
You decide inline vs worker, pick the wrapper, then defer to the
hub skill for mechanics. You are not a wrapper.
tmux-agent-tools你需要决定采用inline还是worker模式,选择对应的包装器,然后将具体操作委托给核心skill处理。你本身并非包装器。
tmux-agent-toolsBYPASS — inline is the DEFAULT
绕过规则 — inline 为默认方式
Handle the task inline unless a named exception below fires. This is a
forcing gate, not ambient advice: record the winner BY NAME for inline and
worker outcomes alike — "it looks substantial" or "this is trivial" without
naming a bullet is not a valid gate pass.
Overrides (win over everything):
- — the caller says "inline" / "quick" / "don't spawn a worker".
explicit-inline - — the whole task is one already-known command (test, build, lint), even when it touches many files.
single-known-command
Delegate ONLY when one of these four exceptions fires:
- — the read-plan-write volume would flood the main context window (the commander does not do grunt work).
independent-context - — work must proceed while the main session continues, or several independent tasks run at once.
parallel-or-background - — the stage needs another CLI/model (second-model review, imagegen → Codex, profile-specific work).
different-engine - — a follow-up in the same repo/domain where a persistent worker already holds context: send to THAT worker (after
existing-teammate); never start a duplicate.result init
No exception fired → inline, receipt .
no-delegate-trigger除非触发以下指定例外情况,否则以inline方式处理任务。这是强制规则,而非一般性建议:无论最终选择inline还是worker模式,都必须明确记录触发的规则名称——仅以“任务看起来复杂”或“任务很简单”为由而未明确对应规则项,不符合规则要求。
优先级最高的覆盖规则(优于所有其他规则):
- — 调用者明确要求“inline”/“快速处理”/“不要启动worker”。
explicit-inline - — 整个任务仅包含一个已知命令(测试、构建、代码检查等),即使该命令涉及多个文件。
single-known-command
仅当触发以下四个例外情况之一时,才进行委托:
- — 读取-规划-写入的数据量会占用主上下文窗口的大量资源(指挥官不执行 grunt work)。
independent-context - — 工作必须在主会话持续运行的同时进行,或者需要同时执行多个独立任务。
parallel-or-background - — 任务阶段需要使用另一个CLI/模型(如二次模型评审、图像生成→Codex、特定配置文件的工作)。
different-engine - — 在同一仓库/领域的后续任务中,已有一个持久化worker持有上下文:将任务发送给该worker(执行
existing-teammate之后);绝不要启动重复的worker。result init
未触发任何例外情况 → 采用inline方式,记录。
no-delegate-triggerQUESTIONS — if delegating, one-shot or teammate? State which, and why.
疑问 — 若进行委托,选择一次性worker还是协作worker?说明选择类型及原因。
- One-shot (one bounded answer, no follow-up of any kind) →
interactive (headed; the pane is the debug surface —
start --task-shape boundedonly when the user explicitly opted in); exactly one--headless, thenresult wait-requiredunless keepalive was requested. Shell-safe name matchingstop; arrange failure-safe cleanup equivalent to[A-Za-z0-9._-]+(success, wait failure, or interruption).trap cleanup EXIT - Teammate (expect a second message to the SAME worker) → interactive
(no
start); do not--headlessbetween tasks; reuse viastop.skills/tmux-agent-tools/references/multi-agent.md#persistent-teammates-worker-reuse
- 一次性(One-shot)(任务有明确边界,无任何后续操作)→ 交互式执行(带界面;面板作为调试界面——仅当用户明确选择时才使用
start --task-shape bounded);执行恰好一次--headless,除非请求保持存活,否则执行result wait-required。使用符合stop格式的安全Shell名称;安排等效于[A-Za-z0-9._-]+的故障安全清理机制(适用于成功、等待失败或中断场景)。trap cleanup EXIT - 协作worker(Teammate)(预期会向同一个worker发送第二条消息)→ 交互式执行(不使用
start);任务间不执行--headless;通过stop实现复用。skills/tmux-agent-tools/references/multi-agent.md#persistent-teammates-worker-reuse
ONE OWNER — assign
is the supervision boundary
assign单一所有者 — assign
为监管边界
assignDispatch one external CLI worker with one blocking call. owns start, result init,
verified send, processing confirmation, and terminal supervision. Do not add a
native supervision proxy: while runs, no second supervisor may
concurrently call , , , , or another wait.
Hosting that one call inside a sub-agent is not a proxy — see below.
agent-tmux <cli> assign <name> <directory> <prompt-file>assignassignstatuscaptureproberesultassignKeep the long supervise off the expensive main context: host that one blocking
in a cheap general-purpose sub-agent (model override, e.g. Sonnet), or
in a background task. The host still makes exactly one call — it hosts,
it does not proxy. Exception — a harness that reaps long-running tasks (local
Claude Code kills them after ~10 min, together with any tmux server in the task
tree) cannot hold the blocking wait at all: there, dispatch with in a short foreground call, then harvest with bounded calls. A single diagnostic call is allowed only when
dispatch or harvest reports an abnormal result.
assignassignassign --detachresult wait-required --wait <s>通过一个阻塞式调用,调度一个外部CLI worker。负责启动、结果初始化、验证发送、处理确认及终端监管。不要添加原生监管代理:当运行时,不得有第二个监管者同时调用、、、或其他等待命令。将该调用托管在子agent中不属于代理行为——详见下文。
agent-tmux <cli> assign <name> <directory> <prompt-file>assignassignstatuscaptureproberesultassign避免占用昂贵的主上下文进行长时间监管:将该阻塞式调用托管在低成本的通用子agent中(可覆盖模型,如Sonnet),或作为后台任务。托管者仍仅执行一次调用——仅负责托管,不承担代理职责。例外情况——若有工具会终止长时间运行的任务(例如本地Claude Code会在约10分钟后终止任务,以及任务树中的任何tmux服务器),则完全无法保持阻塞等待:此时需通过前台短调用执行进行调度,然后通过有限次数的调用获取结果。仅当调度或获取结果报告异常时,才允许进行一次诊断调用。
assignassignassign --detachresult wait-required --wait <s>SELECT — wrapper by task shape
选择 — 根据任务类型选择包装器
- Loop-shaped chain (audit / plan→build / consensus / triage) → the
skill, not this router.
using-workflows - ONE coding CLI as a supervised worker (most common) → (claude / codex / agy built in; gemini, cursor, custom via profile).
agent-tmux <cli> - Same prompt across MANY workers → ; bounded TWO-party exchange →
tmux-agent-fanout. BOTH require the user's explicit authorization for count, tool, model, and effort — never assume it.tmux-agent-dialogue - Inspect / housekeep existing sessions → (resolve, inventory, cleanup) · live overview →
tmux-agent-sessions.tmux-agent-dashboard - Background & scheduled → · dependencies →
tmux-agent-cron· evidence polling →tmux-agent-dag· alerts →tmux-agent-monitor.tmux-agent-notify - Records → /
tmux-agent-audit/tmux-agent-history· worktrees →tmux-agent-replay.tmux-agent-worktrees
Then read the chosen wrapper's row in the canonical capability table:
→ Full script
capability table. Never paraphrase that table from memory.
skills/tmux-agent-tools/references/cheatsheets.md- 循环型任务链(审计/规划→构建/共识/分类)→ 使用skill,而非本路由。
using-workflows - 单个受监管的编码CLI worker(最常见场景)→ (内置claude/codex/agy;gemini、cursor及自定义工具可通过配置文件添加)。
agent-tmux <cli> - 同一提示信息分发至多个worker → ;有限的双向交互 →
tmux-agent-fanout。这两种场景均需用户明确授权数量、工具、模型及工作量——绝不要自行假设。tmux-agent-dialogue - 检查/管理现有会话 → (解析、盘点、清理)· 实时概览 →
tmux-agent-sessions。tmux-agent-dashboard - 后台及定时任务 → · 依赖管理 →
tmux-agent-cron· 证据轮询 →tmux-agent-dag· 告警 →tmux-agent-monitor。tmux-agent-notify - 记录 → /
tmux-agent-audit/tmux-agent-history· 工作树 →tmux-agent-replay。tmux-agent-worktrees
然后查看标准功能表中所选包装器对应的条目: → 完整脚本功能表。绝不要凭记忆转述该表内容。
skills/tmux-agent-tools/references/cheatsheets.mdDEFER — non-negotiable gates (mechanics live in the hub skill)
委托 — 不可协商的规则(具体实现由核心skill负责)
- Prompt shape: every worker prompt filled from (GOAL / ACCEPTANCE / REPORT + common footer + tmux addendum).
delegation-templates - No cascade: every worker prompt carries the literal ban
"Do not spawn additional tmux sessions or delegate further." Only a Claude
Code worker may still use its own in-process tool (CLI-supervised, depth-capped); Codex workers have no equivalent exception.
Agent - Engine-only, never raw tmux: no hand-rolled /
send-keys/capture-pane. Plain shell only for genuine gaps — say so.new-session - Verify every send: prefer . A timeout means submission is UNCONFIRMED — check liveness (
send-wait;status --json, orprobe --metric tool_activefor claude) and resend only if idle. Never nudge with a raw Enter.--metric active_spinner - Preflight & safe invocation: follow the hub skill's preflight
contract (resolve the wrapper bundle, run , prompt-file for task text,
setupfor credentials) before the first worker command.--secret KEY=URI - After the result: collect () →
result --json, or keep the teammate per the reuse protocol. Failure/blocked → follow up on the same worker, or escalate viastopusing-workflows.findings-triage
- 提示格式:每个worker的提示信息均从中填充(包含GOAL/ACCEPTANCE/REPORT + 通用页脚 + tmux补充内容)。
delegation-templates - 禁止级联:每个worker的提示信息必须包含明确禁令:“Do not spawn additional tmux sessions or delegate further.”(不得启动额外的tmux会话或进一步委托任务)。仅Claude Code worker仍可使用其自身进程内的工具(受CLI监管,有深度限制);Codex worker无此例外权限。
Agent - 仅使用引擎,绝不直接操作tmux:不得手动编写/
send-keys/capture-pane命令。仅当确实存在功能缺口时,才可使用纯Shell命令——需明确说明。new-session - 验证每一次发送:优先使用。超时意味着提交未确认——需检查活跃度(
send-wait;针对claude使用status --json或probe --metric tool_active),仅当worker处于空闲状态时才重新发送。绝不要用直接按回车键的方式催促。--metric active_spinner - 预检查与安全调用:在首次执行worker命令之前,遵循核心skill的预检查约定(解析包装器包、运行、为任务文本准备prompt-file、使用
setup传递凭据)。--secret KEY=URI - 结果处理:收集结果()→ 执行
result --json,或根据复用协议保留协作worker。若任务失败/阻塞 → 在同一个worker上跟进处理,或通过stop的using-workflows流程升级处理。findings-triage
NOT-FOUND
未匹配场景
Another skill already owns the task (commit workflow, PR review, …) →
receipt , route there — no tmux worker. A capability no
wrapper covers → plain shell as a last resort, stated explicitly. Hub
reference: (fast paths, result.json
contract, safety, ).
other-skill-ownerskills/tmux-agent-tools/SKILL.mdreferences/若任务已由其他skill负责(提交工作流、PR评审等)→ 记录,将任务路由至对应skill——不使用tmux worker。若没有包装器覆盖对应功能 → 最后才使用纯Shell命令,需明确说明。核心参考文档:(快速路径、result.json约定、安全机制、目录)。
other-skill-ownerskills/tmux-agent-tools/SKILL.mdreferences/