Explore, Plan, Implement, Commit

The four-phase workflow that scales

Beginner 14 minBuilder
What you'll be able to do
  • Run the four phases — Explore, Plan, Implement, Commit — on a real multi-file change
  • Explain why separating research from execution catches misunderstandings early and cheaply
  • Decide when to use the full workflow and when to skip planning for trivial fixes
  • Let Claude commit and open a PR, and resume the linked session later with --from-pr
  • Keep sessions clean by using /clear between unrelated tasks instead of one kitchen-sink session
At a glance

Explore, Plan, Implement, Commit is the four-phase workflow Anthropic recommends for any change that isn't trivial: research the codebase in read-only plan mode first, let Claude draft a detailed plan you approve, then exit plan mode to implement against a verifier, and finally commit and open a PR. Separating research from execution catches misunderstandings before a single line of code is written.

  1. 1The mental model: research before execution
  2. 2Phase 1 — Explore (plan mode, read-only)
  3. 3Phase 2 — Plan (Claude drafts, you approve)
  4. 4Phase 3 — Implement (exit plan mode, code with verification)
  5. 5Phase 4 — Commit (commit + open a PR)
  6. 6When to use it — and when to skip planning
  7. 7One task per session: avoid the kitchen sink

The mental model: research before execution

The single biggest mistake new Claude Code users make is the same one new engineers make: they start editing before they understand the code. Claude is fast and eager, so a vague prompt like "add rate limiting to the API" sends it straight into changing files — and if its picture of your codebase is wrong, you find out only after the diff is already wrong.

The fix is a discipline, not a feature: research first, then execute. Anthropic's recommended end-to-end workflow splits a task into four phases that map cleanly onto how a careful human works:

text
Explore   →   Plan   →   Implement   →   Commit
(read-only)  (draft)     (code + verify)  (commit + PR)
  • Explore — Claude reads the relevant files and builds an accurate picture, without editing anything. You do this in plan mode (read-only).
  • Plan — Claude drafts a detailed, step-by-step plan. You read it, correct misunderstandings, and approve.
  • Implement — you exit plan mode and Claude writes the code, checking its work against a verifier (tests, build, types).
  • Commit — Claude commits the change and opens a pull request.

The load-bearing idea is the seam between phases 2 and 3. A wrong plan costs you ten seconds to read and one sentence to correct. A wrong implementation costs a tangled diff, a burned context window, and a debugging session. Moving the checkpoint earlier — to text, before any edits — is what makes this workflow scale to changes that touch many files.

Key insight

The plan is a cheap dress rehearsal

Reviewing a plan is the highest-leverage thirty seconds in the whole workflow. You're verifying Claude's understanding before it spends effort on execution — the same reason a good engineer writes a design doc before a 600-line PR.

Phase 1 — Explore (plan mode, read-only)

Exploration means letting Claude gather context — read files, search the codebase, trace how things connect — before proposing any change. You enforce this with plan mode, a permission mode in which Claude is read-only: it can explore and propose, but it cannot edit files or run mutating commands.

Enter plan mode any of three ways:

HowWhat it does
Shift+TabCycle permission modes until you reach plan (default → acceptEdits → plan)
/plan [description]Enter plan mode directly, optionally with a starting description
--permission-mode planLaunch a session straight into plan mode

Now give Claude the task and let it read. Concretely, suppose you want to add an audit-log entry every time a user changes their email — a change that touches the route handler, the service layer, and the database model. In plan mode you'd say:

text
Explore how email changes are handled. Read the route, the user service,
and the model. Don't write any code yet — I want to plan this first.

Claude opens the relevant files, follows the call chain, and reports back what it found. Because it's read-only, nothing in your working tree changes. This is also where misunderstandings surface for free: if Claude says "the email update lives in legacy/user.py" and you know that file is dead, you catch it now, before a single edit.

Tip

Point Claude at the right files

Exploration is faster and more accurate when you name starting points — a directory, a file, or a symbol via @-mention. You don't have to know the whole answer; you just have to aim it. For very large investigations, ask Claude to use a subagent so the raw file reads don't fill your main context window.

Phase 2 — Plan (Claude drafts, you approve)

