Claude Code
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 pageshowhide
guide
overview
~2 minClaude 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.
- Setup & Platforms →
Install, sign in and choose a surface first, because the account and where a session runs decide cost and which features exist.
- Agent Loop & Safeguards →
The loop, the tools and the permission model every later section builds on: rules, modes and checkpoints.
- 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.
- Skills & Custom Commands →
The first extension point: packaged instructions loaded on demand, and how they differ from CLAUDE.md.
- Harness Hooks →
Where enforcement lives: lifecycle events, the exit-code contract, and why a hook can stop what an instruction cannot.
- 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_KEYsit 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
- Setup & Platforms11 questions
- Install & Login5 questions
- Surfaces & Remote Access6 questions
- Agent Loop & Safeguards21 questions
- Tool Catalogue5 questions
- Allow, Ask & Deny Rules6 questions
- Permission & Plan Modes6 questions
- Checkpoints & Rewind4 questions
- Session Workflow15 questions
- Resume, Branch & Export4 questions
- Slash Commands5 questions
- Input Modes & Shortcuts6 questions
- Memory & Context22 questions
- CLAUDE.md & Rules6 questions
- Window Budget & Compaction5 questions
- Models & Effort6 questions
- Usage, Cost & Caching5 questions
- Skills & Custom Commands17 questions
- SKILL.md & Frontmatter5 questions
- Invocation & Arguments6 questions
- Design & Evaluation6 questions
- Subagents & Parallel Work17 questions
- Definition Files & Scopes6 questions
- Delegation & Isolation6 questions
- Worktrees & Agent Teams5 questions
- Harness Hooks17 questions
- Events & Matchers6 questions
- Input, Output & Exit Status5 questions
- Handler Types & Patterns6 questions
- MCP Integration12 questions
- Adding & Scoping Servers6 questions
- Using Connected Servers6 questions
- Personalization & Extensions16 questions
- Settings Files & Precedence5 questions
- Plugins & Marketplaces6 questions
- Output Styles & Status Line5 questions
- Unattended Automation23 questions
- Headless Mode6 questions
- CI & Pull Request Review6 questions
- Schedules & Routines5 questions
- Agent SDK6 questions
- Security & Governance17 questions
- Sandboxing & Isolation6 questions
- Injection & Workspace Trust5 questions
- Managed Policy & Data6 questions
questions
188 · 11 sectionsWhich kinds of account can you sign in to Claude Code with, and what happens at first launch with each?
basics
~20 sClaude 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.
Which Claude Code capabilities exist only in the CLI, and what do Desktop and the VS Code and JetBrains integrations offer instead?
basics
~20 sNon-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.
In Claude Code, how does a Remote Control session differ from a cloud session in where it runs and what it can reach?
basics
~20 sRemote 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.
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?
basics
~10 sClaude 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.
How do Claude Code updates differ between the native installer and Homebrew, WinGet or apt, and what does autoUpdatesChannel control?
basics
~20 sNative 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.
After Claude Code deleted a failing test's assertions with Edit to make it pass, how do you rewind and which restore option fits?
basics
~20 sPress 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.
In Claude Code, what does plan mode let Claude do, how do you enter it, and what happens when you approve the plan?
basics
~20 sPlan 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.
In Claude Code, what happens in the gather-context, take-action and verify-results phases, and how do you steer the loop mid-run?
basics
~20 sClaude 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.
Claude Code renamed a symbol across the repo with sed through Bash — why can't /rewind undo it, and what else escapes its checkpoints?
basics
~20 sCheckpoints 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.
In Claude Code, which permission mode fits a supervised refactor, an unattended overnight task and a read-only audit, and why?
basics
~20 sUse 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.
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?
basics
~20 sClaude 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.
In Claude Code, what does starting a prompt with `!` do, and how does it differ from asking Claude to run that command?
basics
~20 sA 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.
In Claude Code, when do you use `claude -c`, `claude -r <name>` and `claude -r` with no argument to return to earlier work?
basics
~20 sclaude -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.
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?
basics
~20 sEnter 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.
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?
basics
~20 sA 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.
What belongs in a Claude Code project CLAUDE.md, and why can't it guarantee Claude follows an instruction?
basics
~20 sA 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.
In Claude Code, what does /usage (alias /cost) report, and what does its dollar figure mean on a Pro plan versus an API key?
basics
~20 sClaude 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.
In Claude Code, how do you switch the model mid-session or at launch, and which method changes the default for new sessions?
basics
~20 sUse /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.
In Claude Code, when do you run /clear instead of /compact, and what does each command keep from the session?
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.
Where can Claude Code's CLAUDE.md files live, at managed, user, project and local scope, and who shares each one?
basics
~10 sManaged 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.
In Claude Code, how do you turn your team's database-migration wiki page into a skill, and what goes in SKILL.md?
basics
~10 sCreate 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.
In Claude Code, what happens to existing .claude/commands/*.md files now that custom commands are merged into skills?
basics
~10 sThey 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.
In Claude Code, when should an instruction live in a skill rather than in CLAUDE.md?
basics
~20 sCLAUDE.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.
How do a Claude Code skill's description, SKILL.md body and supporting files each reach Claude's context, and when?
basics
~20 sBy 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.
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?
basics
~20 sdisable-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.
What is a Claude Code subagent definition file, and how do its frontmatter and its Markdown body each shape the subagent?
basics
~20 sA 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.
How do you run two Claude Code sessions on one repository at once without colliding edits, and what does `claude --worktree` set up?
basics
~20 sStart 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.
In a Claude Code subagent definition, how do the `tools` and `disallowedTools` fields differ, and how would you scope a read-only security reviewer?
basics
~20 stools 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.
In Claude Code, what does a non-fork subagent start with, and what reaches your main conversation when it finishes?
basics
~20 sA 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.
In Claude Code, how do automatic delegation, an @-mention and `claude --agent` differ in deciding which subagent does the work?
basics
~20 sAutomatic 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.
In Claude Code hooks, how do PreToolUse and PostToolUse differ, and which one can stop Claude from editing a database migration file?
basics
~20 sPreToolUse 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.
How does a Claude Code command hook receive the event's data, and how does it report its result back?
basics
~20 sClaude 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.
How do you set up a Claude Code hook that runs your formatter on every file Claude edits, and what does it miss?
basics
~20 sA 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.
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?
basics
~20 sClaude 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.
Why does a Claude Code PreToolUse hook with matcher `mcp__github` never fire, and how do Claude Code matchers choose exact or regex matching?
basics
~10 sA 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__.*.
In Claude Code, how do you add a local stdio MCP server that needs an API key, and why does the `--` separator matter?
basics
~20 sRun 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.
In Claude Code, what does a connected MCP server add to a session, and how are its tools, resources and prompts invoked?
basics
~10 sClaude 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.
In Claude Code, how do the local, project and user MCP server scopes differ, and which one is the default?
basics
~20 sLocal, 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.
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?
basics
~20 sClaude 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.
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?
basics
~20 sReference 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.
In Claude Code, which built-in output styles ship, what does each one change, and how do you switch between them?
basics
~20 sClaude 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.
What is a Claude Code plugin, and where do its manifest and its components sit in the plugin directory?
basics
~20 sA 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.
Where do Claude Code's settings files live, and which one does a team commit versus keep personal?
basics
~10 sClaude 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.
In Claude Code, when one key is set in several settings files, which value wins, and why do list keys behave differently?
basics
~10 sClaude 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.
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?
basics
~20 sAn 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.
What is the Claude Agent SDK, and when would you embed it in an application instead of scripting `claude -p`?
basics
~20 sThe 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.
What does `claude -p` do, and how does a shell script feed it input and tell whether the run succeeded?
basics
~10 sclaude -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.
How does anthropics/claude-code-action@v1 choose between @claude interactive mode and automation mode, and what changes between the two?
basics
~20 sThe 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.
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?
basics
~20 scanUseTool 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.
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?
basics
~20 sPass 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.
In Claude Code, what is the workspace trust dialog, and what does accepting it switch on for a folder?
basics
~20 sThe 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.
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?
basics
~10 sIn 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.
Once you trust a cloned repository in Claude Code, which committed files can run commands or widen permissions on your machine?
basics
~20 sOnce 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.
By default, what can a command inside Claude Code's Bash sandbox write, read and reach on the network?
basics
~10 sWrites: 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.
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?
basics
~10 sManaged 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.