Claude · 06 · Part 3

Claude Code — A Different Way to Develop

Chapter 3 gave the general anatomy of a coding agent. This page shows that anatomy in one real product: what sits between you and the model, which tools it can call, how it understands a repository without reading all of it, where your permission is asked, how context survives a long session, and how Git fits in. It closes with an honest comparison against IDE-based assistants.

5
Tool categories
6
Permission modes
1
Real CLI check
Information current as of: 2026-10-30 — local CLI checked: Claude Code 2.1.314
01
Chapter One · What and Why

An Agent That Lives Where Your Code Lives

Anthropic describes Claude Code as an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools, available in the terminal, IDE, desktop app and browser (Source 1). The docs summarise the product with a contrast: unlike inline code assistants that only see the current file, Claude Code sees your whole project, so it can search for relevant files, read several of them, make coordinated edits, run tests, and commit if you ask (Source 2).

Why it exists follows from Chapter 2: in chat the developer is the courier between model and machine. An agent that runs where the code lives removes the courier. Press coverage dates the first public preview to 24 February 2025 (see Chapter 2, Source 4); Anthropic's current documentation no longer labels it a preview. Beyond that, this page does not speculate about Anthropic's motives, since no official statement of them was read.

One engine, many surfaces. The overview states that each surface — terminal, VS Code, JetBrains, desktop, web — connects to the same underlying Claude Code engine, so your repository's CLAUDE.md files, settings and MCP servers work across all of them (Source 1).
02
Chapter Two · The Big Picture

Architecture: Developer, Harness, Model, Machine

Claude Code is the layer around the model that provides the tools and manages the context the model sees — the harness (Source 2). The model never touches your machine directly. It asks the harness to call a tool, the harness checks permission, runs it, and returns the result as new context.

Claude Code architecture — who talks to whom
Developer prompt, approve, review diffs CLAUDE CODE · the harness Context managerhistory · CLAUDE.md Tool runnerRead · Edit · Bash Extensionsskills · hooks · MCP Checkpointssnapshot before edits Claude modelvia API or a provider context + prompt tool requests tool calls PERMISSION GATE · mode + allow / ask / deny rules Terminalbuild · test · git Filesystemsource · config · docs Git repositorybranch · diff · commits

Compare this with the generic six-part diagram in Chapter 3: instructions and context are the context manager, tools are the tool runner, the execution environment is your terminal, filesystem and repository, and the feedback loop is the arrow carrying every tool result back to the model. The permission gate is the part that makes it safe to let the loop run.

03
Chapter Three · Understanding a Codebase

Exploring on Demand, Not Memorising Everything

A repository can be far larger than any context window, so Claude Code does not load it. It explores: it searches for files and content, reads the ones that matter, and follows what it finds — the "gather context" phase of the loop (Source 2). The documentation's recipes for a new project start broad and narrow down:

Prompts from the common-workflows page (typed inside a Claude Code session)
give me an overview of this codebase explain the main architecture patterns used here how is authentication handled? trace the login process from front-end to database
  • Point at files with @. Typing @path includes a file's content directly when it fits the Read tool's limit, 25,000 tokens by default; a text file over 256KB is not included. A directory reference adds a listing, not contents (Source 3).
  • Language-aware navigation is optional. The LSP tool provides go-to-definition, find-references and type errors, but is inactive until you install a code-intelligence plugin for your language (Source 4). For a typed language such as Java this can replace several text searches with one lookup.
  • Delegate wide exploration. Asking Claude to "use a subagent to investigate" keeps the many file reads in the subagent's own context window and returns only a summary (Source 3).
Exploration can be wrong. Because the agent reads selectively, it can miss a relevant file and then confidently describe the part it saw. Ask it to name the files it based an answer on, and spot-check them.
04
Chapter Four · Reading, Writing and Running

The Built-In Tools

Tool names are the exact strings used in permission rules, subagent tool lists and hook matchers (Source 4). These are the ones you meet first:

ToolWhat it doesAsks permission by default?
ReadReads file contents.No
EditMakes targeted edits to specific files.Yes
WriteCreates or overwrites files.Yes
Grep / GlobSearch file contents by pattern / find files by pattern. The reference lists both as absent by default on macOS, Linux and WSL, so check that page for how search is provided on your platform.No
BashExecutes shell commands in your environment — build tools, git, test runners.Yes
WebFetch / WebSearchFetch a URL / search the web.Yes
AgentSpawns a subagent with its own context window.No
SkillRuns a skill in the main conversation.Yes
EnterPlanMode / ExitPlanModeSwitch to planning, then present a plan for approval.No / Yes

The reference lists many more (task tracking, scheduling, MCP resource access, worktrees and others), grouped in the docs into five capability categories: file operations, search, execution, web and code intelligence (Source 2).

Running tests is just another tool call
Model Permission Bash Your repo run: mvn test allowed → execute builds, runs tests failure output returns as context Edit the file, then run the tests again

