Subagent Tracker
Description
Say "agent status" and get updates on all subagent progress. Track subagent actions while they run; list active subagents, status, and tail transcripts. Install for power users using the agent swarm.
Subagent Tracker
Say “agent status” and get an update on all subagent progress—who’s running, what they’re doing, and when tasks complete. The TUI doesn’t show a live “sub-agent working…” indicator; subagent-tracker is how you see what your agent swarm is doing.
Installation
ClawHub: Update clawhub install and ClawHub links when the new ClawHub instance is live.
CODEBLOCK0
Or clone: git clone https://github.com/RuneweaverStudios/subagent-tracker.git workspace/skills/subagent-tracker
Usage
- - User says: "agent status", "track subagents", "see what the sub-agent is doing", "show progress", "show subagent progress", "why didn't the agent come back", "sub-agent never responded"
- After delegation: user wants a progress/loading-style view — run the tracker and summarize active subagents and recent tool calls
- Debugging: sub-agent was assigned (e.g. "Using: Kimi k2.5") but no result showed in chat — list runs and sessions, tail transcripts, report what the sub-agent is doing or did
| You say | What happens |
|---|
| "agent status" | Orchestrator runs tracker, reports active subagents (Agent 1, Agent 2, … with Task X/Y and model). |
| "track subagents" / "show subagent progress" |
Same: list active subagents and optional status/tail for detail. |
| "what's the sub-agent doing?" | Tracker list + summary; optionally status for a specific session. |
| "why didn't the agent come back?" | Tracker shows what ran or is running; orchestrator can tail transcript and report. |
Examples
List subagents active in the last 30 minutes:
CODEBLOCK1
Status for a session (ID from list or runs.json):
CODEBLOCK2
Tail last 15 transcript events:
CODEBLOCK3
Run all tracker checks locally (list + status + tail on first active subagent):
CODEBLOCK4
Commands
From any cwd (e.g. TUI exec), use the skill path:
CODEBLOCK5
(Use --summary for a single "Here are your active subagents" block with Agent 1, Agent 2, … and Task X/Y when available; report it once, do not duplicate.)
CODEBLOCK6
CODEBLOCK7
Prevent duplicate subagent tasks (run before sessions_spawn):
python3 /Users/ghost/.openclaw/workspace/skills/subagent-tracker/scripts/subagent_tracker.py check-duplicate --task "<task string>" --json
If output has
"duplicate": true, do not call sessions_spawn; reply that the task is already running. The orchestrator rule runs this automatically before spawning.
Session IDs come from list or from subagents/runs.json (extract from childSessionKey, e.g. agent:main:subagent:UUID → use UUID).
Pain point
When you queue multiple tasks (poem, bug fix, research), you have no built-in view of which subagents are active or how far along they are. Without this skill, “agent status” or “what’s the sub-agent doing?” can’t be answered.
Benefits
- - One phrase: Say “agent status”, “track subagents”, or “show subagent progress” and the orchestrator runs the tracker and reports (Agent 1, Agent 2, … with Task X/Y and model).
- Full visibility — List active subagents, view status and tokens, tail transcript events (tool calls, thinking).
- Works with the swarm — Map task → session via
subagents/runs.json; when runs include taskIndex and totalTasks, the tracker shows “Task X/Y” per agent. - Duplicate prevention —
check-duplicate runs before sessions_spawn so the same task isn’t run twice (saves tokens and lag).
Encouraged for power users: If you use Agent Swarm and handle multiple queued tasks, download subagent-tracker so you can say “agent status” and stay updated.
Chat visibility and "agents never come back"
Why results sometimes don't appear: The orchestrator must wait for sessions_spawn to return before replying. If it replies with "I'll let you know once it has findings!" and ends the turn, the sub-agent result never gets into the chat. The rule "Wait for spawn before replying" in the orchestrator delegate rule addresses this.
Progress/loading: The TUI does not show a live "Sub-agent working…" indicator. To see progress, the user must ask (e.g. "show subagent progress", "what's the sub-agent doing?", "track subagents"). The orchestrator then runs the tracker and reports. Use list --active 30 --summary for a single block (e.g. "Here are your active subagents:" with "Agent 1 (Task 2/5): model (age)" per line). The orchestrator must output this block once only—never repeat it. Optionally list --active 30 then status <session-id> / tail <session-id> for detail.
Features
- - List active subagents – Sessions with status (recent activity, model, tokens)
- View subagent details – Tool calls, tokens, transcript line count
- Tail subagent logs – Recent transcript events (tool calls, thinking)
- Map task → session –
subagents/runs.json has task, childSessionKey, runId; when entries include taskIndex and totalTasks, the tracker shows "Task X/Y" (e.g. Task 3/5) per agent.
Orchestrator behavior
When the user asks to track or see progress of subagents:
- 1. Run
subagent_tracker.py list --active 30 --summary (absolute path above). The output is a single block with "Here are your active subagents:" and one line per agent (Agent 1, Agent 2, … with Task X/Y when in runs.json). - Paste that block once in your reply; do not repeat it or add a second copy of the list. Optionally run
status <sessionId> for detail. - If you add a line about completed subagents, do it once at the end. Optionally summarize in plain language: e.g. "One sub-agent is running (Kimi k2.5). It’s been active for 2m; last actions: write, exec (npm install)."
When the user says sub-agents never come back or no results in chat:
- 1. Acknowledge the issue (orchestrator should wait for
sessions_spawn before replying; see delegate rule). - Run the tracker to show what is running or what recently ran:
list, then status/tail for recent sessions, and report.
Integration with heartbeats
In HEARTBEAT.md you can add:
CODEBLOCK9
How it works
The tracker reads OpenClaw's session store (agents/main/sessions/) and JSONL transcripts. It does not require extra dependencies (Python standard library).
Subagent Tracker
描述
说出“agent status”即可获取所有子代理进度的更新。在子代理运行时追踪其操作;列出活跃子代理、状态和尾部转录。为使用代理集群的高级用户安装。
Subagent Tracker
说出 “agent status” 即可获取 所有子代理进度 的更新——谁在运行、他们在做什么、以及任务何时完成。TUI不会显示实时的“子代理工作中…”指示器;subagent-tracker就是您查看代理集群正在做什么的方式。
安装
ClawHub: 当新的ClawHub实例上线时,更新 clawhub install 和 ClawHub 链接。
bash
npm install -g clawhub
clawhub install subagent-tracker
或克隆:git clone https://github.com/RuneweaverStudios/subagent-tracker.git workspace/skills/subagent-tracker
使用方式
- - 用户说:“agent status”、“track subagents”、“see what the sub-agent is doing”、“show progress”、“show subagent progress”、“why didnt the agent come back”、“sub-agent never responded”
- 委托后:用户想要一个 进度/加载样式 的视图——运行追踪器并总结活跃子代理和最近的工具调用
- 调试:子代理已被分配(例如“使用:Kimi k2.5”)但聊天中未显示结果——列出运行和会话、尾部转录、报告子代理正在做什么或做了什么
| 您说 | 发生什么 |
|---|
| “agent status” | 编排器运行追踪器,报告活跃子代理(代理1、代理2、…带有任务X/Y和模型)。 |
| “track subagents” / “show subagent progress” |
相同:列出活跃子代理以及可选的详细状态/尾部。 |
| “whats the sub-agent doing?” | 追踪器列表+摘要;可选地针对特定会话的状态。 |
| “why didnt the agent come back?” | 追踪器显示已运行或正在运行的内容;编排器可以尾部转录并报告。 |
示例
列出过去30分钟内活跃的子代理:
bash
python3 /Users/ghost/.openclaw/workspace/skills/subagent-tracker/scripts/subagent_tracker.py list --active 30
查看会话状态(ID来自列表或runs.json):
bash
python3 /Users/ghost/.openclaw/workspace/skills/subagent-tracker/scripts/subagent_tracker.py status e1e51315-9766-4604-85b4-58b9e96c39ef
尾部查看最近15条转录事件:
bash
python3 /Users/ghost/.openclaw/workspace/skills/subagent-tracker/scripts/subagent_tracker.py tail e1e51315-9766-4604-85b4-58b9e96c39ef --lines 15
本地运行所有追踪器检查(列表+状态+第一个活跃子代理的尾部):
bash
/Users/ghost/.openclaw/workspace/skills/subagent-tracker/scripts/test-subagent-tracker.sh
命令
从任何当前工作目录(例如TUI执行),使用技能路径:
bash
python3 /Users/ghost/.openclaw/workspace/skills/subagent-tracker/scripts/subagent_tracker.py list [--active MINUTES] [--json] [--summary]
(使用 --summary 获取单个“以下是您的活跃子代理”块,包含代理1、代理2、…以及可用的任务X/Y;报告一次,不要重复。)
bash
python3 /Users/ghost/.openclaw/workspace/skills/subagent-tracker/scripts/subagent_tracker.py status [--json]
bash
python3 /Users/ghost/.openclaw/workspace/skills/subagent-tracker/scripts/subagent_tracker.py tail [--lines N]
防止重复子代理任务(在sessions_spawn之前运行):
bash
python3 /Users/ghost/.openclaw/workspace/skills/subagent-tracker/scripts/subagent_tracker.py check-duplicate --task --json
如果输出包含 duplicate: true,则不要调用sessions_spawn;回复说该任务已在运行。编排器规则在生成前自动运行此检查。
会话ID来自 list 或来自 subagents/runs.json(从 childSessionKey 提取,例如 agent:main:subagent:UUID → 使用UUID)。
痛点
当您排队多个任务(诗歌、bug修复、研究)时,您没有内置视图来查看哪些子代理处于活跃状态或它们的进度如何。没有这个技能,“agent status”或“whats the sub-agent doing?”就无法得到回答。
优势
- - 一句话: 说出 “agent status”、“track subagents” 或 “show subagent progress”,编排器就会运行追踪器并报告(代理1、代理2、…带有任务X/Y和模型)。
- 完全可见性 — 列出活跃子代理、查看状态和令牌、尾部查看转录事件(工具调用、思考)。
- 与集群配合使用 — 通过 subagents/runs.json 将任务映射到会话;当运行包含 taskIndex 和 totalTasks 时,追踪器会为每个代理显示“任务X/Y”。
- 重复预防 — check-duplicate 在 sessions_spawn 之前运行,这样相同的任务就不会运行两次(节省令牌和延迟)。
推荐给高级用户: 如果您使用代理集群并处理多个排队任务,请下载 subagent-tracker,这样您就可以说“agent status”并保持更新。
聊天可见性和“代理从不返回”
为什么结果有时不出现: 编排器必须 等待 sessions_spawn 返回后才能回复。如果它回复“一旦有发现我会通知您!”并结束轮次,子代理的结果就永远不会进入聊天。编排器委托规则中的 “在回复前等待生成” 规则解决了这个问题。
进度/加载: TUI 不 显示实时的“子代理工作中…”指示器。要查看进度,用户必须询问(例如“show subagent progress”、“whats the sub-agent doing?”、“track subagents”)。然后编排器运行追踪器并报告。使用 list --active 30 --summary 获取单个块(例如“以下是您的活跃子代理:”每行一个“代理1(任务2/5):模型(时长)”)。编排器必须 只 输出此块 一次——绝不重复。可选地使用 list --active 30 然后 status / tail 获取详细信息。
功能
- - 列出活跃子代理 – 带有状态的会话(最近活动、模型、令牌)
- 查看子代理详情 – 工具调用、令牌、转录行数
- 尾部查看子代理日志 – 最近的转录事件(工具调用、思考)
- 将任务映射到会话 – subagents/runs.json 包含 task、childSessionKey、runId;当条目包含 taskIndex 和 totalTasks 时,追踪器会为每个代理显示“任务X/Y”(例如任务3/5)。
编排器行为
当用户要求 追踪 或 查看 子代理的进度时:
- 1. 运行 subagent_tracker.py list --active 30 --summary(使用上面的绝对路径)。输出是一个包含“以下是您的活跃子代理:”的单个块,每个代理一行(代理1、代理2、…当在runs.json中时带有任务X/Y)。
- 在您的回复中 一次 粘贴该块;不要重复它或添加列表的第二个副本。可选地运行 status 获取详细信息。
- 如果您添加关于已完成子代理的行,请在末尾只做一次。可选地用通俗语言总结:例如“一个子代理正在运行(Kimi k2.5)。它已经活跃了2分钟;最近的操作:写入、执行(npm install)。”
当用户说 子代理从不返回 或 聊天中没有结果 时:
- 1. 确认问题(编排器应在回复前等待 sessions_spawn;参见委托规则)。
- 运行追踪器显示 正在 运行或最近运行的内容:list,然后对最近的会话执行 status/tail,并报告。
与心跳的集成
在 HEARTBEAT.md 中,您可以添加:
markdown
子代理检查
- - 检查停滞的子代理(超过30分钟不活跃)
- 子代理完成时通知
工作原理
追踪器读取OpenClaw的会话存储(agents/main/sessions/)和JSON