cc Claude Code Deciphered
A field guide · v.2026.05

The vocabulary of Claude Code, decoded for engineers and architects.

A single-page reference for everyone who ships with Claude Code — from someone opening the CLI for the first time to architects preparing for the Claude Certified Architect — Foundations exam. Every term is defined, situated, and bracketed with explicit guidance on when to reach for it and when to walk past.

44 terms 7 clusters 7 diagrams Light + dark Single file, no build

What is Claude Code?

Claude Code is an agentic coding harness — a command-line program (with VS Code, JetBrains, GitHub Actions, web, and mobile counterparts) that wraps Anthropic's Claude models in a turn-by-turn loop of read context → reason → call tools → observe → respond. It can edit your repo, run your build, drive Git, and reach out to anything exposed via the Model Context Protocol.

The vocabulary on this page is the working set you need to use it well, configure it safely, integrate it with the rest of your stack, and explain it to a colleague who has never seen it before.

No terms match that filter. Try clearing the search or selecting All.

CLUSTER 01 / 07

Core concepts

The seven primitives that everything else in Claude Code is built from. Internalise these and the rest reads as application of pattern.

FIG. 01 The agentic loop
User request turn 0 Reason model thinks Tool call read · edit · bash Observe tool_result Respond or loop again loop until done turn returns

Each pass through the loop appends to the conversation history. Claude either calls more tools or emits a terminal response — the harness has no other states.

001 / Core

Agentic loop

Core
The iterative cycle in which Claude reads its current context, decides what to do next, optionally calls one or more tools, observes the results, and either calls more tools or emits a final reply. Every Claude Code turn is one trip around this loop — sometimes spanning dozens of tool calls.
Used for
Driving any non-trivial task: gathering context, performing actions, adapting to feedback, and recovering from errors without leaving the session.
When to use
Always — the loop is the engine. The interesting question is how much autonomy you give a single iteration (plan mode, hooks, permissions).
When NOT to use
If you only need a one-shot completion with no tools, you don't need Claude Code — call the model directly via the API. The loop has overhead.
002 / Core

Context window

Core
The total span of tokens Claude can attend to in a single turn: system prompt, tool definitions, conversation history, file contents, and tool results. Opus 4.7 supports up to 1M tokens; Sonnet and Haiku have their own ceilings. Once the window fills, older content must be summarised, dropped, or both.
Used for
Holding everything Claude reasons over — including large file reads and long tool transcripts. The shape of your context drives output quality more than prompt wording.
When to manage actively
Long sessions, repos with very large files, batch operations. Reach for /compact, /clear, or a fresh subagent before quality degrades.
When NOT to micro-manage
Short sessions; let auto-compaction do its job. Premature compaction discards nuance you may need.
Verify in docs: exact token ceilings vary by model and contract. Check current model limits at docs.claude.com.
003 / Core

Tool use

Core
The mechanism by which Claude invokes capabilities outside the language model itself. Claude emits a tool_use block; the harness executes it (Read, Edit, Bash, MCP servers, custom tools); a tool_result is appended to context for the next turn.
Used for
Reading files, editing code, running shell commands, querying databases, calling APIs — anything the model cannot do with text alone.
When to use
Effectively always — Claude Code is built around tool use. The control surface is which tools are exposed and under what permissions.
When NOT to use
For pure ideation or rephrasing, restrict to read-only tools or use --print mode so Claude can't surprise you with a side effect.
004 / Core

System prompt

Core
The instructions injected at the very top of Claude's context that define its role, capabilities, and constraints. In Claude Code this is composed automatically: harness identity, tool catalog, environment metadata, and your CLAUDE.md content.
Used for
Setting the standing rules for every turn — tone, conventions, what counts as "done", which patterns to favour.
When to customise
Through CLAUDE.md (project-specific) or ~/.claude/CLAUDE.md (personal). Keep it concrete: file paths, commands, conventions, gotchas.
When NOT to use
Don't store secrets, ephemeral state, or rapidly changing data in the system prompt. Don't try to override harness identity or jailbreak it.
005 / Core

Slash commands

