Skip to content

Latest commit

 

History

History
78 lines (53 loc) · 4.74 KB

File metadata and controls

78 lines (53 loc) · 4.74 KB

Explore → Plan → Code → Commit

Last Updated

The foundational Claude Code workflow from Anthropic's official best practices guide. Every community workflow listed in DEVELOPMENT WORKFLOWS is a specialization of this four-phase pattern.

← Back to Claude Code Best Practice Claude

The Pattern

Phase Goal What Claude does How to enforce
Explore Build context. No edits. Reads files, runs grep/find, gathers facts. Say "do not write code yet" or delegate to the Explore subagent.
Plan Design before doing. Proposes an approach you can critique. Plan Mode (Shift+Tab twice), or /ultraplan.
Code Execute the approved plan. Edits files according to the plan. Switch out of Plan Mode only after the plan is reviewed.
Commit Capture the change cleanly. Creates focused, reviewable commits. One commit per file (see project rule).

Why It Works

The failure mode it prevents: Claude reads two files, infers a pattern, writes 200 lines, then discovers it misunderstood — now you have a half-correct diff to untangle.

Splitting Explore and Plan from Code makes that misunderstanding visible before code exists. The user reviews a plan (cheap to revise) instead of a diff (expensive to revise).

Two of the global behavioral guidelines in ~/.claude/CLAUDE.md map directly onto the first two phases:

  • §1 Think Before Coding = Explore + Plan
  • §4 Goal-Driven Execution = Plan defines verifiable success criteria before Code starts

How This Repo Already Implements It

Each phase has tooling built into this repo's configuration:

Phase Built-in support
Explore Explore subagent (parallelizable — spawn multiple in one message for independent searches)
Plan Plan Mode, /ultraplan, EnterPlanMode tool
Code Default mode; Auto Mode for less prompting
Commit Per-file commit rule, Checkpointing for safe rewinds

Variations

  • TDD variant: Explore → Plan → Test → Code → Commit. Write a failing test after Plan; Code runs until tests pass. Common in the Superpowers and Matt Pocock workflows.
  • Visual iteration variant: For UI work, add screenshots after Code. Use the Playwright MCP or agent-browser skill.
  • Cross-model review variant: Add a second-model review between Plan and Code (see cross-model workflow).
  • Parallel Explore: Spawn multiple Explore subagents in one message for independent searches — recommended in the Agent tool docs.

Anti-Patterns

Anti-pattern What goes wrong
Skip Explore — start in Code Claude infers structure from filenames, gets it wrong, edits the wrong file.
Skip Plan — bundle Explore + Code You review a 200-line diff instead of a 5-line plan. Expensive to revise.
One giant commit at the end Lost reviewability. Hard to bisect. Violates this repo's per-file rule.
Re-Explore mid-Code Context bloats. Use /compact with a hint or /rewind instead.

See Also