The --planning flag enables planning mode where the agent creates a multi-step plan before execution.
Quick Start
Usage
Basic Planning
Expected Output:
With Reasoning
Auto-Approve Plans
Combine Options
How It Works
- Plan Creation: Agent analyzes the task and creates a multi-step plan
- User Approval: Plan is shown for approval (unless
--auto-approve-plan)
- Step Execution: Each step is executed sequentially
- Context Passing: Results from each step inform the next
- Final Result: Combined output from all steps
Planning Options
YAML Equivalent
Use planning: true inside an agent definition for YAML-based planning:
Examples
Research Task
Code Project
Analysis Task
Programmatic Usage
What happens:
- 📋 Agent creates a multi-step plan
- 🚀 Executes each step sequentially
- 📊 Shows progress with context passing
- ✅ Returns final result
Best Practices
Use planning mode for complex, multi-step tasks that benefit from structured execution.
Planning mode adds overhead for simple tasks. Use it for complex tasks with multiple steps.