Skip to main content

Overview

The --plan option (via --approval-mode plan) runs Qwen Code in plan-only mode, where the AI generates detailed execution plans without actually executing any tools or making changes. This is perfect for reviewing what actions would be taken before committing to them.

Syntax

There is no short -p flag for plan mode (that’s reserved for --prompt). Use the full --approval-mode plan syntax.

What It Does

With plan mode enabled: Generates detailed execution plans
Lists all tools that would be called
Describes what each action would do
Does NOT execute any actions
Does NOT modify any files
Does NOT run any commands

Basic Usage

Review Changes Before Applying

Output:
No actual changes are made to your codebase.

When to Use Plan Mode

Before Large Refactorings

Understanding AI Approach

Cost Estimation

Code Reviews

Learning Tool

Detailed Plan Output

Tool Call Details

Each step in the plan includes:
  • Tool name: Which tool would be called (read, write, edit, bash, etc.)
  • Target: What file or command
  • Purpose: Why this action is needed
  • Changes: What modifications would be made

Example Plan Structure

JSON Plan Output

For programmatic processing:
Output:

Combining with Other Options

Plan with Specific Model

Plan in CI/CD

Iterative Planning

Plan -> Execute Workflow

Step 1: Generate Plan

Step 2: Review Plan

Step 3: Execute Plan

Alternative: Manual Implementation

Plan Mode vs Other Modes

Use Cases

Architecture Review

Get a detailed plan without any implementation.

Security Audit

Review proposed fixes before applying.

Performance Optimization

Understand optimization strategy first.

Dependency Updates

See what would be updated and test impact.

Automation Examples

Plan Generation Script

Compare Approaches

Weekly Planning

Limitations

No Actual Feedback

Plans are based on assumptions:

Cannot Test Feasibility

No Tool Feedback

Plans don’t include tool results:

Workaround

Generate plan, then execute incrementally:

Best Practices

Plan mode is most valuable for complex operations:
Plans are suggestions, not guarantees:
  • Verify file paths exist
  • Check if tools are available
  • Ensure commands are safe
  • Validate dependencies exist
Keep plans for documentation:
Refine plans before executing:

Advanced Techniques

Multi-Stage Planning

Plan Templates

Conditional Plans

Troubleshooting

Plan Too Vague

If plans lack detail:

Plan Incomplete

If plans are missing steps:

Plan Doesn’t Match Needs

If the approach isn’t right:

See Also

--yolo Option

Execute plans automatically

Approval Modes

Understanding all approval modes

Planning Best Practices

Advanced planning techniques

Interactive Mode

Use plan mode interactively