Once Claude has explored, ask it to turn that understanding into a concrete plan. In plan mode it produces a detailed, step-by-step proposal — which files it will touch, what it will add, and in what order — and stops for your approval. Nothing is executed yet.

For our audit-log change, a good plan reads like a checklist:

text
Plan:
1. Add an `AuditLog` model in models/audit.py (user_id, field, old, new, ts)
2. In services/user.py, after a successful email update, write an audit row
3. Wire the route in routes/users.py to pass the actor + old value
4. Add tests in tests/test_user_email.py covering the new audit row
5. Run: pytest tests/test_user_email.py -q

This is the moment to steer. Read the plan critically:

  • Did it miss a call site? Add it.
  • Is step 1 in the wrong module? Tell it where the model belongs.
  • Want a different test strategy? Say so now.

You can edit the plan in your external editor before approving with Ctrl+G (also Ctrl+X Ctrl+E). When the plan is right, exit plan mode (Shift+Tab) to approve and move to implementation.

Note the cost asymmetry one more time: every correction you make here is a one-line comment on text. The same correction made after implementation is a re-do of real code.

Example

Catching a misunderstanding in the plan

Plan step 2 says "write an audit row in services/user.py," but you know email changes also flow through an admin endpoint that bypasses that service. You add one sentence — "also cover the admin path in routes/admin.py" — and the implementation now handles both. Without the plan phase, you'd have shipped a half-finished feature and discovered the gap in code review.

Phase 3 — Implement (exit plan mode, code with verification)

With the plan approved, exit plan mode (Shift+Tab) and let Claude execute. It now works through the plan's steps — creating the model, editing the service, wiring the route, adding tests — making real edits to your working tree.

The critical habit here is verification. Claude stops when work looks done; without a check, you become the verification loop, manually finding the bugs it left behind. Give it a verifier and it closes its own loop instead — running the command, reading the failure, fixing, and re-running until it passes.

That's why the plan ended with a test command. After implementing, Claude runs it:

bash
pytest tests/test_user_email.py -q

If the suite is red, Claude reads the failure and iterates automatically. A build, a type-check, a linter, or even a screenshot diff all work the same way — any runnable signal that says "right" or "wrong" turns implementation from a hopeful one-shot into a self-correcting loop. For long unattended runs you can make the success condition explicit with /goal <condition> or a Stop hook.

This is also where the up-front exploration pays off: because the plan was correct, the implementation is mostly mechanical, and verification confirms it rather than rescuing it.

Watch out

No verifier, no closure

If you implement without a test or build to check against, Claude will hand you something that looks finished and may not work — and you'll spend the time you saved on planning hunting bugs by hand. Decide the verifier during the plan phase, not after the diff lands.

Phase 4 — Commit (commit + open a PR)

When the change is implemented and verified, hand the last mile to Claude too. Ask it to commit and open a pull request:

Commit this with a clear message and open a PR.

Claude writes a descriptive commit message, creates the commit, pushes the branch, and opens the PR (it uses the gh CLI under the hood for GitHub). The result is a reviewable unit of work with a real description — not a pile of uncommitted edits you have to summarize later from memory.

The payoff comes when you return to that work. A single change rarely ends at the first PR — review comments arrive, CI fails, follow-ups appear. You can resume the session linked to a PR with one flag:

bash
claude --from-pr 123

This reattaches Claude to the conversation that produced PR #123 (works with GitHub, GitLab, and Bitbucket; you can pass a number or the full PR URL). All the exploration and decisions from the original session are right there, so addressing review feedback doesn't start from a cold, contextless prompt.

Tip

Let the PR carry the context

Because Claude commits with a real message and opens the PR, the work is self-documenting and resumable. claude --from-pr <id> turns "reviewer asked for changes" into a one-command return to the exact session — no re-explaining what you were doing.

When to use it — and when to skip planning

This workflow is a tool, not a tax. Forcing a full plan on a one-line change is pure overhead; skipping it on a sprawling refactor is how you get a bad diff.

Skip the plan phase for small, clear fixes — the change is so obvious that there's nothing to misunderstand:

  • fixing a typo
  • adding a log line
  • a mechanical rename
  • a one-line config tweak

For these, just describe the change and let Claude make it. A plan would only slow you down.

