Plan mode is Claude Code's "think before you act" gear. When you prefix a request with /plan, Claude produces a complete implementation proposal — files to create, steps to execute, dependencies to install — without touching a single file. You review, refine, and approve. Only then does Claude begin making changes.
For complex or risky changes, this single round-trip prevents broken states, avoids unwanted scope creep, and lets you redirect before any work is done.
/plan followed by your request: /plan Add rate limiting to all API endpointsThe hard guarantee: In plan mode, the Edit, Write, and Bash tools are blocked. Claude cannot write, delete, or execute shell commands. You see exactly what will happen before anything does.
In the interactive Claude Code CLI, prefix your message:
/plan Refactor the auth middleware to support both JWT and API key strategies
Claude enters plan mode, presents the proposal, then waits for your response.
For sufficiently complex tasks, Claude may enter plan mode automatically even without /plan. You'll see it call EnterPlanMode in the tool call stream. The behavior is identical — Claude is still waiting for your approval before writing anything.
In non-interactive SDK usage, spawn a dedicated Plan agent:
Agent({
subagent_type: "Plan",
description: "Design auth refactor",
prompt: "Design a plan to refactor auth middleware to support JWT + API key strategies. Identify the affected files, step ordering, and any risks. Return the plan as a numbered list."
})
The Plan agent cannot write files. Its returned text becomes the plan your orchestrator reviews before dispatching write agents.
Looks good, go ahead.
# or: "yes", "approved", "execute", "do it"
Skip step 3 — the DB migration already ran in staging.
Also handle the case where the user object is null in step 5.
Then proceed.
Claude revises the plan and presents a new version. You can iterate through multiple revisions at no execution cost.
Cancel — I want a different approach.
Instead of middleware, let's use a decorator pattern at the route level.
A complete plan should contain all of these:
Why this approach over alternatives. Trade-offs stated explicitly.
Each step names the specific file(s) and change type: create / edit / delete.
Any packages to install, env vars needed, or services that must be running.
The test command or manual check that confirms success at the end.
Steps that can't easily be undone (schema migrations, force-pushes) are called out explicitly.
Any step where Claude needs your input before it can proceed safely.
If a plan is missing any of these, ask Claude to expand it before approving: "Add a verification step" or "What are the alternatives you considered?"
/plan Implement real-time notifications using WebSockets.
Include: backend event emitter, client-side connection, reconnect logic, and fallback to polling.
Claude maps out the full implementation across backend and frontend files before touching anything.
/plan Migrate all API routes from Express callbacks to async/await with centralized error handling.
You see every file that will be modified. If the list is longer than expected, you can narrow scope before any changes happen.
/plan Upgrade from React 18 to React 19. Identify breaking changes in our codebase and propose a migration path.
Claude reads the codebase for React 18-specific APIs, checks for breaking patterns, and drafts a phased upgrade plan you can schedule across multiple sessions.
/plan Design the agent architecture for an automated PR review pipeline.
Inputs: a GitHub PR URL. Outputs: inline comments + a summary verdict.
Claude produces an agent-graph diagram (as text/ASCII), identifies which sub-agent types to use, and specifies the handoff contract between agents.
| Approach | Tool writes blocked? | Requires approval? | Best for |
|---|---|---|---|
| Ask Claude to "describe what you'll do" | No | No | Understanding an approach; may still read files while describing |
/plan (plan mode) |
Yes | Yes | Risky/complex changes where an early wrong write costs time |
| Plan sub-agent (SDK) | Yes | Programmatic | Headless pipelines; orchestrator reviews before dispatching write agents |
/plan prompt (constraints, related files, what NOT to change), the more accurate the first plan will be.Yes. In the interactive CLI, Claude's plan appears as normal text output. In the desktop/web app, plan mode tool calls (EnterPlanMode / ExitPlanMode) may appear as collapsible tool call blocks. The plan text is always readable in the main conversation stream.
Plan mode blocks all execution — file writes AND shell commands. If a plan step says "run npm install" or "run db migration", Claude will list it as a step but not run it until you approve.
In the interactive CLI, Claude waits for your text response before exiting plan mode — it cannot self-approve. In SDK usage where you control the conversation loop, you handle ExitPlanMode tool calls in your code; if you automatically continue without checking, the plan is effectively auto-approved. Build an approval gate into your SDK loop for untrusted tasks.
Different mechanisms, complementary purposes. Extended thinking (available on Claude Opus/Sonnet 3.7+) is an internal chain-of-thought process that improves reasoning quality — it runs before Claude produces any output and is not user-visible. Plan mode is an explicit tool-call boundary enforced by the harness; it's about workflow control (no writes until approved), not about the quality of reasoning. You can have plan mode active while extended thinking is also enabled.
Claude doesn't persist plans across sessions automatically. If you want a saved plan: ask Claude to write the plan as a PLAN.md file before approving, then reference that file in future sessions. Alternatively, use a CLAUDE.md file to capture the architectural decisions from the plan so future sessions have the context.
Hooks still fire during plan mode for any tool calls that ARE allowed (Bash reads, file reads). But hooks attached to Edit or Write events will not fire during plan mode because those tool calls are blocked. If you have a pre-write hook for validation, it will fire during execution (after plan approval) as expected. See the hooks guide for full event reference.