Official agent skill

Subagent Orchestration

by PostHog in PostHog/code

How and when to delegate work to subagents via the subagent tool (Explore, Plan, General).

OfficialMITAuto-check passedAgent Workflows

Install Subagent Orchestration

skills CLI
$ npx skills add PostHog/code --skill subagent-orchestration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PostHog/code subagent-orchestration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PostHog/code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/harness/src/extensions/subagent/skills/subagent-orchestration .claude/skills/subagent-orchestration && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
subagent-orchestration
GitHub stars
179
Token cost
~1.5k tokens
SKILL.md length
798 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

How and when to delegate work to subagents via the subagent tool (Explore, Plan, General).

  • A task involves codebase recon
  • SKILL.md covers When to delegate, Bundled agents, The context field — always… and Modes, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Implementation planning

What it does

Subagent Orchestration is an agent skill from PostHog/code, published by the product's own GitHub organization. How and when to delegate work to subagents via the subagent tool (Explore, Plan, General). Use when a task involves codebase recon, implementation planning, or actual code changes that would benefit from an isolated context window instead of doing it all inline.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Subagents and Context engineering. It works with Bash. The repository describes itself as: The era of self-driving development is here. The licence is MIT.

When your agent uses it

  • A task involves codebase recon
  • Implementation planning
  • Actual code changes that would benefit from an isolated context window instead of doing it all inline

Example prompts

  • “/subagent-orchestration”

What it can do on your machine

Read from SKILL.md and the folder at commit a4c32df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Subagent Orchestration loads about 1.5k tokens when it runs. Until then it costs about 72 tokens; SKILL.md has 798 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from PostHog/code at commit a4c32df, republished under its MIT licence (© PostHog). 798 words, ~1,456 tokens.