Use the full workflow when the change is multi-file, uncertain, or in unfamiliar code — exactly the situations where Claude's mental model is most likely to be wrong and where a wrong guess is most expensive to unwind:

Skip planningUse the full workflow
Typo, log line, renameTouches several files at once
One obvious editYou're unsure how the pieces connect
You'd write it the same way yourselfUnfamiliar or legacy code
Trivial config changeHigh blast radius if it's wrong

The heuristic: plan when you'd want a design doc from a human. If a junior engineer could safely do the change without one, Claude can too.

Key insight

The workflow earns its keep on uncertainty

Its value scales with how wrong Claude could be. A trivial fix has almost no room for misunderstanding, so the plan adds nothing. A multi-file change in unfamiliar code has lots of room — which is precisely where reviewing a plan saves you a failed implementation.

One task per session: avoid the kitchen sink

The workflow assumes each session is about one coherent change. The fastest way to undermine it is the kitchen-sink session — fixing a bug, then drifting into a refactor, then asking an unrelated question, then starting a third feature, all in the same conversation.

Why it hurts: Claude's context window has a fixed budget, and everything competes for it. Old exploration from task one, a stale plan from task two, and unrelated file reads all crowd out the context that task three actually needs. As the window fills, quality degrades and Claude starts forgetting or conflating things across unrelated work.

The fix is one command: /clear between unrelated tasks. It empties the context so the next task starts clean, with a fresh, focused window. (Your prior conversation isn't lost — it's still resumable via /resume.)

So the real loop at the top level is: run Explore → Plan → Implement → Commit for one task, then /clear and start the next. Each task gets the whole workflow and the whole context window to itself.

Watch out

Unrelated work in one window degrades all of it

Mixing tasks doesn't just slow the new one — it pollutes the context for everything in the session. Treat /clear as the boundary between tasks, the same way you'd open a fresh branch. One session, one job.

Try it: Run all four phases on a multi-file change

Pick a small repo of yours with a test command, and choose a change that touches at least two files (e.g. add a field to a model and surface it through an endpoint, or add input validation in a route plus a helper). 1) Explore: enter plan mode with Shift+Tab (or /plan) and ask Claude to read the relevant files without editing — name the files or use @-mentions to aim it. 2) Plan: ask for a detailed step-by-step plan that ends with a test command. Read it critically and find at least one thing to correct in one sentence (a missed call site, a wrong module, a better test). Edit the plan with Ctrl+G if you like, then approve. 3) Implement: exit plan mode (Shift+Tab) and let Claude code; confirm it runs your verifier and iterates until it passes. 4) Commit: ask Claude to commit with a clear message and open a PR. 5) Reflect: note where the plan-phase correction saved you a redo, then run /clear before your next task. Bonus: tomorrow, resume with claude --from-pr <id> and make one small follow-up edit. The goal is to feel the cost asymmetry firsthand — a one-line plan fix versus a wrong implementation.

Key takeaways

  1. 1The recommended workflow is four phases: Explore (plan mode, read-only) → Plan (Claude drafts, you approve) → Implement (exit plan mode, code with a verifier) → Commit (commit + open a PR).
  2. 2Separating research from execution moves the checkpoint to text: catching a misunderstanding in the plan costs one sentence; catching it in the implementation costs a redo.
  3. 3Skip planning for small, clear fixes — typos, log lines, renames, one-line config — where there's nothing to misunderstand.
  4. 4Reach for the full workflow on multi-file, uncertain, or unfamiliar code, where a wrong guess is both likely and expensive.
  5. 5Let Claude commit and open the PR, then resume the linked session later with `claude --from-pr <id>` to handle review feedback with full context.
  6. 6Run the workflow on one task at a time and `/clear` between unrelated tasks — the kitchen-sink session bloats context and degrades quality.

Quiz

Lock in what you learned

Check your understanding

0 / 4 answered

1.What is the core reason the Explore → Plan → Implement → Commit workflow separates research from execution?

2.During the Explore phase, why is plan mode the right tool?

3.Which task is the best candidate for skipping the plan phase entirely?

4.You finished a task and Claude opened a PR. A reviewer requests changes the next day. What is the most efficient way to address them with full context?

Go deeper

Hand-picked sources to keep learning