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.
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.
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.
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.
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:
- Point at files with
@. Typing@pathincludes 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).
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:
| Tool | What it does | Asks permission by default? |
|---|---|---|
Read | Reads file contents. | No |
Edit | Makes targeted edits to specific files. | Yes |
Write | Creates or overwrites files. | Yes |
Grep / Glob | Search 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 |
Bash | Executes shell commands in your environment — build tools, git, test runners. | Yes |
WebFetch / WebSearch | Fetch a URL / search the web. | Yes |
Agent | Spawns a subagent with its own context window. | No |
Skill | Runs a skill in the main conversation. | Yes |
EnterPlanMode / ExitPlanMode | Switch 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).
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.
How Claude Code Remembers — and Forgets
| Mechanism | What it does | Source |
|---|---|---|
| Fresh sessions | Each new session starts with an empty context window; sessions are independent. | 2 |
| CLAUDE.md | Your instructions, loaded every session. Treated as context, not enforced configuration. | 5 |
| Auto memory | Notes Claude saves itself; the first 200 lines or 25KB of its MEMORY.md load each session. | 2, 5 |
| Transcripts | Each message, tool use and result is stored as plaintext JSONL under ~/.claude/projects/, enabling resume and fork. | 2 |
| Resume / fork | claude --continue or --resume reopens a session; --fork-session or /branch copies it into a new ID. | 2 |
| Compaction | Near 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 |
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.
Who Decides What Runs
Press Shift+Tab to cycle permission modes. The docs list six (Source 7):
| Mode | Runs without asking | Intended for |
|---|---|---|
Manual (default) | Reads only; edits and commands prompt you. | Reviewing every action, sensitive work |
| Accept Edits | Reads, edits in the working directory, common filesystem commands. | Iterating on code you will review afterwards |
| Plan | Reads and exploration; edits blocked until you approve a plan. | Exploring before changing |
| Auto | Everything, with a separate classifier model reviewing each action. | Long tasks, less prompt fatigue |
| Don't Ask | Only pre-approved tools; anything that would prompt is denied. | Locked-down CI and scripts |
| Bypass Permissions | Everything, including protected paths. | Isolated containers and VMs only |
- 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
Esctwice 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).
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:
- Worktrees for parallel work.
claude --worktree feature-authstarts 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 createorglab mr create, the session is linked and can be reopened withclaude --from-pr NUMBER(Source 3). - Attribution lines. Claude Code adds commit and pull-request attribution lines you can change with the
attributionsetting (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.
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.
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.
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.
| Aspect | Typical IDE assistant | Claude Code (terminal) |
|---|---|---|
| Home | Inside the editor. | In a terminal, in your project directory; also VS Code, JetBrains, desktop and web surfaces. |
| Context | Open files, selection, indexed workspace as the tool chooses. | Whatever the agent searches and reads, plus CLAUDE.md and memory. |
| Acting | Often proposes edits; you run builds. | Edits and runs commands itself, under permissions. |
| Reviewing | Strong: inline diffs beside your code. | Diffs in the terminal; the VS Code extension adds inline diffs, @-mentions and plan review. |
| Scripting | Rarely scriptable. | Composable: pipe in, -p out, run in CI. |
| Customisation | Instructions, prompt files. | CLAUDE.md, skills, hooks, MCP, subagents, plugins. |
| Weak spot | Less 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.
Misusing the Harness
Key Takeaways, Exercises and Sources
- 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.
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.
- Anthropic, Claude Code overview — definition, surfaces, Git and CI examples, one engine across surfaces.
- Anthropic, How Claude Code works — agentic loop, harness, tool categories, sessions, context, checkpoints, attribution.
- Anthropic, Common workflows — codebase-exploration prompts,
@references, worktrees, PR sessions, subagent research. - Anthropic, Tools reference — tool names, permission column, LSP tool.
- Anthropic, How Claude remembers your project — CLAUDE.md versus auto memory. Only the opening part of this page was read.
- Anthropic, Extend Claude Code — context cost by feature.
- Anthropic, Permission modes and Permissions — modes, plan mode, Bypass cautions.
- Anthropic, Security — user responsibility, sandboxed Bash, protections.
- Anthropic, Advanced setup — Windows/WSL sandbox support table.
- 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.