Plan Mode
Explore and analyze code safely without making any changes. Plan first, then execute with confidence.
What Is Plan Mode?
Plan Mode is a read-only permission mode where Claude can explore your codebase, analyze code, and propose plans — but cannot write files, run commands, or make any changes. It is the safest way to get Claude's analysis.
How to Activate
Three ways to enter Plan Mode:
- Shift + Tab — Cycle through modes: Normal → Auto-accept → Plan Mode
- Launch directly:
claude --permission-mode plan - Type
planas the first word of your prompt (Claude will stay read-only for that turn)
The Explore → Plan → Code Pattern
The most effective way to use Claude Code for non-trivial tasks:
1. Explore (Plan Mode)
Understand the codebase before touching anything:
plan: I need to add rate limiting to the API.
Explore @src/api/ and @src/middleware/.
What patterns are already used? Where should rate limiting go?
2. Plan (Still Plan Mode)
Ask Claude to produce a detailed implementation plan:
Based on what you found, create a step-by-step plan:
- which files to create/modify
- what tests to write
- what order to implement in
Don't implement yet.
3. Code (Normal Mode)
Switch to Normal mode (Shift + Tab) and execute the plan:
implement the rate limiting plan from above.
commit after each working step.
When to Use Plan Mode
- Onboarding — Exploring a new codebase you just joined
- Bug diagnosis — Tracing issues without accidentally changing code
- Architecture review — Analyzing patterns, dependencies, and tech debt
- Security audit — Scanning for vulnerabilities without modifying anything
- Code review — Reviewing PRs with deep analysis
Tips
- Use
@file references in Plan Mode — Claude can read any file you point to - Combine with
ultrathinkfor deep architectural analysis - The plan Claude produces in Plan Mode carries over when you switch to Normal mode
- If you only need read-only for one turn, prefix your prompt with
plan:instead of switching modes
Why does "plan before code" work so well?
The Explore → Plan → Execute loop is the fundamental pattern behind all autonomous agents. Understanding this architecture helps you work with any AI coding tool more effectively.
Learn the Agent Basics