pb-nested-orchestrator

pb-nested-orchestrator is a skill for Claude Code, Codex from agentproto/ts. It costs 64 tokens per session (1,072 once invoked), scanned A, original, Apache-2.0.

A procedure for creating a two-level agent team in which one parent agent starts and supervises its own child agents. The parent acts as an orchestrator, coordinating work below it.

In plain words
What is it for?
It is for starting an orchestrating parent, letting it create sub-agents, inspecting the resulting tree, and shutting down the complete group.
Why use it?
It allows complex work to be divided into a hierarchy while keeping the whole agent tree visible and removable from the top level.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/agentproto/ts/pb-nested-orchestrator
Any agent
npx skills add agentproto/ts --skill pb-nested-orchestrator
Clone the repo
git clone --depth 1 https://github.com/agentproto/ts

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 pb-nested-orchestrator

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentproto/ts/pb-nested-orchestrator.svg)](https://agentmods.dev/skills/agentproto/ts/pb-nested-orchestrator)
Your own site
<a href="https://agentmods.dev/skills/agentproto/ts/pb-nested-orchestrator"><img src="https://agentmods.dev/badge/skills/agentproto/ts/pb-nested-orchestrator.svg" alt="Measured on agentmods" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,072 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00064 $0.01072
Opus 5 $0.00032 $0.00536
Sonnet 5 $0.00013 $0.00214
Haiku 4.5 $0.00006 $0.00107

Measured today against content hash 3c54833dc951, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pb-nested-orchestrator 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 today.

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.

packages/skill-pack-agentproto/src/skills/pb-nested-orchestrator/SKILL.md · 109 lines

How it starts

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

pb-nested-orchestrator — an agent that spawns its own sub-agents

Goal

Build a two-level tree: you spawn ONE parent; the parent spawns and supervises its own children through a scoped orchestration gateway; you inspect the whole tree from the root and tear it all down at the end.

Golden rule

The nesting PARENT must be adapter claude-code or claude-sdk. A hermes parent ignores the injected orchestration gateway (proven) and simply cannot spawn. Children can be any adapter.

Prerequisites (reference by name): ap-spawn-agent, ap-wait-fanin, ap-lifecycle, and the drive-agents group. Single-level supervision is pb-supervise-parallel-mission.

Steps

1. Spawn the parent as an orchestrator

agent_start({
  adapter: 'claude-code',
  cwd: '<ABSOLUTE host path>',
  label: 'orch-parent',
  orchestrator: true,
  prompt: '<parent brief - see step 3>'
})

orchestrator: true mounts a scoped sub-gateway in the parent: a curated tool subset — start/prompt/wait/poll/output + session_tree + subtree kill — with a per-child scope token that is revoked when the parent exits.

2. Prove the mount

The agent_start response carries an mcpServers entry whose ref ends in /mcp/orchestrator?scope=.... That entry is the proof the gateway is mounted. No entry, no nesting: re-spawn with orchestrator: true before briefing further — a hermes parent fails silently here, not loudly.

3. Brief the parent to use its tools

The parent brief MUST:

  • NAME the orchestration tools it should use (its mounted gateway's start/prompt/wait/poll/output plus session_tree and subtree kill).
  • FORBID shell poll loops, verbatim: "Never wait with a shell/terminal sleep-poll loop. Use session_monitor. A killed poll loop corrupts the session permanently."
  • Give children authentic, bounded tasks (see gotchas) with disjoint ownership and absolute cwds — the same brief discipline as pb-supervise-parallel-mission, one level down.

4. Watch the tree grow from the root

Read the full file on GitHub · 109 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. today First seen · 109 lines · 64 tokens per session scan A 3c54833dc951

Subscribe to this mod's changes

pb-nested-orchestrator is a skill published in the GitHub repository agentproto/ts (5 stars, last pushed yesterday), licensed Apache-2.0. It adds 64 tokens to every session and 1,072 once invoked, about $0.0003 per session on Opus 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-04.

Related

Other skills, from other repositories

github-triage

Triage GitHub issues through a label-based state machine with interactive grilling sessions. Use when user wants to triage issues, review incoming bugs or feature requests, prepare issues for an AFK agent, or manage issue workflow.

sammcj/agentic-coding · 50 tokens

backlog

Capture single backlog items, or list and triage an existing project backlog. Use this skill whenever the user wants to file a bug, feature request, or backlog item without writing a full PRD, including casual requests mid-conversation like "create an issue for that", "add this to the backlog", or "file a quick bug…

sammcj/agentic-coding · 182 tokens

reframe-voice

Write, rewrite, or review content in the evidence-led reframe voice style. Use when the user explicitly asks to write in "reframe voice" or "reframe style". Do NOT use for general writing tasks.

sammcj/agentic-coding · 49 tokens

to-tickets

Break a plan, spec, or the current conversation into independently-grabbable tickets on the project issue tracker using tracer-bullet vertical slices, each declaring the tickets that block it. Use when user wants to convert a plan or spec into tickets, create implementation tickets, or break down work into issues.

sammcj/agentic-coding · 64 tokens

to-spec

Turn the current conversation context into a spec and submit it as a GitHub issue. Use when user wants to create a spec or PRD from the current context.

sammcj/agentic-coding · 36 tokens

goal-flight

Portable Goal Flight workflow for long-running repo work: planning, dispatch, review, recovery, file-backed resume.

simonrowland/goal-flight · 25 tokens