Core
User-invoked shortcuts typed as /name [args]. Built-ins handle session control (/clear, /compact, /help); custom commands live in .claude/commands/*.md (project) or ~/.claude/commands/*.md (user) and inject a prompt template into the conversation.
Used for
Reusable workflows you invoke by hand: /review, /security-review, project-specific scaffolds, repeated prompt templates.
When to use
Anything you've copy-pasted as a prompt three times. Slash commands are the cheapest abstraction Claude Code offers.
When NOT to use
For automatic, event-driven behaviour use hooks. For complex independent tasks with their own context budget, use subagents.
# .claude/commands/spike.md
---
description: Quick exploratory spike on a topic
argument-hint: <topic>
---
Spike a 30-minute exploration of: $ARGUMENTS
Capture findings in scratch/SPIKE.md. Do not modify src/.
006 / Core

Subagents

Core
Independent Claude sessions spawned from the parent session via the Agent tool. Each subagent has its own context window, its own tool restrictions, and returns a single message back to the parent — nothing else leaks across the boundary. Defined in .claude/agents/*.md.
Used for
Parallel research, large grep / read jobs, isolated explorations, specialist roles (code-reviewer, debugger). Protects the main context from output bloat.
When to use
Independent tasks with no shared state mid-flight. Two or more such tasks — dispatch them in parallel in one message.
When NOT to use
When you need ongoing back-and-forth, when the parent must observe intermediate steps, or when the work fits comfortably in the main loop.
007 / Core

Hooks

Core
Shell commands the harness runs automatically on lifecycle events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, Stop, SubagentStop, and others. Hooks are executed by the harness, not by Claude — that's their power and their danger.
Used for
Linting on save, formatting after writes, blocking risky bash commands, injecting context on session start, posting notifications when work stops.
When to use
Anything deterministic that must happen at a known moment, regardless of model judgement. "Whenever X" requirements always become hooks.
When NOT to use
Anything requiring reasoning, taste, or context — that's a slash command or subagent. Hooks should be simple, fast, and side-effect-explicit.
// .claude/settings.json
{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Edit|Write",
      "hooks": [{ "type": "command",
                  "command": "npx prettier --write \"$CLAUDE_FILE_PATHS\"" }]
    }]
  }
}
CLUSTER 02 / 07

Configuration & setup

Where Claude Code reads its standing instructions from, who can override whom, and how secrets stay out of the wrong files.

FIG. 02 Configuration hierarchy — precedence cascade
Higher = wins precedence 1 · Enterprise managed policy /etc/claude-code/managed-settings.json — locks fields, beats everything 2 · Command-line arguments --permission-mode, --allowedTools, --model … per-invocation 3 · Local project settings .claude/settings.local.json — gitignored, your machine only 4 · Shared project settings .claude/settings.json — checked in, team-wide 5 · User settings ~/.claude/settings.json — personal defaults across projects CLAUDE.md is separate — it loads into the system prompt, not this cascade.

A higher layer fully overrides a lower one for the same key. Permissions are merged additively; an enterprise policy with defaultMode: "deny" cannot be reopened from below.

008 / Config

CLAUDE.md

Config
A markdown file Claude Code automatically loads into the system prompt at session start. The project file lives at the repo root; the user file lives at ~/.claude/CLAUDE.md. Sub-directory CLAUDE.md files are also loaded when files in that directory are read.
Used for
Coding conventions, build / test / lint commands, architecture overview, "always do this first" rules, gotchas a newcomer would trip over.
When to use
Anything Claude needs to know every session. The project file should be terse and concrete — not a wiki dump.
When NOT to use
Secrets (use .env), per-task notes (just say them), or runtime state. Long CLAUDE.md files dilute the signal.
009 / Config

.claude/ directory

Config
The project-local folder where Claude Code looks for shareable configuration: settings.json, commands/, agents/, hooks/, skills/, and the local-only settings.local.json. Mirror exists at ~/.claude/ for user-level equivalents.
Used for
Versioned, team-shared Claude Code config. Anything you want every contributor to inherit when they clone the repo.
When to use
Project-wide hooks, allowlists, custom slash commands and subagents that everyone should have available.
When NOT to use
Personal preferences (statusline, theme, personal hooks) — those belong in ~/.claude/.
.claude/
├── settings.json          # committed, team-wide
├── settings.local.json    # gitignored, your overrides
├── commands/              # /custom slash commands
├── agents/                # subagent definitions
├── hooks/                 # shell scripts referenced from settings
└── skills/                # bundled, invokable skills
010 / Config

settings.json

Config
The single JSON document where Claude Code's behaviour is configured: permissions, hooks, environment variables, status line, MCP servers, model selection. Three scopes — user, shared project, local project — plus an enterprise policy file at the OS level.
Used for
All persistent configuration. Treat it as code: review it, version it, lint it.
When to use
Whenever a behaviour should persist across sessions or be enforced across teammates. Especially: permissions and hooks.
When NOT to use
Per-session toggles — pass them as CLI flags. Secrets — reference env vars, don't paste values.
{
  "permissions": {
    "allow": ["Bash(git status)", "Bash(git diff:*)", "Read"],
    "deny":  ["Bash(rm -rf:*)", "Bash(git push --force:*)"],
    "defaultMode": "acceptEdits"
  },
  "env": { "NODE_ENV": "development" },
  "model": "claude-opus-4-7"
}
011 / Config

.env file placement

Config
Claude Code does not load a .env file automatically. Conventionally .env sits at the repo root for the application itself; pass values into Claude Code's process environment via your shell, or surface specific keys via the env map in settings.json.
Used for
Local secrets — API keys, database URLs, OAuth client secrets — that the application (and any tools Claude runs) needs at runtime.
When to use
Local development. .env belongs in .gitignore; pair with a committed .env.example that documents the keys.
When NOT to use
Production secrets (use a secrets manager). Never store them inside .claude/ or CLAUDE.md — those flow into prompts.
Verify in docs: some MCP servers and integrations have first-class .env support — check each server's loader behaviour separately.
012 / Config

Permissions model

Config
The system that decides whether a tool call runs, prompts you, or is blocked. Four modes: default (prompt for new tools), acceptEdits (auto-accept file edits), plan (read-only, must propose a plan), and bypassPermissions (no prompts — dangerous). Allow / deny / ask lists in settings.json refine the defaults.
Used for
Controlling blast radius. Each tool call is checked against the active mode plus the merged permission rules from every settings layer.
When to use
Always — explicit allowlists for read-only commands cut prompt fatigue without weakening safety. Use plan mode for unfamiliar territory.
When NOT to use
Don't leave bypassPermissions on as a default. Reserve it for sandboxed environments where you've thought hard about what could happen.
013 / Config

Allowed / denied tools

Config
String patterns in permissions.allow, permissions.deny, and permissions.ask that match tool calls by name and arguments. Patterns include Read, Edit, Bash(git status), Bash(npm test:*), and mcp__<server>__<tool>.
Used for
Pre-approving safe operations (read-only bash, common npm / git commands, specific MCP tools) and hard-blocking dangerous ones (force push, recursive delete, prod credential reads).
When to use
Once you've used Claude Code in a project for a few days, the prompts you keep approving become an allowlist; the prompts that scare you become a denylist.
When NOT to use
Don't allow broad wildcards on destructive commands — Bash(rm:*) is almost always wrong. Prefer specific commands or none.
CLUSTER 03 / 07

Model Context Protocol

An open standard for plugging tools, data sources, and prompts into any LLM client. The same MCP server works in Claude Code, Claude Desktop, Cursor, and beyond.

FIG. 03 MCP architecture — client, transport, server, external system
Claude Code MCP client tools/list · tools/call Transport stdio subprocess pipe SSE · HTTP network · streamable MCP server tools · resources · prompts github · postgres · jira External system DB · API · FS your data ⚐ OAuth 2.0 + Dynamic Client Registration Remote servers only · client registers itself · user grants access CLIENT SERVER SYSTEM

The transport layer is the only thing that meaningfully differs between local and remote MCP servers. Authentication (OAuth + DCR) is layered onto the transport for remote, network-reachable servers.

FIG. 04 Transport comparison — stdio · SSE · HTTP
Where it runs Authentication Best for Trade-offs
stdio Local subprocess of the client none Inherits user's machine context Filesystem, git, sqlite, anything per-user and local fastestsimple single-user only; client must launch the binary
SSE Remote HTTP server, server → client streaming OAuth per-user, optional Existing SSE deployments, legacy remote servers legacy being superseded by Streamable HTTP; long-lived connections
HTTP Remote, "Streamable HTTP" — bidirectional over HTTP/POST OAuth + DCR recommended for any non-trivial server New remote MCP deployments, multi-user SaaS integrations modernscales needs proper auth and TLS; more moving parts than stdio

For new servers: pick stdio if it's a personal local tool, Streamable HTTP if it's remote and shared. Reach for SSE only when integrating with an existing deployment.

014 / MCP

MCP server

MCP
A program that exposes tools, resources, and prompts via the Model Context Protocol. It can wrap a database, a SaaS API, a file format, or your in-house service. The same server is usable by any MCP client — that's the point of the standard.
Used for
Extending Claude with domain-specific capabilities you want available across many sessions and projects, without bespoke wiring per client.
When to use
When the integration will be reused, shared, or audited. Building one server beats writing the same Bash glue ten times.
When NOT to use
A one-off task — just have Claude run the command directly. Don't build a server until you've felt the friction it would relieve.
015 / MCP

MCP client

MCP
The side of an MCP connection that consumes capabilities — in this context, Claude Code itself. The client discovers what a server offers, surfaces those tools to the model with a mcp__<server>__<tool> naming convention, and routes calls back to the server.
Used for
Letting an LLM use any MCP-compliant capability. Claude Code, Claude Desktop, Cursor, and others are all MCP clients.
When to use
Whenever you want a server's tools available in your AI tool. Configuration is per-client (in settings.json for Claude Code).
When NOT to use
If a tool only ever runs in one client environment, the MCP wrapping is overhead — a slash command or hook may be enough.
016 / MCP

stdio transport

MCP
The simplest MCP transport: the server runs as a local subprocess of the client; the client communicates with it over stdin / stdout using newline-delimited JSON-RPC. No network, no auth, no certificates.
Used for
Local servers operating on local resources — filesystem, git, sqlite, your machine's keychain.
When to use
Default choice for any server that's installed per-user and operates on local data. Fast, predictable, easy to debug.
When NOT to use
Anything multi-user, anything shared, anything you don't want to install on every developer's laptop.
# add a stdio server
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem ~/work
017 / MCP

SSE transport

MCP
Server-Sent Events over HTTP — the older remote MCP transport. The server pushes streaming responses to the client over a long-lived text/event-stream connection; the client posts requests separately.
Used for
Remote MCP servers built before the Streamable HTTP transport landed.
When to use
When you're connecting to an existing SSE deployment that you don't control. Most popular MCP servers still ship an SSE endpoint.
When NOT to use
For new server projects — build them on Streamable HTTP instead. SSE is functional but no longer the recommended forward path.
Verify in docs: SSE deprecation status and exact replacement timing — check the MCP spec at modelcontextprotocol.io.
018 / MCP

HTTP transport

MCP
"Streamable HTTP" — the modern remote MCP transport. A single HTTP endpoint accepts JSON-RPC requests via POST and can stream responses back when needed. Replaces SSE for new deployments and pairs naturally with OAuth.
Used for
Remote, multi-user MCP servers — especially those fronting authenticated SaaS APIs.
When to use
Any new remote server. Pair with OAuth + DCR so any client can authorize without bespoke registration.
When NOT to use
Local-only tools (use stdio — less surface area, less to break).
019 / MCP

OAuth Dynamic Client Registration

MCP
RFC 7591. An OAuth 2.0 extension that lets an MCP client register itself with a server's authorization endpoint at runtime, rather than relying on a pre-shared client ID. The MCP spec recommends DCR so any new client can connect to any compliant server without an out-of-band setup step.
Used for
Letting Claude Code (or any other MCP client) connect to a remote OAuth-protected MCP server with no manual app registration.
When to use
Building any remote MCP server intended for multiple clients or organisations — DCR is the path of least friction.
When NOT to use
Stdio (local) servers — no auth needed. Internal-only servers behind a corporate IdP may use a fixed client registration instead.
020 / MCP

Local vs remote MCP servers

MCP
Local: stdio subprocess, single-user, ambient access to that user's machine, no auth. Remote: HTTP / SSE, multi-user, network-bound, requires authentication, can be operated centrally and updated without redeploying to every laptop.
Used for
Choosing the right deployment shape for the integration's audience — one developer or a whole company.
When local
Filesystem, git, sqlite, ad-hoc personal tools. Anything that depends on the local user's environment.
When remote
Shared business systems — ticketing, CRM, billing, observability — especially when central audit and rotation matter.
021 / MCP

Tool discovery

MCP
The handshake in which the client asks the server tools/list (and similarly resources/list, prompts/list) and receives back the catalog of capabilities, complete with JSON schemas. Claude Code uses these schemas to expose tools to the model.
Used for
Late-binding capability detection. Servers can change their toolset; clients pick it up on the next discovery cycle.
When to use
Automatic on connection — usually you don't think about it. Worth checking explicitly when debugging "why isn't this tool showing up?"
When NOT to use
Don't try to hard-code a tool list and skip discovery — you'll silently desync from what the server actually offers.
CLUSTER 04 / 07

Workflows & patterns

How to actually use the loop — from a single targeted edit to a refactor that touches a hundred files to a scheduled run in CI.

FIG. 05 A typical session — prime → plan → edit → test → commit
You Claude Repo / tools Git 1. read CLAUDE.md, key files 2. /plan refactor draft plan returned 3. approve Edit · Write 4. Bash(npm test) tool_result · pass 5. commit it git add · git commit

The pattern is fractal: a single feature rerun the same five steps, a multi-day project just nests the loop. The "approve" step is what keeps a fast loop accountable.

FIG. 06 Decision — subagent · hook · slash command?
Triggered by an event? Hook harness runs your script YES NO Manual macro you type? Slash command prompt template you invoke YES NO Independent task, own context? Subagent isolated session YES Just ask Claude no abstraction needed NO

Three different mechanisms for three different shapes of problem. They compose — a slash command can dispatch a subagent; a hook can run before either.

022 / Workflow

Plan mode

Workflow
A permission mode in which Claude may only use read tools and must propose a plan via ExitPlanMode for your approval before any write happens. Toggle into it with Shift+Tab at the prompt or --permission-mode=plan on launch.
Used for
Safer exploration, design alignment before commitment, reviewing approach for risky or large changes.
When to use
Unfamiliar code, multi-file refactors, anything where you'd rather argue with a plan than reverse a commit.
When NOT to use
Tiny obvious edits, scratch work, exploratory spikes — the planning round is overhead you don't need.
023 / Workflow

Edit mode

Workflow
The default operating posture — Claude can read and write — with permissions deciding what runs without prompting and what asks first. The acceptEdits permission mode is the common variant in which Edit / Write are auto-accepted.
Used for
Direct implementation once intent is clear and scope is bounded.
When to use
Most coding work. Combine with a tight allowlist for shell commands so prompts only appear for genuinely interesting actions.
When NOT to use
When you need approval gates or are in unfamiliar territory — switch to plan mode.
024 / Workflow

Agentic coding loop

Workflow
The end-to-end pattern engineers actually run: gather contextplaneditrun tests / buildobserve failuresiteratecommit. Each pass tightens the gap between intent and behaviour.
Used for
Almost all real engineering work in Claude Code. The pattern scales from a single bug fix to a multi-day feature.
When to use
As your default. The loop becomes more powerful when the verification step (tests, type-checker, linter) is fast and trustworthy.
When NOT to use
Pure Q&A or research. There's nothing to verify, so there's nothing to iterate against.
025 / Workflow

TDD with Claude

Workflow
A high-leverage variant of the agentic coding loop: write a failing test first, ask Claude to make it pass without editing the test, then refactor. The test gives Claude an unambiguous, machine-checkable definition of "done".
Used for
New features with clear input / output, bug fixes with reproducible failures, contract enforcement.
When to use
Logic-heavy code — parsers, calculators, state machines, API handlers — where behaviour is testable in isolation.
When NOT to use
UI prototyping, exploratory spikes, integration with flaky external systems — the test-first loop costs more than it returns.
026 / Workflow

Multi-file refactors

Workflow
Coordinated, semantics-preserving changes across many files: renames, signature changes, module extractions, API migrations. Plan mode plus a test suite turn this from "scary" to "boring", which is what you want.
Used for
Repo-wide structural changes that mechanical tools (codemods) can't quite handle on their own.
When to use
When the change spans ≥3 files with shared semantics. Stage the work in a separate worktree so you can throw it away if it goes sideways.
When NOT to use
Single-file tweaks. Don't pay the planning cost for a one-spot edit.
027 / Workflow

Headless / CI usage

Workflow
Claude Code running non-interactively — no TTY, no human in the loop. Use claude -p "…" (or --print) to get a single completion to stdout, ideal for scripts, scheduled jobs, and CI tasks like PR review.
Used for
Automated PR review, batch lint / refactor passes, scheduled audits, scripted scaffolding.
When to use
Repeatable, well-scoped tasks where a human approval per step would defeat the point.
When NOT to use
Anything requiring human judgement mid-flow. Lock down permissions tightly before pointing it at production data.
# headless one-shot summary in CI
claude -p "summarise the diff against main and flag risky changes" \
  --permission-mode=plan \
  --output-format=json > review.json
CLUSTER 05 / 07

Integrations & surfaces

The same harness shows up in different surfaces. The reasoning model is the same; the I/O is what changes.

028 / Integrations

Claude Code in VS Code

Integration
Official VS Code extension. Runs the same Claude Code engine inside the editor with selection-aware prompts, inline diff review, and access to the integrated terminal. Great middle ground between the raw CLI and a full IDE chat experience.
Used for
Editor-centric workflows where you want Claude to operate on the file you're looking at, with one-click diff approval.
When to use
When most of your day already lives in VS Code or a fork (Cursor, Windsurf compatibility varies).
When NOT to use
Headless / CI — use the CLI. Heavy multi-window orchestration — the terminal scales further.
029 / Integrations

Claude Code in JetBrains

Integration
Official plugin for the JetBrains IDE family — IntelliJ IDEA, PyCharm, WebStorm, GoLand, Rider, and others. Mirrors the VS Code experience with selection awareness and diff review tuned for the JetBrains UI conventions.
Used for
Teams standardised on JetBrains tooling who want the in-editor experience without leaving the IDE.
When to use
When the IDE's refactor / inspection tooling pays for itself daily — you keep that, and gain Claude on top.
When NOT to use
Headless tasks — CLI. Quick scratch sessions on files outside an open project — CLI.
030 / Integrations

Terminal (CLI)

Integration
The native CLI — the canonical Claude Code surface. Run claude in a project directory, get an interactive prompt; pipe input in, get headless output back. Everything else in this section is built on the same engine.
Used for
Power-user workflows, scripting, headless CI, multiplexed sessions across worktrees, anything tmux-friendly.
When to use
When you want full control, full speed, and no IDE overhead. The CLI is also the source of truth — new features land here first.
When NOT to use
When colleagues need a softer onboarding ramp — the IDE extensions are friendlier for newcomers.
031 / Integrations

GitHub Actions

Integration
Run Claude Code from a workflow on PR open, issue comment, or schedule. The official action wires up auth, mounts the repo, and exposes the headless CLI. Pair with restricted permissions and a denylist for safety.
Used for
Automated PR review, issue triage, label-driven implementation requests, scheduled "audit my repo" jobs.
When to use
When the same task needs to run on every PR or comment without human attention. Always pair with a tight permission profile.
When NOT to use
For tasks that require nuance or interactive clarification — CI is the wrong place to negotiate.
Verify in docs: action input names and trigger wiring are evolving — check the official action README before adopting.
032 / Integrations

Mobile remote control

Integration
Monitor and steer running Claude Code sessions from a phone via the Claude mobile app. The session keeps executing on its host (laptop, dev container, cloud sandbox) and you intervene from anywhere — especially useful for long-running agentic work.
Used for
Long jobs that don't need full attention, on-call check-ins, approving permission prompts when you're away from your desk.
When to use
When you've kicked off something patient (a refactor across many modules, a research dive) and want to keep an eye on it.
When NOT to use
Hands-on coding — the form factor isn't built for it.
Verify in docs: mobile remote-control feature scope and availability vary by plan and region — check current rollout.
033 / Integrations

Slack integration

Integration
Claude in Slack channels — either via the first-party Anthropic app for Q&A and light agentic work, or via custom MCP / GitHub Action plumbing that posts back into Slack from Claude Code sessions running elsewhere.
Used for
Team-facing Q&A, summarising threads, kicking off Claude Code jobs and getting results back where conversations already happen.
When to use
When the team's centre of gravity is Slack and pulling people into the terminal isn't realistic.
When NOT to use
Long-form coding or anything requiring a side-by-side diff — surface those into the IDE or CLI.
CLUSTER 06 / 07

Context management

Steering what Claude knows, remembers, and forgets — the highest-leverage skill once you've been using Claude Code for more than a week.

034 / Context

Context priming

Context
The deliberate act of loading the right files, configs, and notes into context before asking Claude to reason or act. Often the difference between a sharp first answer and three rounds of correction.
Used for
Setting Claude up for success on non-trivial tasks — "read these three files, then plan the migration."
When to use
At the start of any task where the answer depends on specific files, configs, or prior decisions Claude wouldn't otherwise see.
When NOT to use
Don't dump the whole repo — over-priming dilutes signal and burns context. Curate.
035 / Context

Memory files

Context
The collection of files Claude Code loads into the system prompt automatically each session: project CLAUDE.md, user ~/.claude/CLAUDE.md, and any sub-directory CLAUDE.md files when their directory is touched. Some setups also auto-load a memory directory of additional notes.
Used for
Persistent, always-on instructions and facts — user role, conventions, "always do first" rules, project gotchas.
When to use
Anything Claude needs every single session. Update them when patterns crystallise; prune them when they go stale.
When NOT to use
Per-task scratch notes, anything secret, anything that decays quickly — memory files should age well.
036 / Context

/compact

Context
A built-in slash command that asks Claude to summarise the conversation so far, replacing the bulky transcript with a compressed version — recovering tokens for the rest of the session. You can pass an optional focus argument to bias what is preserved.
Used for
Long-running sessions hitting the context ceiling, or any moment you want to keep the gist while shedding noisy tool transcripts.
When to use
When context use is past 70% and you still have meaningful work ahead. Pass a focus arg if part of the history really matters.
When NOT to use
Early in a session, or right before a delicate edit — compaction can blur details you'll wish you still had verbatim.
037 / Context

/clear

Context
Wipes the in-memory conversation entirely. The next turn starts fresh — only the system prompt (CLAUDE.md, harness instructions) survives.
Used for
Pivoting to a completely different task in the same terminal session, without the previous topic biasing what comes next.
When to use
Between unrelated workstreams. Cheaper than spawning a new process; cleaner than relying on Claude to "forget".
When NOT to use
When you still need information from earlier in the session — /compact is reversibly-lossy; /clear is final.
038 / Context

Reference files

Context
Files explicitly read or referenced during a session for ad-hoc context — design docs, ADRs, sample data, the spec you printed last week. Distinct from memory files in that they're loaded by request, not automatically.
Used for
Bringing in external knowledge for a specific task without polluting the persistent memory files everyone else inherits.
When to use
Per-task: "read docs/architecture.md before answering", "use the JSON in fixtures/sample.json as ground truth".
When NOT to use
When the file is huge — summarise it, point Claude at a section, or split it. Loaded files cost real tokens.
039 / Context

Project-level vs user-level config

Context
Two parallel config trees. Project lives in .claude/, is checked into the repo, and applies to anyone working on it. User lives in ~/.claude/, is private to you, and applies across every project. The same file names, the same shape, different scope.
Used for
Splitting team conventions (project) from personal preferences (user) so neither leaks into the other.
When project
Anything every contributor should inherit — build commands, denylists for destructive operations, project-specific subagents.
When user
Personal hooks, statusline, theme, the slash commands you've built up across years of muscle memory.
CLUSTER 07 / 07

Plugins & marketplaces

The unit of distribution for everything else on this page. Bundle skills, slash commands, subagents, hooks, and MCP servers into one installable artifact — share it, version it, govern it.

FIG. 07 Plugin anatomy — from marketplace to installed bundle
Marketplace git repo · local · zip marketplace.json /plugin install Plugin (bundle) .claude-plugin/plugin.json skills/ domain knowledge commands/ /slash macros agents/ subagents hooks.json lifecycle scripts mcp.json MCP servers enabled in Your sessions user · project /plugin enable

A plugin packages any subset of {skills, commands, subagents, hooks, MCP servers} behind a single manifest. The marketplace publishes a catalog; /plugin install resolves it; /plugin enable makes it active in your sessions.

040 / Plugins

Plugin

Plugin
A versioned bundle of Claude Code customisations — any combination of skills, slash commands, subagents, hooks, and MCP servers — behind a single manifest. The unit of distribution: install once, get every artifact the author packaged together.
Used for
Sharing reusable Claude Code capabilities across projects, teams, or the wider community without copy-pasting .claude/ contents around.
When to use
Whenever a set of skills, commands, agents, or hooks goes together — ship them as one unit so users get a coherent experience and predictable upgrades.
When NOT to use
A single ad-hoc command or hook used in one repo — just check it into .claude/. The plugin overhead pays off only when something is reused.
041 / Plugins

Plugin marketplace

Plugin
A source Claude Code can pull plugins from — typically a git repository (public or private), a local directory, or a packaged archive. The marketplace publishes a catalog (a marketplace.json at .claude-plugin/marketplace.json) listing the plugins it offers and where their bundles live.
Used for
Discovery and distribution. Anthropic operates a first-party marketplace; teams run private internal ones; individuals point Claude Code at any GitHub repo that follows the convention.
When to use
When you have more than one or two plugins to share, or want versioning and discovery for a team. Add a marketplace once; install many plugins from it.
When NOT to use
A single plugin you just want to try — you can install directly from a git ref without registering a marketplace.
# add a marketplace, then install from it
/plugin marketplace add anthropics/claude-code-plugins
/plugin install code-reviewer@anthropics
# or install ad-hoc from a git repo
/plugin install github.com/jamesbuckett/my-plugin
Verify in docs: exact CLI syntax for marketplace registration and ad-hoc install evolves — confirm against current Claude Code release notes.
042 / Plugins

.claude-plugin / plugin.json

Plugin
The structural convention every plugin follows. The .claude-plugin/ directory at the bundle root holds the plugin.json manifest — name, version, description, author — and the rest of the bundle (commands/, agents/, skills/, hooks.json, mcp.json) sits alongside.
Used for
Telling Claude Code (and a marketplace) what this plugin is, what version it is, and where its components live. The manifest is the contract.
When to use
Anytime you author a plugin. Keep plugin.json small and accurate; bump the version on every meaningful change.
When NOT to use
Don't try to use the plugin layout for project-only customisations — .claude/ in your repo is simpler and doesn't need a manifest.
my-plugin/
├── .claude-plugin/
│   └── plugin.json          # { "name", "version", "description" }
├── commands/                # /slash command markdown files
├── agents/                  # subagent definitions
├── skills/                  # SKILL.md bundles
├── hooks.json               # lifecycle hook config
└── mcp.json                 # MCP servers shipped with the plugin
Verify in docs: exact filenames inside .claude-plugin/ and the schema of plugin.json are still settling — check the current authoring guide.
043 / Plugins

/plugin command

Plugin
The built-in slash command for managing plugins from inside Claude Code. Subcommands cover the lifecycle: marketplace registration, install / uninstall, enable / disable, list, update. Equivalent operations are available from the claude CLI for headless contexts.
Used for
Day-to-day plugin management without leaving the session. Discover what's installed, toggle a noisy plugin off, pull an update.
When to use
Whenever you need to change what's available in the current Claude Code instance. The interactive picker is friendlier than hand-editing config.
When NOT to use
In CI — pin plugins via committed config so installs are reproducible, not interactive.
/plugin                       # open the interactive picker
/plugin marketplace list      # registered sources
/plugin install <name>        # install a plugin
/plugin enable  <name>        # activate it for this scope
/plugin disable <name>        # keep installed but inactive
044 / Plugins

Plugin scope

Plugin
Where a plugin is installed and where it's enabled. Installation is typically per-user (the binaries live under ~/.claude/); enablement can be scoped per project via .claude/settings.json, so a plugin you have installed only activates for repos that explicitly request it.
Used for
Keeping a personal toolkit broad while keeping each project's surface area narrow. Different projects can opt into different subsets of what you have installed.
When to use
Any time you want a plugin available in some projects but not others — especially security-sensitive ones with restricted tool surfaces.
When NOT to use
Don't enable everything everywhere — more active plugins means more tool definitions in context, which dilutes the model's attention. Curate.
Verify in docs: the exact settings.json keys for project-level plugin enable/disable are evolving — cross-check against current docs.

Further reading

Authoritative sources for the moving parts.

Official documentation

Reference docs for Claude Code, the Claude API, models, and pricing. Updated continuously — treat as the source of truth when this page and the docs disagree.

docs.claude.com

Support & troubleshooting

Anthropic support knowledge base — account questions, billing, plan limits, and the things that aren't quite product docs.

support.claude.com

Model Context Protocol

Open spec, reference servers, and SDKs for MCP — if you're building servers or learning the wire format, start here.

modelcontextprotocol.io