Module 4: The agentic workflow: Explore → Plan → Code

Module 4: The agentic workflow — Explore → Plan → Code

Module 4: The agentic workflow — Explore → Plan → Code

Overview

You installed Claude Code. You configured your CLAUDE.md. Your agent already has memory and context about your project. Now comes the question that separates casual users from professionals: how do you actually work with Claude Code effectively?

This module teaches the agentic workflow — the Explore → Plan → Code cycle that defines how professionals work with a coding agent. It isn't a theoretical framework: it's how Claude Code is designed to operate, and mastering the cycle is the difference between mediocre results and production-grade ones.

Most people open Claude Code, type a prompt, and wait for magic. That works for trivial tasks. But when the project is real — with dependencies, conventions, tests, and existing architecture — you need a structured workflow. Explore → Plan → Code is that workflow.


Where you are in the guide

Module 01: What Claude Code is ✅
Module 02: Installation and setup ✅
Module 03: CLAUDE.md and memory ✅
Module 04: Agentic workflow ← YOU ARE HERE
Module 05: Skills and Hooks
Module 06: Subagents
Module 07: Integrations (Git, SDK, Remote Control)
Module 08: Capstone project

In the first three modules you understood what Claude Code is, installed it, and configured its memory system. Now you move from configuring to using. This module is the operational heart of the guide: everything that comes after (skills, hooks, subagents) runs inside this workflow.


Module objectives

By the end of this module, you'll be able to:

  • ✅ Use Claude Code's 3 modes: Explore (read-only analysis), Plan (design without execution), and Agent/Code (full execution)
  • ✅ Apply the Explore → Plan → Code cycle on real projects
  • ✅ Hold effective multi-turn conversations (iterate and refine across several messages)
  • ✅ Manage the context window (understand compaction, spot degradation signals)
  • ✅ Decide when to start a new session vs continue the current one
  • ✅ Use the /effort parameter to control reasoning depth

The core mental model

Claude Code is not a chatbot. It's an agent with a defined workflow.

That distinction is critical. A chatbot takes a message, generates a reply, and waits for the next message. Claude Code does something radically different:

  1. Reads your codebase — files, dependencies, configuration, tests
  2. Runs commands — terminal, scripts, ecosystem tooling
  3. Writes code — creates files, modifies existing code, generates tests
  4. Iterates — refines the solution based on feedback, errors, and results

Which means how you give instructions matters as much as the instructions themselves. You aren't "chatting" — you're directing an agent that has full access to your development environment.

A precise analogy

Think of Claude Code as a senior developer who just joined your team. You don't say "build feature X" with no context. First you ask them to explore the codebase, then to propose a plan, and finally to implement. That's exactly the Explore → Plan → Code cycle.

The most common mistake

Most users do this:

> "Add authentication to my app"

A professional does this:

Step 1 (Explore): "Analyze the current structure of the project.
What framework is used? Is there any existing auth system?
How are protected routes handled?"

Step 2 (Plan): "Based on what you found, design a plan
to add JWT authentication. Don't implement anything yet,
just give me the plan."

Step 3 (Code): "Implement the plan. Start with the auth
middleware."

The second approach produces dramatically better results because Claude Code understands the context before it acts.


Why this workflow exists

The Explore → Plan → Code cycle isn't a teaching invention. It reflects how Claude Code works internally and how Anthropic's engineering teams designed the tool to be used.

The problem it solves

When you give Claude Code a direct instruction ("add X"), the agent has to do everything at once: understand the context, design the solution, and implement it. That works if the task is trivial. But if the task is complex, the agent makes implicit design decisions — without consulting you — and the result comes down to luck.

With the Explore → Plan → Code workflow, you split the decisions into phases:

PhaseDecisions made
ExploreWhat exists? What patterns are used? What constraints are there?
PlanHow should we implement it? What options are there? What are the trade-offs?
CodePure implementation — the design decisions are already made

Each phase removes uncertainty. By the time you reach Code, Claude knows exactly what to do and how.

The evidence

Anthropic's internal data and the Claude Code community consistently report:

  • Sessions that start with Explore produce fewer corrective iterations
  • Plans reviewed before implementing reduce post-implementation refactoring
  • Using the right /effort reduces context window consumption on simple tasks

It isn't dogma — it's measurable efficiency.

When you don't need the full cycle

Not everything requires Explore → Plan → Code. These situations justify going straight to Code:

  • Typo fix: "Change recieve to receive in file X"
  • Boilerplate: "Create a User model with name, email, and created_at"
  • Execution: "Run npm test and show me the results"
  • Simple question: "What version of Python does this project use?"

The practical rule: if the task requires design decisions, use the cycle. If it's mechanical, go straight in.


Claude Code's 3 modes

Claude Code operates in three distinct modes. Each has a specific purpose:

Explore (read-only analysis)

  • What it does: Reads files, analyzes architecture, looks for patterns. It doesn't execute or write.
  • When to use it: Starting a project, before making changes, to understand somebody else's code.
  • How to activate it: Ask Claude to analyze, explore, or understand without asking for changes.
  • Subagent: Claude Code has a built-in Explore subagent that operates in read-only mode.

