--handoff flag enables agent-to-agent task delegation, allowing multiple specialized agents to collaborate on complex tasks.
Quick Start
Usage
Basic Handoff
Multi-Agent Chain
Handoff Configuration Options
Context Policies
Combine with Other Features
YAML Equivalent
Every--handoff* flag has a YAML equivalent under the agent’s handoff: block:
How It Works
- Parse Agents: The handoff string is parsed into agent names
- Create Chain: Agents are created with handoff capabilities
- Sequential Execution: Each agent processes and hands off to the next
- Context Passing: Previous agent’s output becomes next agent’s input
- Final Output: Last agent’s response is returned
Agent Naming
Agents are automatically configured based on their names:Custom Agent Names
You can use any name - agents will be configured with generic roles:Use Cases
Content Creation Pipeline
Code Review Workflow
Data Analysis Pipeline
Research to Report
Handoff Patterns
Research → Write
Code → Review
Analyze → Report
Plan → Execute → Review
Best Practices
Logical Order
Arrange agents in a logical workflow sequence
Specialized Agents
Use descriptive names that indicate specialization
Chain Length
Keep chains to 2-4 agents for efficiency
Clear Tasks
Ensure each agent has a clear, distinct role
Monitoring Handoffs
Use--metrics to see token usage across all agents:

