skip to content

Claude Code

2 roadmaps188 questionsupdated

Anthropic's agentic coding harness: a gather-act-verify loop over built-in tools, gated by permission modes and steered by CLAUDE.md. Probed because safe use is a permissions and context question.

on this pageshow

guide

overview

~2 min

Claude Code is Anthropic's agentic coding tool: a model working in a loop over built-in tools that read files, edit them and run shell commands inside your repository, with your credentials. Interviewers treat it less as a product to recite than as a system to operate safely. A good answer says what the agent may do, what it can see, and which layer enforces each of those: an instruction the model reads, a permission rule the harness checks, a hook that runs whatever the model decides, or an operating-system sandbox around its commands. The hub follows that question outward. [Setup and platforms](/topics/ai-claude-code-setup) fixes who pays and where a session runs. [Agent loop and safeguards](/topics/ai-claude-code-agent-loop) is the core: the tools, the allow, ask and deny rules, the permission modes and the checkpoints. [Session workflow](/topics/ai-claude-code-sessions) is steering a session you are sitting in, and [memory and context](/topics/ai-claude-code-context) is what fills the window and what it costs. The extension points come next: [skills and custom commands](/topics/ai-claude-code-skills), [harness hooks](/topics/ai-claude-code-hooks), [MCP integration](/topics/ai-claude-code-mcp-integration), and [personalization and extensions](/topics/ai-claude-code-customize) for layered settings and plugins. [Subagents and parallel work](/topics/ai-claude-code-subagents) spreads a task across context windows and worktrees. [Unattended automation](/topics/ai-claude-code-automation) takes the human out of the loop, and [security and governance](/topics/ai-claude-code-security) covers sandboxing, workspace trust and organization policy. Junior rounds stay on daily mechanics: which file holds what, which command resumes or compacts, how a mode changes what Claude may touch. Senior and principal rounds turn into design and incident questions: an overnight job that must neither stall nor overreach, a guard hook that let a command through, a cloned repository that runs code once trusted. Learn the loop and its permission model first, then what loads into context. Skills, hooks and MCP make sense once you know which layer each one belongs to; automation and security assume all of it.

primer

### A loop, not a chat Claude Code does not answer once and stop. It gathers context, acts, checks the result and decides the next step, turn after turn, until it judges the work finished or you interrupt. Every tool result feeds the next decision, so a wrong early read compounds. Interview answers about steering, rewinding and verifying all start from this: you supervise a process, not a reply. ### Four layers, four strengths What Claude Code does is shaped at four layers, and interviewers want to hear which one a requirement belongs in: - **Instructions** — CLAUDE.md, skills, the prompt. The model reads them and usually follows them; nothing enforces them. - **Permissions** — allow, ask and deny rules plus a permission mode, checked by the harness before a tool call runs. - **Hooks** — your code, run by the harness at lifecycle events, outside the model's choice. - **Sandbox** — operating-system limits on what shell commands can write and reach. A requirement that cannot bend does not belong in prose. Each layer also has edges: a deny rule covers the calls Claude makes, not every program a permitted command starts, and the Bash sandbox wraps shell commands only. ### Context is the working budget Everything Claude knows in a session sits in one finite window: system prompt, memory files, tool definitions, file contents, command output, the conversation. As it fills, output quality and cost both move. Most features in this hub are, at bottom, ways to spend that budget deliberately. ### Load on demand The tool keeps reusing one pattern: show a short description up front and load the body only when needed. CLAUDE.md is paid for in every session, so it should stay brief and universally true; a skill's body loads when invoked; MCP tool definitions can be deferred behind a search; a subagent does noisy work in its own window and hands back only a summary. ### Scopes layer and merge Settings, CLAUDE.md, MCP servers, subagents and skills each exist at several scopes — organization-managed, personal, project-shared, project-local. Knowing which file a team commits, which stays personal, and which source wins a conflict answers a surprising share of questions. ### The repository is input, not authority A cloned repository can carry settings, hooks, MCP servers and instructions. Workspace trust decides when that configuration may act, and prompt injection through files, web pages or tool output is why it matters. Claude Code runs as you, with your access. ### Autonomy is decided before the run Permission modes, allow lists and the sandbox are chosen up front. An unattended run has nobody to answer a prompt, so its limits must be complete before it starts.

Built-in tools
The actions Claude Code ships with, such as Read, Edit, Write, Grep, Glob, Bash and WebFetch. Nearly everything Claude itself does to your machine goes through one of them.
Permission rule
An allow, ask or deny entry naming a tool and optionally a pattern, such as a command prefix or a path. Deny is checked before ask and allow.
Permission mode
The session-wide default for tool approval, from asking before each edit through read-only planning to accepting edits or running unattended.
Plan mode
A permission mode in which Claude explores and proposes a change without editing source files, so you approve the approach before any work lands.
Checkpoint
A snapshot Claude Code takes before its file-editing tools change files, letting you rewind code, conversation or both to an earlier prompt.
CLAUDE.md
A Markdown memory file loaded into context at session start, at managed, user, project or local scope. It guides Claude but enforces nothing.
Compaction
Replacing a conversation's history with a summary to free room in the context window while the session continues on the same task.
Skill
A folder holding a SKILL.md with frontmatter and instructions. Its description stays visible; its body loads when Claude matches it or you run it by name.
Hook
A handler the harness runs at a lifecycle event, such as before a tool call or when Claude stops. It can observe, add context or block.
MCP server
A process or remote endpoint speaking the Model Context Protocol, exposing tools, resources and prompts that Claude Code can use in a session.
Subagent
A helper defined in Markdown that runs a delegated task in its own context window, with its own prompt and tools, and returns a summary.
Plugin
An installable bundle of skills, agents, hooks and MCP or LSP servers, distributed through marketplaces and namespaced by the plugin's name.
Managed settings
Settings an organization deploys to a machine's system directory. They sit above every other scope and cannot be overridden by users or projects.
Workspace trust
The one-time consent for a folder that lets the repository's own configuration, such as its hooks and allow rules, take effect.
Headless mode
Running Claude Code non-interactively with a prompt as input and the result on standard output, for scripts, CI jobs and schedules.
Agent SDK
A Python and TypeScript library that exposes Claude Code's agent loop, tools, permissions and hooks for embedding in your own application.

Follow one request through a session. At launch Claude Code resolves who you are and what you pay with, then assembles the starting context: its system prompt, the CLAUDE.md files on the path from the managed scope down to the working directory, skill descriptions, and the MCP tools it knows about. You type a task. The model picks a tool call; before it runs, the harness checks deny, ask and allow rules and the permission mode, and fires any `PreToolUse` hooks, which may block it. A shell command then runs inside the sandbox if one is enabled; a file edit is checkpointed first. The result goes back into the window, and the loop continues until Claude stops, at which point `Stop` hooks get a last word. Everything else attaches to that path: - **Skills** and **subagents** change what enters the window and when: one loads instructions on demand, the other spends a separate window and returns a summary. - **MCP servers** add tools to the catalogue, named so the same permission rules can cover them. - **Settings files** carry the rules, hooks, mode and environment, merged across scopes, with managed settings on top. - **Plugins** bundle skills, agents, hooks and servers so a team installs them as one unit. - **Headless runs, CI and the Agent SDK** drive the same loop with no one at the keyboard, which is why their permissions must be set in advance. A committed project settings file shows three layers meeting — a default mode, rules the harness checks, and a hook that runs regardless of the model: ```json { "permissions": { "defaultMode": "acceptEdits", "allow": ["Bash(./gradlew test *)"], "deny": ["Bash(git push *)", "Read(./secrets/**)"] }, "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [{ "type": "command", "command": ".claude/hooks/guard.sh" }] } ] } } ``` None of it is a boundary on its own. The mode decides how often you are asked, the rules decide what is pre-decided, the hook catches what a pattern cannot express, and this whole file takes effect in a cloned repository only after the folder is trusted.

  1. Setup & Platforms →

    Install, sign in and choose a surface first, because the account and where a session runs decide cost and which features exist.

  2. Agent Loop & Safeguards →

    The loop, the tools and the permission model every later section builds on: rules, modes and checkpoints.

  3. Memory & Context →

    What loads into the window, how CLAUDE.md is scoped, and when to clear or compact; context explains most quality and cost questions.

  4. Skills & Custom Commands →

    The first extension point: packaged instructions loaded on demand, and how they differ from CLAUDE.md.

  5. Harness Hooks →

    Where enforcement lives: lifecycle events, the exit-code contract, and why a hook can stop what an instruction cannot.

  6. Security & Governance →

    Sandboxing, workspace trust and managed policy, which make sense once you know every layer they contain.

  • Putting a must-hold rule in CLAUDE.md: it is context the model usually follows, not configuration, so enforcement belongs in permissions or a hook.

  • Treating a deny rule as a file firewall: it covers the calls Claude makes and commands it recognises, not a script or program a permitted command launches.

  • Writing a guard hook that exits 1 to block: only exit 2 or a deny decision in JSON stops the call — see why exit 1 fails open.

  • Trusting /rewind to undo everything: checkpoints cover Claude's file-editing tools, not edits made through Bash, remote side effects or most subagent work.

  • Saying the Bash sandbox contains the agent: file tools, hooks and local MCP servers run outside it, so unattended or untrusted work needs a container or VM.

  • Reaching for bypassPermissions to stop prompts on an unattended run instead of a narrow allow list with unlisted calls denied, and only inside isolation.

  • Trusting a cloned repository without reading its .claude/ folder and .mcp.json: once trusted, its hooks, allow rules and servers act on your machine.

  • Letting a stray ANTHROPIC_API_KEY sit in the environment of a subscriber, which can move usage onto per-token API billing without anyone noticing.

  • Filling the window with every MCP server and a long CLAUDE.md, then blaming the model for drifting; trim, defer and delegate before switching models.

Claude Code ships often, and several answers depend on the release. This guide assumes the 2.1 line as it stood in late 2026; when an answer leans on recent behaviour, name the version rather than presenting it as permanent. Changes an interviewer may still probe: - **Custom commands merged into skills.** Files under `.claude/commands/` keep working and create the same `/name` as a skill folder would, but new work goes into skills, and when both define one name, the skill takes precedence. Older material treats the two as separate features. - **Shell mode replies on its own.** Since 2.1.186, output from a `!` command prompts a reply from Claude automatically; before that, it only landed in the conversation. - **Headless permission prompts.** The `--permission-prompts none` option arrived in 2.1.259, for unattended runs that might otherwise hang on an approval request. Defaults move too: model names, the effort setting and which features are enabled out of the box have all changed between releases. For anything you cannot pin to a release, describe the mechanism and say the default may differ in the version the team runs.

Interviewers expect you to place Claude Code among coding agents, not only operate it. Its closest neighbours are other terminal agents, such as Codex CLI, Gemini CLI and Aider, and IDE-centred assistants such as GitHub Copilot's agent mode and Cursor. The trade that separates them is where the agent lives: a terminal agent works with the shell, scripts and CI natively, while an IDE assistant sits closer to the editor's diff view and completions. Claude Code covers both ends through its VS Code and JetBrains integrations and a desktop app, with the CLI as the full-featured surface. It is also used with things rather than against them. The Model Context Protocol, an open protocol introduced by Anthropic and supported by other agents, is how it reaches issue trackers, databases and browsers; a server written once works across clients that speak it. The Agent SDK puts the same loop inside your own service, which is the usual answer when a team outgrows shell scripts around headless runs. In CI, the GitHub Action runs reviews and fixes on pull requests. When asked to choose a tool, name the workload, how much autonomy it needs and where enforcement must live; the agent you pick changes the file names, not those questions.

explore

report an issue with this guide →

questions

188 · 11 sections

Which kinds of account can you sign in to Claude Code with, and what happens at first launch with each?

level: juniorimportance: must knowfreq 30%
basics
~20 s

Claude Code accepts a Pro or Max subscription, a Team or Enterprise seat, a Claude Console account, or a cloud provider such as Amazon Bedrock; the free claude.ai plan is excluded. First launch opens a browser login, except for cloud providers.

open as a page

Which Claude Code capabilities exist only in the CLI, and what do Desktop and the VS Code and JetBrains integrations offer instead?

level: juniorimportance: must knowfreq 26%
basics
~20 s

Non-interactive claude -p runs and the Agent SDK are CLI-only, and the CLI has every command and permission mode. Desktop adds visual diffs, panes and parallel sessions, VS Code a graphical panel, and the JetBrains plugin runs the CLI inside the IDE.

open as a page

In Claude Code, how does a Remote Control session differ from a cloud session in where it runs and what it can reach?

level: middleimportance: must knowfreq 22%
basics
~20 s

Remote Control lets claude.ai or the Claude app drive a session that keeps running on your machine, with your files, tools and MCP servers. A cloud session runs on a fresh clone in an Anthropic-managed VM and continues after you disconnect.

open as a page

When several credentials are present, how does Claude Code choose one, and why can a stray ANTHROPIC_API_KEY move a subscriber onto API billing?

level: seniorimportance: must knowfreq 22%
basics
~10 s

Claude Code takes the highest credential in a fixed order: cloud provider switch, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, apiKeyHelper, CLAUDE_CODE_OAUTH_TOKEN, profiles, then the /login subscription. An approved ANTHROPIC_API_KEY therefore beats a subscription and bills its Console organization.

open as a page

How do Claude Code updates differ between the native installer and Homebrew, WinGet or apt, and what does autoUpdatesChannel control?

level: middleimportance: should knowfreq 16%
basics
~20 s

Native installs update themselves in the background; Homebrew, WinGet, apt, dnf and apk installs do not by default. autoUpdatesChannel chooses latest (default) or stable for native updates; Homebrew and the Linux repositories choose the channel by cask or repository.

open as a page

After Claude Code deleted a failing test's assertions with Edit to make it pass, how do you rewind and which restore option fits?

level: juniorimportance: must knowfreq 30%
basics
~20 s

Press Esc twice on an empty prompt, or run /rewind, pick the prompt that started the bad turn, and choose Restore code and conversation: the files and the conversation both return to before that prompt.

open as a page

In Claude Code, what does plan mode let Claude do, how do you enter it, and what happens when you approve the plan?

level: juniorimportance: must knowfreq 34%
basics
~20 s

Plan mode lets Claude read files and run exploratory commands to propose a change without editing source. Enter it with Shift+Tab, a /plan prefix or --permission-mode plan; approving the plan exits plan mode into the mode the chosen option names.

open as a page

In Claude Code, what happens in the gather-context, take-action and verify-results phases, and how do you steer the loop mid-run?

level: juniorimportance: must knowfreq 28%
basics
~20 s

Claude Code repeats three blended phases until the task looks done: gather context (read, search), take action (edit, run commands) and verify results (tests, builds). Each tool result shapes the next step; Esc stops the running call so you can redirect.

open as a page

Claude Code renamed a symbol across the repo with sed through Bash — why can't /rewind undo it, and what else escapes its checkpoints?

level: middleimportance: must knowfreq 22%
basics
~20 s

Checkpoints snapshot only files changed by Claude Code's file-editing tools, so a sed rename through Bash is not tracked. Manual or other-session edits (normally), most subagent edits, symlinked or hard-linked files and remote side effects also escape; use git.

open as a page

In Claude Code, which permission mode fits a supervised refactor, an unattended overnight task and a read-only audit, and why?

level: middleimportance: must knowfreq 30%
basics
~20 s

Use acceptEdits for a supervised refactor you review by diff, plan for a read-only audit since edits stay blocked, and auto for an overnight task; bypassPermissions belongs only in an isolated container or VM, and deny rules hold in every mode.

open as a page

In Claude Code, why does a slash command typed partway through a prompt not run, and what becomes of text after a command's name?

level: juniorimportance: must knowfreq 18%
basics
~20 s

Claude Code recognises a slash command only at the start of a message, and text after the command name becomes its arguments. A /name typed mid-sentence goes to Claude as ordinary prompt text; Claude Code runs nothing.

open as a page

In Claude Code, what does starting a prompt with `!` do, and how does it differ from asking Claude to run that command?

level: juniorimportance: must knowfreq 28%
basics
~20 s

A leading ! puts Claude Code in shell mode: the command runs directly with no approval prompt, its command and output are added to the conversation, and since v2.1.186 Claude replies to that output automatically.

