Claude Code, in four parts
What CLAUDE.md sets up, these four primitives actually use. Short notes on each, linked to the official docs.
MCP — extending Claude Code with external tools
MCP, the Model Context Protocol, is an open standard for exposing external tools, resources, and prompts to a model. It's the seam between the agent and anything that isn't already in your repo.
Claude Code adds MCP servers with claude mcp add, scoped per-project or globally at the user level. The agent then sees those servers' tools alongside its built-in ones.
Reach for MCP when Claude Code can't do something natively — query your database, hit an internal API, pull from a design or monitoring tool. Security caveat: each MCP server runs with your local trust and sees what you grant it, so vet the source before adding one.
Hooks — running code on Claude Code events
Hooks are shell commands Claude Code runs on lifecycle events — PreToolUse, PostToolUse, Stop, Notification, SessionStart, and others. They turn the agent's loop into something you can wire automation into.
People use them to auto-format after edits, block risky bash commands before they run, log every tool call, or notify when the agent stops. Unlike CLAUDE.md guidance, which is advisory, hooks are deterministic — they run every time, which is why they're the right place for checks that must always happen.
Gotcha: hooks run with your full user permissions. Treat the config like code and commit it for review.
Plan Mode — read-only exploration before edits
Plan mode is a read-only permission mode — cycle through the permission modes with Shift+Tab to enter it — where Claude Code can read and search but cannot edit files or run state-changing commands until you approve its plan.
It earns its keep on ambiguous refactors, unfamiliar codebases, and multi-file changes — anywhere you'd want a plan before code lands.
It pairs with CLAUDE.md: a rule like "use plan mode for multi-file changes" makes it reflexive instead of something you have to remember.
Agentic Coding — the loop CLAUDE.md exists to shape
Agentic coding is a coding agent that plans, edits, runs, observes the result, and iterates in a loop — not autocomplete, and not single-shot chat.
The agent owns the loop; you supervise outcomes, not keystrokes. The unit of work shifts from "the next line" to "the next change that compiles, passes tests, and does what was asked."
That's why CLAUDE.md matters: the loop runs unattended for minutes at a time, so written rules are the main thing keeping it on the rails. It's the reason this template exists.