Plan (design without execution)

  • What it does: Proposes changes, creates implementation plans, suggests architecture. It doesn't execute.
  • When to use it: Before implementing complex features, refactors, migrations.
  • How to activate it: Use /plan, press Shift+Tab, or explicitly ask it to plan without implementing.
  • Output: A structured plan you can review, modify, and approve before anything runs.

Agent/Code (full execution)

  • What it does: Reads, writes, runs commands. It's the default mode.
  • When to use it: Implementation, bug fixes, writing tests, creating files.
  • Permissions: Claude asks for confirmation before running commands and editing files.

These three modes aren't separate features — they're phases of a cycle. Capsule 02 covers them in depth with practical examples.

Quick view: the flow of the 3 modes

┌─────────────────────────────────────────────────────────────┐
│                                                             │
│  EXPLORE            PLAN               CODE                 │
│  ┌────────────┐     ┌────────────┐     ┌────────────┐       │
│  │ Read       │     │ Design     │     │ Implement  │       │
│  │ Analyze    │────▶│ Propose    │────▶│ Execute    │       │
│  │ Understand │     │ Compare    │     │ Write      │       │
│  └────────────┘     └────────────┘     └────────────┘       │
│       ▲                                       │             │
│       │             ITERATE                   │             │
│       └───────────────────────────────────────┘             │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Each mode has different permissions:

ModeReads filesWrites filesRuns commands
Explore✅❌❌
Plan✅❌❌
Agent/Code✅✅✅

Explore and Plan are safe by design — they can't modify anything. Agent/Code has full access but asks for confirmation on potentially destructive actions.


Prerequisites

Required knowledge:

  • ✅ Module 03 completed (CLAUDE.md configured in your project)
  • ✅ Claude Code installed and working (Module 02)
  • ✅ Basic familiarity with the terminal

For the practice:

  • ✅ A real project to practice on (the one you set up with CLAUDE.md in Module 03)
  • ✅ At least 10-15 files in the project (so Explore has something to chew on)

Quick check:

Before continuing, make sure you can answer these questions:

  1. What is CLAUDE.md and what is it for?
  2. What are the 4 official CLAUDE.md scopes?
  3. Where does CLAUDE.local.md live, and why?
Answers
  1. CLAUDE.md is the persistent memory file where you define conventions, tech stack, and project rules. Claude Code reads it at the start of every session.
  2. 4 official scopes: Managed policy (organization) → Project (./CLAUDE.md or ./.claude/CLAUDE.md) → User (~/.claude/CLAUDE.md) → Local (./CLAUDE.local.md). On top of that, .claude/rules/ allows modular rules with path-specific frontmatter. Conceptually there are 6 pedagogical levels of precedence (including training data and the system prompt).
  3. In the project root, next to CLAUDE.md. It goes into .gitignore because it holds personal preferences you don't share with the team. Alternatively, ~/.claude/CLAUDE.md (User scope) holds preferences that apply across all your projects.

If you're not ready:

Review these first:

  • Module 02: Installation and setup
  • Module 03: CLAUDE.md and the memory system

Module roadmap

This module has 5 progressive capsules:

Capsule 01 — Module introduction (this capsule)

Context, mental model, and roadmap. You understand why the workflow matters.

Capsule 02 — Explore, Plan, and Code

The three modes in depth. How to activate each one, when to use them, and how to combine them. The /effort parameter for controlling reasoning depth. Practical examples and exercises.

Capsule 03 — Multi-turn conversations

How to iterate with Claude Code across several messages. Incremental refinement techniques, how to give effective feedback, and patterns for productive conversations. The difference between one-shot prompts and multi-turn conversations.

Capsule 04 — Context window and compaction

Claude Code's context window (up to 1M tokens with Opus 5 and Sonnet 5). What compaction is, when it happens automatically, degradation signals, and strategies for managing context on large projects.

Capsule 05 — When to start a new session

The signals that tell you to start fresh. How to preserve what matters when you restart. Strategies for long vs short sessions. The "context poisoning" rule.

Progression map

Capsule 01 (this one) → Mental model and context
Capsule 02            → The 3 modes in depth + /effort
Capsule 03            → Multi-turn: iterating effectively
Capsule 04            → Context window: the finite resource
Capsule 05            → When to restart: the invisible skill

Difficulty: ⭐ ──────────────────────────▶ ⭐⭐⭐

The first two capsules are foundational — you understand and practice the modes. Capsules 03-05 are intermediate — they optimize how you use the workflow in real working sessions.


What you'll build in this module

Across the 5 capsules, you'll practice the full workflow on your real project:

  1. Explore your codebase with Claude Code in Explore mode
  2. Plan a feature or improvement using Plan mode
  3. Implement the plan using Agent mode
  4. Iterate in a multi-turn conversation to refine it
  5. Manage the context window during a real session

By the end of the module, you'll have run a complete Explore → Plan → Code cycle from start to finish.


Connection to the capstone project

