Anthropic ยท Claude ยท Guide

How to Use Claude Code Properly: The Workflow That Works

The recommended Claude Code workflow: explore the codebase first, plan in plan mode, then implement step by step. Best practices that prevent rewrites.

The most effective way to use Claude Code is to separate exploration, planning, and implementation. Start in plan mode (press Shift+Tab), let Claude read the relevant files, build a plan together, then switch out of plan mode and execute step by step. This workflow prevents the most common failure: Claude jumping straight to code and taking the project in a direction you did not want.

Claude Code does not impose any workflow, so most people use it like autocomplete: ask, watch it code, stop it, revert, try again. Frustrating, and expensive in tokens. The Explore, Plan, Code, Commit loop below is what consistently produces better results, as of July 2026.

TL;DR:

  1. Start in plan mode (Shift+Tab)
  2. Explore first: have Claude read files and understand the codebase
  3. Plan thoroughly: use thinking modes for complex problems
  4. Switch to implementation (Shift+Tab)
  5. Execute the plan step by step

What is the recommended Claude Code workflow?

Explore, Plan, Code, Commit. Anthropic describes this pattern in its own engineering guidance, and it maps to four distinct phases:

  1. Explore. In plan mode, point Claude at the files, folders, or docs that matter. It reads, you both build shared context.
  2. Plan. Still in plan mode, ask for an approach. Challenge it. Iterate until the plan matches your intent.
  3. Code. Switch modes and let Claude implement the agreed plan, verifying each piece as it goes.
  4. Commit. Review the diff, run the tests, commit.

The phases matter because they fix different failure modes. Exploration prevents architectural conflicts with the existing code. Planning prevents expensive rewrites. Step-by-step execution keeps the implementation honest to the plan.

How do you explore a codebase with Claude Code?

Read first, code never. Begin by creating a CLAUDE.md file with /init; Claude reads it at the start of every session. When that is not enough, direct its attention explicitly:

Read the authentication files and database schema before we fix [your problem]

Guiding Claude to a specific folder, file, or even a second repository gives it the context to suggest solutions that fit your existing patterns instead of fighting them.

How do you plan effectively in Claude Code?

Claude excels at high-level thinking when you give it time and push back. Ask for a plan, then interrogate it: "What do you think of...", "Why not do it like...", or, when you feel strongly, "Do it this way."

Pro tip 1: Ask for clarification

Ask me any questions before you start about anything that's not concrete and specific enough in the plan.

Pro tip 2: Use a plan.md file

For long tasks, or when you worry about running out of context, have Claude write the plan to disk:

Write your plan in a `plan.md` file with:

1. **Architecture Plan** - tech stack, key decisions, and why
2. **Structured Todo List**
   Break down the implementation into the smallest atomic units that allow it to run without input
   - Phase 1: ...
   - Phase 2: ...

Be specific and actionable. This plan will guide the entire implementation.

Pro tip 3: Manage context length

Treat the context window as a budget, not a container. You get roughly 100,000 good tokens per session (check the balance with /context), and everything spends from it: CLAUDE.md, every MCP tool definition, every file Claude reads, every command's output, and the conversation itself. Count tokens, not percentages: a percentage is measured against whatever window the vendor advertises, and the point where quality drops barely moves when that window grows. Once a long brainstorm has spent the budget, write the plan to plan.md and restart. The new session reads the file and starts fresh on a full budget. Our guide to scaling AI development goes deeper on why advertised context is not usable context.

Pro tip 4: Use thinking modes for complex planning

The keywords think, think hard, think harder, and ultrathink allocate progressively larger reasoning budgets, and they change color in the interface when active. Use think for routine decisions and save ultrathink for genuinely hard architectural calls. They cost tokens, so do not use them on simple tasks. Our guide to extended thinking mode covers when each level pays off.

How do you execute the plan?

Switch out of plan mode (Shift+Tab) and hand over execution:

Now implement it according to your plan. Verify each piece as you go.

If the plan lives in a file or you restarted the session:

Implement `plan.md`. Verify each piece as you go.
At each step, update `plan.md` with notes about what's completed,
key decisions made, and where to resume if this session crashes.

With a solid plan, Claude focuses purely on execution instead of designing and building at the same time. You can even run the same workflow away from your desk through the Claude Code GitHub Action.

Plan Mode Mastery

Plan mode enforces read-only behavior: Claude literally cannot edit files while it is on. That is far more reliable than prompting "don't edit files", which sometimes fails.

When you are in plan mode:

  • Claude can read files and analyze code
  • Claude can research and explore your codebase
  • Claude can create detailed plans and think through problems
  • Claude cannot edit, create, or delete files
  • Claude cannot run commands that modify your system

The loop is simple: Shift+Tab into plan mode, develop the plan together, Shift+Tab out, execute.

What mistakes should you avoid?

  1. Jumping straight to code. Explore first; the ten minutes of reading saves an hour of reverting.
  2. Skipping plan mode on complex tasks. If the change spans multiple files, plan it.
  3. Overusing thinking modes. ultrathink on a one-line fix burns budget for nothing.
  4. Working in a messy directory. Uncommitted changes make diffs unreadable and reverts painful.
  5. Blaming the model before checking the basics. If Claude suddenly seems worse, rule out context bloat and outages first; our page on whether Claude is getting dumber explains how to tell real degradation from a bad day.

FAQ

Do I need plan mode for every task?

No. For a rename, a small bug fix, or a well-specified one-file change, the default mode is faster. Plan mode earns its overhead when the task involves multiple files, architectural decisions, or ambiguity about what you actually want.

How do I stop Claude Code from wasting tokens?

Three habits: plan before coding so you implement once instead of three times, keep thinking modes for hard problems only, and treat the context window as a budget of roughly 100,000 good tokens, restarting with a plan.md handoff once it is spent. Rework is the biggest token sink, and planning is what eliminates rework.

What if Claude Code starts throwing errors mid-session?

Interruptions like "tool result could not be submitted" or 529 overload errors are usually transient infrastructure issues, not something you caused. Our guide to Claude error messages explains what each one means and the fixes that work.