Skip to content

spawn

Launch background tasks for parallel execution. Enables concurrent work on independent tasks with result aggregation.


Launch a background task or manage running tasks.

Start a new background task:

Terminal window
/spawn "[task description]"

Process:

  1. Analyze task for parallelizability
  2. Launch subagent with task
  3. Return task ID for tracking
  4. Continue main conversation

Output:

Spawned: Task #1
- Description: Research authentication patterns
- Status: Running
- Agent: researcher
Continue working. Use `/spawn --list` to check status.

Show running and completed tasks:

Terminal window
/spawn --list

Output:

## Active Tasks
| ID | Description | Status | Duration |
|----|-------------|--------|----------|
| #1 | Research auth patterns | Running | 2m |
| #2 | Analyze security | Complete | 5m |
## Completed Tasks (last hour)
| #2 | Analyze security | ✅ Complete | Results ready |

Gather results from completed tasks:

Terminal window
/spawn --collect

Output:

## Collected Results
### Task #1: Research auth patterns
**Status**: Complete
**Findings**:
- Pattern A: JWT with refresh tokens
- Pattern B: Session-based with Redis
- Recommendation: JWT for stateless API
### Task #2: Analyze security
**Status**: Complete
**Findings**:
- 2 high-priority issues found
- See detailed report below

Stop a running task:

Terminal window
/spawn --cancel [id]
TypeBest ForAgent Used
ResearchInformation gatheringresearcher
AnalysisCode analysisscout
ReviewCode reviewcode-reviewer
TestTest generationtester
ScanSecurity scanningsecurity-auditor
FlagDescription
--listShow all tasks
--collectGather completed results
--cancel [id]Cancel running task
--waitWait for all tasks to complete
--agent=[type]Specify agent type
--priority=[high|normal]Task priority
Terminal window
/spawn "Research OAuth2 best practices"
/spawn "Analyze user service for performance issues"
/spawn "Review security of auth module" --agent=security-auditor
/spawn --list
/spawn --collect
/spawn --wait # Block until all complete

$ARGUMENTS

If quoted text: spawn that task If flag: execute that operation


Terminal window
/spawn "Research authentication approaches"
/spawn "Analyze current auth implementation"
/spawn "Review competitor auth patterns"
# Continue other work...
/spawn --wait
/spawn --collect
# Synthesize findings
Terminal window
/spawn "Review src/auth/ for security"
/spawn "Review src/api/ for performance"
/spawn "Review src/db/ for SQL injection"
/spawn --collect
# Address findings
  1. Independent Tasks: Only spawn truly independent work
  2. Clear Descriptions: Specific task descriptions get better results
  3. Regular Collection: Don’t let results pile up
  4. Resource Awareness: Don’t spawn too many concurrent tasks
  • Tasks cannot communicate with each other
  • Results are collected, not streamed
  • Heavy tasks may take time
  • Some tasks benefit from sequential execution
  • Orchestration mode: Manages multiple spawned tasks
  • /plan: Plan tasks, then spawn parallel execution
  • /execute-plan: Orchestrated task execution

Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.