open as a page

In Claude Code, when do you use `claude -c`, `claude -r <name>` and `claude -r` with no argument to return to earlier work?

level: juniorimportance: must knowfreq 30%
basics
~20 s

claude -c reopens the most recent conversation in the current directory; claude -r with a name or session ID resumes that one session directly; claude -r alone opens the interactive session picker to search, preview and choose.

open as a page

While Claude Code is mid-turn and heading the wrong way, what do typing a message plus Enter, Esc, Ctrl+C and Ctrl+Enter each do?

level: middleimportance: must knowfreq 24%
basics
~20 s

Enter mid-turn queues a message that reaches Claude after the current tool calls; Esc stops the turn but keeps work done and sends the queue; Ctrl+C interrupts, or clears then exits when idle; Ctrl+Enter sends the queue at once.

open as a page

You resume yesterday's Claude Code session with `claude -r flaky-test` and its MCP servers and extra directory are missing — what does a resume restore, and what must you pass again?

level: seniorimportance: must knowfreq 12%
basics
~20 s

A resume restores what the transcript saved: the full history, the model, the agent and, on terminal routes, the permission mode, with exceptions. Launch flags such as --mcp-config, --settings, --plugin-dir, --fallback-model and --add-dir are not saved, so pass them again.

open as a page

What belongs in a Claude Code project CLAUDE.md, and why can't it guarantee Claude follows an instruction?

level: juniorimportance: must knowfreq 38%
basics
~20 s

A project CLAUDE.md holds facts Claude needs every session: build and test commands, conventions, layout and team rules. Claude reads it as context, not enforced configuration, so a rule that must hold belongs in permissions or a hook.

open as a page

In Claude Code, what does /usage (alias /cost) report, and what does its dollar figure mean on a Pro plan versus an API key?

level: juniorimportance: must knowfreq 22%
basics
~20 s

Claude Code's /usage shows session token counts, a locally estimated dollar cost and, on Pro, Max, Team or Enterprise, plan usage bars. API-key users pay per token; subscribers draw on plan limits, so that dollar figure is not their bill.

open as a page

In Claude Code, how do you switch the model mid-session or at launch, and which method changes the default for new sessions?

level: juniorimportance: must knowfreq 30%
basics
~20 s

Use /model inside a session or claude --model at launch. A typed /model name, or Enter in the picker, switches now and saves the model key in ~/.claude/settings.json; s in the picker, --model and ANTHROPIC_MODEL affect only that session.

open as a page

In Claude Code, when do you run /clear instead of /compact, and what does each command keep from the session?

level: juniorimportance: must knowfreq 30%
basics
~10 s

/clear starts a new conversation with empty history, so use it between unrelated tasks. /compact keeps the same conversation but replaces its history with a structured summary, freeing room to continue the current task.

open as a page

Where can Claude Code's CLAUDE.md files live, at managed, user, project and local scope, and who shares each one?

level: middleimportance: must knowfreq 24%
basics
~10 s

Managed policy CLAUDE.md applies to every user on the machine, ~/.claude/CLAUDE.md to you in every project, ./CLAUDE.md or ./.claude/CLAUDE.md to the team through git, and a gitignored ./CLAUDE.local.md to you in one project.

open as a page

In Claude Code, how do you turn your team's database-migration wiki page into a skill, and what goes in SKILL.md?

level: juniorimportance: must knowfreq 28%
basics
~10 s

Create a folder such as .claude/skills/db-migrations/ holding a SKILL.md: YAML frontmatter between --- markers starting on line one, with a description of when to use it, then the migration rules as concise Markdown.

open as a page

