From core
Use at the start of any milestone build, large review, or migration that will spawn subagents — the tiered orchestrator-worker model: the strong model orchestrates and does the judgment work, tiered Haiku/Sonnet workers do the legwork, workers consult main, critics consult no one, and deterministic gates (tests, linters, type-checkers, schema/contract validators) outrank every LLM judge. Trigger from any task you'll parallelize across subagents. The full model behind the cost-aware-delegation skill. Validated against Anthropic's published multi-agent guidance (see Grounding).
How this skill is triggered — by the user, by Claude, or both
Slash command
/core:orchestrationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The main loop is the orchestrator. Spawn cheaper-tier subagents (Haiku/Sonnet) for
The main loop is the orchestrator. Spawn cheaper-tier subagents (Haiku/Sonnet) for
the legwork; keep the judgment on the main loop. This is the full model behind the
cost-aware-delegation skill — read that first for the routing table; this skill
adds the fan-out, verification, and parallelism discipline around it.
Pick the model by the reasoning the task actually needs — decide it before spawning, per subagent. Three tiers:
core's own shipped agents sit on this table: search, doc-sync, and
config-auditor are pinned model: sonnet (locator and audit legwork);
code-reviewer is model: inherit (correctness judgment — it rides the
session's strongest model). A project's own agents slot in the same way: pin the
mechanical / high-read ones to the floor, leave the judgment ones on inherit.
Quality is paramount — the cost rule and the quality rule resolve via stakes. "Don't waste tokens on mechanical work" applies only when the task is genuinely low-reasoning/high-read AND a wrong answer is cheap. When correctness or output quality is at stake, tier up, not down — in doubt on a quality-critical task, go up. A too-cheap model that rubber-stamps a verification or botches a coupled edit is a false economy. Never cost-cut the judgment, verification, or gate paths.
Write specs so subagents translate, not design: exact types + pseudocode + hand-computed expected test values as the correctness anchor.
The Workflow tool's agent() calls inherit the session's strong model unless you
set opts.model per stage. A fan-out that lets mechanical stages inherit it
burns the budget in minutes (a real un-tiered deep-research run spent ~1.95M tokens
across 108 agents and produced no report). Rules:
opts.model on EVERY stage — search/fetch/extract → haiku;
verify/moderate analysis → sonnet; synthesis / final judgment → the strong model.budget.remaining(); stop fanning out before the cap.log() what you dropped.SubagentStop does not fire for Workflow-internal agents, and even for
Agent-tool subagents the payload carries no result text. Checkpoint per landed
unit, not all at the end; synthesize even if partial. The orchestrator does
the Write — worker file-Writes are best-effort (a real 18-agent fleet: 6 wrote
to their CWD, 12 wrote nowhere; the payloads survived only in the run journal).
Carry results in structured returns and treat the run journal as the recovery
record (journal.jsonl in the workflow run's transcript dir —
subagents/workflows/wf_*/ under the session's project dir).A long orchestration session accretes context that is re-sent on every API call. The cost that bites is not dollars — re-sent history is cache-read, the cheap tier — but context rot (reasoning degrades as the window fills; see Grounding), window pressure (nearing the limit forces a compaction), and latency (a bigger window is a slower call). Spend the right context per prompt; don't let it grow unbounded because it "still fits."
When the window fills, Claude Code auto-compacts: it replaces history with a
generated summary, on its own schedule, lossily. Don't let that be your
context-management strategy. The discipline is to checkpoint durable state to files,
/clear, and resume from those files at a boundary you choose (a gate or milestone
close) — so the resume reads from your curated substrate, not an auto-summary you never
reviewed. This is the session-level twin of checkpoint before loss above: that rule
saves a worker's output; this one saves the orchestrator's own working context.
Three delivery tiers, by session mode:
/clear. It needs a
status-line → file → hook bridge: no hook event receives context-window usage on
its stdin, so the status line (the only surface that sees usage) must persist it to a
state file for a hook to read and act on. Opt-in per-repo machinery, not a core
primitive.PreCompact commits durable state before the summary lands (it can't steer the summary
or run /clear — verified), and a SessionStart(compact|clear) hook re-injects that
saved resume file into the fresh window afterward. Together they make an unplanned
autocompact — or a deliberate /clear — resume from your curated substrate, not just
the auto-summary. Bridge-free (needs no context-window data), unlike the proactive
nudge.claude -p session so context never accretes across phases; cap per-phase
compaction with CLAUDE_AUTOCOMPACT_PCT_OVERRIDE.Keep the principle here; bind the machinery in a project. The concrete thresholds,
the state-file path, the resume-file layout, the nudge hook, and the runner are a repo's
opt-in .context/ substrate (e.g. the scaffold plugin's milestone substrate) — core
can't ship them because they need a project's own statusLine and settings.json. Same
split as Extending this skill: principle and guards here, concrete bindings in the
companion/substrate.
The main loop may call advisor (on Fable sessions: the advisor-plus
agent — the built-in tool is unsupported there; cost-aware-delegation › Verify
with the advisor). Subagents fall into two classes, and neither calls advisor:
SendMessage
main — never advisor. Each consult must carry enough context (the decision,
options, what was tried), since main doesn't see their transcript. Scope:
implementation direction; main centralizes design.advisor is not gated by tools: frontmatter. A critic
that needs to consult is a prompt-construction bug — pack the critic's prompt
completely instead.Verification is never orchestrator-as-sole-judge. Use independent reviewer agents
with fresh context. The strongest check is a deterministic gate — your repo's
test suite, a determinism/reproducibility check (same input → byte-equal output),
linters run in strict mode, formatters run as a check, type-checkers, and any
schema/contract/catalog validator. Gates outrank every LLM judge; an auditor that
independently re-derives a golden from raw inputs substantiates "hand-computed".
Main backstops its own design with the advisor (advisor-plus on Fable).
.claude/) diffs; the heaviest per-call agent gets the tightest gate. Critics
run once per PR on the full branch diff — after all the PR's tasks, before
the PR opens — never per commit and never as an iterative re-review loop:
fragmentary diffs produce fragmentary findings, and loops burn tokens
re-adjudicating settled points.dispatching-parallel-agents' "don't parallelize agents that would edit the
same files" — coupled writers corrupt the design even when they never touch the
same file.isolation: worktree). Caveat: a worktree branches from the default
branch, not the parent's HEAD — workers see neither your uncommitted work nor
each other's. Commit first; single-thread coupled writes.superpowers:dispatching-parallel-agentsHow to write the dispatch — pack the full context because the agent starts blind
and never inherits your history, give it scope + goal + constraints + expected output
format, then review and integrate what comes back — is
superpowers:dispatching-parallel-agents. It says it well; this skill does not
restate it.
What that skill has no notion of, and this one exists for: model tiering
(opts.model per stage, the Haiku/Sonnet/strong table above), the budget guard,
checkpointing before loss, worktree branch-point semantics, and the
workers-vs-critics consult rule. Read both: that one for the prompt, this one for
which model runs it and what it costs.
One Claude-Code specific it doesn't carry: "starts blind" is not absolute — a custom subagent still loads CLAUDE.md + memory; it is your task-specific constraints that must be restated. The sole parent→child channel remains the prompt string, and only the child's final message returns (see Grounding).
git branch --show-current before merging or cherry-picking.isolation: worktree helps only when
the reader targets default-branch state (a worktree branches from the default
branch, not your HEAD — see above).git log for commits newer than the phase that produced the claim, and
reconcile each phase against the HEAD it ran at.gh flow (push/PR/CI-watch/merge-on-green) to a Sonnet
subagent; keep the merge decision on the main loop (see git-workflow).Portable, project-neutral discipline. To specialize it for a repo, add a companion — never
copy this into a project orchestration skill. Plugin skills are namespaced
(core:orchestration) and can't be shadowed by a project skill: a same-named copy coexists
ambiguously and drifts behind core (there is no skill inheritance).
orchestration-<yourrepo> (a distinct name) fills this skill's generic slots
with the repo's concrete bindings — the deterministic-gate roster (that repo's tests /
linters / validators), the agent→tier map (which of its agents run Haiku / Sonnet /
strong), and task→model tier examples. Name it in the repo's CLAUDE.md so it co-fires
with this skill.opts.model, the fan-out cap, and "judgment / verification /
gates stay on the strong model" are budget-critical — keep them here and mirror the caps into
CLAUDE.md. A companion carries only lose-able reference; if it fails to co-fire you lose
examples, never a guard.model frontmatter).
(code.claude.com/docs/en/sub-agents)journal.jsonl
(recorded in the maintainer's audit memory; journal path/schema re-verified on
disk 2026-07-16).opts.model per
stage, the budget object, isolation: 'worktree'. (Claude Code Workflow tool
interface.)PreCompact stdin carries only
trigger + custom_instructions and cannot steer the compaction summary; the
documented re-inject-after-compaction channel is a SessionStart(compact) hook.
(code.claude.com/docs/en/hooks)Re-validate with a claude-code-guide lookup if the docs evolve.
npx claudepluginhub mrinaldhillon/claude-skills --plugin coreCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.