Claude Code Workflow: Explore, Plan, Build, Check

A Claude coding workflow that ships: set up CLAUDE.md, explore, plan in plan mode, build with a check to run, review, commit, and run parallel worktrees.

Josh Pocock8 min read

Claude Code workflow cover

AI Coding

Claude Code workflow

Stride AI Academy

A good Claude coding workflow is a loop of four steps: explore the code, plan the change, build it with a check Claude can run, then review and commit. Around that loop you need two things: a short CLAUDE.md that tells Claude what it can't see in the code, and a separate git worktree for each piece of work you run in parallel. That's the whole system. The rest is commands.

This guide walks through each step with the exact commands, then shows how to run several sessions at once. Everything here was checked against Claude Code's guidance on getting good results, permission modes, worktrees, memory and commands docs on November 22, 2026.

Step 0: set up CLAUDE.md once

Claude Code loads CLAUDE.md into every session. Anthropic's guidance page says it works best when it only holds what Claude can't work out from the code: the exact test, typecheck and lint commands, places where the code is misleading, decisions that aren't written down anywhere, and anything you've had to correct twice.

Run /init to generate a starting file, then cut it down. The memory docs suggest staying under 200 lines. A file that passes that test looks like this example from the docs:

Markdown
# Commands
- Install: pnpm install
- Run one test file: pnpm vitest run path/to/file.test.ts
- Typecheck: pnpm tsc --noEmit

# Conventions
- Use the error helpers in src/lib/errors.ts, never throw raw strings

# Gotchas
- Integration tests need DATABASE_URL set, see .env.example

The shared-file setup we use

Our site owner's repos keep the shared agent instructions in AGENTS.md, so Claude Code, Codex and other agents read the same rules. Each repo also has a CLAUDE.md that imports it with one line:

Markdown
@AGENTS.md

The memory docs document this exact pattern: Claude reads the imported file first, then anything you add below the import. We compare the options in AGENTS.md vs CLAUDE.md, and there are more starter files in CLAUDE.md file examples.

Step 1: explore

Start by asking questions, not by asking for code. Point Claude at the area you're about to change and have it explain how it works today:

How does checkout handle expired cards? Read src/payments/ and explain the flow before we change anything.

Anthropic's guidance page says broad codebase searches go to the built-in Explore agent, a subagent that keeps the search noise out of your main conversation. You don't need to set it up.

If you don't know exactly what you want yet, the docs suggest letting Claude interview you:

I want to add rate limiting to the public API but haven't thought it through yet. Interview me until you could write the spec, then write it to SPEC.md.

Step 2: plan in plan mode

Plan mode has Claude read files, run commands to explore and write a plan, without editing your source. The permission modes docs give three ways in:

  • Press Shift+Tab to cycle to plan mode
  • Start one prompt with /plan, such as /plan fix the auth bug
  • Start the session in it:
Terminal
claude --permission-mode plan

When the plan is ready, press Ctrl+G to open it in your editor and change it yourself. Then pick one of the approval options:

  • Yes, and use auto mode: approve and let Claude build without stopping for routine approvals
  • Yes, manually approve edits: approve and review each edit
  • No, keep planning: stay in plan mode and say what to change

The costs docs make the case for this step: planning first prevents expensive re-work when the first direction is wrong. Our Claude Code plan mode guide covers it in more depth.

If you wrote a SPEC.md in step 1, Anthropic's guidance page suggests starting a fresh session to build from it, so the build begins with a clean context and a written definition of done.

Step 3: build with a check to run

The single most useful thing in this whole workflow is a check that comes back pass or fail. Anthropic's guidance page puts it plainly: if Claude has nothing to run, "looks done" is all it has to go on. With a test, a build, a linter or a screenshot to compare, Claude makes the change, runs the check, reads the output and fixes what broke.

You can set the check at different strengths:

How strict How
In the prompt run the auth tests after, and keep going until they pass
As a goal /goal all tests in tests/auth pass and lint is clean
Enforced A Stop hook that blocks the turn until your script passes

Whichever you use, ask for evidence: the command Claude ran and its output. The docs note that "All tests pass" on its own tells you very little.

Steer while it builds

  • Press Esc to stop Claude the moment it drifts.
  • Type a correction and press Enter without stopping it. Claude reads it after its current tool calls.
  • Run /rewind, or press Esc twice, to roll the code and conversation back to an earlier point.

The docs add one rule worth keeping: after two failed corrections, run /clear and write a better prompt instead of a third.

