Skip to content

Hybrid architecture: Agent Teams + subagents in Claude Code

The system has two layers:

  1. Agent Team — Lead + 3 teammates that debate to build the artifact
  2. Subagents — 3 agents the Lead launches for scoped tasks (research, validate, publish)

The separation is not cosmetic — it defines available tools, assigned models and communication structure.

┌─────────────────────────────────────────────────────────────────┐
│ AGENT TEAM │
│ │
│ ┌─────────────────────────────────┐ │
│ │ LEAD │ │
│ │ Model: Sonnet │ │
│ └─────────────────────────────────┘ │
│ │ │ │ │
│ PHASE 1 PHASE 2 PHASE 3 │
│ (subagent) (teammates) (subagents) │
│ │ │ │ │
│ v v v │
│ │
│ ┌──────────────┐ │ ┌──────────────┐ ┌────────────┐ │
│ │ Investigator │ │ │ Validator │ │ Publisher │ │
│ └──────────────┘ │ └──────────────┘ └────────────┘ │
│ Subagent │ Subagents — run inside the Lead │
│ No own session │ │
│ v │
│ ┌─────────────────────────────┐ │
│ │ Shared Task List │ │
│ └──────┬──────────┬───────────┘ │
│ │ │ │ │
│ v v v │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │Architect │◇│ Reviewer │◇│Optimizer │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ Teammates — Model: Opus (always) │
│ Own session. Communicate via Mailbox │
│ │
└─────────────────────────────────────────────────────────────────┘
1. Lead receives user request
2. Lead detects blocking ambiguities → asks before starting
3. Lead launches Investigator (subagent, WITHOUT team_name) → receives research

The Lead doesn’t start work without the research. If the Investigator didn’t find a primary source for a command, it reports it — the Architect doesn’t invent commands without a source.

4. Lead creates task list with dependencies
5. Lead spawns Architect + Reviewer + Optimizer (WITH team_name)
→ includes Investigator research in spawn prompt
6. Architect writes SKILL.md using the researched information
7. Reviewer challenges → direct debate with Architect (max 2 rounds)
8. Optimizer compresses → removes what Claude already knows (< 500 lines)
9. Lead launches Validator (subagent, WITHOUT team_name) → PASS or FAIL
10. If PASS: Lead launches Publisher (subagent, WITHOUT team_name) → verifies in portal

The Publisher doesn’t run if the Validator failed.

This is the critical behavior that defines the architecture:

Teammates do NOT have access to the Task Tool. Only the Lead can launch subagents.

If a teammate tries to launch a subagent, it either fails silently or the system converts it into an additional teammate (with team_name), which changes the model from Sonnet to Opus and breaks the design.

The rule:

  • Investigator, Validator, Publisher → launched by Lead WITHOUT team_name = subagents on Sonnet
  • Architect, Reviewer, Optimizer → launched by Lead WITH team_name = teammates on Opus

Agent Teams assigns Opus to teammates automatically, regardless of what you configure.

MechanismWorks
model: haiku in CLAUDE.mdNo — ignored
”Use Sonnet model” in spawn promptNo — it’s text, not a system parameter
Global model for all teammatesYes — but no per-role differentiation
Lead session modelYes — subagents inherit from Lead

Real data from 37 analyzed calls:

ComponentRequestedActual
LeadHaikuSonnet (inherits from user)
All teammatesHaiku / Sonnet per roleOpus always
Subagents (without team_name)HaikuSonnet (inherits from Lead)
Haiku usedNever, in any demo

Each role has an explicit exit condition to prevent loops:

RoleExit condition
LeadSkill published and verified in portal
InvestigatorSearched max 2 primary sources
ArchitectSKILL.md written and Reviewer approved
ReviewerMax 2 rounds of objections
OptimizerBody < 500 lines AND removed at least 1 block
ValidatorRan validate.sh and returned result
PublisherPublished to portal and verified with curl

See roles in detail: contracts and rules