Identify opportunities to parallelize work using sub-agents. Use when receiving multi-item tasks, batch operations, or work that could benefit from concurrent execution...
Recognize when to spawn sub-agents for parallel execution, and audit agent configs to enable sub-agent capabilities.
Triggers automatically when receiving parallelizable tasks.
Triggers on: "optimize agents", "audit agent config", "check subagent permissions"
Spawn sub-agents when:
Do it yourself when:
| Pattern | Example | Action |
|---|---|---|
| "Research these N items" | "Research these 5 companies" | Spawn N research workers |
| "Create N variations" | "Write 3 headline options" | Spawn N content workers |
| "Check/verify all of X" | "Verify all 10 links work" | Spawn workers per batch |
| "For each X, do Y" | "For each competitor, analyze pricing" | Spawn per item |
| "In parallel" / "simultaneously" | "Research both simultaneously" | Explicit parallel request |
# Standard parallel spawn
for item in items:
sessions_spawn(
agentId="research-agent", # or same type for parallel work
task=f"[Specific task for {item}]. Return: [expected output format]."
)
# Results announce back ā aggregate ā deliver
| Task Type | Spawn Agent Type | Why |
|---|---|---|
| Research, fact-finding | Research-specialized agent | Optimized for discovery |
| Content drafts, copy | Content agent (or self) | Voice-consistent |
| Data processing | Self (parallel instances) | Same capabilities needed |
| Personalization at scale | Self | Context-aware |
When triggered with "optimize agents" or "audit agent config":
cat ~/.openclaw/openclaw.json | jq '.agents.list[] | {id: .id, name: .name, subagents: .subagents}'
For each agent, check:
Common issues:
AUDIT RESULTS:
ā
orchestrator: Can spawn [content, research, sales] ā Good
ā ļø content-agent: Can only spawn [main] ā Limited
ā Recommend: Add [content, research] for parallel drafts + research delegation
ā ļø research-agent: Can only spawn [main] ā Limited
ā Recommend: Add [research] for parallel deep-dives
ā
sales-agent: Can spawn [sales, research, main] ā Good
Apply recommended fixes? [y/n]
Edit ~/.openclaw/openclaw.json to update subagents.allowAgents arrays, then:
# Restart gateway to apply
openclaw gateway restart --reason "Updated subagent permissions"
Note (OpenClaw 2026.1.30+): Sub-agent announce routing now prefers requesterOrigin over stale session entries, improving result delivery reliability.
# Pseudo-code for audit logic
def audit_agents():
config = read_config("~/.openclaw/openclaw.json")
recommendations = []
for agent in config.agents.list:
allowed = agent.subagents.allowAgents or []
agent_type = agent.id
# Check: Can agent parallelize its own work?
if agent_type not in allowed:
recommendations.append({
"agent": agent_type,
"add": agent_type,
"reason": "Enable parallel self-spawning"
})
# Check: Can agent delegate research?
if "research" not in allowed and agent_type != "research":
recommendations.append({
"agent": agent_type,
"add": "research",
"reason": "Enable research delegation"
})
return recommendations
Add to AGENTS.md for persistent behavior:
### Sub-Agent Parallelization
When receiving tasks with multiple items:
1. Check if items are independent
2. Spawn sub-agents for parallel execution
3. Aggregate results when all complete
Use `sessions_spawn` with appropriate agentId. Batch large requests (5-8 at a time).
To audit permissions: "optimize agents" or "audit agent config"
ā Spawning for single items (overhead not worth it) ā Spawning when items depend on each other ā Spawning 20+ workers simultaneously (rate limits) ā Forgetting to aggregate results after spawn ā Agents that can't spawn themselves (limits parallelization)