Repository navigation
Band Roles and Agents
During orchestrated runs, five role agents handle specific phases. Each is defined in .claude/agents/ with a fixed tool mask, success condition, and scope constraint.
| Agent | Role | Band | Tool Kind | Shell | Can Write |
|---|---|---|---|---|---|
spec.md |
spec | define | RW | No (Guard 7) | Spec files only |
plan.md |
plan | define | RW | No (Guard 7) | Plan files only |
code.md |
code | build | RW | Test command only | Task scope from envelope |
audit.md |
audit | verify | R | No (Guard 7) | Nothing |
qa.md |
qa | verify | X | Test command only | Nothing (Guard 5) |
A sixth agent, define-review.md, is a non-band advisory reviewer for the review loop.
Each agent's frontmatter declares:
-
tools:— The role's tool mask (what tools it can call) - Success condition — What constitutes a completed task
- Stop-on-denial — If a guard denies, the agent stops
- One hand-back — Claims only the role's own gate
-
No dispatch — Agents cannot dispatch other agents (Guard 6:
ORCH_NESTED_DISPATCH) - Scope copy — Verbatim scope from the SNAP envelope
All prompts fit in 999 tokens or fewer.
When a role completes, it returns exactly one SNAP_HANDBACK line. The orchestrator validates this before the next dispatch. A wall of prose never reaches the orchestrator's context.
Every role is a separate container dispatched by the orchestrator. The hook (Guards 5–7) sits between each role and the repository, so a role can only do what its band envelope allows.
flowchart TB
orch["<b>Orchestrator</b><br/><i>[Claude Code session running /cc-orchestrate]</i><br/>Only caller allowed to dispatch — Guard 6"]
subgraph defineb["Define band"]
spec["<b>spec</b><br/><i>[Agent · RW]</i><br/>No shell · writes spec files only"]
plan["<b>plan</b><br/><i>[Agent · RW]</i><br/>No shell · writes plan files only"]
rev["<b>define-review</b><br/><i>[Agent · R, advisory]</i><br/>Checklist review, no writes"]
end
subgraph buildb["Build band"]
code["<b>code</b><br/><i>[Agent · RW]</i><br/>Test command only · task scope"]
end
subgraph verifyb["Verify band"]
audit["<b>audit</b><br/><i>[Agent · R]</i><br/>No shell · no writes"]
qa["<b>qa</b><br/><i>[Agent · X]</i><br/>Test command only · no writes"]
end
hook["<b>pre-tool-use.mjs</b><br/><i>[Hook · Node.js]</i><br/>G5 write scope · G6 no nested dispatch · G7 shell"]
env[("<b>band-envelope.json</b><br/>role, tool kind, scope globs")]
repo[("<b>Repository</b>")]
orch <-- "Dispatch with SNAP envelope ⇄<br/>one-line SNAP_HANDBACK" --> defineb & buildb & verifyb
defineb & buildb & verifyb -- "Every write<br/>and shell call" --> hook
hook -- "Reads" --> env
hook -- "Allowed calls only" --> repo
classDef system fill:#1168bd,stroke:#0b4884,color:#fff
classDef container fill:#438dd5,stroke:#2e6295,color:#fff
classDef component fill:#85bbf0,stroke:#5d82a8,color:#000
class orch system
class spec,plan,rev,code,audit,qa container
class hook,env,repo component
style defineb fill:none,stroke:#1168bd,stroke-dasharray:5 5
style buildb fill:none,stroke:#1168bd,stroke-dasharray:5 5
style verifyb fill:none,stroke:#1168bd,stroke-dasharray:5 5
Before each define approval:
-
define-reviewagent checks the spec/plan against a declared checklist - Open rows go back to the generating role via
SendMessage - Up to 3 reviewer passes, 2 revisions
-
ORCH_REVIEW_CAPrefuses a fourth round (no halt) - Advisory only — your approval is always required
- Orchestrator builds a SNAP v3 envelope with the role's scope
- Validates:
snap-validate --to <role> - Installs envelope at
.claude/memory/band-envelope.json - Dispatches via
Agenttool withagent_typematching the role name - Waits for completion
- Validates the
SNAP_HANDBACKresponse - Proceeds to next role or phase
Getting Started
Core Concepts
Usage
Community