Autopilot mode uses an AI planner to analyze complex tasks and generate execution plans that leverage multiple agents’ strengths. Each step in the plan is assigned to the most suitable agent (claude, gemini, codex, ollama) based on what it does best.
Usage
TUI (Interactive)
/autopilot "<task>"
/planner <agent> # set planner agent
/execute # toggle auto-execution
/interactive # toggle pause between steps
CLI
puzldai autopilot "<task>" [-p planner] [-x] [-i]
| Flag | Description |
|---|
-p | Agent to use for planning (default: ollama) |
-x | Execute the plan after generating |
-i | Interactive mode - prompt before each step |
Examples
# TUI: Generate and review a plan
/autopilot "Build user authentication with JWT"
# CLI: Full autonomous execution with claude as planner
puzldai autopilot "Refactor the API layer" -p claude -x
# CLI: Interactive execution (approve each step)
puzldai autopilot "Add unit tests for utils" -p claude -x -i
How It Works
Analyze Task
The planner agent analyzes the task and determines what steps are needed.
Assign Agents
For each step, the planner selects the best agent based on their strengths:
- claude: Code writing, architecture, creative tasks
- gemini: Analysis, research, planning
- codex: Debugging, security, code review
- ollama: Simple queries, fast local responses
Generate Plan
A 1-5 step execution plan is created, with each step showing the assigned agent and action.
Execute (optional)
If /execute is enabled, steps run in sequence. Each step receives the output from previous steps.
Agent Assignment
The planner automatically matches agents to tasks:
| Task Type | Recommended Agent |
|---|
| Write code, generate files | claude |
| Analyze requirements, plan architecture | gemini |
| Review code, find bugs, security check | codex |
| Quick lookups, simple transformations | ollama |
Configuration
Planner Agent
Set which agent creates the execution plan:
# TUI
/planner claude
# CLI
puzldai autopilot "task" -p claude
Execution Mode
Control how the plan is executed:
| Mode | Description |
|---|
| Plan only | Generate plan without executing (default) |
Auto-execute (/execute) | Execute all steps automatically |
Interactive (/interactive) | Pause and confirm before each step |
To enable execution in TUI:
/execute # toggle auto-execution on
/autopilot "task" # now runs the plan automatically
Keyboard Shortcuts
| Key | Action |
|---|
Escape | Hide view (keeps running) |
Ctrl+E | Return to autopilot view |
Ctrl+C | Cancel operation |
Example Output
─── Autopilot [Autopilot Mode] ───
Generated Plan:
━━━━━━━━━━━━━━━━
1. [gemini] analyze
Break down the authentication requirements and identify components
2. [claude] code
Implement JWT token generation and validation utilities
3. [claude] code
Create login and register API endpoints
4. [codex] review
Review implementation for security vulnerabilities
Use /execute to enable auto-execution
Tips
Claude makes a great planner - For complex tasks, use /planner claude to get more detailed, well-structured plans.
Start with plan-only mode - Review the generated plan before enabling /execute to ensure the agent assignments make sense.
Use interactive for learning - Enable /interactive to see how each agent handles its assigned step.