knowledge-agent-execution-and-orchestration-subagent-runtime

knowledge-agent-execution-and-orchestration-subagent-runtime is a skill for Claude Code, Codex from echoVic/blade-code. It costs 117 tokens per session (2,367 once invoked), scanned A, original, MIT.

A runtime for defining, running, pausing, resuming, and verifying child coding agents working on separate tasks.

In plain words
What is it for?
Use it when adding agent definitions, managing foreground or background tasks, restoring interrupted runs, verifying results, or handling isolated worktrees.
Why use it?
It keeps delegated work recoverable and isolated, including when a process stops or the parent agent is missing a result.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Good fit Use it when adding agent definitions, managing foreground or background tasks, restoring interrupted runs, verifying results, or handling isolated worktrees.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/echovic/blade-code/subagent-runtime
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add echoVic/blade-code --skill subagent-runtime
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for knowledge-agent-execution-and-orchestration-subagent-runtime

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/blade-code/subagent-runtime/github.svg)](https://agentmods.dev/skills/echovic/blade-code/subagent-runtime)
Your own site
<a href="https://agentmods.dev/skills/echovic/blade-code/subagent-runtime"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/subagent-runtime/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for knowledge-agent-execution-and-orchestration-subagent-runtime

Your own site · 80×15
<a href="https://agentmods.dev/skills/echovic/blade-code/subagent-runtime"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/subagent-runtime.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 117 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,367 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00117 $0.02367
Opus 5.5 $0.00047 $0.00947
Sonnet 5.5 $0.00023 $0.00473
Haiku 4.5 $0.00012 $0.00237

Measured 1mo ago against content hash 40f55a36e2d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

knowledge-agent-execution-and-orchestration-subagent-runtime scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.trae/knowledges/agent-execution-and-orchestration/subagent-runtime/SKILL.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Module Structure

子代理是拥有独立 SessionRuntime、transcript 和 sidecar 的 child run;Task 工具负责身份与调用契约,执行器负责运行,后台管理器负责持久状态、通知和崩溃恢复。

Directory Layout

  • packages/cli/src/agent/subagents/ — 注册表、执行器、sidecar、恢复、结果采纳和内置代理
    • SubagentRegistry.ts — Markdown/frontmatter 配置加载和优先级
    • SubagentExecutor.ts — 独立 child SessionRuntime 执行
    • BackgroundAgentManager.ts — 后台运行、等待、取消、resume 和 orphan reconciliation
    • AgentSessionStore.ts — durable sidecar 与 lineage/config snapshot
    • SubagentWorktreeLifecycle.ts — 隔离 worktree 准备与收尾
    • SubagentResultAdoption.ts — 父 Task 缺失结果时的重启采纳
    • BackgroundSubagentCompletion.ts — 后台终态通知构造
  • packages/cli/src/tools/builtin/task/task.ts — Task 工具前台、后台和 resume 协议
  • packages/cli/src/cli/agents.ts — --agents 单次运行定义严格解析
  • packages/cli/src/slash-commands/agents.ts — TUI agent 管理入口
  • .claude/agents/ — Git 可见的 Claude Code 兼容 agent 定义
  • docs/guides/subagents.md — 用户可见配置与恢复契约

Key Entry Points

  • createTaskTool() in packages/cli/src/tools/builtin/task/task.ts — 模型侧委派入口
  • SubagentRegistry.loadFromStandardLocations() in packages/cli/src/agent/subagents/SubagentRegistry.ts — 分层资源发现
  • SubagentExecutor.execute() in packages/cli/src/agent/subagents/SubagentExecutor.ts — 直接前台执行器
  • BackgroundAgentManager.startBackgroundAgent() in packages/cli/src/agent/subagents/BackgroundAgentManager.ts — durable 后台 child 启动
  • BackgroundAgentManager.resumeAgent() in packages/cli/src/agent/subagents/BackgroundAgentManager.ts — immutable child resume

Gotchas

  • resume_from 不会复用原 agent ID,而会创建新的 child run;源运行必须已终止、类型必须一致,并记录 rootAgentId → resumedFrom → resumeDepth,否则恢复被拒绝 (packages/cli/src/tools/builtin/task/task.ts, packages/cli/src/agent/subagents/BackgroundAgentManager.ts)
  • resume 使用源 sidecar 中冻结的模型、权限、工具、系统提示、最大回合和隔离配置,不重新读取同名 agent 的最新定义;修改配置不会改变既有 lineage (packages/cli/src/agent/subagents/AgentSessionStore.ts, packages/cli/src/agent/subagents/BackgroundAgentManager.ts, git:888d608f)
  • 子代理访问权按 parent sessionId + canonical projectPath 复合校验;只有相同 session ID 不足以跨 workspace 查询、取消、采纳或恢复 child (packages/cli/src/agent/subagents/AgentSessionStore.ts, packages/cli/src/tools/builtin/task/task.ts)
  • 子 Agent 的 blacklist 总会加入 EnterWorktree、ExitWorktree 和 TeamCreate;隔离 worktree 由宿主生命周期创建,teammate 也不能嵌套创建团队 (packages/cli/src/agent/subagents/SubagentExecutor.ts, packages/cli/src/agent/subagents/BackgroundAgentManager.ts)
  • 隔离运行只有“成功且无改动、无提交”才自动删除 worktree;失败或任何变更都会保留路径与分支,调用方必须按交付语义处理 (packages/cli/src/agent/subagents/SubagentWorktreeLifecycle.ts)
  • 后台完成通知只内联最多 32,000 字符结果和 8,000 字符错误,并明确标为不可信数据;需要完整 durable 结果时才调用 TaskOutput,不能通过高频轮询代替 completion push (packages/cli/src/agent/subagents/BackgroundSubagentCompletion.ts, packages/cli/src/tools/builtin/task/task.ts)
  • orphan child 只有在 durable turn 已 turn_completed 且恢复上下文中存在最终 assistant 文本时才恢复为 completed;其他情况记为 interrupted failed 并允许用新 ID resume (packages/cli/src/agent/subagents/BackgroundAgentManager.ts)
  • running sidecar 同时保存 PID 和进程启动身份,防止 PID 复用被误判为原 owner 仍存活;旧记录缺身份时采用更保守的兼容窗口 (packages/cli/src/agent/subagents/AgentSessionStore.ts, packages/cli/src/agent/subagents/BackgroundAgentManager.ts)
  • 父 transcript 中缺失前台 Task 结果时,只有 child ID、owner、description、显式 type、resume lineage 和终态结果全部匹配才会采纳;后台 child 或 cancelled child 不走该路径 (packages/cli/src/agent/subagents/SubagentResultAdoption.ts, git:103e57b7)
  • verification 与 goal-verification 是保留名称,用户、项目和命令行 override 都不能覆盖;普通内置 agent 则允许被后续高优先级来源替换 (packages/cli/src/agent/subagents/SubagentRegistry.ts)

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 71 lines · 117 tokens per session scan A 40f55a36e2d1

Subscribe to this mod's changes

knowledge-agent-execution-and-orchestration-subagent-runtime is a skill published in the GitHub repository echoVic/blade-code (181 stars, last pushed 3d ago), licensed MIT. It adds 117 tokens to every session and 2,367 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.