Claude Reference Claude Code CLI · model family · Messages API

Everything the terminal agent, the model family, and the API expose — commands, flags, keys, settings, hook events, frontmatter, model IDs and prices — on one page. Guide cards explain the mechanisms; the index below is a searchable dictionary of every command, flag, tool, setting, variable, and event. Three terms recur: a token is the unit models read and bill by (about ¾ of an English word); the context window is the token budget one conversation can hold; MCP (Model Context Protocol) is the open standard for plugging outside tools and data sources into an agent.

built-inbundled skillsettingtoolhook eventAPI Claude Code v2.1.260 · docs Sep 2026

Claude Code — Working Reference

how the agent, its configuration, and its extension points actually behave · click the title to collapse

Starting a session & invoking Claude

claude [options] [prompt]
Welcome to Claude Code cwd: ~/projects/myapp /help for help model: Opus 5 (1M) · effort xhigh · Manual mode
claudeinteractive session in the current directory claude "explain this project"interactive, seeded with a first prompt claude -p "fix the type errors"print mode: one answer to stdout, then exit cat log.txt | claude -p "what broke?"piped input (stdin) becomes context — Claude Code is pipeable claude -ccontinue the most recent conversation in this directory claude -r "auth-refactor" "finish it"resume by session ID or name; bare -r opens a picker claude --model opus --effort xhighpick model + reasoning depth for this session only claude -w feature-auth --tmuxrun in a fresh git worktree (a second checkout of the repo in its own folder), inside its own tmux terminal pane claude --bg "investigate flaky test"detach as a background agent; manage with claude agents claude --safe-modedisable every customization — the first move when config breaks

Session lifecycle

  • Each conversation lives in a session keyed to the working directory. -c takes the newest; -r picks any; --fork-session resumes into a new ID so the original stays intact.
  • /clear starts a fresh conversation (the old one is kept and resumable). /compact keeps working but summarizes. /rewind steps the conversation and/or the code back to a checkpoint.
  • --session-id <uuid> pins a known ID for scripting; -n/--name labels the session in the prompt bar, picker, and terminal title.
  • claude project purge [path] deletes all local state (transcripts, tasks, file history) for a project.

Where Claude Code runs

  • Terminal (this CLI) · IDE (VS Code, JetBrains) · desktop app (macOS / Windows) · web at claude.ai/code · mobile for review.
  • --cloud starts a session on claude.ai infrastructure; /teleport pulls a web session down into this terminal; --remote-control lets claude.ai drive this local session.
  • --ide auto-attaches to a running IDE; /ide manages the connection.

Fast paths worth knowing

  • --bare — skips hooks, LSP (language-server) integration, plugin sync, auto-memory, CLAUDE.md discovery and keychain reads. Fastest cold start for scripts; auth is strictly ANTHROPIC_API_KEY/apiKeyHelper.
  • --add-dir ../lib ../apps — grant file access outside the cwd without moving.
  • /cd <path> — move the session to another directory keeping the conversation and its prompt cache.
  • --tools "Bash,Edit,Read" — restrict the built-in tool set; --tools "" disables all tools.
  • --restricted — for evaluation harnesses on shared machines: removes the command-running tools and WebFetch, ignores user/project settings, confines file tools to the working directories.

Keyboard & input

