Planning Agent
Breaks down large features into sequential sub-tasks for structured execution.
Planning Agent
The Planning Agent decomposes complex instructions into 3-8 ordered sub-tasks for structured, step-by-step execution. Instead of sending a large, ambiguous request to a single Task Agent, the Planning Agent breaks it down into concrete steps that can be reviewed, approved, and executed sequentially.
Characteristics
| Property | Value |
|---|---|
| Lifecycle | Ephemeral -- spawned per planning request, terminated after plan is created |
| Cardinality | One per planning request |
| Color | Signal Blue (#3B82F6) |
When to Use the Planning Agent
The Planning Agent is most valuable for:
- New features that touch multiple files or modules (e.g., "add user authentication with OAuth")
- Large refactors that need to happen in a specific order (e.g., "migrate from REST to GraphQL")
- Framework migrations where steps have dependencies (e.g., "upgrade from Next.js 14 to 15")
- Multi-step workflows where each step builds on the previous one
For simple, single-file changes, use instruct directly. The Planning Agent adds value when the scope is too large for a single task.
Command
The plan command accepts a natural language description of what you want to build or change. The Planning Agent sends this to Claude with a specialized system prompt that returns a structured JSON array of sub-tasks.
Example: Creating a Plan
Approval Flow
Plans require explicit approval before execution. This gives you the opportunity to review the decomposition, reorder steps, or refine the scope before any code is written.
After approval, the Project Agent executes each sub-task sequentially by spawning a Task Agent for each step. Each step receives context from the previous step's output, ensuring continuity across the plan.
Future: Auto-execute on approval is planned for L3+ autonomy levels, where the plan would begin executing immediately after approval without requiring a separate command for each step.
How It Works
Decomposition Pipeline
System Prompt
The Planning Agent uses a specialized system prompt that instructs Claude to:
- Analyze the feature request and identify logical boundaries
- Break the work into 3-8 concrete, ordered steps
- Ensure each step is small enough for a single Task Agent execution
- Order steps so that each builds on the previous one
- Return a structured JSON array with step descriptions
Response Format
Claude returns a JSON array that the Planning Agent parses and stores:
Configuration
| Variable | Description | Default |
|---|---|---|
PLANNING_MODEL | AI model used for plan decomposition | claude-sonnet-4-20250514 |
The Planning Agent uses the same model configuration pattern as other agents. You can override the model via environment variable if you want to use a different Claude model for planning.
Use Cases
New Feature
The Planning Agent might decompose this into:
- Create notification model and database schema
- Implement email notification service with templates
- Implement in-app notification service with WebSocket delivery
- Add notification preferences to user settings
- Create notification API endpoints (list, mark read, preferences)
- Integrate notifications into existing workflows (PR merged, deploy complete)
Large Refactor
Steps might include:
- Define the auth service API contract and shared types
- Create the auth service project structure with health check endpoint
- Migrate user/session models and database queries to the auth service
- Implement auth API endpoints (login, logout, refresh, validate)
- Update the monolith to call the auth service instead of local auth logic
- Add integration tests for the auth service communication
- Remove deprecated auth code from the monolith
Framework Migration
Steps might include:
- Add Fastify dependencies and create the base server configuration
- Migrate middleware to Fastify hooks and plugins
- Convert route handlers from Express to Fastify route syntax
- Update error handling to use Fastify error handler pattern
- Migrate tests to use Fastify's inject method instead of supertest
- Remove Express dependencies and update documentation
Relationship with Other Agents
The Planning Agent works closely with the Project Agent and Task Agent:
Plan steps are executed sequentially, not in parallel, because each step may depend on changes made by the previous one. For independent tasks that can run concurrently, use multiple instruct commands instead -- see the Parallel Task Execution guide.