Notice what is not special about tests: there is no built-in test runner. Claude runs whatever your project already runs (for a Spring Boot project, Maven or Gradle through Bash) and reads the output. That is why a project with fast, trustworthy tests is the best environment for an agent.

05
Chapter Five · Context

How Claude Code Remembers — and Forgets

MechanismWhat it doesSource
Fresh sessionsEach new session starts with an empty context window; sessions are independent.2
CLAUDE.mdYour instructions, loaded every session. Treated as context, not enforced configuration.5
Auto memoryNotes Claude saves itself; the first 200 lines or 25KB of its MEMORY.md load each session.2, 5
TranscriptsEach message, tool use and result is stored as plaintext JSONL under ~/.claude/projects/, enabling resume and fork.2
Resume / forkclaude --continue or --resume reopens a session; --fork-session or /branch copies it into a new ID.2
CompactionNear the limit the conversation is summarised; detail from early on can be lost, so put persistent rules in CLAUDE.md. /compact accepts a focus.2
Inspecting/context shows what is using space.2
What loads, and when
CLAUDE.mdfull text, every request Skillsdescriptions always · full text only when used MCPtool names always · schemas on demand Subagentsown window · only a summary comes back Hookszero, unless the hook returns output

The diagram restates the loading table from the extension guide (Source 6). Solid fill means "occupies your context"; dashed means "not until needed". Chapter 10 covers each mechanism in depth.

06
Chapter Six · Permissions

Who Decides What Runs

Press Shift+Tab to cycle permission modes. The docs list six (Source 7):

ModeRuns without askingIntended for
Manual (default)Reads only; edits and commands prompt you.Reviewing every action, sensitive work
Accept EditsReads, edits in the working directory, common filesystem commands.Iterating on code you will review afterwards
PlanReads and exploration; edits blocked until you approve a plan.Exploring before changing
AutoEverything, with a separate classifier model reviewing each action.Long tasks, less prompt fatigue
Don't AskOnly pre-approved tools; anything that would prompt is denied.Locked-down CI and scripts
Bypass PermissionsEverything, including protected paths.Isolated containers and VMs only
The permission ladder — more autonomy, less friction, more need for isolation
Manual Accept Edits Auto Bypass fewer prompts → need stronger isolation Plan and Don't Ask are special-purpose modes, not steps on the ladder deny rules apply in every mode, including Bypass
  • Rules beat modes. You can allow specific commands (for example npm test) in .claude/settings.json; deny rules apply in every mode (Source 7).
  • Checkpoints cover files only. Before editing, Claude snapshots files so Esc twice rewinds them; remote actions such as databases, APIs and deployments cannot be checkpointed (Source 2).
  • Sandboxing adds filesystem and network isolation for shell commands; on Windows it is not supported natively, but is in WSL 2 (Source 8, Source 9).
Bypass is not a convenience setting. The documentation says to use it only in isolated containers or VMs, warns it provides no protection against prompt injection, and notes it refuses to start as root outside a recognised sandbox. Chapter 13 covers the threat model.
07
Chapter Seven · Git

Working with Git

Claude Code works with Git directly: it can see your branch, uncommitted changes and recent history, stage changes, write commit messages, create branches and open pull requests (Source 1, Source 2). In practice you ask in plain language:

Prompt examples (from the docs)
commit my changes with a descriptive message create a pr summarize the changes I've made to the authentication module
  • Worktrees for parallel work. claude --worktree feature-auth starts a session in its own git worktree on its own branch, so two sessions do not collide. The repository needs at least one commit first (Source 3).
  • Sessions link to pull requests. When Claude creates a PR with gh pr create or glab mr create, the session is linked and can be reopened with claude --from-pr NUMBER (Source 3).
  • Attribution lines. Claude Code adds commit and pull-request attribution lines you can change with the attribution setting (Source 2).
  • Git is your real undo. Checkpoints are separate from Git and local to the session; commit in small steps so a bad change is a revert, not a rescue.
A real check of the CLI on this machine

The following was run while writing this page. It needs no login: it reads the installed CLI's own help text and shows the flags the chapter just described.

