> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Plan First, Then Execute (Plan)

<div id="overview">
  # Overview
</div>

Plan allows Qoder to explore the codebase in read-only mode, analyze problems, and propose a solution before making any code changes. Once you approve the plan, you can exit Plan mode to proceed with the actual modifications. It is ideal for tasks with a broad impact, those involving multiple files, or situations where you want to review the overall approach before any changes are made.

Plan is an independent **working state**, not a permission policy—it can coexist with any permission mode. When in Plan mode, Qoder's write access is restricted, and its primary output is a proposed plan.

<div id="enter-exit">
  # Entering and Exiting
</div>

Use the `/plan` command to toggle Plan mode on or off:

```shell theme={null}
/plan
```

* Once enabled, Qoder will explore the code in read-only mode and output a plan without directly modifying your code.
* Run `/plan` again to exit.

You can also enter the Plan working state at startup:

```shell theme={null}
qodercli --permission-mode plan
```

> `--permission-mode plan` is retained for backward compatibility. Since Plan is a working state rather than a permission mode, this value is mapped to "default permission mode + enter Plan state".

<div id="how-it-works">
  # How It Works
</div>

In Plan mode:

* Qoder reads relevant files, searches the codebase, and analyzes the current state to understand what needs to be done and how.
* Its write access is restricted, focusing its output on a plan for your review.
* You can provide feedback on the plan and have Qoder adjust it until it meets your expectations.

This "look before you leap" approach reduces rework on complex tasks by ensuring the direction is correct before Qoder executes the changes.

<div id="with-goal">
  # Executing with Goal
</div>

Plan is often used in conjunction with Goal: first, confirm the approach in Plan mode, then exit Plan and use `/goal set` to enter Goal mode, allowing Qoder to autonomously execute the approved plan to completion. This ensures the correct direction while letting Qoder handle the subsequent implementation.

For detailed information on Goal, see [Continuously Achieving Goals (Goal)](/en/cli/03-using-qoder-cli/02-task-automation/goal). If Plan is active before Goal execution, Qoder will restore the Plan state along with the goal when resuming across processes.

<div id="when-to-use">
  # When to Use
</div>

* **High-impact changes**: Modifications spanning multiple files or involving public interfaces and core logic.
* **Uncertain direction**: Scenarios with multiple implementation options that require comparison before deciding.
* **Desire for prior review**: When you want to see Qoder's intended approach before any changes are made.

For simple, well-defined minor changes, it is usually faster to let Qoder work directly in interactive mode without entering Plan.

<div id="related">
  # Related
</div>

* For the relationship between Plan and permission modes, see [Permissions](/en/cli/06-configuration-and-security/permissions).
* For how to choose between different working methods, see [Choosing the Right Working Approach](/en/cli/02-core-concepts/work-modes).