Download SKILL.mdSave it as .claude/skills/subagent-orchestration/SKILL.md (or your agent's skills folder).
name
subagent-orchestration
description
How and when to delegate work to subagents via the `subagent` tool (Explore, Plan, General). Use when a task involves codebase recon, implementation planning, or actual code changes that would benefit from an isolated context window instead of doing it all inline.

Subagent Orchestration

You (the parent session) can delegate scoped work to focused subagents, each running in its own isolated pi process with its own context window. Use this to keep your own context clean and to parallelize independent work.

When to delegate

Delegate when a piece of work is:

  • Self-contained: it doesn't need your full conversation history, just a task and some context you can state explicitly.
  • Isolable: it would otherwise burn a lot of your context window (e.g. broad codebase search, reading many files) for a result you can summarize down to a few paragraphs.
  • Parallelizable: several independent instances of it can run at once (e.g. exploring two unrelated areas of a large codebase in the same turn).

Do not delegate trivial one-line changes, or work that fundamentally needs your full conversation context to do correctly — that's what context (below) is for, but if almost everything is relevant, delegation adds overhead for no benefit.

Bundled agents

AgentUse forToolsModelNotes
ExploreFast, read-only recon: find files, entry points, data flowread, bash, grep, find, lsFast/cheap model, falls back to your current modelReports compressed findings, never edits
PlanTurn Explore's findings (or your own) into a concrete implementation planread, bash, grep, find, lsInherits your current modelNever edits
GeneralActual implementation: make the code changes an Explore/Plan investigation identified, or any task that needs real editsread, bash, edit, write, grep, find, lsInherits your current modelSame read-write capability as you have; makes real changes

Explore and Plan are read-only. General has the same read-write capability you do — reach for it when a change is mechanical/independent enough to delegate (especially several at once via parallel mode) rather than doing every edit yourself in sequence. For a small, one-off change, just make it directly instead of delegating.

Subagents cannot themselves call subagent — they are leaves, not orchestrators. Keep all delegation decisions in your own (parent) session.

For larger fan-out orchestration — many agents, loops over file lists, staged map/verify/synthesize flows — prefer the workflow tool (if available), which runs a JavaScript script coordinating these same read-only agents and returns one synthesized result. subagent is for one-off or small parallel delegations.

A project can add its own agents (including ones that write) as .pi/agents/<name>.md files — same frontmatter convention as the bundled agents above. See agentScope below.

The context field — always fill it in

A subagent gets only its task string, plus a small automatic digest of your last few conversation turns (as a fallback, not a substitute). It does not see the files you've already read, tool results you've already seen, or decisions you've already made unless you put them in context.

Always pass context with whatever the subagent actually needs:

  • File paths and line numbers you already found.
  • Decisions already made ("use approach B, not A, because...").
  • Constraints ("don't touch files under vendor/").

A subagent given a bare one-line task and no context will waste its own turns re-discovering things you already know.

Show full SKILL.md (301 more words)Show less

Modes

  • single — one agent, one task. Default choice.
  • parallel — tasks: [...], up to 8 tasks / 4 concurrent. Use for independent work that can run at once, e.g. Exploreing two unrelated parts of a codebase together.

There is no chain mode. For a fixed pipeline (e.g. explore then plan), just call subagent twice in sequence yourself and pass the first call's output back in as the second call's context — you are already the orchestrator holding both results.

clarify -> Explore -> Plan -> implement it yourself -> confirm before any risky follow-up

This is guidance, not a rigid workflow — decide per task whether you need both steps. For a small, well-understood change, skip straight to implementing it yourself.

Returning outcomes to the user

A subagent is a means to answer the user's request, not a background task whose result can be silently acknowledged. After a subagent finishes, read its result and give the user the relevant substantive outcome in the parent response.

  • For an open-ended request such as "explore the repo", the findings are the answer: summarize the architecture, notable files, and any recommended next steps without waiting for the user to ask "what did it return?"
  • For implementation, investigation, or review tasks, state what changed or was found, name relevant file paths, and include limitations, failures, or follow-ups that matter.
  • Keep the relay proportional. Do not paste a huge transcript when a concise summary answers the request, but do not replace findings with empty praise such as "that helped" or "I can drill in further."
  • If the result is incomplete, failed, or ambiguous, say so plainly and explain the next action rather than presenting it as success.

The tool result remains available in the conversation for detailed follow-up, but the parent agent owns communicating its useful conclusion to the user.

Observability

Every run writes status.json, events.jsonl, and a full transcript.md to ~/.pi/agent/subagent-runs/<runId>/ for later inspection.

© PostHog, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in packages/harness/src/extensions/subagent/skills/subagent-orchestration of PostHog/code.

Open the folder on GitHubat commit a4c32df

Compare with similar skills

Subagent Orchestration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Subagent Orchestration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Subagent Orchestration this skillPostHog/code179—~1.5kAutomated safety check: PassMIT
Kimi Code DelegationCherryHQ/cherry-studio52k1 repos~504Automated safety check: PassAGPL-3.0
Teamethanhq/cc-fleet2151 repos~3.4kAutomated safety check: PassApache-2.0
Claude Statusbarleeguooooo/claude-code-usage-bar377—~2.5kAutomated safety check: PassMIT
Badstephenleo/bmad-autonomous-development107—~7.7kAutomated safety check: PassMIT
Analyze Trajectoryyologdev/yoyo-evolve1.9k—~3.6kAutomated safety check: PassMIT

Similar skills

  • Kimi Code Delegation

    CherryHQ/cherry-studio

    Delegates one bounded repository task to Kimi Code in non-interactive prompt mode and reads back the final result from its JSON event stream.

    52k GitHub starsUsed in 1 repo~504 tokens
    Agent WorkflowsAuto-check passed
  • Team

    ethanhq/cc-fleet

    Spawn long-lived provider LLM teammates in tmux panes that you message via the native agent-team tools — multi-turn, collaborative, watchable.

    215 GitHub starsUsed in 1 repo~3.4k tokens
    Agent WorkflowsAuto-check passed
  • Claude Statusbar

    leeguooooo/claude-code-usage-bar

    Manage cs (claude-statusbar) — switch theme/style/density, override severity colors, preview combinations, run doctor, reset config, install, upgrade (cs upgrade — the only supported upgrade path)…

    377 GitHub stars~2.5k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Bad

    stephenleo/bmad-autonomous-development

    BMad Autonomous Development — orchestrates parallel story implementation pipelines.

    107 GitHub stars~7.7k tokensUpdated 5 mo ago
    Agent WorkflowsAuto-check passed
  • Analyze Trajectory

    yologdev/yoyo-evolve

    Diagnoses a recurring failure such as a stuck task, repeated CI error or frequent reverts by sending sub-agents through the logs and returning one root-cause diagnosis.

    1.9k GitHub stars~3.6k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Code Context Slicing

    trailofbits/skills

    Official

    Picks a small, graph-based slice of source with Trailmark and hands a focused code task to a smaller or local model without exposing the whole repository.

    7.4k GitHub stars~2.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from PostHog/code

All 10 skills in this repo
  • Canvas Templates

    PostHog/code

    Official

    How PostHog "canvas" dashboards work end-to-end — the two rendering tiers (json-render vs freeform React-in-iframe), the agent system prompts that steer each, and the RIGHT way to fetch PostHog data…

    179 GitHub stars~2.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Dynamic Workflows

    PostHog/code

    Official

    How to write JavaScript workflow scripts for the workflow tool - fanning work out across many isolated subagents with agent(), parallel(), and pipeline(), then synthesizing one result.

    179 GitHub stars~2.3k tokensUpdated 2 mo ago
    Auto-check passed
  • MCP Servers

    PostHog/code

    Official

    Install, configure, authenticate, and troubleshoot MCP (Model Context Protocol) servers for this agent.

    179 GitHub stars~1.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Merging PRs

    PostHog/code

    Official

    Merge a PR into main through the Trunk merge queue and babysit it until it lands.

    179 GitHub stars~1.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Onboarding Videos

    PostHog/code

    Official

    Add, replace, and optimize the looping demo videos in the onboarding "welcome" bento grid (packages/ui/src/features/onboarding).

    179 GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • Quill Code

    PostHog/code

    Official

    Edit the @posthog/quill design system locally and consume the change in this repo (posthog-code) before it is published to npm.

    179 GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Subagent Orchestration

What does Subagent Orchestration do?

How and when to delegate work to subagents via the subagent tool (Explore, Plan, General). Subagent Orchestration is an agent skill from PostHog/code, published by the product's own GitHub organization. How and when to delegate work to subagents via the subagent tool (Explore, Plan, General).

When should I use Subagent Orchestration?

Subagent Orchestration fits situations like: A task involves codebase recon; implementation planning; actual code changes that would benefit from an isolated context window instead of doing it all inline.

How do I install Subagent Orchestration in Claude Code?

Run `npx skills add PostHog/code --skill subagent-orchestration -a claude-code`. Or copy the skill folder (packages/harness/src/extensions/subagent/skills/subagent-orchestration in PostHog/code) into .claude/skills/subagent-orchestration in your project. Claude Code loads it when a task matches its description.

How do I install Subagent Orchestration in Codex?

Run `npx skills add PostHog/code --skill subagent-orchestration -a codex`. Or copy the skill folder (packages/harness/src/extensions/subagent/skills/subagent-orchestration in PostHog/code) into .agents/skills/subagent-orchestration in your project. Codex loads it when a task matches its description.

Can I use Subagent Orchestration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PostHog/code --skill subagent-orchestration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/subagent-orchestration, .gemini/skills/subagent-orchestration, .github/skills/subagent-orchestration and .opencode/skills/subagent-orchestration in your project.

What does Subagent Orchestration need to run?

SKILL.md names no scripts, command-line tools or credentials: Subagent Orchestration is instructions for the agent only.

Does Subagent Orchestration access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Subagent Orchestration safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Subagent Orchestration use?

Subagent Orchestration is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Subagent Orchestration use?

About 1.5k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Subagent Orchestration?

Skills that share tags, products or a category with Subagent Orchestration: Kimi Code Delegation (CherryHQ/cherry-studio, 52k stars), Team (ethanhq/cc-fleet, 215 stars), Claude Statusbar (leeguooooo/claude-code-usage-bar, 377 stars) and Bad (stephenleo/bmad-autonomous-development, 107 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Subagent Orchestration?

PostHog (a GitHub organization, an official publisher) maintains it in PostHog/code, which has 179 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on August 5, 2026.

Source: PostHog/code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.