$ claude --version $ claude --help | grep -E "^Usage|^ -p, --print|^ --permission-mode|^ --model|^ -w, --worktree|^ -c, --continue|^ -r, --resume|^ --effort|^ --max-budget-usd"
Actual output · executed 2026-10-30 · Linux · lines truncated to 96 characters
2.1.314 (Claude Code) Usage: claude [options] [command] [prompt] -c, --continue Continue the most recent conversation in --effort <level> Effort level for the current session --max-budget-usd <amount> Maximum dollar amount to spend on API --model <model> Model for the current session. Provide --permission-mode <mode> Permission mode to use for the session -p, --print Print response and exit (useful for -r, --resume [value] Resume a conversation by session ID or -w, --worktree [name] Create a new git worktree for this

What it shows: every concept above has a flag — permission mode, model, effort, resume, worktree — and -p prints a response and exits, which is how Claude Code is used in scripts and CI. No Claude session was started, so nothing here proves how the agent behaves on a task; that is demonstrated in later chapters, and any session output on those pages will be labelled as executed or illustrative.

08
Chapter Eight · Comparison

Claude Code vs. IDE-Based AI Assistance

This is not a contest. The two approaches optimise different things, and Claude Code itself ships an IDE extension that narrows the gap.

AspectTypical IDE assistantClaude Code (terminal)
HomeInside the editor.In a terminal, in your project directory; also VS Code, JetBrains, desktop and web surfaces.
ContextOpen files, selection, indexed workspace as the tool chooses.Whatever the agent searches and reads, plus CLAUDE.md and memory.
ActingOften proposes edits; you run builds.Edits and runs commands itself, under permissions.
ReviewingStrong: inline diffs beside your code.Diffs in the terminal; the VS Code extension adds inline diffs, @-mentions and plan review.
ScriptingRarely scriptable.Composable: pipe in, -p out, run in CI.
CustomisationInstructions, prompt files.CLAUDE.md, skills, hooks, MCP, subagents, plugins.
Weak spotLess autonomy on multi-step tasks.Review is more effort if you rely on the terminal alone; autonomy raises the stakes of a wrong assumption.

The VS Code extension bundles its own copy of the CLI, supports checkpoints and MCP, and adds per-change accept/reject diffs, while a subset of the CLI's commands and features (for example the ! bash shortcut and tab completion) are CLI-only (Source 10). Many developers will use both: the editor for fine edits and review, the agent for multi-step work. Which mix is right is an empirical question for your project.

09
Chapter Nine · Common Mistakes

Misusing the Harness

1 · Approving commands without reading them. The security page states you are responsible for reviewing proposed code and commands. A prompt is only a safeguard if you read it.
2 · Expecting checkpoints to undo everything. They cover file edits, not database changes, API calls or deployments. Keep Git commits and avoid pointing an agent at production systems.
3 · Using Bypass Permissions on your own machine. It is documented for isolated containers or VMs. On a developer laptop it removes the main protection against a mistaken or injected command.
4 · Treating CLAUDE.md as enforcement. It is context the model usually follows, not a guarantee. A rule that must always hold belongs in a permission rule or a hook (Chapter 10).
5 · Never clearing context. A long session carries every earlier file and log into each request. Start fresh between unrelated tasks, and keep persistent rules in CLAUDE.md, not in the chat.
6 · Using an agent for a one-line edit. Exploration, tool calls and verification cost tokens. A direct edit in your editor is often quicker for trivial changes.
10
Chapter Ten · Summary

Key Takeaways, Exercises and Sources

∑ Claude Code architecture — what to remember
  • Claude Code is a harness around the Claude model: it supplies tools, manages context and enforces permissions.
  • The model never touches your machine; every action is a tool call that passes the permission gate.
  • It explores on demand with search and read tools instead of loading the repository.
  • Tests are just commands. It runs your project's own build and test tooling and reads the output.
  • Context is finite and sessions are fresh; persistent knowledge lives in CLAUDE.md and memory.
  • Permissions, checkpoints and Git are the safety net — and checkpoints do not cover remote systems.
  • Terminal and IDE approaches complement each other; the VS Code extension shares the same engine.
Exercises

Exercise 1 Beginner

Without starting a session, run claude --version and claude --help. Find the flags for permission mode, model and resuming a session, and write one sentence describing each in your own words.

Learning outcome: map the concepts on this page to real CLI controls.

Exercise 2 Intermediate

Redraw the architecture diagram for a task you do often (for example "fix a failing Maven test"). Add the specific commands the Bash tool would run and mark which would need your approval in Manual mode versus Accept Edits mode.

Learning outcome: reason about where permission boundaries fall for a real workflow.

Exercise 3 Advanced

Write a risk table for letting an agent work on one of your repositories: list five actions it could take, the worst plausible outcome of each, whether a checkpoint or Git can undo it, and the permission setting you would use to contain it.

Learning outcome: separate reversible from irreversible actions before granting autonomy.

Sources (read on 2026-10-30; paraphrased, at most one short quote per source)
  1. Anthropic, Claude Code overview — definition, surfaces, Git and CI examples, one engine across surfaces.
  2. Anthropic, How Claude Code works — agentic loop, harness, tool categories, sessions, context, checkpoints, attribution.
  3. Anthropic, Common workflows — codebase-exploration prompts, @ references, worktrees, PR sessions, subagent research.
  4. Anthropic, Tools reference — tool names, permission column, LSP tool.
  5. Anthropic, How Claude remembers your project — CLAUDE.md versus auto memory. Only the opening part of this page was read.
  6. Anthropic, Extend Claude Code — context cost by feature.
  7. Anthropic, Permission modes and Permissions — modes, plan mode, Bypass cautions.
  8. Anthropic, Security — user responsibility, sandboxed Bash, protections.
  9. Anthropic, Advanced setup — Windows/WSL sandbox support table.
  10. Anthropic, VS Code extension — extension versus CLI features.

Local CLI check: Claude Code 2.1.314, Linux, 2026-10-30 (help text only; no session run). The IDE-assistant column is a generalisation for comparison, not a statement about one product.