Overview
Subagent delegation allows a primary agent to:- Spawn specialized subagents for specific tasks
- Control concurrency and resource limits
- Scope permissions per subagent
- Collect and aggregate results
Quick Start
Available Agents
Get list of available agents for delegation:Built-in Agent Profiles
| Agent | Mode | Description |
|---|---|---|
general | Primary | General-purpose coding assistant |
coder | All | Focused code implementation |
planner | Subagent | Task planning and decomposition |
reviewer | Subagent | Code review and quality |
explorer | Subagent | Read-only codebase investigation |
debugger | Subagent | Debugging and troubleshooting |
Explorer Agent
The explorer agent is a specialized read-only agent for codebase investigation:- Uses only read-only tools (read_file, grep, glob, list_files)
- Cannot modify files or execute commands
- Provides structured reports with file locations and insights
Parallel Delegation
Delegate multiple tasks in parallel:Configuration
Task Management
Cancel a Task
Check Task Status
Statistics
Custom Agent Factory
Provide a custom agent factory for more control:Callbacks
Register callbacks for task completion:Convenience Function
Quick delegation without creating a delegator:Best Practices
- Use appropriate agents - Match agent capabilities to task requirements
- Set timeouts - Prevent runaway subagents
- Limit concurrency - Don’t overwhelm resources
- Scope permissions - Use read-only agents when possible
- Handle failures - Check
result.successand handle errors