In Claude Code, what happens to existing .claude/commands/*.md files now that custom commands are merged into skills?

level: juniorimportance: must knowfreq 24%
basics
~10 s

They keep working. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy and behave the same way; the skill wins a name clash, and new work should use the skill folder.

open as a page

In Claude Code, when should an instruction live in a skill rather than in CLAUDE.md?

level: juniorimportance: must knowfreq 30%
basics
~20 s

CLAUDE.md loads into every session, so it suits short always-true facts and rules; a skill loads its body only when invoked by /name or matched by its description, so it suits procedures and long reference material needed sometimes.

open as a page

How do a Claude Code skill's description, SKILL.md body and supporting files each reach Claude's context, and when?

level: middleimportance: must knowfreq 20%
basics
~20 s

By default the description sits in the skill listing on every turn; the SKILL.md body enters context only when the skill is invoked, then stays; supporting files load only when Claude follows a pointer to them, and bundled scripts run without being read.

open as a page

In a Claude Code SKILL.md, how do disable-model-invocation: true and user-invocable: false differ, and which keeps a /deploy skill from running on its own?

level: middleimportance: must knowfreq 27%
basics
~20 s

disable-model-invocation: true stops Claude invoking the skill and drops its description from context, while you can still type /deploy. user-invocable: false only hides it from you; Claude can still load it. /deploy needs the first.

open as a page

What is a Claude Code subagent definition file, and how do its frontmatter and its Markdown body each shape the subagent?

level: juniorimportance: must knowfreq 30%
basics
~20 s

A subagent is a Markdown file in .claude/agents/ or ~/.claude/agents/: YAML frontmatter configures it (name and description required; tools, model, permissionMode and others optional) and the body becomes its system prompt in place of Claude Code's own.

open as a page

How do you run two Claude Code sessions on one repository at once without colliding edits, and what does `claude --worktree` set up?

level: juniorimportance: must knowfreq 26%
basics
~20 s

Start each session with claude --worktree <name> (or -w). Claude Code creates a git worktree at .claude/worktrees/<name> on a new branch worktree-<name> and starts there, so each session edits its own files while sharing the repository history.

open as a page

In a Claude Code subagent definition, how do the `tools` and `disallowedTools` fields differ, and how would you scope a read-only security reviewer?

level: middleimportance: must knowfreq 22%
basics
~20 s

tools is an allowlist and disallowedTools a denylist applied first; omit both and the subagent inherits every subagent tool. A read-only reviewer lists Read, Grep and Glob, because keeping Bash still lets it change files.

open as a page

In Claude Code, what does a non-fork subagent start with, and what reaches your main conversation when it finishes?

level: middleimportance: must knowfreq 30%
basics
~20 s

A non-fork subagent starts with its own system prompt, the task message Claude writes for it, your CLAUDE.md files and a git status snapshot, not your conversation history. Only its final message comes back to the main conversation.

open as a page

In Claude Code, how do automatic delegation, an @-mention and `claude --agent` differ in deciding which subagent does the work?

level: juniorimportance: should knowfreq 22%
basics
~20 s

Automatic delegation lets Claude pick a subagent by matching your request to its description; an @-mention guarantees that subagent runs for one task; claude --agent <name> makes the whole session run as that agent, with its prompt, tools and model.

open as a page

In Claude Code hooks, how do PreToolUse and PostToolUse differ, and which one can stop Claude from editing a database migration file?

level: juniorimportance: must knowfreq 30%
basics
~20 s

PreToolUse fires after Claude builds a tool call but before it runs, so it can block the call; PostToolUse fires only after the tool succeeded and cannot undo it. Only a PreToolUse hook can stop a migration edit.

open as a page

How does a Claude Code command hook receive the event's data, and how does it report its result back?

level: juniorimportance: must knowfreq 22%
basics
~20 s

Claude Code pipes one JSON object describing the event to the hook's stdin. The hook answers with its exit code (0 success, 2 block where the event allows it, others a non-blocking error) and, optionally, a JSON object on stdout.

open as a page

How do you set up a Claude Code hook that runs your formatter on every file Claude edits, and what does it miss?

level: juniorimportance: must knowfreq 30%
basics
~20 s

A PostToolUse command hook matched on Edit|Write, committed in .claude/settings.json, reads tool_input.file_path from stdin with jq and formats that one file. It runs after the edit, and files changed through Bash slip past that matcher.

open as a page

A Claude Code PreToolUse guard prints an error and exits 1 on terraform destroy, yet the command still runs. Why, and what do you change?

level: middleimportance: must knowfreq 18%
basics
~20 s

Claude Code treats exit 1 as a non-blocking error, so the call proceeds with only a hook-error notice. Exit 2 with the reason on stderr, or exit 0 and print JSON with permissionDecision set to deny.

open as a page

Why does a Claude Code PreToolUse hook with matcher `mcp__github` never fire, and how do Claude Code matchers choose exact or regex matching?

level: middleimportance: should knowfreq 12%
basics
~10 s

A matcher of only letters, digits, underscores, hyphens, spaces, commas and pipes is compared exactly, so mcp__github matches no tool. Any other character makes it an unanchored regex; use mcp__github__.*.

open as a page

In Claude Code, how do you add a local stdio MCP server that needs an API key, and why does the `--` separator matter?

level: juniorimportance: must knowfreq 22%
basics
~20 s

Run claude mcp add with --env KEY=value, the server name, then -- and the launch command. Everything after -- reaches the server untouched; without it, Claude Code parses the server's flags, such as -y or --port, as its own.

open as a page

In Claude Code, what does a connected MCP server add to a session, and how are its tools, resources and prompts invoked?

level: juniorimportance: must knowfreq 22%
basics
~10 s

Claude Code exposes a server's tools for Claude to call as mcp__server__tool, its resources as @server:protocol://path mentions you attach, and its prompts as commands listed as /server:prompt (MCP) or typed as /mcp__server__prompt.

open as a page

In Claude Code, how do the local, project and user MCP server scopes differ, and which one is the default?

level: middleimportance: must knowfreq 18%
basics
~20 s

Local, the default, is private to you and one project, stored in ~/.claude.json under that project's path. Project writes .mcp.json at the repository root for everyone who clones it. User is private to you across all projects.

open as a page

In Claude Code, how is a connected MCP server's tool named, and how do you write permission rules for one tool or a whole server?

level: middleimportance: must knowfreq 18%
basics
~20 s

Claude Code names each MCP tool mcp__<server><tool>, using the server name from your configuration. The rule mcp__server or mcp__server* covers every tool on that server, mcp__server__tool covers one, and an allow glob must start with a literal server prefix.

open as a page

How do you share an MCP server through a Claude Code project's `.mcp.json` without committing anyone's token, and where can `${VAR}` expansion fail you?

level: seniorimportance: should knowfreq 8%
basics
~20 s

Reference each developer's own variable as ${VAR} or ${VAR:-default} in command, args, env, url or headers. Unset without a default, it stays literal text with a warning; credential names like ANTHROPIC_API_KEY read as empty in remote url and headers.

open as a page

In Claude Code, which built-in output styles ship, what does each one change, and how do you switch between them?

level: juniorimportance: must knowfreq 22%
basics
~20 s

Claude Code starts in Default and ships four more styles: Proactive acts without routine questions, Concise leads with the result, Explanatory adds Insight blocks, and Learning also leaves TODO(human) code for you. Switch with /output-style, /config or outputStyle.

open as a page

What is a Claude Code plugin, and where do its manifest and its components sit in the plugin directory?

level: juniorimportance: must knowfreq 24%
basics
~20 s

A Claude Code plugin is a directory packaging skills, agents, hooks, MCP and LSP servers as one installable unit. Only the optional manifest lives in .claude-plugin/plugin.json; components sit at the plugin root, namespaced by the plugin name.

open as a page

Where do Claude Code's settings files live, and which one does a team commit versus keep personal?

level: juniorimportance: must knowfreq 30%
basics
~10 s

Claude Code reads ~/.claude/settings.json (you, every project), .claude/settings.json (the team, committed), .claude/settings.local.json (you, one project, kept out of git) and managed settings an organization deploys.

open as a page

In Claude Code, when one key is set in several settings files, which value wins, and why do list keys behave differently?

level: middleimportance: must knowfreq 17%
basics
~10 s

Claude Code uses the highest level setting a key: managed, then command line, then .claude/settings.local.json, then .claude/settings.json, then ~/.claude/settings.json. List keys such as permissions.allow merge across files instead.

open as a page

In Claude Code, how does an output style differ from CLAUDE.md, --append-system-prompt and a hook, and why can it never enforce a rule?

level: seniorimportance: must knowfreq 14%
basics
~20 s

An output style reshapes how Claude responds: built-ins add instructions, custom styles also drop the coding instructions unless kept. CLAUDE.md and --append-system-prompt only add. All three are guidance; enforcement comes from hooks and permission rules.

open as a page

What is the Claude Agent SDK, and when would you embed it in an application instead of scripting `claude -p`?

level: juniorimportance: must knowfreq 15%
basics
~20 s

The Claude Agent SDK runs Claude Code's agent loop, built-in tools, permissions, hooks and sessions as a Python or TypeScript library. Embed it when your service needs approval callbacks, in-process custom tools or typed messages; script claude -p for shell jobs.

open as a page

What does `claude -p` do, and how does a shell script feed it input and tell whether the run succeeded?

level: juniorimportance: must knowfreq 30%
basics
~10 s

claude -p (alias --print) runs Claude Code non-interactively: it takes the prompt plus any piped stdin, runs the agent loop, prints the result to stdout, and exits 0 on success or non-zero on failure.

open as a page

How does anthropics/claude-code-action@v1 choose between @claude interactive mode and automation mode, and what changes between the two?

level: middleimportance: must knowfreq 26%
basics
~20 s

The action's prompt input decides: without it, Claude waits for the trigger phrase, @claude by default, and replies in a comment; with it, Claude runs on the workflow's event and reports in the workflow run log by default.

open as a page

In a Claude Agent SDK service, why does the canUseTool callback never see some tool calls, and where must a check that sees every call live?

level: seniorimportance: must knowfreq 10%
basics
~20 s

canUseTool is the last step of the SDK's permission flow, so calls already approved by a hook, a mode such as acceptEdits or bypassPermissions, or an allow rule never reach it. A check for every call belongs in a PreToolUse hook callback.

open as a page

A nightly `claude -p` lint-triage job must neither stall on a permission prompt nor run commands nobody approved; how do you set its permissions?

level: seniorimportance: must knowfreq 20%
basics
~20 s

Pass the mode explicitly, usually --permission-mode dontAsk with narrowly scoped --allowedTools rules, so anything unlisted is denied rather than prompted; add --permission-prompts none (2.1.259+) when a permission host could otherwise wait, and never a bare Bash allow.

open as a page

In Claude Code, what is the workspace trust dialog, and what does accepting it switch on for a folder?

level: juniorimportance: must knowfreq 24%
basics
~20 s

The workspace trust dialog is Claude Code's interactive prompt in a folder you haven't trusted. Accepting it lets the repository's own config act: settings-file hooks, permissions.allow rules, additional directories and most env values. Deny and ask rules apply regardless.

open as a page

Where does an administrator place Claude Code's managed-settings.json on macOS, Linux and Windows, and how do you confirm a session enforces it?

level: middleimportance: must knowfreq 12%
basics
~10 s

In the system directory: /Library/Application Support/ClaudeCode/ on macOS, /etc/claude-code/ on Linux and WSL, C:\Program Files\ClaudeCode\ on Windows. Then run /status and look for Enterprise managed settings (file) on the Setting sources line.

open as a page

Once you trust a cloned repository in Claude Code, which committed files can run commands or widen permissions on your machine?

level: middleimportance: must knowfreq 16%
basics
~20 s

Once trusted, a repository's .claude/settings.json hooks, env block, apiKeyHelper and permissions.allow rules take effect, its .mcp.json servers can connect, and its subagents' frontmatter hooks run. Project skills' allowed-tools grants never waited for trust at all.

open as a page

By default, what can a command inside Claude Code's Bash sandbox write, read and reach on the network?

level: middleimportance: must knowfreq 20%
basics
~10 s

Writes: the working directory, a per-user temp directory and added directories, minus protected config paths. Reads: most of the machine, credential files included. Network: only through a local proxy whose allowedDomains list starts empty.

open as a page

Claude Code's managed settings already deny some reads, yet developers still pre-approve tools and run their own hooks — which managed-only keys close that gap?

level: seniorimportance: must knowfreq 9%
basics
~10 s

Managed settings win conflicts, but lists such as permission rules and hooks still merge in from lower files. Locks close that: allowManagedPermissionRulesOnly, allowManagedHooksOnly, allowManagedMcpServersOnly and strictKnownMarketplaces make Claude Code honour only managed values.

open as a page