OpenClaw Sub-Agents: How to Run Parallel Tasks Efficiently
OpenClaw Sub-Agents: How to Run Parallel Tasks Efficiently
By David Park | February 7, 2026
OpenClaw Sub-Agents: How to Run Parallel Tasks Efficiently
The single biggest bottleneck with AI agents is waiting.
You ask your agent to research a topic, and your entire conversation freezes. You request five independent tasks, and they execute one at a time. This sequential approach wastes hours.
OpenClaw's sub-agent architecture solves this by letting you spawn independent workers that run in the background while your main conversation continues.
---
What Sub-Agents Actually Do
Sub-agents are completely isolated worker sessions spawned from your main agent. Each sub-agent:
agent::subagent: )Think of it like a construction site:
---
When to Use Sub-Agents
Use sub-agents for:
Don't use sub-agents for:
---
Basic Sub-Agent Usage
Spawning a Sub-Agent
openclaw sessions spawn --task "Research three competitors in the EV market. List their strengths, weaknesses, and market share." --label "EV Competitor Research" Via the agent (in conversation):
You: "Can you research EV competitors in the background while we plan our marketing strategy?" The agent will spawn a sub-agent automatically for suitable tasks.
Managing Sub-Agents
Use the /subagents slash command:
/subagents list # Show all running sub-agents /subagents info # Detailed info about one /subagents log 100 # View last 100 messages /subagents stop # Terminate a sub-agent /subagents send # Send additional instructions ---
Configuration Options
Default Model for Sub-Agents
Set sub-agents to use cheaper models:
{ "agents": { "defaults": { "subagents": { "model": "claude-haiku", "thinking": false } } } } Cost impact: Using Haiku instead of Opus can reduce sub-agent costs by 90%.
Concurrency Limits
Control how many sub-agents run simultaneously:
{ "agents": { "defaults": { "subagents": { "maxConcurrent": 4 } } } } Default is 8. Adjust based on your API limits and budget.
Auto-Archive Settings
Sub-agent sessions auto-cleanup after completion:
{ "agents": { "defaults": { "subagents": { "archiveAfterMinutes": 60 } } } } ---
Practical Parallelization Patterns
Pattern 1: Research Fan-Out
Before (sequential):
Research Apple → Research Google → Research Microsoft Total time: 30 minutes After (parallel):
Spawn sub-agent for Apple Spawn sub-agent for Google Spawn sub-agent for Microsoft Total time: 10 minutes Prompt:
You are a market researcher. Analyze [COMPANY] and provide: 1. Company overview 2. Recent product launches 3. Market position 4. Key strengths and weaknesses Report back with a concise summary for each section. Pattern 2: Content Batching
Before (sequential):
Write blog post → Write social updates → Write email → Write newsletter Total time: 4 hours After (parallel):
Spawn sub-agent: Blog post Spawn sub-agent: Social updates Spawn sub-agent: Email copy Spawn sub-agent: Newsletter Total time: 1 hour Prompt:
Create [CONTENT_TYPE] about [TOPIC]: [TYPE-SPECIFIC REQUIREMENTS] Target audience: [AUDIENCE] Tone: [TONE] Length: [LENGTH] Pattern 3: Data Pipeline Split
Before (sequential):
Process 10,000 rows → Aggregate results → Generate report Total time: 2 hours After (parallel):
Spawn sub-agent: Process rows 1-2500 Spawn sub-agent: Process rows 2501-5000 Spawn sub-agent: Process rows 5001-7500 Spawn sub-agent: Process rows 7501-10000 Spawn main agent: Aggregate and report Total time: 45 minutes ---
Tool Access for Sub-Agents
Sub-agents have restricted tool access by default:
Tools Sub-Agents CAN Use:
read, write, exec (with approvals)web_fetch, browsermemory_get, memory_searchTools Sub-Agents CANNOT Use:
sessions_list, sessions_historysessions_send, sessions_spawnCustomizing Tool Access
{ "tools": { "subagents": { "tools": { "deny": ["gateway", "cron", "process"], "allow": ["read", "write", "exec", "web_fetch"] } } } } ---
Cost Optimization
Each sub-agent consumes tokens independently. Optimize with:
1. Use Cheaper Models
{ "agents": { "defaults": { "model": "claude-opus-4", "subagents": { "model": "claude-haiku" } } } } 2. Limit Run Time
{ "agents": { "defaults": { "subagents": { "maxRuntimeSeconds": 300 } } } } 3. Tight Task Scoping
Vague tasks → more iterations → more tokens
Bad: "Research AI agents" Good: "Find the top 5 AI agent frameworks by GitHub stars and last update date"
---
Results and Announcements
When a sub-agent completes:
1. Announce step runs inside the sub-agent session 2. Results post to your main conversation 3. Statistics included: - Runtime duration - Token usage (input/output/total) - Estimated cost (if pricing configured) - Session key and transcript path
Example announcement:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📋 Sub-agent Complete: EV Market Research ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Status: ✅ Success Runtime: 7m32s Tokens: 12,451 in | 3,892 out | 16,343 total Cost: ~$0.12 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Summary
Tesla (TSLA)
Market cap: $975B Recent: Cybercab announced Q4 2025 Strength: Charging network Weakness: Price sensitivity [Full report in transcript]
---
Limitations to Understand
No Nested Spawning
Sub-agents cannot spawn other sub-agents. This prevents runaway recursion.Isolated Context
Each sub-agent starts fresh. Provide all necessary context in the initial task.Best-Effort Announce
If the gateway restarts during a sub-agent run, the announce may be lost. Use/subagents log to recover results.Shared Resources
Sub-agents share the same gateway process. Too many concurrent sub-agents can slow everything down.---
Advanced: Custom Sub-Agent Models
Override the model per spawn:
openclaw sessions spawn \ --task "Write technical documentation" \ --model "claude-sonnet-4" \ --label "Tech Docs" Useful when a task requires more reasoning but shouldn't use your main agent's premium model.
---
Monitoring and Control
Real-Time Monitoring
# Watch all sub-agent activity openclaw gateway logs --follow | grep subagentCheck specific sub-agent
openclaw sessions history Resource Management
# Stop all sub-agents from main session /stopView sub-agent costs
openclaw costs --subagents ---
Example Workflow: Market Analysis
Main conversation:
You: "I need a comprehensive analysis of the electric vehicle market. Research competitors, regulations, and trends."Agent: Spawning three sub-agents for parallel research... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📋 Sub-agent spawned: Competitor Analysis 📋 Sub-agent spawned: Regulations Research 📋 Sub-agent spawned: Trend Analysis ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You: "While those run, let's discuss our go-to-market strategy."
[Main conversation continues independently]
[30 minutes later - announcements arrive]
📋 Competitor Analysis: ✅ Complete (12m, $0.08) 📋 Regulations Research: ✅ Complete (8m, $0.05) 📋 Trend Analysis: ✅ Complete (15m, $0.11)
You: "Great, now synthesize all three reports into a strategy recommendation."
---
Best Practices
1. Start simple — One sub-agent, observe behavior 2. Scope tightly — Narrow tasks = predictable costs 3. Monitor actively — Use /subagents list regularly 4. Kill when needed — Don't let runaway sub-agents accumulate 5. Use cheaper models — Haiku is sufficient for most sub-agent work 6. Provide full context — Sub-agents don't see your main conversation
---
Further Reading
---
Related Articles:
Tags: OpenClaw, AI, Tutorial
Comments
Post a Comment