Step 4: review with fresh eyes

The person who wrote the code is the worst reviewer of it, and that holds for Claude too. Run a review in a context that never saw how the code was written:

/code-review

The commands reference says /code-review reviews the current diff for correctness bugs. Pass --fix to have Claude apply the findings, or --comment to post them on a GitHub pull request. /review is an alias.

To review against your plan instead of hunting for general bugs, the docs suggest a prompt like this:

use a subagent to review the rate limiter diff against SPEC.md, check every requirement is implemented and the listed edge cases have tests, report gaps that affect correctness and skip style

Keep the skip style part. The docs warn that a reviewer asked to find problems will always find something. Our Claude Code review guide covers the other review options.

Step 5: commit and open a pull request

Ask Claude to commit when the check passes and the review is clean. The how-it-works docs say Claude Code ships with built-in commit and pull request instructions, so a plain request works:

commit this with a clear message, push the branch and open a pull request

Then /clear before the next task. The docs say it costs nothing and stops the next task paying for the last one's history.

Run several sessions in parallel with worktrees

Once one loop works, run more than one. Each session needs its own copy of the files so the edits can't collide. That's what a git worktree is: a separate folder with its own branch, sharing the same repository history.

Start a session in a new worktree:

Terminal
claude --worktree feature-auth

The worktrees docs say this creates .claude/worktrees/feature-auth/ on a new branch named worktree-feature-auth. Run the same command with a different name in another terminal for a second isolated session. Add .claude/worktrees/ to your .gitignore.

A worktree is a fresh checkout, so gitignored files like .env aren't there. List the ones you need in a .worktreeinclude file at the repo root, using .gitignore syntax:

.env
.env.local

This is how our site owner runs parallel work: each session works in its own git worktree on its own branch, then opens a pull request, and a person reviews and merges it. No session merges its own work. That last step matters. Anthropic's guidance page lists "a person who approves the merge" as the deterministic last word, as opposed to Claude's own summary of what it did.

When you exit an interactive worktree session, Claude Code removes the worktree if there's nothing in it, and asks what to do if there is. For more, see our Claude Code worktrees guide.

For one large mechanical change across many files, the commands reference describes /batch, which splits the work into 5 to 30 units, shows you the plan, then runs each unit in its own worktree.

The whole workflow on one page

Step What you do Command
Set up Short CLAUDE.md with test and lint commands /init
Explore Ask how the code works now plain prompt
Plan Review and edit the plan Shift+Tab, /plan, Ctrl+G
Build Give Claude a check to pass prompt, /goal, or a Stop hook
Steer Stop, correct or roll back Esc, /rewind, /clear
Review Fresh-context review /code-review
Ship Commit and open a pull request plain prompt
Parallel One worktree per task claude --worktree <name>

For the features behind each step, start with our Claude Code guide.

Learn to build with Claude Code

The Stride AI Coding course teaches Claude Code and Codex for building client tools, written for non-programmers, with weekly live calls to review your builds. Many of the free guides cover Claude Code setups, and the Claude Code community is where members compare theirs.

FAQ

What is the best Claude Code workflow?

Explore, plan, build, check. Ask Claude how the code works, plan in plan mode, build with a test or build Claude can run, review in a fresh context with /code-review, then commit. Keep a short CLAUDE.md with your test commands.

How do I use plan mode in Claude Code?

Press Shift+Tab to cycle to plan mode, start a prompt with /plan, or launch with claude --permission-mode plan. Claude explores and writes a plan without editing your source. Press Ctrl+G to edit the plan before you approve it.

How do I run multiple Claude Code sessions at once?

Start each one in its own git worktree with claude --worktree <name>. Each worktree has its own files and branch, so parallel sessions can't overwrite each other's edits.

Should Claude Code review its own code?

Use a fresh context for review. /code-review reviews the diff in a subagent that never saw your conversation, so it isn't swayed by the reasoning that produced the code. A second session works the same way.

When should I use /clear?

Between unrelated tasks, and after two failed corrections on the same problem. It starts a new conversation with empty context. Pass a name, such as /clear oauth-migration, to find the old session later with /resume.

What should go in CLAUDE.md for this workflow?

The commands Claude needs to check its work, such as test, typecheck and lint, plus gotchas the code doesn't show. Leave out architecture Claude can read from the repo, and keep the file under 200 lines.

Build it with us in Stride AI Academy

Four courses, weekly live calls and a community of people building and selling AI. Or start with 320+ free guides.

Keep reading

Free AI Coding guides