Explore-Plan-Execute Pattern

A safe approach for complex or risky Claude Code tasks: first ask Claude Code to explore the codebase and produce a detailed plan without making changes, review the plan, then authorize execution. Provides visibility before irreversible file modifications.

Syntax

claude-code
// Phase 1 — Explore and plan (no changes):
"Explore the codebase for [task].
List every file you would modify and what you would change.
Identify any complications or risky changes.
Do not make any changes yet. Show me the plan first."

// Phase 2 — Review plan manually

// Phase 3 — Authorize execution:
"The plan looks correct. Proceed in the order you described.
Run typecheck after each file change."

Example

claude-code
// Task: Migrate auth state from React Context to Zustand

// Phase 1:
"I need to migrate auth state from AuthContext to Zustand.
Explore the codebase:
- List every file that imports from AuthContext
- Describe what each file uses from the context
- Flag any risky or complicated changes
- Propose a migration sequence
Do not make any changes yet."

// Review: Confirm plan is safe and complete

// Phase 2:
"The plan is correct. Proceed with the migration in the
order you described. Run typecheck after each file.
Stop if any test failures would require significant rework."