In Module 08, you'll build a complete CLI tool using Claude Code. The workflow you learn here is exactly the one you'll apply:

  1. Explore: Analyze the initial CLI project template
  2. Plan: Design the commands, the structure, and the architecture
  3. Code: Implement command by command
  4. Iterate: Refine each command with multi-turn conversations
  5. Manage context: Know when to start new sessions during a multi-session project

The Explore → Plan → Code workflow isn't just for this module — it's the methodology you'll use in all your professional work with Claude Code.


Key concepts you'll see

The Explore → Plan → Code cycle

The central workflow. It isn't linear — it's iterative. Sometimes you go back to Explore after Code. Sometimes you go Explore → Code directly for bug fixes. You'll learn when to use each variation.

Multi-turn conversations

Claude Code isn't for one-shot prompts. Conversations of 10, 20, even 50 messages are normal on a real project. You'll learn how to keep those conversations productive.

A finite context window

Even with 1M tokens (Opus 5 and Sonnet 5), the context window fills up. When it fills, Claude compresses it (compaction). When that compression degrades quality, you need a new session. Reading those signals is a professional skill.

Effort level (Opus and Sonnet)

Claude Code supports several effort levels that control how much the model reasons before it answers. The available levels depend on the model:

LevelUseAvailable
lowRoutine tasks, direct answers✅
mediumSpeed/depth balance✅
highDeep reasoning, intelligence-sensitive work (default)✅
xhighVery deep, recommended for coding/agentic✅
maxMaximum depth, no thinking-token cap✅

Default: high on the models that support effort (Opus 5, Sonnet 5, Fable 5); xhigh is the one recommended for coding/agentic. Haiku 4.5 doesn't expose a configurable effort.

You set it with /effort, inside /model with the ← → arrows, in settings (effortLevel), or via an env var (CLAUDE_CODE_EFFORT_LEVEL). You'll learn to use it in capsule 02.

When to start a new session

This is probably the most underrated skill. Staying in a degraded session produces worse code than starting from scratch. You'll learn the exact signals.


A real day with the workflow

So you can picture how it all fits together, here's a real scenario from a 2-hour working session:

9:00 — New session, new feature

You open Claude Code in your project. You need to add a search endpoint with filters.

> Analyze the products module. How are the current endpoints
  implemented? Is there a query pattern? Is there
  pagination?

Claude explores and gives you a full map. You discover there's basic pagination but no filters.

9:10 — Plan

/plan Design a GET /api/products/search endpoint with filters
by name, category, min/max price, and sorting. It should
use the pagination that already exists.

Claude produces a 5-step plan. You review it, ask for a tweak to the price handling, and approve.

9:20 — Incremental implementation

> Implement step 1: the search schema with the filters.
> Now step 2: the query in the service layer.
> Step 3: the endpoint in the router. Run tests afterward.

9:50 — Verification

> Review the full implementation. Do the tests cover every
  filter? Are there edge cases with negative prices or empty
  strings?

Claude spots that there's no validation for negative prices. You fix it.

10:00 — Commit and next task

> Commit with a descriptive message.

You start the next task with a fresh Explore → Plan → Code cycle. The context window carries the previous session, which helps Claude stay coherent.

This flow — Explore, Plan, Code, Verify, Commit — repeats throughout the session. It's the unit of work with Claude Code.


Versions and compatibility

This module covers:

  • Claude Code 2.0+
  • Opus 5 (1M token context window)
  • Sonnet 5 (1M token context window)
  • Haiku 4.5 (200K context window)

Features covered:

  • ✅ Explore mode (built-in subagent)
  • ✅ Plan mode (/plan command or Shift+Tab)
  • ✅ Agent mode (default mode)
  • ✅ Auto mode (permission classifier — research preview, March 2026)
  • ✅ Effort level (low, medium, high, xhigh, max — works on Opus 5 and Sonnet 5; xhigh is Opus 5 only)
  • ✅ Automatic compaction + PreCompact / PostCompact hooks
  • ✅ Session recap when resuming sessions (--resume, --continue)
  • ✅ Multi-turn conversations

A note on change:

Claude Code ships an update roughly every 2 days (~35 releases in 7 weeks, January-February 2026). The concepts and the workflow we teach are stable — Explore, Plan, and Code modes are fundamental to Claude Code's architecture. UI details can change; the principles don't.


Summary

This module is the operational heart of the guide. We move from "configuring Claude Code" to "working with Claude Code."

What you learned in this capsule:

  • Claude Code isn't a chatbot — it's an agent with a defined workflow
  • The Explore → Plan → Code cycle is how professionals work
  • There are 3 modes: Explore (read-only), Plan (design), Agent/Code (execution)
  • Multi-turn conversations are the norm, not the exception
  • The context window is finite and you have to manage it
  • /effort controls reasoning depth

Next capsule: 02 - Explore, Plan, and Code — the three modes in depth, with practical examples and exercises.


Additional resources

Official documentation

Subagents and modes

  • Sub-agents — Documentation for the built-in subagents (Explore, Plan)
  • CLI Reference — Every available command and flag

Context and memory

  • Memory — The memory system and CLAUDE.md
  • Settings — Configuring scopes and preferences