concept
Created: 2026-04-29
Updated: 2026-04-29

Sources:

crew-reference2026-04-29-no-acp
conceptsLast updated 2026-04-29

Subagent Pattern

The native subagent execution pattern — spawning specialized agents via `sessions_spawn` with `runtime: "subagent"`. Simple, reliable, no permission issues.

Summary

The native subagent execution pattern — spawning specialized agents via sessions_spawn with runtime: "subagent". Simple, reliable, no permission issues.

The Pattern

sessions_spawn({
  runtime: "subagent",
  task: "You are [AgentName], [Role]. Your task: ..."
});

Why Native?

Approach
Pros
Cons
Native subagent
Simple, reliable, full filesystem access
Limited to OpenClaw runtime
ACP harness
Theoretical portability
Permission hell, complexity
External API
No runtime dependency
Latency, cost, context loss

Key Principles

1. One task per spawn — Clear scope, clear completion

2. Workspace file coordination — Agents read/write files to communicate

3. No mock data — Real inputs produce real outputs

4. Re-delegate repairs — If an agent built it, that agent fixes it

Anti-Patterns

  • ❌ Spawning without clear task boundaries
  • ❌ Trying to fix another agent's work yourself
  • ❌ Using ACP when native works fine
  • ❌ Mock data in production systems

Relationships

  • crew-coordination — File-based coordination works with subagent pattern
  • 2026-04-29-no-acp — Decision record explaining why native won
  • blinky — DevOps Engineer, primary subagent user
  • clyde — CEO, orchestrates subagent spawning