Get the FREE Ultimate OpenClaw Setup Guide →

parallel-agents

npx machina-cli add skill parcadei/Continuous-Claude-v3/parallel-agents --openclaw
Files (1)
SKILL.md
3.2 KB

Parallel Agent Orchestration

When launching multiple agents in parallel, follow this pattern to avoid context bloat.

Core Principles

  1. No TaskOutput calls - TaskOutput returns full agent output, bloating context
  2. Run in background - Always use run_in_background: true
  3. File-based confirmation - Agents write status to files, not return values
  4. Append, don't overwrite - Multiple agents can write to same status file

Output Patterns

Simple Confirmation (parallel batch work)

For tasks where agents just need to confirm completion:

# Agent writes to shared status file
echo "COMPLETE: <task-name> - $(date)" >> .claude/cache/<batch-name>-status.txt
  • Use >> to append (not > which overwrites)
  • Include timestamp for ordering
  • One line per agent completion
  • Check with: cat .claude/cache/<batch-name>-status.txt

Detailed Output (research/exploration)

For tasks requiring detailed findings:

.claude/cache/agents/<task-type>/<agent-id>/
├── output.md      # Main findings
├── artifacts/     # Any generated files
└── status.txt     # Completion confirmation
  • Each agent gets own directory
  • Full output preserved for later reading
  • Status file still used for quick completion check

Task Prompt Template

# Task: <TASK_NAME>

## Your Mission
<clear objective>

## Output
When done, write confirmation:
\`\`\`bash
echo "COMPLETE: <identifier> - $(date)" >> .claude/cache/<batch>-status.txt
\`\`\`

Do NOT return large output. Complete work silently.

Launching Pattern

// Launch all in single message block (parallel)
Task({
  description: "Task 1",
  prompt: "...",
  subagent_type: "general-purpose",
  run_in_background: true
})
Task({
  description: "Task 2",
  prompt: "...",
  subagent_type: "general-purpose",
  run_in_background: true
})
// ... up to 15 parallel agents

Monitoring

# Check completion status
cat .claude/cache/<batch>-status.txt

# Count completions
wc -l .claude/cache/<batch>-status.txt

# Watch for updates
tail -f .claude/cache/<batch>-status.txt

Batch Size

  • Max 15 agents per parallel batch
  • Wait for batch to complete before launching next
  • Use status file to track which completed

DO

  • Use run_in_background: true always
  • Have agents write to status files
  • Use append (>>) not overwrite (>)
  • Give each agent clear, self-contained instructions
  • Include all context in prompt (agents don't share memory)

DON'T

  • Call TaskOutput (bloats context)
  • Return large outputs from agents
  • Launch more than 15 at once
  • Rely on agent return values for orchestration

Example: Provider Backfill

# Status file
.claude/cache/provider-backfill-status.txt

# Each agent appends on completion
echo "COMPLETE: anthropic - Thu Jan 2 12:34:56 2025" >> .claude/cache/provider-backfill-status.txt
echo "COMPLETE: openai - Thu Jan 2 12:35:12 2025" >> .claude/cache/provider-backfill-status.txt

Check progress:

cat .claude/cache/provider-backfill-status.txt
# COMPLETE: anthropic - Thu Jan 2 12:34:56 2025
# COMPLETE: openai - Thu Jan 2 12:35:12 2025

Source

git clone https://github.com/parcadei/Continuous-Claude-v3/blob/main/.claude/skills/parallel-agents/SKILL.mdView on GitHub

Overview

Coordinate multiple agents running in parallel while avoiding context bloat. Agents do not return large outputs; they write completion status to shared files under .claude/cache, enabling scalable batching of up to 15 agents. Detailed per-agent outputs are preserved in dedicated directories for later review.

How This Skill Works

Each agent is run in the background and does not use TaskOutput to prevent context bloat. Agents append a completion line to a shared status file or save detailed results in per agent directories, preserving outputs for later reading. A batch supports up to 15 agents; progress is monitored by checking the status file with cat, wc -l, or tail.

When to Use It

  • When launching multiple agents in parallel to complete a batch without bloating memory
  • When you only need a simple completion confirmation per agent
  • When you need detailed per agent findings stored in a dedicated directory
  • When orchestrating up to 15 agents per batch and delaying the next batch until completion
  • When monitoring progress via a shared status file and quick counts like wc -l and tail

Quick Start

  1. Step 1: Create a shared batch status file and decide batch size up to 15
  2. Step 2: Launch each agent with run_in_background true and have it append its completion to the status file
  3. Step 3: Monitor progress with cat or tail and proceed to next batch when counts match expectations

Best Practices

  • Always set run_in_background to true
  • Write completion to a shared status file using append to preserve history
  • Avoid TaskOutput to prevent context bloat
  • Provide each agent with self contained instructions and include all needed context in the prompt
  • Preserve detailed outputs per agent in its own directory while keeping memory isolated

Example Use Cases

  • Provider backfill status tracking with a shared status file
  • Simple confirmation batch where each agent appends to a batch status file
  • Detailed research outputs stored under per agent directories with output and status
  • Launching a batch of up to 15 agents in a single message
  • Monitoring progress using cat wc -l and tail to track status updates

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers