CoachDiscoverMapCompareSavedAI LearningAI WeeklyAbout
← Back to Library
02 · Applied

The Claude Code Workflow

How Anthropic's agentic coding tool actually works under the hood — its loop, its building blocks, the canonical workflow, and how enterprises put it to work.

MODEL 01

It's an agent, not autocomplete

You hand it a goal, not line-by-line prompts. It reads files, runs commands, and loops on its own results until done.

MODEL 02

The harness is the product

The model reasons; Claude Code supplies the tools, context management, and execution environment that turn a model into a coding agent.

MODEL 03

You stay in the loop

Permission prompts, plan mode, and checkpoints keep a human in control — which is what makes autonomy safe on real codebases.

The agentic loop — gather, act, verify, repeat

One line: Every task runs the same cycle — Claude gathers context, takes an action with a tool, reads the result, and repeats until no more tool calls are needed.

Picture a capable colleague at your keyboard who narrates as they go. You say "fix the failing tests." Claude runs the tests to see what broke → reads the errorsearches for the relevant file → reads it → edits it → re-runs the tests to check. Each result tells it what to do next. Mechanically it's a simple rule: keep calling tools until the answer needs no more tools (engineers describe it as a while(tool_use) loop). A small fix might loop 8–12 times in under a minute; a big refactor chains dozens of steps and course-corrects along the way.

The three phases (they blend together)

Powered by two things

The key advance over Copilot-style tools is autonomy. You give it a goal, not a prompt per line, and it iterates on its own failures — gathering, acting, and verifying without you driving each step.

What Claude can see and touch — the working environment

One line: Run claude in a directory and it gains scoped access to your project, terminal, git state, and any extensions you've configured.

Unlike an inline assistant that only sees the file you're staring at, Claude Code sees the whole project — so when you say "fix the auth bug" it can search across files, read several to understand how they connect, make coordinated edits, run the tests, and commit. It works inside your real environment using your real tools, rather than in some opaque backend.

What it gets access to

CLAUDE.md and memory — persistent project context

One line: A markdown file in your project root that Claude reads at the start of every session — the highest-leverage thing you can set up.

Think of it as the onboarding doc you'd hand a new hire. Coding standards, architecture decisions, preferred libraries, the commands to build and test, a review checklist. Because Claude re-reads it each session, a good CLAUDE.md dramatically cuts how many back-and-forth iterations a task needs. There's also auto memory: Claude quietly saves learnings (like build commands and debugging insights) to a MEMORY.md as it works, and reloads them next time — so the project gets easier to work in over time.

Permission modes and checkpoints — the safety layer

One line: Claude asks before risky actions, you pick how much autonomy to grant, and every file edit is reversible.

A dial between "ask me everything" and "just go." Tap Shift+Tab to cycle modes. Before editing any file Claude takes a snapshot, so Esc Esc rewinds you to an earlier state — like a local undo separate from git. Actions that hit the outside world (databases, deploys, APIs) can't be checkpointed, which is exactly why Claude always asks before those.

The four permission modes

"Supervised autonomy" — decisions about what ships stay with the human. Plan mode isn't a limitation; it's what makes autonomous operation trustworthy rather than risky.

Skills · MCP · Hooks · Subagents — the extension layer

One line: Four ways to extend the core loop — add knowledge, connect tools, automate guardrails, and parallelize work.

If the loop is the engine, these are the bolt-ons. Skills are reusable playbooks ("how we review a PR") packaged as files Claude loads only when relevant. MCP is a universal adapter that lets Claude read a Jira ticket, a Google Doc, or a Slack thread as if they were built-in tools. Hooks are automatic triggers — "run the formatter after every edit," "lint before every commit." Subagents are disposable helpers with their own context window that go do one scoped job and hand back a summary, so deep digging doesn't clog the main conversation.

PrimitiveWhat it addsExample
SkillsPackaged repeatable workflows, loaded on demand/review-pr, /deploy-staging
MCPConnects external data/tools via an open standardRead Drive docs, update Jira, pull Slack
HooksShell commands before/after Claude's actionsAuto-format on edit; lint before commit
SubagentsIsolated context for delegated/parallel workOne reviews tests while another reads diffs
Subagents = quick parallel research within one task (fresh context, returns a summary). Agent teams = genuinely parallel workstreams (e.g. one agent on the backend, another on frontend tests), coordinated by a lead agent that assigns subtasks and merges results.

Context management — keeping the agent sharp

One line: The context window holds everything Claude is "thinking about"; as it fills, Claude prunes and compacts automatically — but early instructions can get lost.

The context window is the agent's desk — limited surface area. It holds the conversation, file contents, command outputs, CLAUDE.md, and loaded skills. When the desk fills, Claude first clears old tool outputs, then summarizes the conversation if needed (compaction). Your requests and key code survive; fine-grained instructions from early on may not — which is why durable rules belong in CLAUDE.md. Run /context to see what's eating space.

The "kitchen-sink session" — start one task, veer into an unrelated one, jump back, and now context is full of noise and quality drops. Fix: keep sessions focused, or start fresh (a new session begins with a clean window).

Sessions, resume and fork — continuity and parallelism

One line: Conversations are saved locally so you can resume, fork, or run several in parallel — each tied to a directory.

Every session is written to a local logbook (a plaintext file under ~/.claude/). That's what lets you resume tomorrow exactly where you stopped, or fork — branch off to try a different approach without disturbing the original thread. To run multiple Claudes at once without their edits colliding, give each its own folder via git worktrees. Sessions are independent: a new one starts fresh, which is why persistent rules live in CLAUDE.md, not chat history.

Explore → Plan → Code → Commit — the canonical workflow

One line: The most reliable results come from separating research from writing code — explore first, plan, then implement, then commit.

  1. Explore — Ask Claude to read the relevant code and understand it, without writing any code yet. Use plan mode (read-only).
  2. Plan — Have it produce a plan for the change. Review and refine it through conversation before approving.
  3. Code — Let it implement against the agreed plan, ideally with a test or screenshot to verify against.
  4. Commit — It stages changes, writes the commit message, and can open a PR with a structured description.

The habits that make it work

Jumping straight to code lets small misunderstandings compound. Forcing an explore-and-plan step surfaces the misunderstanding before any code is written — cheaper to fix a plan than a pile of edits.

Surfaces and execution environments — one engine, many doors

One line: The same agentic loop runs everywhere; what changes is where the code executes and how you interact. Your CLAUDE.md, settings, and MCP servers carry across all of them.

One brain, many doors into it. The terminal is the full-featured home base; the IDE extension (VS Code, JetBrains) adds inline diffs; the Desktop app runs several sessions side-by-side; the web and iOS app let you kick off long tasks and check back later. You can even start on the web and pull the task into your terminal with --teleport, or hand a terminal session to Desktop for visual diff review.

Execution environmentWhere code runsUse case
LocalYour machineDefault. Full access to your files and tools.
CloudAnthropic-managed VMsOffload long tasks; work on repos you don't have locally.
Remote ControlYour machine, driven from a browserUse the web UI while everything stays local.

Automation and team entry points

Enterprise use cases — real deployments and results

One line: The same loop powers fintech, e-commerce, dev tools, supply chain, telecom, and finance — at scales from dozens to tens of thousands of developers.

Ramp · Fintech

Org-wide adoption beyond engineering. A grassroots rollout where data teams query the Snowflake warehouse in natural language, and non-technical staff in sales, risk, finance, and recruiting pull insights without writing SQL.

Rakuten · E-commerce, 70+ businesses

Long autonomous runs on complex refactors. Used Claude Code to automate coding tasks across thousands of developers while holding enterprise-grade quality and security.

cubic · Dev tools

AI-native code review. Built review workflows on Claude to catch issues before merge, compressing development cycles.

Altana · Supply-chain AI

Building sophisticated AI/ML systems faster. Uses Claude Code to accelerate development of large-scale knowledge graphs for global supply chains.

Other patterns worth knowing

How to think about enterprise value

✦ Quiz — check your understanding (8 questions)

Pick an answer and hit "Check" to see if you've got it.

Question 1 of 8

What is Claude Code's core agentic loop?

Question 2 of 8

Where should durable project rules be written so they survive context compaction?

Question 3 of 8

Which permission mode is read-only and best suited for reviewing changes to production code?

Question 4 of 8

What does a Subagent do differently from the main agent in a Claude Code session?

Question 5 of 8

What is the key benefit of the Explore → Plan → Code → Commit workflow?

Question 6 of 8

What is "compaction" in Claude Code's context management?

Question 7 of 8

What does a Hook do in Claude Code?

Question 8 of 8

What does MCP (Model Context Protocol) do in the context of Claude Code?

🃏 Flashcards — tap any card to reveal the definition

16 key terms from this guide. Tap to flip.

Agentic loop
tap to reveal →
Gather context → take action → verify → repeat. Runs until no more tool calls are needed. The core of Claude Code.
← tap to flip back
Agentic harness
tap to reveal →
Everything around the model — tools, context management, execution environment — that turns an LLM into a coding agent.
← tap to flip back
CLAUDE.md
tap to reveal →
Project-root markdown file of standards, commands, and context — read at the start of every session. Use /init to generate a starter.
← tap to flip back
Auto memory
tap to reveal →
Learnings Claude saves itself (to MEMORY.md) and reloads across sessions — build commands, debugging insights — no writing required.
← tap to flip back
Plan mode
tap to reveal →
Read-only permission mode — Claude produces a plan for you to approve before making any change. Press Shift+Tab twice to activate.
← tap to flip back
Checkpoint
tap to reveal →
A pre-edit file snapshot taken automatically. Press Esc Esc to rewind. Local, separate from git; applies to file changes only.
← tap to flip back
MCP
tap to reveal →
Model Context Protocol — open standard to connect external data/tools (Jira, Drive, Slack) as native tools without bespoke integration per service.
← tap to flip back
Skill
tap to reveal →
A packaged, on-demand workflow Claude loads only when relevant — e.g. /review-pr or /deploy-staging. Keeps context clean until needed.
← tap to flip back
Hook
tap to reveal →
A shell command that runs automatically before or after Claude's actions — format-on-edit, lint-before-commit, type-check after any file change.
← tap to flip back
Subagent
tap to reveal →
A disposable helper with its own context window. Does one scoped job and returns a summary — keeps deep digging from clogging the main session.
← tap to flip back
Agent team
tap to reveal →
Multiple full agents on parallel workstreams — e.g. one on backend, one on frontend tests — coordinated by a lead agent that merges results.
← tap to flip back
Compaction
tap to reveal →
Auto-summarizing older context when the window fills. Steerable via /compact or a "Compact Instructions" section in CLAUDE.md.
← tap to flip back
Worktree
tap to reveal →
An isolated git checkout so parallel Claude sessions don't collide on edits. The Desktop app manages these visually.
← tap to flip back
Non-interactive mode
tap to reveal →
claude -p "…" — pipes Claude into CI, hooks, and scripts. Use --output-format json for programmatic parsing of results.
← tap to flip back
Routines
tap to reveal →
Scheduled recurring tasks on Anthropic-managed infra — morning PR reviews, overnight CI-failure analysis — run even when your machine is off.
← tap to flip back
Agent SDK
tap to reveal →
Library to embed Claude Code's loop in your own apps with full control over tools, permissions, and orchestration logic.
← tap to flip back