<!-- Markdown mirror. Canonical: https://empryo.com/docs/recipes/plan-mode -->

# Plan before you code

> Use Empryo plan mode for multi-file refactors: the agent researches, writes a light or full plan, waits for approval, then executes step by step.

For anything touching more than 2-3 files, use plan mode. The agent researches first, writes a structured plan, waits for your approval, then executes step-by-step.

## Start a plan

```
/plan refactor the auth module to use JWT refresh tokens
```

Or switch to plan mode globally:

```
/mode plan
```

In plan mode the agent has its full tool belt, it can read, search, and run read-only commands to make the plan true, but it is instructed to research only and never to change the project. Changing anything is your call: the agent calls the `plan` tool and the plan appears in the sidebar for review. Approval gates (destructive commands, writes outside the project) still apply as normal.

## Review the plan

- **Approve** - switches the lane to auto and executes the plan step-by-step, with progress in the sidebar.
- **Revise** - type what you want changed, the agent rewrites.
- **Cancel** - discards the plan.

## Plan types

- **Light plan** - a checklist, no code. Fast, low context.
- **Full plan** - includes code snippets and old→new diffs. More context, higher confidence on big refactors.

The agent picks based on the request. You can override in the prompt ("make a detailed plan").

## Why plan mode

For small fixes, planning is overhead. For multi-file refactors, it catches mistakes before you commit to them - cheaper than re-running an expensive edit session.

## Resume a plan

If you close Empryo mid-plan, `/session continue` picks up where you left off. Plans are saved to `.empryo/plans/` so they survive restarts.