? on empty input toggles the help panel
KeyActionNotes
EscInterrupt Claude / close a dialogStops the current response or tool call without exiting
Esc EscClear input draft, or rewindWith text: clears it. Empty: opens the rewind / checkpoint picker
Shift+TabCycle permission modesManual → acceptEdits → plan → auto…; Alt+M on Windows without VT input
Ctrl+CInterrupt, or clear the inputTwice in a row exits
Ctrl+DExit sessionFirst press asks for confirmation
Ctrl+OToggle transcript viewerFull tool calls and execution detail
Ctrl+RReverse-search prompt historyHistory is stored per working directory, across sessions
Ctrl+BBackground the running taskBackgrounds Bash commands and agents
Ctrl+TToggle the task checklistInside /theme: toggles code syntax highlighting instead
Ctrl+SStash / restore the promptPark a half-written prompt, do something else, bring it back
Ctrl+X EnterQueue the messageSubmits without interrupting a running turn; it waits its turn (v2.1.247+)
Ctrl+]Reopen the latest artifactOpens the most recently published artifact page in the browser
Ctrl+G / Ctrl+X Ctrl+EOpen prompt in $EDITORFor long or structured prompts
Ctrl+LRedraw the screenKeeps input and conversation
Ctrl+VPaste image from clipboardCmd+V in iTerm2, Alt+V on Windows/WSL; inserts an [Image #N] chip
Ctrl+X Ctrl+KStop all background subagentsTwice within 3 s to confirm; also disarms artifact auto-replies
Ctrl+ZSuspend the processUnix only; fg to resume
Option+P / Alt+PSwitch modelWithout clearing the prompt
Option+T / Option+OToggle extended thinking / fast modemacOS needs Option-as-Meta configured
TabAccept autocomplete; or annotate a permission answerAdd a comment to a yes/no permission decision

Line editing (readline-style)

  • Ctrl+A/Ctrl+E line start/end · Ctrl+K kill to end · Ctrl+U kill to start · Ctrl+W delete word · Ctrl+Y yank it back · Alt+Y cycles the kill ring.
  • Alt+B/Alt+F move by word · Alt+D delete next word · Ctrl+_ undo the last input edit.
  • Set "keybindingFlavor": "readline" to make Ctrl+W delete back to whitespace (GNU/bash behavior) instead of only the last path segment. Default is "classic".

Multiline & quick prefixes

  • Newline without submitting: \+Enter anywhere · Ctrl+J anywhere · Shift+Enter natively in iTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal · Option+Enter with Option-as-Meta. /terminal-setup configures the rest.
  • / at start → command or skill · ! at start → shell mode: run it, add the output to context, and let Claude react · @ → file-path autocomplete (and other live sessions to message) · : → emoji shortcode.

Transcript viewer (Ctrl+O)

  • { / } jump to the previous/next user prompt · [ dumps the whole conversation into native terminal scrollback so Cmd+F and tmux copy-mode can search it · v opens it in $EDITOR · ? shows the shortcut panel · q/Esc exits.
  • Fullscreen renderer (/tui fullscreen) is flicker-free and mouse-aware; /tui alone reports which renderer is active.

Vim editor mode

Enable with /config → Editor mode, or "editorMode": "vim". Mode and cursor position survive toggling the transcript or opening a panel.

ModeKeys
Enter NORMALEsc from INSERT or VISUAL
Enter INSERTi I a A o O
Enter VISUALv char-wise · V line-wise (no Ctrl+V block mode)

Motion

h j k l · w e b · 0 ^ $ · gg G · f F t T then ; / , to repeat · / opens reverse history search (same as Ctrl+R).

Operators

x dd D dw de db · cc C cw ce cb · s S substitute · yy/Y yw ye yb · p P · >> << · J join · u undo · . repeat.

Text objects

iw aw iW aW i" a" i' a' i( a( i[ a[ i{ a{ — combine with d, c, y.

At the top or bottom of the input, j/k fall through to command history. Map an escape sequence with "vimInsertModeRemaps": {"jj": "<Esc>"} — user settings only, so a checked-out repo can never remap your keys.

Permission modes & rules

Shift+Tab cycles · /permissions edits
ModeRuns without askingBest for
default (shown as Manual)Reads onlyReviewing every action; sensitive work
acceptEditsReads, file edits, common filesystem commands (mkdir, touch, mv, cp)Iterating on code you're watching
planReads, plus classifier-approved commands where auto mode is available — never edits your sourceExploring before changing anything
autoEverything, with a background classifier — a separate model call that judges each action against your request — checking every callLong tasks; killing prompt fatigue
dontAskOnly pre-approved tools; everything else is auto-deniedLocked-down CI and scripts
bypassPermissionsEverything, no checksIsolated containers and VMs only

Rule syntax

Bashevery Bash call Bash(git log *)prefix match on the command Bash(npm run build)that exact command Read(./.env)one file, relative to cwd Edit(src/**/*.ts)glob under the current directory Read(~/Documents/*.pdf)path from home Read(//**/.env)anchored at the filesystem root — anywhere WebFetch(domain:example.com)one domain Agent(model:opus)subagent calls requesting a model tier Agent(isolation:worktree)subagents asking for a worktree Bash(run_in_background:true)background Bash calls Cd(~/code/**)directories Claude may cd into

How rules resolve

  • Three buckets: permissions.allow (never prompts), permissions.ask (always prompts), permissions.deny (always blocks). Deny wins in every mode, bypassPermissions included.
  • Path prefixes: //abs from filesystem root · ~/… from home · /rel relative to the settings file that declares it · bare or ./ relative to the cwd.
  • An allow rule like Edit(src/**) matches only this project's src; write Edit(**/src/**) to match at any depth.
  • Nothing auto-approves an explicit ask rule, AskUserQuestion, or MCP tools marked requiresUserInteraction — not even bypass mode.
  • Protected paths are never auto-approved outside bypass mode.

Reducing prompts, safely

  • /fewer-permission-prompts mines your own transcripts for repeated read-only Bash/MCP calls and writes a prioritized allowlist into project settings.
  • --allowedTools "Bash(git log *)" "Read" and --disallowedTools set rules for one run — the usual pair for CI.
  • auto mode is the middle ground: it classifies each call rather than blanket-approving. claude auto-mode defaults prints the built-in classifier rules as JSON.
  • --permission-prompt-tool mcp_auth_tool routes prompts to an MCP tool in non-interactive runs; --permission-prompts none denies anything that would have prompted.

How the layers stack in practice

  • Starting mode depends on the plan. Interactive terminal sessions on Pro, Max and Team start in auto; API-key, Console and cloud-provider logins start in Manual. permissions.defaultMode or --permission-mode overrides either.
  • Rules run first, mode second. A deny rule blocks in every mode; an allow rule skips the prompt in every mode; only what is left over is decided by the mode (ask you, ask the classifier, or refuse).
  • Sandbox is the third layer. With sandbox.enabled, Bash runs inside an OS-enforced boundary and autoAllowBashIfSandboxed (default true) stops prompting for it — the kernel, not the classifier, is what keeps it inside the allowed paths and domains.
  • Protected paths (.claude/, .git/, .mcp.json, settings files) are never auto-approved by the classifier; a person answers, or a rule.
  • Reads outside the project: permissions.blockReadsOutsideWorkingDirectories stops Read/Grep/Glob leaving the working directories in every mode, bypass included.

The model family — what each one is for

/model · /effort · --model · --effort
ModelAPI model IDCtx / max out$ per million tokens (MTok), in / outReach for it when…
Claude Fable 5.1
most capable released
claude-fable-5-11M / 128k$10 / $50
cache hit $0.25
Work bigger than one sitting: multi-hour autonomous runs, root-cause hunts through an unfamiliar system, outage forensics, architecture decisions. Describe the outcome, not the steps — it plans the path and verifies itself without nagging. Slower per turn; not the default on any plan. Alias fable, or best. Successor to Fable 5 (claude-fable-5, still served, same price but cache hits at $1) — the one API difference: forced tool choice (tool_choice any/tool) is rejected.
Claude Opus 5
the default workhorse
claude-opus-51M / 128k$5 / $25Complex agentic coding and enterprise work — large refactors, multi-file features, debugging with real reasoning, anything where being wrong is expensive. Thinking is on by default. This is the right starting point for almost everything. Alias opus.
Claude Sonnet 5
speed × intelligence
claude-sonnet-51M / 128k$2 / $10Daily coding at volume: code generation, data analysis, content, visual understanding. Frontier-class at a third of Opus's price — the sensible default for high-throughput pipelines and for subagents doing well-specified work. Alias sonnet.
Claude Haiku 4.5
fastest
claude-haiku-4-5200k / 64k$1 / $5Real-time and high-volume: classification, extraction, routing, log triage, cheap fan-out workers. Near-frontier quality at the lowest latency. The one model here that still uses the old fixed budget_tokens thinking. Alias haiku.
Claude Mythos 5.1 (invite-only)claude-mythos-5-11M / 128k$10 / $50Fable 5.1's specs and pricing, offered through Project Glasswing for defensive cybersecurity work. No self-serve access. (claude-mythos-5 remains.)
Still available, previous generation: claude-opus-4-8 · claude-opus-4-7 · claude-opus-4-6 · claude-opus-4-5 (all 1M ctx, $5/$25) · claude-sonnet-4-6 · claude-sonnet-4-5 ($3/$15). Every ID is a pinned snapshot, never an evergreen pointer — from the 4.6 generation on, IDs are dateless but still pinned.

Aliases & what they resolve to

AliasResolves to
defaultClears any override, back to your account's runtime default
bestFable 5.1 where your org has it, else the latest Opus
fable / opus / sonnet / haikuLatest of that tier for your provider — today Fable 5.1, Opus 5, Sonnet 5, Haiku 4.5 on the Anthropic API
opus[1m] / sonnet[1m]Force the 1M-token context window
opusplanOpus while planning, Sonnet to execute — cheap way to buy good plans

On Bedrock and Google Cloud, sonnet still resolves to Sonnet 4.5, and on Foundry opus is 4.6 — pin the full ID or set ANTHROPIC_DEFAULT_SONNET_MODEL to get newer.

Effort — the second dial

LevelUse for
lowShort, scoped, latency-sensitive work that isn't intelligence-sensitive
mediumCost-sensitive work that can trade a little quality
highBalanced — the default on the API and in Claude Code for every model except Opus 4.7, which defaults to xhigh
xhighDeeper reasoning, more tokens. Best setting for most coding and agentic work on Fable 5 / Opus 5 / Sonnet 5
maxCorrectness over cost. Diminishing returns; can overthink — test before adopting
ultracodeClaude Code only: plans a dynamic multi-agent workflow per task at xhigh reasoning

Effort often matters more than the model choice. Opus 5 at low can beat Sonnet at high for reasoning, and cost less than Opus at max. Set it with /effort, --effort, effortLevel, or per-skill / per-subagent frontmatter.

Choosing, in practice

  • Start capability-first when accuracy dominates: implement on Opus 5, then walk effort or model down once it works. Cheaper than debugging a weak model's output.
  • Start efficiency-first when volume dominates: build on Haiku 4.5, test honestly, upgrade only at a real capability gap.
  • Split the session: opusplan, or Opus in the main loop with CLAUDE_CODE_SUBAGENT_MODEL=sonnet for the fan-out. Subagents doing well-specified searching rarely need frontier reasoning.
  • Fast mode (/fast, Option+O) runs Opus 5 / 4.8 at up to 2.5× output speed for $10/$50 — the same model, priced up, not a smaller one.
  • Fallbacks: --fallback-model sonnet,haiku tries each in order when the primary is overloaded, retrying the primary each turn. Fable requests flagged by the safety classifiers fall back on their own: biology to Opus 5, cybersecurity to Opus 4.8.
  • Fable models can bill to usage credits rather than plan limits on some plans; interactive sessions prompt for consent first (v2.1.255+), -p mode never does.

Prompt caching is the real cost lever, not the model. A cache hit costs 10% of base input — $0.50/MTok on Opus 5 versus $5 — and only 2.5% ($0.25) on Fable 5.1. Batch API halves both directions and stacks with caching. Switching models mid-session invalidates the cache and buys you one slow, expensive uncached turn, so switch at a natural boundary.

Context, compaction & caching

/contextcolored grid of what is filling the window, with suggestions /compact [focus]summarize the conversation, keep working /cleardrop it entirely and start fresh (old session stays resumable) /autocompact 500kcompact at 500k rather than the default threshold /usagesession cost, plan limits, breakdown by skill/subagent/plugin

What fills the window

Caching rules that bite

Auto-compaction defaults scale with the window; --autocompact auto|<tokens> or autoCompactWindow override it. DISABLE_AUTO_COMPACT=1 turns it off entirely — useful when you'd rather hit the wall than lose fidelity.

CLAUDE.md, rules & memory

ScopeLocation
Managed policy/Library/Application Support/ClaudeCode/CLAUDE.md · /etc/claude-code/CLAUDE.md · C:\Program Files\ClaudeCode\CLAUDE.md
User~/.claude/CLAUDE.md
Project./CLAUDE.md or ./.claude/CLAUDE.md
Local (gitignored)./CLAUDE.local.md

All discovered files are concatenated, root-down — they don't override each other. Files above the cwd load at launch; files in subdirectories load lazily when Claude reads there.

Imports & rules

@path/to/file.mdimport into CLAUDE.md, max 4 hops deep; relative to the importing file `@README`backticks keep it literal — no import @~/.claude/my-prefs.mdexternal import: prompts for approval once .claude/rules/*.mdtopic files; paths: frontmatter scopes them by glob

Claude Code reads CLAUDE.md, not AGENTS.md — if your repo has the latter, make a CLAUDE.md that imports it. Block-level HTML comments are stripped before injection, so <!-- notes --> costs no tokens.

Auto memory

Target under ~200 lines for CLAUDE.md. Longer files still load in full (up to 4 MiB; larger is skipped), but adherence drops — move procedures into skills, which cost nothing until invoked.

Skills

SKILL.md

A skill is a folder with instructions Claude loads only when relevant — so long reference material costs nothing until used. Custom commands merged into skills: .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy.

--- name: deploy description: Ship the service to staging. Use when the user says deploy, ship, or release. argument-hint: "[env]" allowed-tools: Bash(git *), Read model: sonnet effort: low context: fork --- Steps: !`git status --short` Read @docs/runbook.md, then …

Frontmatter — the block between --- lines at the top of the file

KeyEffect
name / descriptionDisplay name; what it does and when — this is what Claude matches on
when_to_useExtra trigger phrases, appended to the listing
argument-hint / argumentsAutocomplete hint; named positional args for $name
disable-model-invocationtrue → only you can run it (/name); keeps its description out of context
user-invocable: falseOnly Claude runs it; hidden from the / menu
allowed-tools / disallowed-toolsGrant without prompting for this turn / remove from the pool while active
model / effortOverride for the rest of this turn only
context: fork + agent + backgroundRun it in a forked subagent instead of the main context
pathsGlobs that gate when the skill is even considered
hooksHooks registered on invoke, live for the rest of the session
shellbash (default) or powershell for inline execution

Substitutions inside a skill

$ARGUMENTS · $ARGUMENTS[N] / $N · $name · ${CLAUDE_SESSION_ID} · ${CLAUDE_EFFORT} · ${CLAUDE_SKILL_DIR} · ${CLAUDE_PROJECT_DIR} · ${CLAUDE_PLUGIN_ROOT} · ${CLAUDE_PLUGIN_DATA}. Backtick-bang !`cmd` injects live shell output; @file injects a file.

Write a skill the moment you notice you're pasting the same checklist twice, or a CLAUDE.md section has turned into a procedure. /reload-skills picks up changes without restarting.

Subagents

.claude/agents/*.md

A subagent gets its own context window. That's the point: it can read fifty files and hand you back one paragraph, leaving your main context clean. Use them for broad searches, independent parallel work, and reviews.

--- name: security-reviewer description: Audits a diff for injection, authz, and secret-handling defects. tools: Read, Grep, Glob, Bash model: sonnet effort: high permissionMode: plan isolation: worktree memory: project --- You review only for security…

Frontmatter

KeyEffect
name* / description*Identifier (hooks see it as agent_type); when to delegate
tools / disallowedToolsAllowed set (inherits all if omitted) / removals
modelsonnet, opus, haiku, fable, a full ID, or inherit (default)
effort / maxTurnsReasoning depth; hard turn ceiling
permissionModeAny of the six modes, scoped to this agent
skillsSkills preloaded in full at startup, not just their descriptions
mcpServersNamed or inline MCP servers just for this agent
isolation: worktreeOwn git worktree — required if parallel agents write the same files
memoryuser / project / local → persistent learning across sessions
background / color / hooks / initialPromptKeep detached · task-list color · scoped hooks · auto first turn when used as the session agent

Scope order: --agents JSON → .claude/agents/~/.claude/agents/. Built-ins include Explore (read-only fan-out search), Plan (architecture), and general-purpose. /subtask forks one that inherits the whole conversation; /list-agents shows who you can message.

Isolation costs ~200–500 ms and disk per agent — use worktree only when agents genuinely collide.

Hooks — deterministic reactions to the agent loop

/hooks · 30+ events

Hooks are the answer to "every time X happens, do Y." Claude can be asked to do something; a hook guarantees it. Three nesting levels: eventmatcher group → one or more handlers.

{ "hooks": { "PostToolUse": [{ "matcher": "Edit|Write", "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/fmt.sh", "if": "Edit(**/*.ts)", "async": true, "timeout": 60 }] }] }}

Handler types

  • command — shell command; event JSON on stdin. Set args for exec form (no shell parsing).
  • http — POST the event JSON to a URL (gated by allowedHttpHookUrls).
  • mcp_tool — call a tool on a connected MCP server.
  • prompt — single-turn model evaluation against a response schema.
  • agent — spawn a subagent that can Read/Grep/Glob before deciding.

Control channel

  • Exit 0 — allow, stdout shown in transcript. Exit 2 — block, stderr fed back to Claude as the reason. Other codes — non-blocking error.
  • JSON on stdout gives finer control: hookSpecificOutput.permissionDecision (allow/deny/ask) and updatedInput for PreToolUse, decision, additionalContext, retry: true, permission updates.
  • async: true runs in background; asyncRewake: true also wakes Claude on exit 2.
  • once: true (skill frontmatter) fires a single time per session.

The events, by cadence

SessionSessionStart · SessionEnd · PreModelSwitch (can block a model change) · PostModelSwitch · Setup (with --init-only/--init/--maintenance) · InstructionsLoaded (CLAUDE.md or a rule loads) · ConfigChange · CwdChanged (great for direnv) · DirectoryAdded · FileChanged (watch by filename matcher).

TurnUserPromptSubmit · UserPromptExpansion (a typed command expands; can block) · MessageDisplay · Notification · Stop (Claude finished — can force it to keep going) · StopFailure (turn died on an API error) · TeammateIdle · PreCompact · PostCompact.

Tool loopPreToolUse (can block) · PermissionRequest · PermissionDenied · PostToolUse · PostToolUseFailure · PostToolBatch (after a whole parallel batch) · SubagentStart / SubagentStop · TaskCreated / TaskCompleted · WorktreeCreate / WorktreeRemove · Elicitation / ElicitationResult (MCP asks the user something).

Recipe — a PreToolUse guard

{ "hooks": { "PreToolUse": [{ "matcher": "Bash", "hooks": [{ "type": "command", "if": "Bash(rm *)", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/block-rm.sh" }] }]}}
#!/bin/bash # .claude/hooks/block-rm.sh cmd=$(jq -r '.tool_input.command') if echo "$cmd" | grep -q 'rm -rf'; then jq -n '{hookSpecificOutput:{hookEventName:"PreToolUse", permissionDecision:"deny", permissionDecisionReason:"Destructive command blocked"}}' else exit 0; fi

The event JSON arrives on stdin; jq pulls the command out. Printing the deny object blocks the call and tells Claude why; exit 0 with nothing printed lets it through. The same shape with updatedInput rewrites a command instead of blocking it. chmod +x the script and check /hooks to confirm it registered.

Matchers

"*", "", or omitted = match all. Letters, digits, _ - , | and spaces = exact string or a |/, separated list. Anything else = unanchored JavaScript regex. The separate if field takes exactly one permission rule ("Bash(git *)", "Edit(*.ts)") — no &&/||. For Bash, if checks each subcommand, strips leading assignments, and inspects $(…); it fails open when the command can't be parsed, so treat it as a filter, not a security boundary.

Hooks live in ~/.claude/settings.json, .claude/settings.json, .claude/settings.local.json, managed policy, plugin hooks/hooks.json, and skill or subagent frontmatter. They merge across levels rather than replacing, run in parallel, and also run inside subagents. Identical handlers defined twice run once.

MCP — Model Context Protocol

claude mcp · /mcp

An MCP server is a small program that exposes tools (and optionally prompts and resources) to any MCP client; Claude Code connects to it over HTTP or over stdin/stdout for a local process (stdio). Ready-made servers exist for GitHub, databases, Sentry, browsers and most SaaS APIs.

claude mcp add --transport http sentry https://mcp.sentry.dev/mcpremote HTTP server claude mcp add db -e PGURL=… -- npx my-serverlocal stdio server with env claude mcp add-json name '{…}'paste a config written for another client claude mcp login <name>run its OAuth (browser sign-in) flow from the terminal; --no-browser for remote shells claude mcp list / get <name>status; unapproved .mcp.json shows ⏸ Pending claude mcp serveexpose Claude Code itself as an MCP server

Scopes

ScopeFileShared?
localproject entry in ~/.claude.jsonJust you, this project
project.mcp.json at the repo rootCommitted; each teammate approves once
user~/.claude.jsonYou, everywhere
{ "mcpServers": { "github": { "type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": { "Authorization": "Bearer ${GITHUB_PAT}" } }, "db": { "type": "stdio", "command": "npx", "args": ["-y", "@bytebase/dbhub"], "env": { "DB_URL": "${DATABASE_URL:-postgresql://localhost/mydb}" }, "timeout": 600000 } }}

.mcp.json expands ${VAR} and ${VAR:-default} so secrets stay out of the repo; headersHelper names a script that returns auth headers. --strict-mcp-config ignores every other source.

Living with big servers

Plugins

claude plugin · /plugin

A plugin is one distributable bundle of everything below. Install from a marketplace, a directory, or a .zip URL.

my-plugin/ ├── .claude-plugin/plugin.json manifest (name, version, deps) ├── skills/<name>/SKILL.md skills ├── commands/*.md flat-file skills ├── agents/*.md subagents ├── workflows/*.js workflow scripts ├── hooks/hooks.json hook config ├── .mcp.json .lsp.json MCP + language servers ├── monitors/monitors.json background monitors ├── output-styles/ themes/ system-prompt styles, colors ├── bin/ added to the Bash tool's PATH └── settings.json defaults applied when enabled
claude plugin init my-toolsscaffold under ~/.claude/skills/, auto-loads next session claude plugin install x@marketplaceinstall from a specific marketplace claude plugin details <name>component inventory + projected token cost claude plugin validate <path>lint the manifest, skills, agents, commands claude plugin eval <target>run scored eval cases against a plugin claude --plugin-dir ./pload for this session only, no install

A plugin's root CLAUDE.md is not loaded as project context — plugins contribute through skills, agents, and hooks. /reload-plugins applies changes in place.

Settings & precedence

#LevelFile
1Managedmanaged-settings.json, MDM, or the console — your org, always wins
2Command lineclaude --settings …
3Project local.claude/settings.local.json — you, this project
4Shared project.claude/settings.json — committed, whole team
5User~/.claude/settings.json — you, every project

Scalar keys: highest level wins. Array keys like permissions.allow and hooks: combined across levels. --setting-sources user,project limits which load at all.

{ "model": "opus", "effortLevel": "xhigh", "permissions": { "allow": ["Bash(git *)", "Read"], "deny": ["Read(./.env)", "Read(**/secrets/**)"], "defaultMode": "acceptEdits", "additionalDirectories": ["../lib"] }, "env": { "NODE_ENV": "development" }, "hooks": { … }, "statusLine": { "type": "command", "command": "~/.claude/statusline.sh" }, "autoMemoryEnabled": true, "keybindingFlavor": "readline", "cleanupPeriodDays": 30 }

Settings vs. everything else: settings.json is what Claude Code enforces; CLAUDE.md is what Claude is told; hooks are what happens regardless of what Claude decides. A preference that must always hold is a hook or a setting, never a memory.

/config edits interactively (or /config key=value) · claude doctor / /doctor diagnoses and fixes · --safe-mode disables every customization for bisecting a broken config.

Headless, scripting & SDK

-p / --print
claude -p "summarize the diff" --output-format jsonsingle JSON result object claude -p … --output-format stream-json --verboserealtime event stream, one JSON object per line (NDJSON) claude -p --json-schema '{"type":"object",…}'validated structured output claude -p --max-turns 3 --max-budget-usd 5.00hard ceilings for unattended runs claude -p --permission-mode dontAsk --allowedTools Read,Grepthe safe shape for CI (continuous-integration) jobs: deny by default, allow explicitly claude -p --restricted --permission-prompts noneevaluation harness on a shared box: no command tools, no user settings, prompts auto-denied claude -p --input-format stream-json --replay-user-messagesbidirectional streaming for a host app claude --init-onlyrun Setup + SessionStart hooks and exit (CI warmup) claude setup-tokenlong-lived OAuth token for CI

Notes

Workflows & agent teams

A workflow is a JavaScript script that orchestrates many subagents deterministically — loops, conditionals, fan-out — instead of leaving the structure to the model. Runs in the background; /workflows watches it.

export const meta = { name: 'review', description: 'Review each dimension, verify each finding', phases: [{title:'Review'},{title:'Verify'}] } const out = await pipeline(DIMENSIONS, d => agent(d.prompt, {phase:'Review', schema:FINDINGS}), r => parallel(r.findings.map(f => () => agent(`Refute: ${f.title}`, {phase:'Verify', schema:VERDICT}))))

Agent teams are the other axis: named teammates that message each other via SendMessage, each in its own session — in-process by default, or in tmux / iTerm2 panes with --teammate-mode. Experimental and off until CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1; roughly 7× the tokens of a single session. Workflows are for structure you can write down; teams are for work that needs conversation.

Which to reach for

SubagentWorkflowAgent team
ShapeOne helper, one result backScript you write: loops, fan-out, schemasPeers that talk to each other
Who coordinatesThe main sessionThe script, deterministicallyThe teammates, via a shared task list and mailbox
Best forBroad reads, isolated checks, reviewsRepeatable batch work (review every file, verify every finding)Competing hypotheses, cross-layer features, debate
CostLowest — summary returnsBounded by the script and budgetHighest — each teammate is a full session
Start withJust ask, or Agent(…)/workflow-authoring, /deep-research"Spawn three teammates to…"

Git, worktrees, checkpoints & CI

Checkpoints

Worktrees

Attribution & CI

Sandboxing & security

/sandbox runs Bash inside an OS sandbox (Seatbelt on macOS, bubblewrap on Linux) so filesystem and network access are enforced by the kernel, not by Claude's judgment. It composes with permissions rather than replacing them.

"sandbox": { "enabled": true, "autoAllowBashIfSandboxed": true, "filesystem": { "denyRead": ["~/.ssh/**", "~/.aws/**"], "allowWrite": ["/tmp/**", "./"] }, "network": { "allowedDomains": ["registry.npmjs.org", "github.com"], "strictAllowlist": true }, "credentials": { "envVars": ["GITHUB_TOKEN"] } }

The security model in one line each

Idioms — the moves that pay off

Working with the agent

  • Plan before you let it write. Shift+Tab to plan mode or /plan <task>. Read the plan, correct the wrong assumption there — it is much cheaper than correcting fifteen files.
  • Give it a way to check itself. A failing test, a repro script, a /run-able app. An agent that can verify converges; one that can't guesses confidently.
  • Point at the target. @path autocompletion to name files, or !cmd to drop real output into context, beats describing them.
  • Correct early, not politely. Esc the moment it goes the wrong way. Letting a bad turn finish costs context and adds mistakes to imitate.
  • One concern per session. /clear between unrelated tasks; a stale conversation is a worse prior than an empty one.

Managing context & cost

  • /context when it feels sluggish — it names what's eating the window, usually MCP tool schemas.
  • Delegate reading to a subagent: it burns its window and returns a conclusion.
  • /compact with focus instructions ("keep the API design decisions, drop the file listings") rather than bare.
  • Model down, effort down, or both — for a well-specified mechanical change, Sonnet at medium is often indistinguishable and several times cheaper.
  • Keep the prefix stable. Do the model/tool/mode switching at the start of a task, not in the middle of one.

Making it stick

  • Said twice → CLAUDE.md. Said as a procedure → a skill. Must happen every time → a hook.
  • /fewer-permission-prompts once a week; the allowlist it writes is derived from what you actually approve.
  • Commit .claude/settings.json, .claude/rules/, and skills. Keep settings.local.json and CLAUDE.local.md out of git.
  • claude --safe-mode is the bisect tool: if the problem vanishes, it's your config, not the model.
  • /insights and /team-onboarding mine your own history into a report or a guide for the team.

The .claude directory

── project ────────────────────────── CLAUDE.md project instructions (<200 lines) CLAUDE.local.md your private ones — gitignore it .mcp.json MCP servers, committed .claude/ ├── settings.json team: permissions, hooks, model, env ├── settings.local.json yours only — gitignore it ├── CLAUDE.md alternative home for the above ├── rules/*.md topic instructions, glob-scoped ├── skills/<n>/SKILL.md project skills → /n ├── commands/*.md flat-file skills (legacy shape) ├── agents/*.md project subagents ├── workflows/*.js saved workflow scripts └── agent-memory/ subagent persistent memory
── home ───────────────────────────── ~/.claude/ ├── settings.json your defaults everywhere ├── CLAUDE.md your global instructions ├── rules/ skills/ commands/ agents/ workflows/ ├── keybindings.json /keybindings ├── plugins/ installed plugins — don't delete ├── agent-memory/ user-scope subagent memory └── projects/<project>/ ├── memory/ auto memory + MEMORY.md index └── session transcripts (.jsonl) ~/.claude.json auth, MCP user/local scope, per-project state ── managed (org) ──────────────────── managed-settings.json /Library/Application Support/ClaudeCode/ /etc/claude-code/ · C:\Program Files\ClaudeCode\

Don't delete ~/.claude.json, ~/.claude/settings.json, or ~/.claude/plugins/ — they hold your auth, your defaults, and your installs. CLAUDE_CONFIG_DIR relocates the whole tree.

The first hour — install to first commit

a worked path

1 · Install and sign in

curl -fsSL https://claude.ai/install.sh | bashmacOS / Linux / WSL native build; updates itself in the background irm https://claude.ai/install.ps1 | iexWindows PowerShell (winget install Anthropic.ClaudeCode also works) brew install --cask claude-codeHomebrew; does not auto-update — brew upgrade claude-code claude --versionprints 2.1.260 (Claude Code) when it worked cd ~/projects/myapp && claudefirst run opens a browser login: Pro/Max/Team/Enterprise, or a Console (API) account

A subscription bills against plan limits; a Console account bills per token and gets a "Claude Code" workspace for cost tracking. /login switches accounts later; claude auth status shows which is active. The first session asks you to trust the folder — that gate is what lets a repo's hooks and settings run.

2 · Orient, then instruct

what does this project do?Claude reads files as needed; nothing to attach /initwrites a starter CLAUDE.md from build commands and conventions it finds (improves an existing one rather than overwriting) /contextconfirm CLAUDE.md appears under Memory files Shift+Tab → planread-only mode: it explores and proposes before touching anything add input validation to the signup formthe first real task — specific beats vague ("fix the bug")

Trim what /init wrote to facts Claude can't infer: the test command, the deploy rule, the thing that bit you last week. Keep it under 200 lines.

3 · Review, keep, commit

/diffinteractive viewer of uncommitted changes and per-turn diffs Esc Escwrong direction? rewind code, conversation, or both to any earlier prompt run the testsgive it a way to check itself; it fixes what fails commit with a descriptive messageClaude stages and commits; attribution settings control the trailer it adds /clearnext unrelated task starts clean; /resume finds the old one

On Pro, Max and Team the session starts in auto mode (a classifier approves most edits and commands); on API-key logins it starts in Manual and asks. Shift+Tab changes it any time. When something the classifier declines is fine, answer the prompt with "always" to write an allow rule.

Source: code.claude.com quickstart, setup and permission-modes pages; claude --help v2.1.260.

What costs money, and how to read it

/usage · /cost
/usagesession tokens and $ (API users), plan usage bars, attribution by skill / subagent / MCP server, heaviest loops; d/w for 24 h / 7 d /cost /statsaliases for /usage Prompt cache (main): 14 requests · 91% …the line to watch: share of input served from cache, misses, warm/cold (v2.1.251+) claude -p … --max-budget-usd 5hard dollar ceiling for unattended runs /usage-creditsturn on or request pay-as-you-go beyond plan limits

Where the tokens go

Order of operations when a bill surprises you: /context (what is in the window) → /usage attribution (who put it there) → /clear between tasks, model or effort down for mechanical work, subagents for verbose reads.

Source: code.claude.com costs and prompt-caching pages; platform pricing table Sep 2026.

Troubleshooting

bisect, then read the log
claude --safe-modeevery customization off (CLAUDE.md, hooks, MCP, plugins, skills, keybindings). Problem gone → it's your config claude doctorread-only checkup from the shell, works when claude won't start a session /doctorfull checkup inside a session; proposes fixes and applies them after you confirm; trims a bloated CLAUDE.md claude --debug=api,hooksdebug log for chosen categories (!file excludes one) claude --debug-file ./debug.txtwrite it to a path of your choosing; /debug turns logging on mid-session ~/.claude/debug/<session-id>.txtwhere the log lands by default; CLAUDE_CODE_DEBUG_LOG_LEVEL sets verbosity claude updatecheck for and install an update; claude install stable|latest|2.1.260 pins a version claude --resumea hang or crash loses nothing: the transcript is on disk /heapdumpmemory snapshot to ~/Desktop for a bug report — it contains your whole conversation, don't post it publicly USE_BUILTIN_RIPGREP=0search or @-file completion finds nothing → install your OS's ripgrep and set this

Symptom → first move

SymptomDo
Settings or hooks silently ignoredclaude doctor reports invalid JSON; -p mode never shows the error dialog
"Autocompact is thrashing"A file or tool output refills the window each time: read it in ranges, or hand it to a subagent
Session started in auto mode unexpectedlyPlan default (Pro/Max/Team) — set permissions.defaultMode
Unknown command: /schedule or /usage-creditsNeeds a claude.ai login; an ANTHROPIC_API_KEY in the shell takes precedence over it
Garbled text in VS Code's terminal/terminal-setup turns GPU acceleration off
High CPU / memory/compact, restart between big tasks, then --safe-mode to blame a plugin or MCP server

Source: code.claude.com troubleshooting, debug-your-config and .claude-directory pages; claude doctor --help.

Status line & keybindings.json

/statusline · /keybindings

The status line is a row above the footer that shows whatever a script of yours prints. Claude Code runs the script after each update and feeds it session JSON on stdin. /statusline writes one from a description (or copies your shell prompt); by hand:

"statusLine": { "type": "command", "command": "~/.claude/statusline.sh", "padding": 0 }
#!/bin/bash input=$(cat) M=$(echo "$input" | jq -r '.model.display_name') PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1) COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0') printf '[%s] %s%% ctx $%.2f' "$M" "$PCT" "$COST"

Fields on stdin

model.display_name · cwd · session_id · version · cost.total_cost_usd / total_duration_ms / total_lines_added · context_window.used_percentage / remaining_percentage / context_window_size · exceeds_200k_tokens · rate_limits.five_hour.used_percentage / seven_day (subscribers, after the first response) · prompt_cache (hit ratio, misses, warm). Fields that don't apply yet are absent or null — use // 0 guards in jq.

keybindings.json

{ "bindings": [{ "context": "Chat", "bindings": { "ctrl+e": "chat:externalEditor", "ctrl+x ctrl+k": null, "ctrl+u": null } }] }

/keybindings opens ~/.claude/keybindings.json; changes apply live. Keys are ctrl+k, shift+tab, meta+p (Option on macOS), chords as space-separated sequences (ctrl+k ctrl+s); null unbinds. Actions are context:action — the index lists them. Reserved and not rebindable: Ctrl+C, Ctrl+D, Ctrl+M, Ctrl+[, Ctrl+I. Vim motions are not in this file; use vimInsertModeRemaps for jj-style escapes.

Source: code.claude.com statusline and keybindings pages.

Loops, schedules & routines

/loop · /schedule
/loopDesktop taskRoutine (cloud)
Runs whereThis open sessionYour machine, Desktop appAnthropic cloud (or your self-hosted environment)
NeedsSession open and idleDesktop app runningLaptop can be closed; claude.ai subscription
Minimum interval1 minute1 minute1 hour
Expiry7 daysUntil paused; daily run cap
TriggersInterval, or Claude-pacedScheduleCron, one-off time, HTTP POST, GitHub PR/release events
/loop 5m check whether the deploy finishedfixed interval: s m h d units, cron granularity (1 min), rounded to a clean step /loop check CI and address review commentsno interval → Claude picks a delay (1 min–1 h) after each pass; Esc stops it /loop 20m /review-pr 1234re-run a skill each pass /loopbare: the built-in maintenance prompt, or your .claude/loop.md remind me in 30 minutes to …plain language → a one-shot task that deletes itself /schedule daily PR review at 9amcreates a cloud routine conversationally; list · update · run manage it /schedule in 2 weeks, remove the feature flagone-off cloud run at a time; doesn't count against the daily cap

Source: code.claude.com scheduled-tasks and routines pages; /loop skill description.

Remote Control, cloud sessions & teleport

three different things
MechanismWhere the work runsStart it
Remote ControlYour machine — files, MCP servers, tools stay local; you drive it from claude.ai/code or the phone appclaude remote-control · claude --rc [name] · /rc mid-session
Cloud sessionAnthropic's infrastructure, cloning your GitHub repo into a cloud environmentclaude --cloud "fix the flaky test" · --environment ccpool_… for a self-hosted runner
TeleportPulls a cloud session's branch and conversation down into this terminalclaude --teleport [id] · /teleport picker
Background agentYour machine, detached from the terminalclaude --bg "…" · claude agents · attach / logs / stop
claude remote-control --spawn worktree --capacity 8persistent server; each on-demand session gets its own git worktree (w toggles at runtime) claude remote-control -creattach to the session last recorded for this directory (within ~4 h) claude --rc "Billing refactor"ordinary interactive session, also visible in the claude.ai session list; footer shows /rc active /remote-controltoggle on/off, or open the status panel with a QR code for your phone claude --from-pr 142resume the session linked to a pull request

Source: code.claude.com remote-control and claude-code-on-the-web pages; claude remote-control --help.

Artifacts

/artifacts · Ctrl+]

An artifact is a single self-contained web page Claude Code publishes from the session to a private URL on claude.ai, updated in place as work continues: an annotated diff, a dashboard, four layout options side by side, a checklist that ticks itself off during a migration.

make an artifact that walks through this PRClaude writes an HTML (or Markdown) file outside the project and publishes it; the browser opens /artifactslist yours and those shared with you: o open, c copy link, Enter attach to this session Ctrl+]reopen the latest one update https://claude.ai/code/artifact/… with today's numbersa new session updates an existing page only if given its URL or attached via /artifacts /design a settings screen for a banking appartboards on a canvas, opened in the Claude Design editor preview

Source: code.claude.com artifacts page.

Sidebar: data centers, or the AI social conflict box

where the tokens actually come from

Every card above assumes a building full of accelerators somewhere, humming. That building is now the most contested piece of infrastructure in American local politics, and it is worth knowing both halves of the argument — you are, after all, on the demand side of it.

Why the buildout is real

  • Inference, not just training, is the load. Training a frontier model is a large one-off; serving it to millions of people all day is a permanent one. Every 1M-token context you fill is memory bandwidth and power drawn somewhere on a grid.
  • The numbers are genuinely large. US data centers used roughly 4.4% of national electricity in 2023; credible projections put them at ~7–12% by 2028. Globally the International Energy Agency (IEA) has data-center demand going from ~415 TWh in 2024 to ~945 TWh by 2030 — roughly Japan's entire consumption.
  • Concentration is the hard part. Not the terawatt-hours in aggregate but a single 500 MW request landing on one county's substation, in one interconnection queue, on one utility's five-year plan. Grids are built for gradual growth; this is not gradual.
  • Refusing to build has costs too — capacity moves to whichever jurisdiction says yes, taking the tax base and the transmission investment with it, and the emissions land on a dirtier grid instead.

Why the neighbors object

  • Electricity bills. The core fear, and not an irrational one: if new transmission and generation are socialized across ratepayers while the load is one company's, residents pay for someone else's substation. Whether that happens is a rate-design question — large-load tariffs, contract terms — not a law of nature, but it is a real fight and it has real losers.
  • Water. Evaporative cooling consumes potable water, which reads very differently in West Texas than in Ohio. Closed-loop and air-cooled designs largely solve it; the older designs are what people have seen.
  • Noise, land, and what you get back. Chillers run continuously. A 300-acre windowless campus with a 20-year tax abatement and 40 permanent jobs is a genuinely poor trade for a small town, and people can do that arithmetic.
  • Scale of the pushback. Gallup found 71% of Americans opposed to a data center in their own area, and between March and June 2025 community opposition blocked or delayed an estimated $98 billion of projects. Kentucky, Tennessee, West Virginia, Georgia, and Texas have all had packed hearings; several counties have moratoria.

The meeting itself (observed with affection)

  • The genre is fixed. A consultant presents a rendering with implausibly mature landscaping. Someone asks how many jobs. The number is smaller than the number of parking spaces on the slide. A murmur goes through the room.
  • Speaker three has printed the water figures and brought a laser pointer. Speaker seven wants to know why nobody was told. Speaker eleven has been to every meeting since the 2016 pipeline and treats this as one long continuous argument, which, honestly, fair.
  • Someone says "we're not against progress, but" — and here is the thing: they usually mean it. The objection is almost never to computers. It is to being the one who pays for them.
  • Meanwhile the person live-tweeting the meeting is doing so over a network that terminates in a building exactly like the one being opposed, which is either hypocrisy or simply what infrastructure feels like from the inside — infrastructure is only visible when it is proposed near you.
  • The developer's representative says "we're committed to being a good neighbor." Everyone writes it down. Nobody believes it is a commitment. It occasionally turns out to be one.

Where it actually gets settled: large-load tariffs that make the requesting party pay for its own interconnection, closed-loop cooling requirements, clawbacks tied to real job counts, and published water and power figures before the vote rather than after. The technical questions are mostly solved; the allocation questions are the fight. Anthropic, Google, Microsoft, Amazon, Meta and OpenAI are all building — so this argument is going to be running underneath the tooling on this page for the rest of the decade.

Figures: US Energy Information Administration (EIA) / IEA electricity projections, Gallup polling on local siting, and 2025–26 reporting on blocked and delayed projects. Treat all of them as directional — the forecasts have been revised upward repeatedly.

Public opposition to AI

the argument under the tooling

A large share of the public — in most 2025–26 polling, a plurality to a majority — says it is more worried than excited about AI. You use Anthropic's tools all day; it is worth being able to state the other side's case accurately, and then say why you are on this side of it anyway.

What people are worried about

  • Jobs. The fear is not abstract: entry-level software, support, translation and content roles are where hiring has visibly softened, and "learn to code" was the advice given to the last displaced cohort.
  • Training data. Models were trained on books, code and images whose authors were not asked. Courts have mostly sided with fair use so far; the authors have not changed their minds.
  • Energy, water, neighbours. Data-center electricity demand is real, concentrated, and frequently paid for through everyone's rates — the one objection that wins county votes.
  • Slop and trust. Fluent, confident, wrong text at scale: fabricated citations, AI-generated pull requests that waste maintainers' time, search results that are summaries of summaries.
  • Deskilling. If the tool writes the code, who still knows how? Juniors who never debug a thing they did not write are the worry here.
  • Concentration. A handful of companies own the frontier models, the chips and the capital. Nobody voted for that.

Why the advantages are larger

  • The productivity is measured, not claimed. Controlled studies put task completion gains for developers at roughly a third to a half on bounded work; at the high end, teams using agentic tools report output doubling. Every previous tool with that profile — compilers, IDEs, Stack Overflow — ended up with more programmers, not fewer, because cheaper software means more software gets built.
  • Access. The person who could never afford a developer, a lawyer's first read, a tutor at 11 pm, a translator, or a patient explanation of their own lab results now has one. That is the largest transfer of expert capacity to ordinary people since the public library.
  • Verification is the answer to slop — and it is a discipline, not a hope. Everything on this sheet about tests, hooks, reviewers and evidence exists because the failure mode is known and solvable. The tool that writes the bug also runs the test.
  • Learning accelerates rather than atrophies for anyone who uses it to be questioned instead of answered. The deskilling risk is real and it is a choice: a tutor that refuses to give the answer is one output style away.
  • Small teams do large things. One person with an agent fleet ships what took a department. For a hobbyist with a bench and a 3D printer that is the difference between a project finished and a project imagined.
  • The hard problems need it. Protein structure, materials, formal verification, reading every paper in a field — these are not jobs the technology takes; they are jobs nobody could do.

Where the honest ground is

  • Most objections are to allocation, not to the technology: who pays for the substation, who is compensated for the training data, who is retrained. Those are policy fights with real losers, and "the benefits are larger" is true and insufficient to the person on the losing end.
  • The energy objection gets settled by large-load tariffs and closed-loop cooling, not by arguing about it.
  • The slop objection gets settled by people who refuse to ship unverified work. Be one of them — it is the single thing a user can do for the tool's reputation.
  • The jobs objection is the one without a clean answer. The historical pattern is strongly reassuring and the people living through the transition are not wrong to be afraid of it.

Anthropic specifically. The company's founding premise is that the technology is dangerous enough to need a safety-focused lab at the frontier — which critics read as either sincere or as the best marketing line in the industry. Its models are the ones most often cited for refusing things, which is the mirror image of the Grok complaint. And it is building data centers like everyone else: the card above is the local-politics half of this argument.

The short version for the dinner table: the concerns are mostly legitimate and mostly about who pays; the benefits are larger, broader and already measurable; and the one thing in your control is to be a user whose output earns the tool its trust.

Building on the Claude API

the Messages API and everything hanging off it · click the title to collapse

Messages API

POST /v1/messages

Everything goes through one endpoint. Tools, structured output, thinking, caching, and server-side tools are all features of this call, not separate APIs.

client.messages.create( model="claude-opus-5", max_tokens=16000, thinking={"type": "adaptive"}, output_config={"effort": "high"}, system="…", messages=[{"role":"user","content":"…"}], )

Getting it right

  • Don't lowball max_tokens: ~16000 non-streaming (stays under SDK timeouts), ~64000 streaming. 128k output requires streaming.
  • Stream anything with long input, long output, or high max_tokens; use .get_final_message() / .finalMessage() if you don't need per-event handling.
  • Check stop_reason before reading content. A safety refusal returns HTTP 200 with stop_reason: "refusal" and a stop_details.category. On Fable 5 / Opus 5, pair it with server-side fallbacks.
  • Assistant prefill is gone on Fable 5.1 / 5, Opus 5, Sonnet 5 and the 4.6–4.8 family — it returns 400. Use output_config.format or system instructions instead. Fable 5.1 also rejects forced tool choice (tool_choice: any / tool): use auto plus an instruction, or strict: true.
  • output_config.format constrains the response shape; strict: true on a tool definition guarantees its input validates.
  • Supporting endpoints: Batches (50% off, async), Files, Token Counting (count_tokens — never tiktoken), Models (live max_input_tokens, max_tokens, capabilities).

Thinking & effort

ModelThinking configIf omitted
Fable 5.1 / Fable 5 / Mythos{"type":"adaptive"} or omit; disabled → 400Adaptive (always on)
Opus 5adaptive; disabled only at effort ≤ highAdaptive — on by default
Opus 4.8 / 4.7, Sonnet 5adaptive is the only on-mode4.8/4.7 run without thinking
Opus 4.6 / Sonnet 4.6adaptive recommendedNo thinking
Haiku 4.5 and older{"type":"enabled","budget_tokens":N}No thinking

Two traps

  • budget_tokens is removed (400) on Fable 5.1 / 5, Opus 5/4.7/4.8 and Sonnet 5. Adaptive thinking + effort replaced it. So are temperature/top_p/top_k on those models.
  • display defaults to "omitted" on Fable 5.1 / 5, Opus 5 / 4.8 / 4.7 and Sonnet 5 — a silent change from 4.6. If you stream reasoning to users, set {"type":"adaptive","display":"summarized"} or your UI shows a long blank pause.

Disabling thinking on Opus 5 has two failure modes: it may write a tool call into visible text (the call silently never runs) and may leak <thinking> tags. Prefer adaptive thinking at low/medium effort — cheaper and correct.

Tools & server tools

Your tools

  • Manual loop — you write while stop_reason == "tool_use". Full control, no beta.
  • Tool Runnerclient.beta.messages.tool_runner() with @beta_tool / betaZodTool. You write only the functions; per-turn hooks give approval gates, retries, compaction.
  • Parallel calls: one assistant message may hold several tool_use blocks. Return all tool_results in a single user message — splitting them silently trains Claude out of parallel calls. Failed tool → tool_result with is_error: true, never a dropped block.

Anthropic-hosted tools

Tooltype
Web searchweb_search_20260209
Web fetchweb_fetch_20260209
Code executioncode_execution_20260521
Tool searchtool_search_tool_regex_20251119 · …_bm25_…
Memorymemory_20250818
Bash / editorbash_20250124 · text_editor_20250728 (schema-less)

The _20260209 search/fetch variants have dynamic filtering built in — don't also declare code_execution. Server-tool errors return HTTP 200 with an error object in the result block; they never raise.

Caching & context management

  • Prefix match. Render order is toolssystemmessages. Stable content first; timestamps, request IDs, and the varying question go after the last breakpoint.
  • Max 4 cache_control breakpoints; minimum cacheable prefix is model-dependent, 512–4096 tokens (512 on Fable 5.1). Verify with usage.cache_read_input_tokens — a persistent zero means a silent invalidator (a datetime.now() in the system prompt, unsorted JSON, a varying tool list).
  • Compaction (beta compact-2026-01-12) summarizes history server-side. Append the whole response.content back, not just the text — dropping the compaction blocks silently loses the state.
  • Context editing (beta context-management-2025-06-27) clears rather than summarizes: clear_tool_uses_20250919, clear_thinking_20251015. Different feature; don't mix the beta headers.
  • Mid-conversation system messages — append {"role":"system",…} to messages (Opus 5, Opus 4.8, Fable 5.1 / 5; not Sonnet 5). Adds operator instructions without invalidating the cached prefix, and is the injection-safe channel.
  • Cache hits cost 10% of base input (2.5% on Fable 5.1). Entries live 5 minutes by default (the TTL, time to live); 1-hour writes cost 2× instead of 1.25× and are worth it for long sessions.

Agents, SDKs & providers

Four ways to build an agent

ApproachHarnessDeployment
Manual loopyouyou
Tool RunnerSDKyou
Managed AgentsAnthropicAnthropic (per-session sandbox)
Claude Agent SDKClaude Codeyou

Managed Agents is the only one that hosts the loop and the container: persisted versioned agent configs, sessions streamed as server-sent events (SSE), vault credentials substituted at egress, scheduled deployments (cron), and multiagent rosters. Create the agent once, reference by ID — never in the request path.

SDKs & provider clients

Official SDKs: Python, TypeScript, Java (Kotlin/Scala), Go, Ruby, C#, PHP — plus raw HTTP. Use the platform's own client rather than a base_url override: AnthropicBedrockMantle (Bedrock, IDs prefixed anthropic.), AnthropicVertex (project + region, bare IDs), AnthropicFoundry.

Credentials resolve in order: ANTHROPIC_API_KEYANTHROPIC_AUTH_TOKEN → the OAuth profile from ant auth login → workload identity federation → the default profile. An unset key does not mean no credentials — check ant auth status before asking anyone for one.

Tool use — the minimal loop

Python · curl

A tool is a JSON schema you describe; Claude replies with a tool_use block naming it, you run the function and send a tool_result back, and repeat until stop_reason is end_turn.

import anthropic client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY tools = [{"name": "get_weather", "description": "Current weather for a city", "input_schema": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}] messages = [{"role": "user", "content": "Weather in Paris?"}] while True: r = client.messages.create(model="claude-opus-5", max_tokens=16000, tools=tools, messages=messages) if r.stop_reason != "tool_use": break messages.append({"role": "assistant", "content": r.content}) results = [{"type": "tool_result", "tool_use_id": b.id, "content": get_weather(**b.input)} for b in r.content if b.type == "tool_use"] messages.append({"role": "user", "content": results}) print(r.content[0].text)
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{"model":"claude-opus-5","max_tokens":16000, "tools":[{"name":"get_weather", "description":"Current weather for a city", "input_schema":{"type":"object", "properties":{"location":{"type":"string"}}, "required":["location"]}}], "messages":[{"role":"user","content":"Weather in Paris?"}]}'
  • All tool_result blocks for one turn go back in one user message, each keyed by the tool_use_id it answers; a failed call is a result with is_error: true.
  • Parse input as JSON (b.input is already a dict in the SDK) — never string-match it.
  • stop_reason: "pause_turn" means a server-side tool hit its iteration limit: resend the same messages to continue. "refusal" is a safety stop with HTTP 200.
  • The tools list is billed as input tokens on every request (a few hundred tokens of system prompt plus each schema) and sits first in the cache prefix — keep it stable.
  • Prefer the SDK’s Tool Runner (client.beta.messages.tool_runner with @beta_tool) once this loop is more than a demo; it adds retries, approval hooks and streaming.

Source: Claude API tool-use reference and the bundled /claude-api skill (python and curl examples).

Index

every command, flag, tool, setting, variable and event · use the search box at the top

Commands · session

/

Start, stop, move

/clear [name]Start a new conversation with empty context
/compact [instructions]Free up context by summarizing the conversation so far
/autocompact [auto|]Set the auto-compact window: how full the context window gets before Claude Code compacts automatically
/resume [session]Resume a conversation by ID or name, or open the session picker
/rename [name]Rename the current session and show the name on the prompt bar
/branch [name]Create a branch of the current conversation at this point, so you can try a different direction without losing the conversation as it stands
/fork [prompt]Copy the current conversation into a new background session and keep working here
/subtaskSpawn a forked subagent: a background subagent that inherits the full conversation and works on the task while you keep working
/background [prompt]Detach the current session to run as a background agent and free this terminal
/stopStop the current background session
/exitExit the CLI. In an attached background session, this detaches and the session keeps running
/cdMove this session to a new working directory, keeping the conversation and its prompt cache
/add-dirAdd a working directory for file access during the current session
/context [all]Visualize current context usage as a colored grid
/rewindRewind the conversation and/or code to a previous point, or summarize from a selected message
/recapGenerate a one-line summary of the current session on demand
/focusToggle the focus view, which shows only your last prompt, a one-line tool-call summary with edit diffstats, and the final response
/copy [N]Copy the last assistant response to clipboard
/export [filename]Export the current conversation as plain text
/diffOpen an interactive diff viewer showing uncommitted changes and per-turn diffs

Ask about the session

/btw [question]Ask a side question about the current session without adding to the conversation
/goal [condition|clear]Set a goal: Claude keeps working across turns until the condition is met or the goal clears for another reason
/tasksView and manage background work in the current session, including subagents that have finished
/list-agentsList the subagents, agent team teammates, and other Claude Code sessions Claude can message, with the name to use for each
/statusOpen the Settings interface on the Status tab, showing version, model, account, and connectivity
/usageShow session cost, plan usage limits, and activity stats
/costAlias for /usage
/statsAlias for /usage
/insightsGenerate an HTML report analyzing your recent sessions on this machine: which projects you work in, how you use Claude Code, where things go wrong, and features to try

Commands · model & reasoning

/

Pick the engine

/model [model]Switch the AI model and save it as your default for new sessions
/effort [level|auto|status]Set the effort level: low to xhigh, max, ultracode, or auto; status prints it
/fast [on|off]Toggle fast mode on or off
/advisor [model|off]Enable or disable the advisor tool, which consults a second model for guidance at key moments during a task
/plan [description]Enter plan mode directly from the prompt

Commands · code quality

/

Review & verify

/code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [pr#|branch|path]Review the current diff, or a PR number, branch, or path you pass, for correctness bugs and cleanup opportunities
/review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [pr#|branch|path]Alias of /code-review: reviews the current diff, or a PR number, branch, or path you pass, such as /review 1234, and takes the same effort levels and flags
/ultrareview [PR or branch]Run a deep, multi-agent code review in a cloud sandbox with ultrareview
/security-reviewAnalyze the changes on your current branch for security vulnerabilities
/simplify [target]Review the changed code for cleanup opportunities and apply the fixes
/runLaunch and drive your project's app to see a change working, not only passing tests
/verifyConfirm a code change does what it should by building your project's app, running it, and observing the result, rather than relying on tests or type checks
/run-skill-generatorTeach /run and /verify how to build, launch, and drive your project's app from a clean environment by writing a per-project skill
/debug [description]Enable debug logging for the current session and troubleshoot issues by reading the session debug log
/batchOrchestrate large-scale changes across a codebase in parallel
/deep-researchFan out web searches on a question, fetch and cross-check sources, and synthesize a cited report
/dataviz [request]Design guidance for charts, graphs, and dashboards
/design [brief]Draft UI mockups, screen flows, landing pages or posters as artboards on one canvas, published as an artifact in the Claude Design editor preview
/design-sync [hint]Convert your repo's React design system and upload it to Claude Design, so designs it produces use your real components
/design-loginAuthorize design-system access for /design-sync with your claude.ai account

Commands · configure & extend

/

Configuration

/config [key=value ...]Open the Settings interface to adjust theme, model, output style, and other preferences
/permissionsManage allow, ask, and deny rules for tool permissions
/hooksView hook configurations for tool events
/memoryEdit CLAUDE.md files, enable or disable auto memory, and view auto memory entries
/initInitialize project with a CLAUDE.md guide
/statuslineConfigure Claude Code's status line
/themeChange the color theme
/keybindingsOpen your keyboard shortcuts file
/terminal-setupConfigure terminal keybindings for Shift+Enter and other shortcuts
/tui [default|fullscreen]Set the terminal UI renderer and relaunch into it with your conversation intact
/scroll-speedAdjust mouse wheel scroll speed interactively, with a ruler you can scroll while the dialog is open to preview the change
/color [color|default]Set the prompt bar color for the current session
/sandboxToggle sandbox mode
/voice [hold|tap|off]Toggle voice dictation, or enable it in a specific mode
/doctorRun a setup checkup that diagnoses issues and can fix them
/fewer-permission-promptsScan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project .claude/settings.json to reduce permission prompts
/setup-bedrockInteractive wizard for Amazon Bedrock auth, region and model pins; hidden until CLAUDE_CODE_USE_BEDROCK is set
/setup-vertexInteractive wizard for Google Cloud auth, project, region and model pins; hidden until CLAUDE_CODE_USE_VERTEX is set

Extensions

/skillsList available skills
/plugin [subcommand]Manage Claude Code plugins
/mcp [reconnect |enable|disable [|all]]Manage MCP server connections and OAuth authentication
/workflowsOpen the workflow progress view to watch, pause, resume, or save running and completed workflows
/reload-skillsRe-scan skill and command directories so skills added or changed on disk during the session become available without restarting
/reload-plugins [--force]Reload all active plugins to apply pending changes without restarting
/import [codex|gemini] [--dry-run] [--yes]Bring configuration from other coding agents on your machine, currently OpenAI Codex and Google Gemini CLI, into Claude Code, including instruction files, MCP servers, commands, subagents, and skills
/agentsAs of v2.1.198, running /agents prints a reminder to ask Claude to create or manage subagents, or to edit .claude/agents/ or ~/.claude/agents/ directly
/claude-api [migrate|upgrade|…]Load Claude API and Managed Agents reference material for the project language; subcommands migrate, upgrade, managed-agents-onboard, prompt-audit, cost-optimize
/workflow-authoringLoad the reference for writing dynamic workflow scripts: script API, resume behaviour, worked examples
/auto-mode-setupDraft autoMode.environment entries from your project and recent sessions, review, and save to user settings (Pro/Max/Team)

Commands · cloud, sharing & account

/

Elsewhere

/artifactsList the artifacts you own or that are shared with you, then attach one to the session, open it in your browser, or copy its link
/teleportPull a Claude Code on the web session into this terminal
/remote-controlMake this session available for Remote Control from claude.ai
/remote-envChoose the default environment for cloud agents
/schedule [description]Create, update, list, or run routines, which execute in the cloud
/loop [interval] [prompt]Run a prompt repeatedly while the session stays open
/autofix-pr [prompt]Spawn a Claude Code on the web session that watches the current branch's PR and pushes fixes when CI fails or reviewers leave comments
/desktopContinue the current session in the Claude Code Desktop app
/mobileShow QR code to download the Claude mobile app
/chromeConfigure Claude in Chrome settings
/ideManage IDE integrations and show status
/web-setupConnect your GitHub account to Claude Code on the web using your local gh CLI credentials
/install-github-appInstall the Claude GitHub App for a repository, with an optional step to set up GitHub Actions workflows and secrets
/install-slack-appInstall the Claude Slack app
/team-onboardingGenerate a team onboarding guide from your Claude Code usage history

Account

/loginSign in to your Anthropic account
/logoutSign out from your Anthropic account
/upgradeOpen the upgrade page in your browser to switch to a higher plan tier
/usage-creditsConfigure usage credits, or request them from your admin, when you hit a limit
/rate-limit-optionsWays to keep working when a claude.ai usage limit blocks a request: wait and auto-continue at reset, add usage credits, or switch model family
/privacy-settingsView and update your privacy settings
/passesShare a free week of Claude Code with friends
/stickersOrder Claude Code stickers

Commands · help & misc

/

Help

/helpShow help and available commands
/powerupDiscover Claude Code features through quick interactive lessons with animated demos
/release-notesView the changelog in an interactive version picker
/bug [report]Report a bug or share your conversation
/feedback [report]Send product feedback about Claude Code
/radioOpen Claude FM lo-fi radio in your browser
/heapdumpWrite a JavaScript heap snapshot and a memory breakdown to ~/Desktop, or your home directory on Linux without a Desktop folder, for diagnosing high memory usage

Removed

/vimRemoved in v2.1.92
/pr-comments [PR]Removed in v2.1.91
/ultraplanRemoved

CLI flags

claude …

Session

-c, --continueContinue the most recent conversation in this directory
-r, --resume [id|name]Resume a session, or open the picker
--fork-sessionResume into a NEW session id, leaving the original intact
-n, --name <name>Display name in the prompt bar, picker, and terminal title
--session-id <uuid>Pin a specific session id (must be a valid UUID)
--from-pr [n|url]Resume the session linked to a pull request
--no-session-persistenceDo not write the session to disk (print mode only)

Model & reasoning

--model <alias|id>fable, opus, sonnet, haiku, best, opusplan, opus[1m], or a full id
--effort <level>low, medium, high, xhigh, max — and ultracode in Claude Code
--advisor <model>Enable the server-side advisor tool with this model
--fallback-model <list>Comma-separated models to try when the primary is overloaded
--autocompact <auto|tokens>Auto-compact window: auto, or 100k–1M
--betas <betas...>Extra anthropic-beta header values (API key users only)

Permissions

--permission-mode <mode>manual/default, acceptEdits, plan, auto, dontAsk, bypassPermissions
--allowedTools <tools...>Tools that run without prompting, e.g. "Bash(git log *)" Read
--disallowedTools <tools...>Deny rules for this run
--tools <names...>Restrict the built-in tool set; "" disables all, "default" restores
--dangerously-skip-permissionsSkip every permission check — sandboxes with no network only
--allow-dangerously-skip-permissionsMake bypass mode reachable without starting in it
--permission-prompt-tool <tool>Route prompts to an MCP tool in non-interactive runs
--permission-prompts host|nonePrint mode: who answers permission prompts — the SDK host / prompt tool (default), or nobody, so anything that would prompt is denied
--restrictedRestricted mode: no command-running tools or WebFetch unless --tools names them; ignores user, project and local settings; refuses bypassPermissions (v2.1.248+)

Input & output

-p, --printPrint the response and exit — the scripting entry point
--output-format <fmt>text (default), json, or stream-json
--input-format <fmt>text, or stream-json for realtime streaming input
--json-schema <schema>Validate structured output against a JSON Schema
--include-partial-messagesEmit partial chunks as they arrive
--include-hook-eventsInclude hook lifecycle events in the stream
--forward-subagent-textForward subagent text and thinking as messages
--replay-user-messagesRe-emit stdin user messages on stdout for acknowledgment
--prompt-suggestionsEmit a predicted next user prompt after each turn
--verboseOverride the verbose setting
--ax-screen-readerFlat text, no borders or animations
--briefEnable the SendUserMessage tool for agent-to-user communication
--file <id:path...>File resources to download at startup, as file_id:relative_path pairs
--timeout <seconds>Maximum time this command may run before it times out

Prompt & context

--system-prompt <text>Replace the entire system prompt
--system-prompt-file <path>…from a file
--append-system-prompt <text>Append to the default system prompt
--append-system-prompt-file <path>…from a file
--append-subagent-system-prompt <t>Append to every subagent system prompt
--add-dir <dirs...>Additional directories Claude may read and edit
--exclude-dynamic-system-prompt-sectionsMove cwd/env/git sections to the first user message for cache reuse
--system-prompt-snapshot on|offRecord the system prompt once per conversation and reuse it verbatim on every request and resume; on by default for the built-in prompt

Agents & concurrency

--agent <name>Agent for this session, overriding the agent setting
--agents <json>Define subagents inline as JSON
--bg, --backgroundStart as a background agent and return immediately
--exec <cmd>Run a shell command as a PTY-backed background job
-w, --worktree [name]Create a git worktree for this session
--tmuxPut the worktree in its own tmux session (needs --worktree)
--teammate-mode <mode>in-process, auto, tmux, or iterm2
--max-turns <n>Cap agentic turns (print mode only)
--max-budget-usd <amt>Stop after this much API spend (print mode only)
--work-onPick a file to focus on from an interactive list

Config & extensions

--settings <file|json>Extra settings from a file or inline JSON
--setting-sources <list>Which of user,project,local to load at all
--safe-modeDisable every customization — the config bisect tool
--bareMinimal mode: no hooks, LSP, plugin sync, or CLAUDE.md discovery
--mcp-config <configs...>Load MCP servers from JSON files or strings
--strict-mcp-configUse only servers from --mcp-config
--plugin-dir <path>Load a plugin from a directory or .zip for this session
--plugin-url <url>Fetch a plugin .zip from a URL for this session
--channels <list>MCP servers whose channel notifications to listen for
--disable-slash-commandsDisable all skills and commands
--dangerously-load-development-channelsEnable channels not on the approved allowlist, for local development; prompts for confirmation

Remote, IDE & hooks

--cloud [desc|id|url]Create or attach to a claude.ai cloud session
--environment <ccpool_…>Run the cloud session on a self-hosted environment
--ref <branch>Base the new session checkout on this ref
--teleport [session]Pull a web session into this terminal
--remote-control, --rc [name]Make this session drivable from claude.ai or the phone app, optionally named
--remote-control-session-name-prefixPrefix for auto-generated Remote Control session names (default: the machine hostname)
--remoteDeprecated alias for --cloud
--ideAuto-connect to the IDE at startup
--chrome / --no-chromeEnable or disable the Claude in Chrome integration
--init-onlyRun Setup and SessionStart hooks, then exit
--init / --maintenanceRun Setup hooks with that matcher first (print mode)

Diagnostics

-d, --debug [filter]Debug mode, e.g. --debug="mcp,startup" or "!1p,!file"
--debug-file <path>Write debug logs to a path (implies --debug)
-v, --versionPrint the version
-h, --helpHelp — note it does not list every flag

CLI subcommands

claude

claude <subcommand>

claude updateCheck for updates and install
claude install [target]Install the native build (stable, latest, or a version)
claude doctorRead-only installation and settings diagnostics
claude auth login|logout|statusManage Anthropic account authentication
claude setup-tokenLong-lived OAuth token for CI and scripts
claude agentsAgent view: monitor and dispatch background sessions
claude attach <id>Attach to a background session
claude logs <id>Print recent output from a background session
claude respawn <id>|--allRestart a background session (or all of them) so it runs the current Claude Code version, conversation intact
claude stop|kill <id>Stop a background session
claude rm <id>Delete a background session, and its worktree when that is safe; --discard-unpushed <commit>@<worktree-id> to force
claude daemon status|logs|stop|run|uninstallInspect, tail, stop or run in the foreground the background-session supervisor; stop --keep-workers leaves detached sessions running
claude project purge [path]Delete all local state for a project
claude import [codex|gemini]Import config from another coding agent
claude auto-mode defaults|config|critique|resetPrint the built-in classifier rules, print the effective config, get AI feedback on your custom rules, or reset to shipped defaults
claude ultrareview [target]Cloud multi-agent review, non-interactive
claude gatewayRun the enterprise auth/telemetry gateway
claude self-hosted-runnerRunner process for a self-hosted environment
claude remote-control [--spawn same-dir|worktree|session]Run a persistent Remote Control server in this directory; --capacity N concurrent sessions, -c reattaches the last one, --name labels it

claude mcp …

mcp add <name> <cmd|url>Add a server; --transport http|sse|ws, -e ENV=v, --header
mcp add-json <name> <json>Add from a JSON config written for another client
mcp add-from-claude-desktopImport servers from Claude Desktop (macOS, WSL)
mcp list | get <name>List or inspect servers and their health
mcp login|logout <name>Run or clear the OAuth flow for a server
mcp remove <name>Remove a server
mcp reset-project-choicesReset approvals for project-scoped .mcp.json servers
mcp serveExpose Claude Code itself as an MCP server

claude plugin …

plugin init|new <name>Scaffold a plugin under ~/.claude/skills/
plugin install <p[@mkt]>Install from a marketplace
plugin uninstall|remove <p>Uninstall
plugin enable|disable <p>Toggle without uninstalling
plugin update <p>Update to the latest version (restart to apply)
plugin listList installed plugins
plugin details <name>Component inventory and projected token cost
plugin validate <path>Validate a manifest, or a directory of skills/agents
plugin eval [target]Run scored eval cases against a plugin
plugin marketplaceManage marketplaces
plugin prune|autoremoveDrop auto-installed dependencies no longer needed
plugin tag [path]Create a {name}--v{version} release tag

Built-in tools

--tools

Files & search

ReadRead a file — text, images, PDFs by page range, notebooks with outputs
WriteCreate or fully replace a file
EditExact-string replacement in a file; replace_all for every occurrence
NotebookEditModify Jupyter notebook cells
GlobFind files by pattern
GrepSearch file contents
LSPLanguage-server intelligence: definitions, references, type errors

Execution

BashRun shell commands; run_in_background detaches across turns
PowerShellNative PowerShell execution where available
MonitorRun a command in the background and feed each output line back

Agents & messaging

AgentSpawn a subagent with its own context window
ListAgentsList subagents, teammates, and other sessions you can message
SendMessageMessage a teammate, a resumed subagent, or another session
SendUserFileSend a generated file to the user with a caption
EndConversationEnd the session — sustained abuse, or on request

Planning & tasks

EnterPlanModeSwitch to plan mode to design before coding
ExitPlanModePresent a plan for approval and leave plan mode
TaskCreateCreate a task in the task list
TaskGetFull details for one task
TaskListList all tasks and their status
TaskUpdateUpdate status, dependencies, details, or delete
TaskOutputRead a background task output (deprecated — Read the file instead)
TaskStopStop a background task, teammate, or named agent
TodoWriteSession checklist — off by default in favor of Task*

Worktrees & scheduling

EnterWorktreeCreate an isolated git worktree and switch into it
ExitWorktreeReturn to the original directory
CronCreateSchedule a recurring or one-shot prompt in this session
CronListList scheduled tasks
CronDeleteCancel a scheduled task by id
ScheduleWakeupReschedule the next iteration of a self-paced /loop

Web & MCP

WebSearchSearch the web (US-only results)
WebFetchFetch a URL, convert to markdown, answer a prompt against it
ToolSearchSearch for and load deferred tools
ListMcpResourcesToolList resources exposed by connected MCP servers
ReadMcpResourceToolRead one MCP resource by URI
WaitForMcpServersWait for servers still connecting instead of restarting

User-facing

AskUserQuestionMultiple-choice questions, with optional previews
ArtifactPublish an HTML or Markdown page to claude.ai — private by default
SkillExecute a skill inside the main conversation
WorkflowRun a multi-agent workflow script
PushNotificationDesktop notification, and phone push under Remote Control
ReportFindingsReport code-review findings as structured data
RemoteTriggerCreate, update, run and list Routines on claude.ai
ShareOnboardingGuideUpload ONBOARDING.md and return a share link

Settings · model, permissions & sandbox

settings.json

Model

modelSet the model every new session uses, so you don't have to pick one with /model each time
availableModelsRestrict which models people can select for the main session, subagents, skills, and the advisor
enforceAvailableModelsThe /model picker has a **Default** option that resolves to your organization default model when one applies, and otherwise to your account type's default
effortLevelKeep an effort level across sessions
fallbackModelName backup models for Claude Code to try, in order, when your primary model is overloaded or unavailable
advisorModelPick which model answers when Claude calls the server-side advisor tool
fastModeTurn fast mode on for sessions where it's available, for interactive work like rapid iteration or live debugging where you want speed at a higher cost
fastModePerSessionOptInNormally, running /fast saves fastMode to a person's user settings, so fast mode is on at the start of every later session
alwaysThinkingEnabledTurn extended thinking off for every session by setting this to false
showThinkingSummariesSee summaries of Claude's extended thinking in interactive sessions
switchModelsOnFlagChoose what happens when a safety classifier flags a request: switch to the fallback model and continue, or pause so you can choose between switching and stopping
ultracodeStart sessions with ultracode on
modelOverridesMap Anthropic model IDs to provider-specific model IDs, such as Amazon Bedrock inference profile ARNs
modelSettingsPer-model effort levels; Claude Code writes here when you run /effort or move the /model picker slider (v2.1.251+)
modelPricingManaged only: report spend at your contracted rates (multiplier and/or per-model overrides) in /usage, the status line and --max-budget-usd
outputStyleSelect an output style by name
teammateDefaultModelRemoved in v2.1.234, together with its /config row **Default teammate model**. Setting it has no effect on current versions.
languageHave Claude respond in a language other than English by default

Permissions

permissionsControl which tools Claude can use without asking, which ones always prompt, and which ones are blocked, and set the permission mode a session starts in
permissions.allowList the tool uses Claude Code approves without asking you
permissions.askList the tool uses that prompt you for confirmation even in a permission mode that would otherwise approve them, such as acceptEdits or bypassPermissions
permissions.denyList the tool uses Claude Code blocks
permissions.additionalDirectoriesGive Claude file access to directories outside the one you started in, as additional working directories
permissions.defaultModeSet the permission mode new sessions start in
permissions.disableBypassPermissionsModePrevent anyone from entering bypassPermissions mode
permissions.blockReadsOutsideWorkingDirectoriesStop Read, Grep, Glob and LSP leaving the working directories in every mode, bypass included; true in any file wins (v2.1.257+)
allowManagedPermissionRulesOnlyMake managed settings the only source of allow, ask, and deny permission rules
autoModeAdd your own rules to what the auto mode classifier blocks and allows
autoMode.classifyAllShellSend every Bash and PowerShell command through the auto mode classifier while auto mode is active
disableAutoModeRemove auto mode from the Shift+Tab cycle
useAutoModeDuringPlanChoose whether Claude Code uses the auto mode classifier to review shell commands in plan mode
skipAutoPermissionPromptSkip the one-time notice describing auto mode that Claude Code shows when you first enter auto mode yourself, for example through your own settings or Shift+Tab
skipDangerousModePermissionPromptSkip the confirmation dialog Claude Code shows before a session enters bypassPermissions mode, whether from --dangerously-skip-permissions or from defaultMode in your settings

Sandbox

sandboxIsolate the Bash commands Claude runs from your filesystem and network with sandboxing
sandbox.enabledTurn on sandboxing for Bash commands
sandbox.failIfUnavailableMake Claude Code exit with an error at startup when sandbox.enabled is true but the sandbox can't start, because a dependency is missing or the platform isn't supported
sandbox.autoAllowBashIfSandboxedLet Claude Code run sandboxed Bash commands without a permission prompt
sandbox.excludedCommandsName commands that Claude Code always runs outside the sandbox, such as tools that don't work under it
sandbox.allowUnsandboxedCommandsLet Claude retry a command outside the sandbox with the dangerouslyDisableSandbox parameter after the sandbox blocks it
sandbox.filesystem.allowWriteAdd paths where sandboxed commands can write, beyond the working directory and the session temp directory
sandbox.filesystem.denyWriteBlock sandboxed commands from writing to specific paths, including paths inside a directory that is otherwise writable.
sandbox.filesystem.denyReadBlock sandboxed commands from reading specific paths, such as credential files that the default read policy would otherwise expose
sandbox.filesystem.allowReadRe-open reading for specific paths inside a region that denyRead blocks, to build workspace-only read access
sandbox.network.allowedDomainsPre-allow domains for outbound traffic from sandboxed commands, so the sandbox doesn't prompt for them
sandbox.network.deniedDomainsBlock domains for outbound traffic from sandboxed commands, using the same wildcard, port, and IPv6 syntax as allowedDomains
sandbox.network.strictAllowlistDeny sandboxed commands access to hosts outside the allowlist instead of prompting for approval
sandbox.network.allowLocalBindingLet sandboxed commands bind localhost ports on macOS, e.g. a dev server
sandbox.network.httpProxyPortPoint the sandbox at your own HTTP proxy port instead of the one Claude Code runs (inspection, filtering, logging)
sandbox.enableWeakerNetworkIsolationLet sandboxed commands on macOS reach the system TLS trust service — needed by Go tools behind a MITM proxy; weakens isolation
sandbox.credentials.filesProtect credential files or directories from sandboxed commands
sandbox.credentials.envVarsProtect environment variables from sandboxed commands
sandbox.ignoreViolationsSilence sandbox violation reports for paths you expect a command to probe and be refused, such as a tool that checks /etc/hosts on startup, so those don't show up as violations

Settings · context, memory & interface

settings.json

Context & memory

autoCompactEnabledHave Claude Code compact the conversation automatically when context approaches the limit
autoCompactWindowSet how full the context window gets before Claude Code compacts automatically.
autoMemoryEnabledTurn auto memory on or off
autoMemoryDirectoryStore auto memory in a directory of your choice instead of the per-project default.
claudeMdInject CLAUDE.md-style instructions as organization-managed memory without deploying a separate file
claudeMdExcludesSkip specific CLAUDE.md files when Claude Code loads memory
plansDirectoryChoose where Claude Code stores the plan files it writes in plan mode
fileCheckpointingEnabledHave Claude Code snapshot files before each edit so /rewind can restore them
skillListingBudgetFractionEach turn, Claude sees a listing of your skills with their descriptions, and Claude Code caps that listing at a share of the context window
skillListingMaxDescCharsEach turn, Claude sees a listing of your skills that shows each skill's description and when_to_use text
envSet environment variables for every session and for the subprocesses Claude Code starts from it
cleanupPeriodDaysSet how many days Claude Code keeps session transcripts and other application data before deleting them
promptCacheTtl5m or 1h: how long the prompt cache holds the main conversation; 1h keeps it warm across breaks at a higher write price (v2.1.242+)
subagentPromptCacheTtl5m or 1h for requests outside the main conversation: subagents, workflows, compaction and other helpers
autoContinueAtUsageLimitAfter a claude.ai usage limit stops the session, wait and continue the task automatically when the window resets (user or managed)

Interface

themePick the color theme for the interface
tuiChoose the terminal UI renderer
viewModeSet the transcript view Claude Code starts in: "default", "verbose", or "focus"
editorModeChoose the key binding mode for the input prompt.
keybindingFlavorChoose which convention Ctrl+W follows in the prompt input
vimInsertModeRemapsMap two-key INSERT-mode sequences to Escape in vim editor mode
statusLineRun your own command to render a status line below the prompt with context such as the model, cost, or git branch
subagentStatusLineWhen Claude runs subagents, Claude Code lists them in a task display below the prompt, one row per subagent showing name · description · token count
verboseBy default, the transcript collapses each tool call to a short summary, such as the command Claude ran and a line count of its output, and you press Ctrl+O to expand one
spellcheckUnderline misspelled words in the prompt input as you type, using a spell checker you install
emojiCompletionEnabledShow emoji suggestions when you type : plus a shortcode in the prompt input, and replace a completed shortcode such as :heart: with its emoji
fileSuggestionRun your own command to supply @ file path autocomplete instead of the built-in file suggestion
autoScrollEnabledFollow new output to the bottom of the conversation in fullscreen rendering
prefersReducedMotionReduce or turn off interface animations such as the spinner, shimmer, and flash effects
showTurnDurationShow or hide the turn duration message after each response, such as "Cooked for 1m 6s"
timeFormatHow times in the interface are written (turn-done stamps, transcript timestamps); /config → Time format (v2.1.257+)
timeZoneIANA zone name for interface times, e.g. "UTC" or "Europe/Dublin"; settings file only
syntaxHighlightingDisabledClaude Code colors code by language in the diffs, code blocks, and file previews it shows in the terminal, with its built-in highlighter; no plugin or theme is involved
terminalTitleFromRenameClaude Code sets your terminal tab's title
terminalProgressBarEnabledSome terminals can show a progress indicator on the tab or in the taskbar for the program running in them
spinnerTipsEnabledWhile Claude works, the spinner line rotates through short tips about Claude Code features, such as "Use Plan Mode to prepare for a complex request before you start"
spinnerVerbsWhile a turn is in progress, the spinner shows a rotating verb such as "Accomplishing", "Architecting", or "Baking"
defaultShellChoose whether Bash or PowerShell runs the shell commands you type with the ! prefix in the input box, the ones Claude Code runs directly and adds to the transcript
respondToBashCommandsChoose whether Claude responds after you run a shell command with the ! prefix in the input box
respectGitignoreControl whether the @ file picker leaves out files that match .gitignore patterns
askUserQuestionTimeoutLet an unanswered AskUserQuestion dialog auto-continue after a period of idle time, submitting whatever options you had already selected
dialogExpirySet the deadline for dialogs Claude Code forwards to a remote client, such as a Remote Control or SDK host, for the approval dialog for a held cross-session message
axScreenReaderRender screen-reader friendly output: flat text without decorative borders or animations
voiceTurn on voice dictation and choose how the dictation key behaves
voiceEnabledDeprecated since v2.1.92, when the voice object replaced it
promptSuggestionEnabledShow or hide prompt suggestions, the grayed-out predictions that appear in your prompt input
showClearContextOnPlanAcceptWhen Claude finishes a plan in plan mode, it shows an approval menu
wheelScrollAccelerationEnabledAccelerate mouse-wheel scroll speed during fast scrolls in fullscreen rendering
companyAnnouncementsShow your organization's announcements to users at startup
footerLinksRegexesRender extra clickable badges in the footer below the input box when a regex matches turn output: tool results, including file contents and fetched pages

Settings · hooks, skills & plugins

settings.json

Hooks & workflows

hooksRun your own commands, prompts, agents, HTTP requests, or MCP tools as hooks at points in Claude Code's lifecycle, such as before a tool call or when a session starts
disableAllHooksTurn off hooks, any custom status line, and any custom file suggestion command
allowManagedHooksOnlyRestrict hook execution to hooks your organization deploys.
allowedHttpHookUrlsLimit which URLs HTTP hooks can target
httpHookAllowedEnvVarsAn HTTP hook can put the value of an environment variable into a request header, for example an Authorization: Bearer $HOOK_TOKEN header, but only for the variables you list here
enableWorkflowsTurn dynamic workflows on or off for yourself when your plan's default isn't what you want
disableWorkflowsTurn off dynamic workflows and the bundled workflow commands for everyone your settings reach, such as an organization through managed settings
workflowSizeGuidelineSet the agent count Claude aims for in the dynamic workflows it writes
workflowKeywordTriggerEnabledChoose whether typing the keyword ultracode in a prompt triggers a dynamic workflow

Skills

disableBundledSkillsTurn off the skills and workflows included with Claude Code
disableSkillShellExecutionTurn off the inline shell execution skills and custom commands can use, where a !`command` line runs and its output is substituted into the prompt
skillOverridesHide or collapse a skill without editing its SKILL.md
syncClaudeAiSkillsTurn off the download of the skills you enable on claude.ai

Plugins

enabledPluginsTurn individual plugins on or off, keyed by plugin-name@marketplace-name
extraKnownMarketplacesRegister additional plugin marketplaces by name, so that people who open the repository, or everyone your managed settings reach, get the marketplace without adding it themselves
pluginConfigsStore the non-sensitive answers you give a plugin's userConfig configuration dialog, keyed by plugin ID. Claude Code writes this key to your user settings
blockedMarketplacesBlock plugin marketplace sources for your organization
strictKnownMarketplacesRestrict which plugin marketplace sources people in your organization can add and install plugins from
strictPluginOnlyCustomizationBlock skills, agents, hooks, and MCP servers from user and project sources, so they can come only from plugins or managed settings
disableCommandPluginSourcesBlock the command plugin source, which installs a plugin by running a marketplace-declared command on the user's machine
pluginSuggestionMarketplacesName the marketplaces whose plugins can appear as contextual install suggestions, in spinner tips and pinned at the top of the /plugin **Discover** tab
pluginTrustMessageAdd your organization's own text to the plugin trust warning Claude Code shows before installation, for example to confirm that plugins from your internal marketplace are approved
channelsEnabledAllow channels for your organization
allowedChannelPluginsChoose which channel plugins can push messages into sessions in your organization

MCP

allowedMcpServersAllowlist the MCP servers people can use
deniedMcpServersBlock specific MCP servers
allowManagedMcpServersOnlyMake the managed allowlist the only one that applies
enableAllProjectMcpServersApprove every MCP server defined in project .mcp.json files without a prompt
enabledMcpjsonServersApprove specific servers defined in project .mcp.json files so Claude Code connects them without asking
disabledMcpjsonServersReject specific servers defined in a project's .mcp.json file so Claude Code never connects them or asks you to approve them
allowAllClaudeAiMcpsLoad the claude.ai connectors Claude Code fetches itself alongside a deployed managed-mcp.json
disableClaudeAiConnectorsTurn off claude.ai MCP connectors so Claude Code neither fetches nor connects them

Settings · agents, git, auth & admin

settings.json

Agents & worktrees

agentRun the main thread as a named subagent, so Claude Code applies that subagent's system prompt, tool restrictions, and model to your session
teammateModeChoose where Claude Code shows agent team teammates: inside your main terminal pane, or in split panes when your terminal supports them
disableAgentViewTurn off background agents and agent view: claude agents, --bg, /background, and the on-demand supervisor
crossSessionInboundChoose what this session does with messages arriving from your other Claude Code sessions
isolatePeerMachinesRequire your explicit approval before Claude's SendMessage reaches one of your sessions beyond this machine; see Require approval for cross-machine messages
processWrapperOn macOS and Linux, place a corporate launcher command in front of the background processes Claude Code starts
worktreeConfigure how Claude Code creates and manages git worktrees for --worktree, the EnterWorktree tool, and isolated subagents and background sessions.
worktree.baseRefChoose which ref new worktrees branch from
worktree.symlinkDirectoriesSymlink directories from the main repository into each worktree so you don't duplicate large directories on disk.
worktree.sparsePathsCheck out only the listed directories in each worktree through git sparse-checkout
worktree.bgIsolationChoose how background sessions isolate their file edits

Git attribution

attributionCustomize the attribution Claude Code adds to git commits and pull requests
attribution.commitSet the attribution text Claude Code adds to git commits, including any trailers
attribution.prSet the attribution text Claude Code adds to pull request descriptions
attribution.sessionUrlChoose whether Claude Code appends the claude.ai session link when it commits or opens a pull request from a cloud or Remote Control session
includeCoAuthoredByDeprecated since v2.0.62, when attribution replaced it
includeGitInstructionsAt session start, Claude Code adds two git-related pieces to Claude's prompt: its built-in instructions for how to write commits and pull requests, and the repository's current status and recent log
prUrlTemplatePoint the PR links Claude Code renders, in the footer badge and in tool-result summaries, at an internal code-review tool instead of github.com

Notifications & remote

preferredNotifChannelChoose how Claude Code notifies you when a task completes or a permission prompt is waiting
agentPushNotifEnabledAllow Claude to send a push notification to your phone when it decides one is worth sending, for example when a long task finishes
inputNeededNotifEnabledGet a push notification on your phone when a permission prompt or question is waiting for your input
awaySummaryEnabledShow a one-line session recap when you return to the terminal after a few minutes away
enableArtifactTurn the Artifact tool on or off for yourself
disableArtifactTurn off the Artifact tool, which publishes session output as a private web page on claude.ai, for everyone your settings reach, such as an organization through managed settings
disableRemoteControlTurn off Remote Control: Claude Code then refuses claude remote-control, the --remote-control flag, auto-start, and the in-session toggle, and reports that it is disabled by policy
remoteControlAtStartupConnect Remote Control automatically when each interactive session starts, instead of waiting for /remote-control
remote.defaultEnvironmentIdPick the default cloud environment for cloud sessions you create from the CLI, such as with claude --cloud
sshConfigsAdd SSH connections to the Desktop environment dropdown
sshHostAllowlistLimit the hosts a Desktop SSH session can connect to
disableDeepLinkRegistrationStop Claude Code from registering the claude-cli:// protocol handler with the operating system, which it otherwise does after you send the first prompt

Auth & admin

apiKeyHelperRun your own command to produce the credential Claude Code sends with model requests
awsAuthRefreshRun your own command, such as aws sso login, to refresh the credentials in your .aws directory when the ones Claude Code has for Amazon Bedrock stop working
awsCredentialExportRun your own command that prints AWS credentials as JSON, so Claude Code can call Amazon Bedrock with credentials that don't live in your .aws directory
gcpAuthRefreshRun your own command to refresh Google Cloud Application Default Credentials when Claude Code finds they've expired or can't be loaded, so Google Cloud calls keep working
otelHeadersHelperRun your own command to generate the headers Claude Code sends with OpenTelemetry exports, for backends whose tokens rotate
forceLoginMethodRestrict which kind of account people can log in with
forceLoginOrgUUIDFrom a managed source, require claude.ai account logins to belong to one Anthropic organization, a single UUID, or to any of several, an array
forceLoginGatewayUrlSet the gateway URL the /login Cloud gateway screen connects to, so people reach your cloud gateway without typing its address
policyHelperRun an executable you deploy that computes managed settings at startup, so you can derive policy from device posture, identity, or a remote service in real time
parentSettingsBehaviorChoose whether Claude Code applies managed settings supplied by an embedding host process, such as the Agent SDK or an IDE extension, when an admin-deployed managed settings file is also present
managedSourcesBehaviorManaged only: apply just the highest-priority managed source (default) or merge every admin-delivered source
autoUpdatesChannelChoose which release channel background auto-updates and claude update follow
minimumVersionKeep background auto-updates and claude update from installing any version below this one, so moving to the "stable" channel doesn't downgrade you from a newer build
requiredMinimumVersionSet the oldest Claude Code version your organization allows to start
requiredMaximumVersionSet the newest Claude Code version your organization allows to start
disableSideloadFlagsReject the --plugin-dir, --plugin-url, --agents, and --mcp-config CLI flags at startup, which users could otherwise pass to bypass strictKnownMarketplaces
wslInheritsWindowsSettingsHave Claude Code on WSL read managed settings from the Windows policy chain, with HKLM and the Windows managed settings file taking priority over /etc/claude-code/managed-settings.json
feedbackSurveyRateSet the probability that the session quality survey appears when a session is eligible for it
skipWebFetchPreflightSkip the WebFetch domain safety check, which sends each requested hostname to api.anthropic.com before fetching

IDE

autoConnectIdeConnect to a running IDE automatically when you start Claude Code from an external terminal
autoInstallIdeExtensionInstall the Claude Code IDE extension automatically when you run Claude Code from a VS Code terminal
diffToolChoose where Claude Code shows the diff of an Edit or Write change it proposes when a VS Code or JetBrains IDE is connected: "auto" opens it in the IDE
externalEditorContextWhen you press Ctrl+G, Claude Code opens the prompt you're typing in your external editor
permissionExplainerEnabledWhen Claude asks permission to run a Bash or PowerShell command, you can press Ctrl+E on the prompt to get a model-generated explanation of the command

Env vars · auth & providers

export

Credentials

ANTHROPIC_API_KEYAPI key sent as X-Api-Key header
ANTHROPIC_AUTH_TOKENCustom value for the Authorization header (the value you set here will be prefixed with Bearer )
ANTHROPIC_CUSTOM_HEADERSCustom headers to add to requests (Name: Value format, newline-separated for multiple headers)
ANTHROPIC_BASE_URLOverride the API endpoint to route requests through a proxy or gateway
CLAUDE_CODE_OAUTH_TOKENOAuth access token for claude.ai authentication
CLAUDE_CODE_OAUTH_REFRESH_TOKENOAuth refresh token for Claude.ai authentication
CLAUDE_CODE_OAUTH_SCOPESSpace-separated OAuth scopes the refresh token was issued with, such as "user:profile user:inference user:sessions:claude_code"
ANTHROPIC_PROFILEName of the Anthropic profile to authenticate with, such as one created by ant auth login
ANTHROPIC_ORGANIZATION_IDOrganization ID for Workload Identity Federation
ANTHROPIC_WORKSPACE_IDWorkspace ID for workload identity federation
ANTHROPIC_FEDERATION_RULE_IDFederation rule ID for Workload Identity Federation

Third-party providers

CLAUDE_CODE_USE_BEDROCKUse Amazon Bedrock
CLAUDE_CODE_USE_VERTEXUse Google Cloud's Agent Platform
CLAUDE_CODE_USE_FOUNDRYUse Microsoft Foundry
CLAUDE_CODE_USE_MANTLEUse the Amazon Bedrock Mantle endpoint
CLAUDE_CODE_USE_ANTHROPIC_AWSUse Claude Platform on AWS
ANTHROPIC_BEDROCK_BASE_URLOverride the Amazon Bedrock endpoint URL. Use for custom Amazon Bedrock endpoints or when routing through an LLM gateway
ANTHROPIC_BEDROCK_REGION_PREFIXCross-region inference profile prefix (us, eu, apac, jp, au, or global) Claude Code tries first instead of the one derived from the AWS region
ANTHROPIC_BEDROCK_SERVICE_TIERAmazon Bedrock service tier (default, flex, or priority)
ANTHROPIC_VERTEX_PROJECT_IDGCP project ID for Google Cloud's Agent Platform requests
ANTHROPIC_VERTEX_BASE_URLOverride Google Cloud's Agent Platform endpoint URL. Use for custom Google Cloud's Agent Platform endpoints or when routing through an LLM gateway
ANTHROPIC_FOUNDRY_RESOURCEMicrosoft Foundry resource name (for example, my-resource)
ANTHROPIC_FOUNDRY_API_KEYAPI key for Microsoft Foundry authentication (see Microsoft Foundry)
ANTHROPIC_AWS_WORKSPACE_IDRequired for Claude Platform on AWS. Sent on every request as the anthropic-workspace-id header
ANTHROPIC_AWS_API_KEYWorkspace API key for Claude Platform on AWS, generated in the AWS Console
AWS_BEARER_TOKEN_BEDROCKAmazon Bedrock API key for authentication (see Amazon Bedrock API keys)

Env vars · model & reasoning

export

Model selection

ANTHROPIC_MODELName of the model setting to use (see Model Configuration)
ANTHROPIC_DEFAULT_MODELModel that new sessions start on by default
ANTHROPIC_DEFAULT_FABLE_MODELModel ID that the fable alias resolves to, and the ID Claude Code recognizes as Fable 5 for automatic model fallback on third-party providers
ANTHROPIC_DEFAULT_OPUS_MODELModel ID that the opus alias resolves to, and that opusplan uses while Plan Mode is active
ANTHROPIC_DEFAULT_SONNET_MODELModel ID that the sonnet alias resolves to, and that opusplan uses when Plan Mode is not active
ANTHROPIC_DEFAULT_HAIKU_MODELModel ID that the haiku alias resolves to, also used for background functionality
ANTHROPIC_SMALL_FAST_MODEL[DEPRECATED] Name of Haiku-class model for background tasks
ANTHROPIC_CUSTOM_MODEL_OPTIONModel ID to add as a custom entry in the /model picker
CLAUDE_CODE_SUBAGENT_MODELThe model Claude Code uses for all subagents, agent teams, and agents in a workflow
CLAUDE_CODE_SUBAGENT_MODEL_FORCESet to 1 to force one model onto subagents, teammates and workflow agents (v2.1.257+)
FALLBACK_FOR_ALL_PRIMARY_MODELSSet to any non-empty value, such as 1, to make every model stop retrying with a repeated-overload error when no fallback model is configured

Reasoning & limits

CLAUDE_CODE_EFFORT_LEVELSet the effort level for supported models
CLAUDE_EFFORTSet automatically in Bash tool subprocesses and hook commands to the active effort level for the turn: low, medium, high, xhigh, or max
CLAUDE_CODE_ALWAYS_ENABLE_EFFORTSet to 1 to send the effort parameter with every request, even when Claude Code does not recognize the model ID as effort-capable
MAX_THINKING_TOKENSFixed token budget for extended thinking
CLAUDE_CODE_DISABLE_THINKINGSet to 1 to omit the thinking parameter from API requests entirely
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKINGSet to 1 to disable adaptive reasoning on Opus 4.6 and Sonnet 4.6 and fall back to the fixed thinking budget controlled by MAX_THINKING_TOKENS
DISABLE_INTERLEAVED_THINKINGSet to 1 to prevent sending the interleaved-thinking beta header
CLAUDE_CODE_MAX_OUTPUT_TOKENSSet the maximum number of output tokens for most requests
CLAUDE_CODE_MAX_CONTEXT_TOKENSOverride the context window size Claude Code assumes for the active model
CLAUDE_CODE_MAX_TURNSCap the number of agentic turns when no explicit limit is passed
CLAUDE_CODE_DISABLE_1M_CONTEXTSet to 1 to disable 1M context window support
CLAUDE_CODE_AUTO_COMPACT_WINDOWSet the auto-compact window in tokens, from 100000 to 1000000
CLAUDE_AUTOCOMPACT_PCT_OVERRIDESet the percentage (1-100) of the auto-compact window at which auto-compaction triggers
DISABLE_AUTO_COMPACTSet to 1 to disable automatic compaction when approaching the context limit
DISABLE_COMPACTSet to 1 to disable all compaction, automatic and the manual /compact
MAX_STRUCTURED_OUTPUT_RETRIESHow many times -p retries when the response fails --json-schema validation; also applies to workflow subagent schemas
ANTHROPIC_BETASComma-separated list of additional anthropic-beta header values to include in API requests

Caching

DISABLE_PROMPT_CACHINGSet to 1 to disable prompt caching for all models (takes precedence over per-model settings)
DISABLE_PROMPT_CACHING_OPUSSet to 1 to disable prompt caching for Opus models
DISABLE_PROMPT_CACHING_SONNETSet to 1 to disable prompt caching for Sonnet models
DISABLE_PROMPT_CACHING_HAIKUSet to 1 to disable prompt caching for Haiku models
DISABLE_PROMPT_CACHING_FABLESet to 1 to disable prompt caching for Fable models
ENABLE_PROMPT_CACHING_1HSet to 1 to request a 1-hour prompt cache TTL instead of the default 5 minutes
FORCE_PROMPT_CACHING_5MSet to 1 to force the 5-minute prompt cache TTL even when 1-hour TTL would otherwise apply
CLAUDE_CODE_PROMPT_CACHE_TTL5m or 1h for the main conversation; takes precedence over the promptCacheTtl setting

Env vars · tools & agents

export

Tool behavior

BASH_DEFAULT_TIMEOUT_MSDefault timeout for long-running bash commands (default: 120000, or 2 minutes)
BASH_MAX_TIMEOUT_MSMaximum timeout the model can set for long-running bash commands (default: 600000, or 10 minutes)
BASH_MAX_OUTPUT_LENGTHMaximum number of characters of bash output that Claude Code reads back into a command's result (default: 30000; maximum: 150000)
CLAUDE_CODE_SHELLSet the shell Claude Code uses to run Bash tool commands
CLAUDE_CODE_SHELL_PREFIXCommand prefix that wraps shell commands Claude Code spawns: Bash tool calls, hook commands, status line commands, and stdio MCP server startup commands
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENSOverride the default token limit for file reads
CLAUDE_CODE_GLOB_HIDDENSet to false to exclude dotfiles from results when Claude invokes the Glob tool
CLAUDE_CODE_GLOB_NO_IGNORESet to false to make the Glob tool respect .gitignore patterns
CLAUDE_CODE_GLOB_TIMEOUT_SECONDSTimeout in seconds for Glob tool file discovery
USE_BUILTIN_RIPGREPSet to 0 to use system-installed rg instead of rg included with Claude Code
CLAUDE_CODE_USE_NATIVE_FILE_SEARCHSet to 1 to discover custom commands, subagents, and output styles using Node.js file APIs instead of ripgrep
CLAUDE_CODE_USE_POWERSHELL_TOOLControls the PowerShell tool
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCYMaximum number of read-only tools and subagents that can execute in parallel (default: 10)
CLAUDE_CODE_TOOL_MEMORY_LIMITOn Linux and WSL, set to a size such as 4G to cap the memory that Bash and PowerShell tool commands can use
TASK_MAX_OUTPUT_LENGTHMaximum number of characters in subagent output before truncation (default: 32000, maximum: 160000)
CLAUDE_CODE_WEBFETCH_CACHE_TTL_MSSet to the number of milliseconds WebFetch keeps each fetched URL's response cached
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSIONCap on the total number of WebSearch calls one session can make (default: 200)

Subagents & tasks

CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTSHow many subagents can be running in one session before the Agent tool refuses to spawn another (default: 20)
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSIONRemoved in v2.1.224 and now a no-op
CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTHNumber of subagent layers allowed below the main conversation (default: 3)
CLAUDE_CODE_FORK_SUBAGENTControls fork mode, which lets Claude spawn forked subagents itself and is on by default in interactive sessions only
CLAUDE_CODE_FORWARD_SUBAGENT_TEXTSet to 1 to emit subagent text and thinking blocks in claude -p --output-format stream-json output, the same behavior as the --forward-subagent-text flag
CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPTSet to 1 to enable appending extra text to the end of the system prompt of every subagent other than a forked subagent
CLAUDE_CODE_ENABLE_TASKSSelects which task-tracking tools Claude Code provides in sessions that have them
CLAUDE_CODE_ENABLE_TODO_TOOLSSet to 1 to get the task-tracking tools on the models listed under Task tool availability, where Claude Code otherwise leaves them out
CLAUDE_AUTO_BACKGROUND_TASKSSet to 1 to force-enable automatic backgrounding of long-running agent tasks
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSSet to 1 to disable all background task functionality, including the run_in_background parameter on Bash and subagent tools, auto-backgrounding, and background sessions
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSSet to 1 to enable agent teams
CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTSSet to 1 to disable the built-in Explore and Plan subagents

MCP

ENABLE_TOOL_SEARCHControls MCP tool search
MAX_MCP_OUTPUT_TOKENSMaximum number of tokens allowed in MCP tool responses
MCP_TIMEOUTTimeout in milliseconds for MCP server startup (default: 30000, or 30 seconds)
MCP_TOOL_TIMEOUTTimeout in milliseconds for MCP tool execution (default: 100000000, about 28 hours)
MCP_CONNECT_TIMEOUT_MSHow long blocking MCP startup waits, in milliseconds, for the connection batch before snapshotting the tool list (default: 5000)
MCP_OAUTH_CALLBACK_PORTFixed port for the OAuth redirect callback, as an alternative to --callback-port when adding an MCP server with pre-configured credentials
MCP_DISCOVERY_CACHETurns the MCP discovery cache on or off
MCP_SERVER_CONNECTION_BATCH_SIZEMaximum number of local MCP servers (stdio) to connect in parallel during startup (default: 3)
CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUTIdle timeout in milliseconds for MCP tool calls
CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSElapsed time in milliseconds before a still-running MCP tool call moves to a background task (default: 120000, or 2 minutes)
ENABLE_CLAUDEAI_MCP_SERVERSSet to false to disable claude.ai MCP servers in Claude Code

Env vars · behavior switches

export

Turn things off

CLAUDE_CODE_SAFE_MODESet to 1 to start in safe mode: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes are all skipped
CLAUDE_CODE_SIMPLESet to 1 to run with a minimal system prompt and only the Bash, file read, and file edit tools
CLAUDE_CODE_DISABLE_CLAUDE_MDSSet to 1 to prevent loading any CLAUDE.md memory files into context, including user, project, and auto memory files
CLAUDE_CODE_DISABLE_AUTO_MEMORYSet to 1 to disable auto memory
CLAUDE_CODE_DISABLE_BUNDLED_SKILLSSet to 1 to disable the skills and workflows included with Claude Code: bundled skills and workflows are removed entirely, while built-in commands stay
CLAUDE_CODE_DISABLE_WORKFLOWSSet to 1 to disable workflows
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTINGSet to 1 to disable file checkpointing
CLAUDE_CODE_DISABLE_ARTIFACTSet to 1 to disable the Artifact tool, which publishes session output as a private web page on claude.ai
CLAUDE_CODE_ARTIFACT_AUTO_OPENSet to 0 to stop the browser opening when a new artifact is published
CLAUDE_CODE_DISABLE_AGENT_VIEWSet to 1 to turn off background agents and agent view: claude agents, --bg, /background, and the on-demand supervisor
CLAUDE_CODE_DISABLE_ADVISOR_TOOLSet to 1 to disable the advisor tool
CLAUDE_CODE_DISABLE_FAST_MODESet to 1 to disable fast mode
CLAUDE_CODE_DISABLE_CRONSet to 1 to disable scheduled tasks
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICSet to any non-empty value, such as 1, to disable nonessential network traffic: auto-updates, telemetry, error reporting, the /feedback command, and similar background requests
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONSSet to 1 to remove built-in commit and PR workflow instructions and the git status snapshot from Claude's system prompt
DISABLE_AUTOUPDATERSet to 1 to disable automatic background updates
DISABLE_UPDATESSet to 1 to block all updates including manual claude update and claude install — stricter than DISABLE_AUTOUPDATER
DISABLE_TELEMETRYSet to any non-empty value, such as 1, to opt out of telemetry
DISABLE_ERROR_REPORTINGSet to any non-empty value, such as 1, to opt out of error reporting
DISABLE_COST_WARNINGSSet to 1 to disable cost warning messages
DO_NOT_TRACKSet to 1 to opt out of telemetry, with the same effect as DISABLE_TELEMETRY, including making Remote Control and the other features that need feature telemetry unavailable
DISABLE_GROWTHBOOKSet to 1 or true to disable GrowthBook feature-flag fetching and use code defaults for every flag
CLAUDE_CODE_RESTRICTEDSet to 1 to start in restricted mode, the same as --restricted; ignored inside a settings env block (v2.1.248+)
CLAUDE_CODE_SKIP_PROMPT_HISTORYSet to 1 to write no prompt history or transcripts to disk; such sessions cannot be resumed — for ephemeral scripted runs
CLAUDE_CODE_HIDE_CWDSet to 1 to hide the working directory in the startup banner, for screenshares and recordings
CLAUDE_CODE_SUBPROCESS_ENV_SCRUBSet to 1 to strip Anthropic, cloud-provider and registry credentials from the environment of Bash commands, hooks and stdio MCP servers
CLAUDE_CODE_DISABLE_TERMINAL_TITLESet to 1 to stop automatic terminal-title updates; in -p and SDK sessions also skips the title-generating model request

Turn things on

CLAUDE_CODE_ENABLE_AUTO_MODEAccepted for compatibility with older releases and has no effect
CLAUDE_CODE_ENABLE_TELEMETRYSet to 1 to enable OpenTelemetry data collection for metrics and logging
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTIONSet to false to turn off prompt suggestions, the grayed-out predictions that appear in your prompt input
CLAUDE_CODE_ENABLE_AWAY_SUMMARYOverride session recap availability
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMINGControls whether tool call inputs stream from the API as Claude generates them
CLAUDE_CODE_NEW_INITSet to 1 to make /init run an interactive setup flow
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MDSet to 1 to load memory files from directories specified with --add-dir
CLAUDE_CODE_ARTIFACT_COMMENTSSet to 1 to let Claude read and reply to comments on an artifact when feature-flag fetching is off
CLAUDE_CODE_GOAL_CHECKIN_MINUTESHow many minutes background work can keep an active goal waiting before Claude Code asks Claude to check on it
CLAUDE_CODE_ACCESSIBILITYSet to 1 to keep the native terminal cursor visible and disable the inverted-text cursor indicator
CLAUDE_CODE_SYNC_SKILLSSet to 1 to download your enabled claude.ai skills into ~/.claude/skills/synced/ and resync every 10 minutes
CLAUDE_AX_SCREEN_READERSet to 1 to render screen-reader friendly output: flat text without decorative borders or animations

Env vars · paths, network & telemetry

export

Paths & identity

CLAUDE_CONFIG_DIROverride the configuration directory (default: ~/.claude)
CLAUDE_CODE_PROJECT_DIR_NAMESet together with CLAUDE_CONFIG_DIR to choose the projects/ directory name Claude Code stores that session's transcripts and auto memory under, instead of the name derived from the working directory path
CLAUDE_CODE_TMPDIROverride the temp directory used for internal temp files
CLAUDE_CODE_DEBUG_LOGS_DIROverride the debug log file path
CLAUDE_CODE_DEBUG_LOG_LEVELMinimum level written to the debug log: verbose, debug (default), info, warn, error
CLAUDE_CODE_PLUGIN_CACHE_DIROverride the plugins root directory
CLAUDE_ENV_FILEPath to a shell script whose contents Claude Code runs before each Bash command in the same shell process, so exports in the file are visible to the command
CLAUDE_CODE_SESSION_IDSet automatically to the current session ID in Bash and PowerShell tool subprocesses, hook command subprocesses, and stdio MCP server subprocesses
CLAUDECODESet to 1 in subprocesses Claude Code spawns (Bash and PowerShell tools, tmux sessions, hook commands, status line commands, stdio MCP server subprocesses)
CLAUDE_PIDClaude Code sets this to its own process ID in the subprocesses it spawns: Bash and PowerShell tool commands and hook commands
CLAUDE_CODE_REMOTESet automatically to true when Claude Code is running as a cloud session

Network & TLS

HTTP_PROXYSpecify HTTP proxy server for network connections
HTTPS_PROXYSpecify HTTPS proxy server for network connections
NO_PROXYList of domains and IPs to which requests will be directly issued, bypassing proxy
API_TIMEOUT_MSTimeout for API requests in milliseconds (default: 600000, or 10 minutes; maximum: 2147483647)
CLAUDE_CODE_CONNECT_TIMEOUT_MSRemoved in v2.1.186 and now a no-op
CLAUDE_CODE_MAX_RETRIESOverride the number of times to retry failed API requests (default: 10)
CLAUDE_CODE_CERT_STOREComma-separated list of CA certificate sources for TLS connections
CLAUDE_CODE_CLIENT_CERTPath to client certificate file for mTLS authentication
CLAUDE_CODE_CLIENT_KEYPath to client private key file for mTLS authentication
CLAUDE_STREAM_IDLE_TIMEOUT_MSTimeout in milliseconds before the event- and byte-level streaming idle watchdogs close a stalled connection
CLAUDE_CODE_PROXY_RESOLVES_HOSTSSet to 1 to allow the proxy to perform DNS resolution instead of the caller
CLAUDE_CODE_EXTRA_BODYJSON object merged into the top level of every API request body, for provider-specific parameters Claude Code does not expose

Telemetry (OpenTelemetry, OTel)

OTEL_LOG_USER_PROMPTSSet to 1 to include user prompt text in OpenTelemetry traces and logs
OTEL_LOG_ASSISTANT_RESPONSESSet to 1 to include the model's response text on assistant_response OpenTelemetry log events
OTEL_LOG_TOOL_DETAILSSet to 1 to include tool input arguments, MCP server names, user-authored workflow names, raw error strings on tool failures, the refusal category on blocked requests
OTEL_LOG_TOOL_CONTENTSet to 1 to include tool input and output content in OpenTelemetry span events
OTEL_LOG_RAW_API_BODIESEmit Anthropic Messages API request and response JSON as api_request_body / api_response_body log events
OTEL_METRICS_INCLUDE_SESSION_IDSet to false to exclude session ID from metrics attributes (default: included)
OTEL_METRICS_INCLUDE_ACCOUNT_UUIDSet to false to exclude account UUID from metrics attributes (default: included)
OTEL_METRICS_INCLUDE_VERSIONSet to true to include Claude Code version in metrics attributes (default: excluded)
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMITStandard OpenTelemetry SDK limit on attribute value length
CLAUDE_CODE_PROPAGATE_TRACEPARENTSet to 1 to propagate W3C trace context when ANTHROPIC_BASE_URL points at a custom proxy

Hook events

/hooks

Session lifecycle

SessionStartWhen a session begins or resumes
SetupWith --init-only, or --init / --maintenance in -p mode. One-time CI prep
SessionEndWhen a session terminates
PreModelSwitchBefore a requested model switch is applied — can block it, require confirmation, or show what it will cost; matcher is the model name
PostModelSwitchAfter the session model changes — inject model-specific guidance without editing every CLAUDE.md
InstructionsLoadedA CLAUDE.md or .claude/rules/*.md file is loaded into context
ConfigChangeA configuration file changes mid-session
CwdChangedThe working directory changes — pairs well with direnv
DirectoryAddedA directory is added via /add-dir
FileChangedA watched file changes on disk; matcher selects filenames

Turn lifecycle

UserPromptSubmitYou submit a prompt, before Claude sees it
UserPromptExpansionA typed command expands into a prompt — can block
MessageDisplayWhile assistant text is being displayed
NotificationClaude Code sends a notification; matcher selects the notification type
StopClaude finished responding — can send it back to work
StopFailureThe turn ended on an API error
TeammateIdleAn agent-team teammate is about to go idle
PreCompactBefore context compaction
PostCompactAfter compaction completes

Tool loop

PreToolUseBefore a tool call executes — can block or defer it
PermissionRequestA tool call needs a permission decision
PermissionDeniedAuto mode denied a call; can grant a retry
PostToolUseAfter a tool call succeeds
PostToolUseFailureAfter a tool call fails
PostToolBatchAfter a whole parallel batch resolves, before the next model call

Agents, tasks & worktrees

SubagentStartA subagent is spawned; matcher is the agent type
SubagentStopA subagent finishes
TaskCreatedA task is being created via TaskCreate
TaskCompletedA task is being marked complete
WorktreeCreateA worktree is being created — replaces default git behavior
WorktreeRemoveA worktree is being removed at exit or on subagent finish

MCP

ElicitationAn MCP server asks the user for input during a tool call
ElicitationResultAfter the user answers, before it goes back to the server

Models, effort & pricing

/model

Current — Claude API IDs

claude-fable-5-11M ctx · 128k out · $10/$50 · cache hit $0.25 · thinking always on · no forced tool_choice · most capable · knowledge to Jun 2026
claude-fable-51M · 128k · $10/$50 · cache hit $1 · thinking always on · predecessor, still served
claude-opus-51M · 128k · $5/$25 · adaptive thinking on by default · the workhorse · knowledge to May 2026
claude-sonnet-51M · 128k · $2/$10 (the launch price, made permanent Sep 2026) · speed × intelligence · knowledge to Jan 2026
claude-haiku-4-5200k · 64k · $1/$5 · fastest; still uses budget_tokens thinking · dated ID claude-haiku-4-5-20251001 · knowledge to Feb 2025
claude-mythos-5-1 / claude-mythos-51M · 128k · $10/$50 · Project Glasswing, invitation only; 5.1 shares Fable 5.1's surface and $0.25 cache hits

Previous generation

claude-opus-4-81M · 128k · $5/$25 · thinking off unless set to adaptive
claude-opus-4-71M · 128k · $5/$25 · default effort is xhigh
claude-opus-4-61M · 128k · $5/$25 · last with budget_tokens and temperature
claude-opus-4-51M · $5/$25 · effort low/medium/high only
claude-sonnet-4-61M · 128k · $3/$15
claude-sonnet-4-51M · $3/$15 · fixed thinking budgets

Aliases

defaultClear the override; use the account runtime default
bestFable 5.1 where available, else the latest Opus
fable / opus / sonnet / haikuLatest of that tier for your provider
opus[1m] / sonnet[1m]Force the 1M context window
opusplanOpus to plan, Sonnet to execute

Effort levels

lowShort, scoped, latency-sensitive, not intelligence-sensitive
mediumCost-sensitive work that can trade some quality
highBalanced — the default on the API and in Claude Code; Opus 4.7 alone defaults to xhigh
xhighBest for most coding and agentic work on Fable 5 / Opus 5 / Sonnet 5
maxCorrectness over cost; can overthink
ultracodeClaude Code only: plan a dynamic workflow per task at xhigh

Rates per MTok

Cache hit10% of base input — $0.50 Opus 5, $0.20 Sonnet 5, $0.10 Haiku 4.5, $1 Fable 5; 2.5% on Fable 5.1 / Mythos 5.1 ($0.25)
5m cache write1.25× base input
1h cache write2× base input
Batch API50% off input and output; stacks with caching
Fast modeOpus 5 / 4.8 only — $10/$50, up to 2.5× output speed
US-only inferenceinference_geo: "us" on 4.6+ models — 1.1× on every token category; global routing is standard price
Web search$10 per 1,000 searches plus the tokens of the results; web fetch has no surcharge

Keybindings

~/.claude/keybindings.json

Contexts

Global / ChatEverywhere / the main input
Autocomplete / SelectSuggestion and list menus
ConfirmationPermission and confirm dialogs
Transcript / ScrollTranscript viewer, fullscreen scrolling
HistorySearch / Tabs / HelpCtrl+R search, tab strips, help panel
ModelPicker / ThemePicker / PluginThose dialogs
DiffDialog / MessageSelectorDiff viewer, rewind picker
Task / Footer / AttachmentsRunning task, footer indicators, image chips

Rebindable actions

app:interruptCtrl+C — cancel the current operation
app:exitCtrl+D — exit; twice within 800 ms confirms
app:redrawunbound by default
app:toggleTodosCtrl+T
app:toggleTranscriptCtrl+O
chat:cycleModeShift+Tab — cycle permission modes
chat:modelPickerMeta+P
chat:fastModeMeta+O
chat:thinkingToggleMeta+T
chat:submit / chat:newlineEnter / Ctrl+J
chat:queueSubmitCtrl+X Enter — submit but wait your turn; never interrupts a running turn (v2.1.247+)
chat:externalEditorCtrl+G, Ctrl+X Ctrl+E
chat:stashCtrl+S
chat:imagePasteCtrl+V (Alt+V on Windows/WSL)
chat:killAgentsCtrl+X Ctrl+K — stop all background subagents
chat:undoCtrl+_ , Ctrl+Shift+-
chat:clearScreenCmd+K
confirm:cycleModeShift+Tab in a permission dialog — cycle modes, or pick the allow-for-session option
task:backgroundCtrl+B, Ctrl+X Ctrl+B — background the running task (the chord avoids the tmux prefix)
historySearch:cycleScopeCtrl+S inside Ctrl+R search — session / project / everywhere (fullscreen renderer)
modelPicker:thisSessionOnlys in the model picker — apply the highlighted model to this session only
history:search / previous / nextCtrl+R / Up / Down
transcript:toggleShowAllCtrl+E — classic renderer only
transcript:exitq, Ctrl+C, Esc