Cheat sheet · Checked Nov 17, 2026

Claude Code cheat sheet

Every Claude Code feature I could find in the official docs, 1,862 in all, sorted into beginner (455), intermediate (687) and advanced (720), each with a link to an official page that documents it. The release list on this page refreshes from the official changelog every day.

Latest Claude Code · released Nov 17, 2026
claude-code 2.1.327
Features on this sheet · released Nov 17, 2026
1,862 with official links
A clay diorama of a friendly robot at a terminal console with small floating tools orbiting it

Explore with AI

Browse by topic

Quick reference

The commands you reach for most

Everything here is explained further down, and every feature has an official link in the tables. Start with these.

Start and resume

claude
Open a session in the current folder.
claude "explain this project"
Open a session with a first prompt.
claude -p "query"
Run one query, print the answer and exit. Works in pipes and scripts.
claude -c
Continue the most recent conversation in this folder.
claude -r
Resume by session ID or name, or pick from a list.

Inside a session

/clear
Start a new conversation. The old one stays resumable.
/compact
Summarize the conversation to free up context.
/context
See what is filling the context window.
/rewind
Roll back the code, the conversation or both.
/model
Switch the model.
/btw
Ask a side question that stays out of the conversation.

Set it up

/init
Generate a starting CLAUDE.md from your codebase.
/memory
Edit CLAUDE.md files and turn auto memory on or off.
/permissions
View and edit the allow, ask and deny rules.
/mcp
Manage MCP servers and sign in to them.
/config
Open the settings screen.
/doctor
Check your setup and get fixes proposed.

Keys and input

@path
Mention a file. It autocompletes and adds the file content.
! command
Run a shell command directly. The output joins the conversation.
Shift+Tab
Cycle through the permission modes.
Esc Esc
On an empty prompt, open the rewind menu.

Cost and help

/usage
Session cost, plan limits and activity.
/help
Help and the list of available commands.
/login
Sign in or out.

Showing 1862 of 1862 features

Topic 1 of 7

Start here

Pick your level, then see the big ideas explained.

Beginner, intermediate or advanced?

Every feature carries a level. Beginner means useful in your first week, intermediate means daily power use, and advanced means teams, CI, security and rollout. Pick a column and read it from top to bottom, or use the level buttons above the tables.

beginner

Get productive in a day

The habits that make the first week smooth.

  • Install Claude Codecurl -fsSL https://claude.ai/install.sh | bash
  • Start in your projectclaude
  • Write a CLAUDE.md/init
  • Plan before you editShift+Tab, or claude --permission-mode plan
  • Undo a mistakeEsc Esc, or /rewind
  • Keep the context small/context, /compact, /clear
  • Ask a side question/btw what does this do?
  • Pick a model/model
  • Pick up where you left offclaude --continue, or claude --resume
  • Run a shell command in the chat! git status
  • Check your installclaude doctor
  • Point at a file@path/to/file
intermediate

Make it yours

Rules, tools and automation for daily use.

  • Permission rulespermissions.allow and permissions.deny in .claude/settings.json
  • Rules for some files only.claude/rules/*.md with paths: frontmatter
  • Skills.claude/skills/name/SKILL.md
  • Subagents.claude/agents/name.md
  • Connect a toolclaude mcp add --transport http notion https://mcp.notion.com/mcp
  • Scripts and CIclaude -p "prompt" --output-format json
  • Parallel sessionsclaude -w feature-auth
  • Keep going until done/goal all tests pass
  • Repeat on a timer/loop 5m check the deploy
  • Add Claude to your pull requests/install-github-app
  • Background sessionsclaude --bg "task", then claude agents
  • A custom status linethe statusLine key in settings.json
advanced

Run it for a team

Guardrails, scale and cloud rollout.

  • Hooks that blockexit code 2 in a PreToolUse hook
  • A skill that forkscontext: fork with agent: Explore
  • Plugins/plugin, and claude plugin validate --strict
  • Sandboxthe sandbox key in settings.json
  • Managed settingsorganization policy in managed-settings.json
  • Safe automationclaude --bare -p --max-budget-usd 5.00, with ANTHROPIC_API_KEY
  • Schema checked output--json-schema, then read .structured_output
  • Cloud sessionsclaude --cloud, then --teleport
  • A CI tokenclaude setup-token, for runs without --bare
  • BedrockCLAUDE_CODE_USE_BEDROCK=1
  • TelemetryCLAUDE_CODE_ENABLE_TELEMETRY=1
  • The Agent SDKpip install claude-agent-sdk

The big ideas, explained

Plan before you edit

beginner

Plan mode lets Claude read your code and propose a plan. Nothing is edited until you approve it.

A tiny robot with a pencil over a blueprint and a clay house model, with the real building site untouched
Plan mode
Show the command and notes
Shell
#!/usr/bin/env bash
# Start in plan mode: Claude reads and proposes a plan, no edits until you approve.
# In a session, Shift+Tab cycles modes and /plan <task> enters plan mode.
# Source: https://code.claude.com/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode
claude --permission-mode plan
  • Shift+Tab cycles the permission modes. /plan <task> jumps straight into plan mode.
  • claude --permission-mode plan starts a session already in plan mode.
  • The model alias opusplan plans on Opus and runs the plan on Sonnet.
  • The old ultraplan feature was removed on Aug 4, 2026. Plan mode replaces it.

Sources: Permission modes

Undo with checkpoints, or branch the chat

beginner

Claude Code takes a checkpoint before every prompt, so you can roll back the code, the conversation or both.

A tiny robot turns a big dial with a curved arrow and a clock beside a path with flags
Rewind
Show the command and notes
Shell
#!/usr/bin/env bash
# Branch a conversation: resume it under a NEW session id so the original stays untouched.
# Inside a session, /branch does the same thing.
# Source: https://code.claude.com/docs/en/sessions#branch-a-session
claude --continue --fork-session
  • Press Esc twice on an empty prompt, or type /rewind, to restore code, conversation, or both.
  • The 100 most recent checkpoints are kept. Changes made only through Bash, by subagents or outside Claude Code are not restored, so it does not replace Git.
  • claude --continue --fork-session or /branch resumes a conversation under a new session ID and leaves the original alone.

Sources: Checkpointing · Sessions

Teach it your project with CLAUDE.md

beginner

CLAUDE.md is a plain file Claude reads at the start of every session. Put your commands, conventions and workflow in it.

A tiny robot at a cork wall with a notebook and sticky notes
CLAUDE.md
Show the command and notes
Markdown
# Project instructions (CLAUDE.md)

<!-- Block-level HTML comments like this one are stripped before the file is sent to Claude, so they cost no context tokens. -->

## Commands
- Build: `npm run build`
- Test one file: `npm test -- path/to/file.test.ts`
- Lint before every commit: `npm run lint`

## Conventions
- Use 2-space indentation.
- API handlers live in `src/api/handlers/`.
- Use the standard error response format from `src/api/errors.ts`.

## Workflow
- Run `npm test` before committing.
- Never push directly to `main`; open a pull request.

## Compact instructions
When you are using compact, please focus on test output and code changes.

<!-- Keep this file under about 200 lines. Move rules that only matter for some files into .claude/rules/ with `paths:` frontmatter. -->
  • /init writes a starting CLAUDE.md from your codebase.
  • Block level HTML comments are stripped before Claude sees the file, so they cost no context.
  • @path imports pull in other files, up to four hops deep.
  • Rules in .claude/rules/*.md with paths: frontmatter load only when Claude touches matching files.

Sources: How Claude remembers your project

Keep the context window healthy

beginner

Everything Claude has read sits in the context window, and a full window gets worse answers and costs more.

Colored beads flow from a tall jar through a funnel into a small jar
The context window
Show the command and notes
  • /context shows a coloured grid of what fills the window, with hints to trim it.
  • /compact [instructions] summarizes the conversation to free space. Add a focus, such as the failing tests.
  • /clear starts a fresh conversation. The old one stays available through /resume.
  • A /clear plus a better prompt usually beats a third round of corrections.

Sources: The context window · Commands reference

Decide what Claude may do on its own

intermediate

Permission rules allow, ask about or deny a tool call. They live in settings files and apply in every mode.

A tiny robot at a locked door beside a green tray and a red tray
Permissions
Show the command and notes
JSON
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "permissions": {
    "defaultMode": "acceptEdits",
    "allow": [
      "Bash(npm run *)",
      "Bash(git commit *)",
      "Bash(git diff *)",
      "WebFetch(domain:docs.anthropic.com)",
      "mcp__puppeteer__*",
      "Read(~/.zshrc)"
    ],
    "ask": [
      "Bash(git push *)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(./secrets/**)",
      "Bash(curl *)",
      "Bash(rm -rf *)"
    ],
    "additionalDirectories": [
      "../shared-config"
    ]
  }
}
  • Deny beats ask beats allow. An allow rule can never carve an exception out of a deny.
  • A .claudeignore file does nothing. Block files with Read(...) deny rules.
  • Bash deny rules are not a security boundary: /usr/bin/curl or sh -c can slip past a rule for curl. Use the sandbox for real isolation.
  • "Yes, and do not ask again" writes the rule to .claude/settings.local.json, and Claude keeps that file out of Git.
  • /permissions lets you review and edit the rules.

Sources: Configure permissions · Sandboxed Bash tool

Run Claude Code from scripts and CI

intermediate

Print mode runs one prompt and exits. Pipe it, parse its JSON and put it in a pipeline.

Paper sheets slide into a pipe and neat identical cubes drop into a crate
Print mode
Show the command and notes
Shell
#!/usr/bin/env bash
# Structured output that must match a JSON Schema. The answer is in .structured_output.
# Check that the field exists before you use it: it is absent if the run ended without valid output.
# Source: https://code.claude.com/docs/en/headless#get-structured-output
claude -p "Extract the main function names from auth.py" \
  --output-format json \
  --json-schema '{"type":"object","properties":{"functions":{"type":"array","items":{"type":"string"}}},"required":["functions"]}' \
  | jq '.structured_output'
  • -p is print mode. --output-format takes text, json or stream-json.
  • --json-schema makes the answer match a schema and puts it in .structured_output. The field is missing when the run ended without valid output, so check for it.
  • --max-budget-usd caps spend, though it is a client side estimate and can be overshot, so leave headroom. --bare skips hooks, skills, plugins, MCP, auto memory and CLAUDE.md.
  • --bare ignores OAuth and keychain logins, including the one year token from claude setup-token, so pair it with ANTHROPIC_API_KEY.

Sources: Run Claude Code programmatically · CLI reference

Run sessions in parallel without collisions

intermediate

A worktree gives each session its own folder and branch, so two Claudes never edit the same files.

A tree trunk splitting into three branches, each with a tiny robot at a workbench
Worktrees
Show the command and notes
Shell
#!/usr/bin/env bash
# Parallel, isolated sessions: each name gets its own git worktree and branch (worktree-<name>).
# Needs at least one commit. Add .claude/worktrees/ to .gitignore.
# Source: https://code.claude.com/docs/en/worktrees#start-claude-in-a-worktree
claude --worktree feature-auth          # terminal 1
claude -w bugfix-123                    # terminal 2 (short flag)
claude -w "#1234"                       # branch the worktree from a pull request
  • claude -w name creates a git worktree under .claude/worktrees/name. The repo needs at least one commit.
  • Add .claude/worktrees/ to .gitignore. claude -w "#1234" branches the worktree from a pull request.
  • isolation: worktree in an agent definition gives that subagent its own worktree.
  • claude --bg "task" runs a background session, and claude agents lists them.

Sources: Worktrees

Connect Claude to your tools with MCP

intermediate

MCP servers give Claude new tools, such as your tracker, database or browser.

A tiny robot plugs a cable into one socket of a wide power strip
MCP
Show the command and notes
Shell
#!/usr/bin/env bash
# Adding MCP servers. Every flag below appears in `claude mcp add --help` (v2.1.296)
# and in https://code.claude.com/docs/en/mcp.md#installing-mcp-servers
# Do not run blindly: these add real servers to your config.

# 1) Remote HTTP server (recommended transport)
claude mcp add --transport http notion https://mcp.notion.com/mcp

# 2) Remote HTTP server with a bearer header, saved for ALL your projects
claude mcp add --transport http secure-api https://api.example.com/mcp \
  --scope user \
  --header "Authorization: Bearer your-token"

# 3) Remote SSE server (deprecated transport; HTTP is tried first on v2.1.265+)
claude mcp add --transport sse asana https://mcp.asana.com/sse

# 4) Local stdio server. `--` separates Claude's flags from the server command.
#    Put another option between --env and the server name.
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
  -- npx -y airtable-mcp-server

# 5) Share a server with the team: writes .mcp.json in the project root
claude mcp add --transport http shared-server --scope project https://example.com/mcp

# 6) Pre-registered OAuth: fixed callback port and client id (prompts for the secret)
claude mcp add --transport http --callback-port 8080 --client-id your-client-id \
  --client-secret my-server https://mcp.example.com/mcp

# 7) Paste a JSON block (type is required for url entries: http | sse | ws)
claude mcp add-json weather-api \
  '{"type":"http","url":"https://api.weather.com/mcp","headers":{"Authorization":"Bearer token"}}'

# 8) WebSocket servers can only be added with add-json
claude mcp add-json events-server \
  '{"type":"ws","url":"wss://mcp.example.com/socket","headers":{"Authorization":"Bearer YOUR_TOKEN"}}'

# 9) Import from Claude Desktop (macOS and WSL only)
claude mcp add-from-claude-desktop --scope user
  • HTTP is the recommended transport. SSE is deprecated. A stdio server needs -- before its command.
  • --scope is local, project or user. Project scope writes a .mcp.json the whole team can commit.
  • WebSocket servers can only be added with claude mcp add-json.
  • MCP resources are @server:protocol://path mentions, and MCP prompts appear as /mcp__server__prompt commands.
  • claude mcp serve turns Claude Code itself into an MCP server.

Sources: Connect Claude Code to tools via MCP

Package a workflow as a skill

intermediate

A skill is a folder with a SKILL.md. Claude loads it when the task matches, or you run it as a slash command.

A tiny robot slides a folder out of a small filing cabinet
Skills
Show the command and notes
Markdown
---
name: deploy
description: Deploy the application to staging or production. Use when the user asks to ship, release or deploy a build.
when_to_use: Trigger phrases such as "deploy to staging", "ship it", "release v2".
argument-hint: "[environment] [version]"
arguments: [environment, version]
disable-model-invocation: true
allowed-tools: Bash(${CLAUDE_SKILL_DIR}/scripts/deploy.sh *) Read Grep
model: inherit
effort: high
paths: "src/**,deploy/**"
shell: bash
---

Deploy $environment (version $version) as follows:

1. Run the test suite and stop if anything fails.
2. Run `${CLAUDE_SKILL_DIR}/scripts/deploy.sh $environment $version`.
3. Verify the deployment and report the URL.

Current branch: !`git branch --show-current`

Reference material lives next to this file and loads only when needed:
see [reference.md](reference.md) for the rollback runbook.

Session: ${CLAUDE_SESSION_ID}
  • disable-model-invocation: true stops Claude running the skill on its own, so only you can.
  • A line like !git branch --show-current runs the command and inlines its live output.
  • context: fork with agent: Explore runs the skill as isolated research in a subagent.
  • Custom slash commands were merged into skills in January 2026. Skills hot reload without a restart.
  • /skill-doctor shows each skill's context cost and usage, so you can drop the ones you never use.

Sources: Extend Claude with skills

Hand work to a subagent

intermediate

A subagent runs in its own context window with its own tools, and sends back only a summary.

A larger robot hands envelopes to three smaller robots, each with a different tool
Subagents
Show the command and notes
Markdown
---
name: code-reviewer
description: Reviews code for quality, security and best practices. Use proactively after code changes.
tools: Read, Glob, Grep, Bash
disallowedTools: Write, Edit
model: sonnet
permissionMode: default
maxTurns: 25
effort: medium
skills:
  - api-conventions
memory: project
background: false
color: blue
---

You are a senior code reviewer. When invoked:

1. Run `git diff` to see recent changes.
2. Review the modified files for correctness, security and readability.
3. Report findings grouped by severity: critical, warning, suggestion.
4. Update your agent memory with recurring issues you find in this repo.
  • Agent files live in .claude/agents/. tools and disallowedTools set what each agent can use.
  • Explore is a fast read only search agent, and general-purpose has every tool. Claude delegates to them on its own.
  • The /agents editor was removed on Jul 1, 2026. Ask Claude to write the file or edit it yourself.
  • claude agents is a different feature: the background session view.
  • claude --agents '{...}' defines agents inline with no files, and claude --agent name runs one.

Sources: Create custom subagents

Enforce rules with hooks

advanced

Hooks run your own scripts at fixed points, such as before a tool call, so a rule holds no matter what Claude decides.

Parcels pass one at a time through a scanner arch with a lamp on top
Hooks
Show the command and notes
JSON
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "python3",
            "args": [
              "${CLAUDE_PROJECT_DIR}/.claude/hooks/hook_block_rm.py"
            ],
            "if": "Bash(rm *)",
            "timeout": 10,
            "onFailure": "block"
          }
        ]
      }
    ]
  }
}
  • There are 33 hook events. A matcher narrows when one fires, and /hooks lists everything configured.
  • A hook script reads JSON on stdin. On PreToolUse, exit code 2 blocks the call. Exit code 1 is a non blocking error and the tool still runs, unless the handler sets onFailure to block, as the settings above do.
  • A hook deny holds even in bypassPermissions mode.
  • @ file mentions bypass PreToolUse hooks, so do not rely on a hook to hide a file.
  • A PreToolUse hook can return additionalContext to give Claude more to go on.

Sources: Hooks reference · Automate actions with hooks

Python
#!/usr/bin/env python3
"""PreToolUse hook for the Bash tool: block `rm -rf` style deletes.

Register in .claude/settings.json (see hooks_settings.json):
  matcher "Bash", type "command", command "python3 .claude/hooks/hook_block_rm.py"

Contract (hooks.md#exit-code-output):
  stdin  = JSON event (tool_name, tool_input.command, ...)
  exit 0 = no decision, normal permission flow continues
  exit 2 = blocking error, stderr is shown to Claude as the reason
  any other non-zero exit = non-blocking error, the tool call still runs
"""
import json
import re
import sys

BLOCKED = re.compile(r"(^|[;&|]\s*|\s)rm\s+(-[a-zA-Z]*r[a-zA-Z]*f|-[a-zA-Z]*f[a-zA-Z]*r)\b")


def main() -> int:
    try:
        event = json.load(sys.stdin)
    except json.JSONDecodeError as exc:
        # Exit 1 is a NON-blocking error: the tool call would still run.
        print(f"hook_block_rm: invalid JSON on stdin: {exc}", file=sys.stderr)
        return 1

    if event.get("tool_name") != "Bash":
        return 0

    command = (event.get("tool_input") or {}).get("command", "")
    if BLOCKED.search(command):
        print("Blocked: recursive forced delete (rm -rf) is not allowed here.", file=sys.stderr)
        return 2  # blocking error

    return 0


if __name__ == "__main__":
    sys.exit(main())
The script the settings above point to. Exit code 2 is the block.

Topic 2 of 7

Install and everyday use

Install, the CLI, keys, slash commands and sessions.

Install, update and sign in

$ curl -fsSL https://claude.ai/install.sh | bash

That is the native installer for macOS, Linux and WSL, and it keeps itself updated. Every other install method is in the table, with the docs link beside it.

Install, update, uninstall, doctorNative installer (macOS, Linux, WSL), Native installer (Windows PowerShell), Native installer (Windows CMD), Homebrew and 27 more31 features
FeatureWhat it doesHowDocs
Native installer (macOS, Linux, WSL)beginnerInstalls the native binary; recommended; auto updates in backgroundcurl -fsSL https://claude.ai/install.sh | bashDocs ↗
Native installer (Windows PowerShell)beginnerSame, from PowerShell (prompt shows PS C:\)irm https://claude.ai/install.ps1 | iexDocs ↗
Native installer (Windows CMD)beginnerSame, from CMDcurl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdDocs ↗
HomebrewbeginnerInstalls via cask; no auto update. claude-code = stable channel (about a week behind), claude-code@latest = latest channelbrew install --cask claude-code or brew install --cask claude-code@latest; upgrade with brew upgrade claude-codeDocs ↗
WinGetbeginnerInstalls via WinGet; no auto updatewinget install Anthropic.ClaudeCode; upgrade winget upgrade Anthropic.ClaudeCodeDocs ↗
Linux package managers (apt, dnf, apk)intermediateSigned repos with stable and latest channels; updates through your normal system upgradesudo apt install claude-code after adding the repo (key from https://downloads.claude.ai/keys/claude-code.asc); apt upgrade: sudo apt update && sudo apt upgrade claude-code; apk: apk add claude-codeDocs ↗
npm global installintermediateInstalls the same native binary through a per platform optional dependency; needs Node.js 22+ (older Node only warns EBADENGINE). Discrepancy: the GitHub README marks npm "Deprecated" and its badge says Node 18+; the setup docs still document npmnpm install -g @anthropic-ai/claude-code; upgrade npm install -g @anthropic-ai/claude-code@latest (avoid npm update -g, never sudo)Docs ↗
Desktop appbeginnerGraphical alternative to the terminalDownload for macOS, Windows, Linux (links on the setup page)Docs ↗
System requirementsbeginnermacOS 13+, Windows 10 1809+ / Server 2019+, Ubuntu 20.04+, Debian 10+, Alpine 3.19+; 4 GB+ RAM; x64 or ARM64; internet; Bash, Zsh, PowerShell or CMDDocs ↗
Git (optional)intermediateNot required. If git is installed, claude plugin eval needs git 2.31 or later, and uploading a local repository to a cloud session from macOS, Linux or WSL also needs git 2.31 or latergit --versionDocs ↗
Native Windows vs WSLintermediateNative Windows: no sandboxing, Git for Windows optional (gives Git Bash; otherwise PowerShell tool). WSL 2: sandboxing supportedInstall inside WSL for Linux toolchainsDocs ↗
Alpine / musladvancedNeeds bash curl libgcc libstdc++ ripgrep and USE_BUILTIN_RIPGREP=0 in settings envapk add bash curl libgcc libstdc++ ripgrepDocs ↗
Verify installbeginnerPrints the version, e.g. 2.1.211 (Claude Code)claude --version (or claude -v)Docs ↗
claude doctor (shell)beginnersince changelog 2.0.33Read only install and settings diagnostics without starting a session; shows last auto update resultclaude doctorDocs ↗
/doctor (in session)beginnersince `prompt-audit` needs 2.1.283Setup checkup that diagnoses install, settings, extensions, CLAUDE.md and proposes fixes Claude applies after you confirm; /doctor prompt-audit audits instructions/doctor (alias /checkup)Docs ↗
Fix "command not found: claude"beginnerInstaller puts claude at ~/.local/bin/claude (%USERPROFILE%\.local\bin\claude.exe on Windows); add that dir to PATHSee the per-shell commands on the pageDocs ↗
Auto update (native)beginnerChecks on startup and periodically, installs in background, applies next launchautomaticDocs ↗
claude update / claude upgradebeginnersince changelog 2.0.67Check for updates now and installclaude updateDocs ↗
Release channelintermediatelatest (default) or stable (about one week old, skips releases with major regressions)/config then Auto-update channel, or "autoUpdatesChannel": "stable" in settings.jsonDocs ↗
Minimum version flooradvancedAuto update and claude update refuse versions below the pin"minimumVersion": "2.1.100" in settings.jsonDocs ↗
Disable auto updatesintermediateStops the background check only (claude update still works)"env": {"DISABLE_AUTOUPDATER": "1"}; to block all update paths set DISABLE_UPDATESDocs ↗
Package manager auto upgradeadvancedLets Claude Code run the Homebrew or WinGet upgrade for youenv CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1Docs ↗
Install a specific version or channelintermediatePass a version number, stable or latest to the installercurl -fsSL https://claude.ai/install.sh | bash -s 2.1.89; or claude install stableDocs ↗
claude install [target]intermediateInstall or reinstall the native binary; --force reinstallsclaude install latestDocs ↗
Verify binary integrityadvancedsince 2.1.89GPG signed manifest.json with SHA256 per platform (signatures from 2.1.89); macOS and Windows binaries are code signedgpg --verify manifest.json.sig manifest.json; codesign --verify --verbose ./claudeDocs ↗
Install on network storageadvancedWarns that a running session reads its executable lazily; keep installs local and per version, set DISABLE_UPDATESSee pageDocs ↗
Uninstall (native)beginnerRemove the launcher and versions dirrm -f ~/.local/bin/claude && rm -rf ~/.local/share/claudeDocs ↗
Uninstall (brew / winget / npm / apt)beginnerPackage specific removalbrew uninstall --cask claude-code; winget uninstall Anthropic.ClaudeCode; npm uninstall -g @anthropic-ai/claude-code; sudo apt remove claude-codeDocs ↗
Remove config and historyintermediateDeletes all settings, allowed tools, MCP config and session historyrm -rf ~/.claude && rm ~/.claude.json (and project .claude, .mcp.json)Docs ↗
claude purge [path]advancedsince 2.1.288 (renamed from `claude project purge`)Deletes local state for one project (transcripts, tasks, debug logs, file edit history, prompt history lines, ~/.claude.json entry); --dry-run, -y, -i, --allclaude purge ~/work/repo --dry-runDocs ↗
Fully local diagnosticsadvancedsince 2.1.169claude --safe-mode starts with all customizations off to find a broken configclaude --safe-modeDocs ↗
First run and authenticationFirst run, Accounts that work, Browser login tips, Claude subscription login and 13 more17 features
FeatureWhat it doesHowDocs
First runbeginnerRun claude in a project folder; a browser opens to log in on first launchcd your-project && claudeDocs ↗
Accounts that workbeginnerPro, Max, Ultra, Team, Enterprise, or Console account; the free claude.ai plan has no Claude Code accessDocs ↗
Browser login tipsbeginnerIf the browser does not open press c to copy the URL; if the browser shows a code, paste it at Paste code here if prompted (common in WSL2, SSH, containers)at the login promptDocs ↗
Claude subscription loginbeginnerLog in with a Pro, Max, Ultra, Team or Enterprise claude.ai account/login in session, or claude auth login (default --claudeai)Docs ↗
Console (API billing) loginintermediateSign in with Anthropic Console for pay as you go API billingclaude auth login --consoleDocs ↗
Force SSO / prefill emailintermediateSSO flow or prefilled login emailclaude auth login --sso --email you@company.comDocs ↗
API key from environmentintermediateIf ANTHROPIC_API_KEY is set and you approve it once, login is skipped; in -p mode the key is always usedexport ANTHROPIC_API_KEY=...Docs ↗
Cloud providersadvancedAmazon Bedrock, Google Cloud's Agent Platform (Vertex), Microsoft Foundry via env varsCLAUDE_CODE_USE_BEDROCK=1, CLAUDE_CODE_USE_VERTEX=1, CLAUDE_CODE_USE_FOUNDRY=1; wizards /setup-bedrock, /setup-vertexDocs ↗
Auth precedenceadvancedOrder: cloud provider, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, apiKeyHelper, CLAUDE_CODE_OAUTH_TOKEN, profile/federation, subscription /loginDocs ↗
claude setup-tokenadvancedsince local 2.1.296 has it (changelog mention 2.1.212)Generates a one year OAuth token for CI and scripts; prints it, does not save it; needs a subscription; token cannot start Remote Control or fetch claude.ai connectors; --bare ignores itclaude setup-token then export CLAUDE_CODE_OAUTH_TOKEN=...Docs ↗
claude auth statusintermediatesince `configDirectory` field needs 2.1.268; `loginExpiresAt` 2.1.318 (changelog)Auth state as JSON (--text for readable); exit 0 if logged in, 1 if not; JSON has authMethod, and from 2.1.318 loginExpiresAt, the date a stored claude.ai sign in endsclaude auth status --textDocs ↗
LogoutbeginnerSign out/logout or claude auth logoutDocs ↗
Renew expiring loginbeginnerStartup warns 3 days before expiry/loginDocs ↗
Multiple accountsintermediateSeparate config dir per account (own settings, history, login)alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'Docs ↗
Credential storageadvancedmacOS Keychain; ~/.claude/.credentials.json (mode 0600) on Linux, Windows, or when Keychain write failsDocs ↗
Restrict login / providers (admins)advancedforceLoginMethod, forceLoginOrgUUID, allowedProviders in managed settingsmanaged settingsDocs ↗
Team auth optionsintermediateClaude for Teams/Enterprise, Console, cloud provider, or self hosted Claude apps gatewayDocs ↗

The claude command: subcommands and flags

Shell
#!/usr/bin/env bash
# JSON output: one result object with the text in .result and the session id in .session_id.
# Source: https://code.claude.com/docs/en/headless#get-structured-output
claude -p "Summarize this project" --output-format json | jq -r '.result'
CLI subcommandsStart interactive, Start with a prompt, claude -p, Pipe content and 25 more29 features
FeatureWhat it doesHowDocs
Start interactivebeginnerOpens a session in the current folderclaudeDocs ↗
Start with a promptbeginnerInteractive session with an opening promptclaude "explain this project"Docs ↗
claude -pbeginnerOne shot non interactive query then exit (pipes, scripts)claude -p "explain this function"Docs ↗
Pipe contentbeginnerProcess piped stdincat logs.txt | claude -p "explain"Docs ↗
claude -cbeginnersince changelog 0.2.93Continue most recent conversation in this directoryclaude -c, claude -c -p "Check for type errors"Docs ↗
claude -rbeginnersince changelog 0.2.93Resume by ID or name, or open the pickerclaude -r "auth-refactor" "Finish this PR"Docs ↗
claude update / upgradebeginnersince changelog 2.0.67Update to latestclaude updateDocs ↗
claude install [target]intermediate(Re)install native build; --forceclaude install stableDocs ↗
claude auth login/logout/statusbeginnerAccount managementclaude auth status --textDocs ↗
claude doctorbeginnersince changelog 2.0.33Read only health checkclaude doctorDocs ↗
claude setup-tokenadvancedLong lived CI tokenclaude setup-tokenDocs ↗
claude agentsintermediatesince changelog 2.1.50 (agent view research preview 2.1.139)Opens agent view to monitor and dispatch parallel background sessions; --json (add --all for completed), --cwd <path>, plus --permission-mode, --model, --effort, --agent, --add-dir, --settings, --mcp-config, --plugin-dirclaude agents --jsonDocs ↗
claude attach <id|name>intermediateOpen a background session in this terminal (part of a running session's name works from 2.1.290)claude attach 7c5dcf5dDocs ↗
claude logs <id|name>intermediatePrint a background session's recent outputclaude logs 7c5dcf5dDocs ↗
claude stop / kill <id>intermediateStop a background session (conversation kept)claude stop 7c5dcf5dDocs ↗
claude respawn <id>|--alladvancedRestart background sessions on the current binaryclaude respawn --allDocs ↗
claude rm <id>advancedsince `--discard-unpushed` 2.1.260, `--force-remove-worktree` 2.1.268Remove a background session and its worktree if safe; --discard-unpushed, --force-remove-worktreeclaude rm 7c5dcf5dDocs ↗
claude daemonadvancedBackground session supervisor: status, logs, run, stop --any [--keep-workers], uninstall (local help: service install disabled, runs on demand)claude daemon statusDocs ↗
claude mcpintermediateConfigure MCP servers (add, list, get, remove, login, logout...)claude mcp add --transport http sentry https://mcp.sentry.dev/mcpDocs ↗
claude mcp login/logout <server>intermediateRun or clear a server's OAuth flow from the shell (--no-browser over SSH)claude mcp login sentryDocs ↗
claude plugin / pluginsintermediateManage plugins (install, enable, disable, details, configure, eval...)claude plugin install code-review@claude-plugins-officialDocs ↗
claude auto-modeadvancedsince defaults 2.1.208, reset 2.1.212config (effective rules as JSON), defaults [--label], critique, reset [-y] for the auto mode classifierclaude auto-mode defaults --label 'Git Destructive'Docs ↗
claude import [source]intermediatesince 2.1.213Bring config from codex, gemini or cursor; --dry-run, --yesclaude import codex --dry-runDocs ↗
claude ultrareview [target]advancedsince `--post` 2.1.227Cloud multi agent code review of the branch or a PR; --json, --timeout <min> (default 45), --post/--no-postclaude ultrareview 1234 --jsonDocs ↗
claude ultrareview --trust-workspaceadvancedsince 2.1.309Trusts the current folder for this run only, without asking, so a script or CI job can review a checkout you have not trusted. Takes no value, so put a PR number or base branch before it. Without it, a run that cannot ask exits with Error: Workspace not trusted.claude ultrareview 1234 --trust-workspaceDocs ↗
claude remote-controlintermediatesince changelog 2.1.51Server mode so claude.ai or the Claude app can drive local sessions; alias claude rc; --settings <file> applies a settings file to every session it starts (v2.1.321)claude remote-control --name "My Project"Docs ↗
claude gatewayadvancedAdmin: run the self hosted Claude apps gateway (needs --config gateway.yaml)claude gateway --config gateway.yamlDocs ↗
claude self-hosted-runneradvancedsince 2.1.224Register this machine as a self hosted cloud session runner (setup, doctor, orchestrator)claude self-hosted-runner setupDocs ↗
Typo helpbeginnerA mistyped subcommand suggests the nearest match and exitsclaude udpate prints "Did you mean claude update?"Docs ↗
Print mode, output and automation-p, --print, --output-format, Sign in expiry warning in print mode, --input-format and 16 more20 features
FeatureWhat it doesHowDocs
-p, --printbeginnerPrint the response and exit; skips the workspace trust dialog, so use only in directories you trustclaude -p "query"Docs ↗
--output-formatintermediatesince changelog 0.2.66text (default), json (single result object with result, session_id, metadata), stream-json (newline delimited events)claude -p "Summarize this project" --output-format json | jq -r '.result'Docs ↗
Sign in expiry warning in print modeintermediatesince 2.1.318 (changelog)claude -p text output prints a one line stderr warning starting 10 days before a stored claude.ai sign in ends, and JSON results carry credential_expires_atclaude -p "query" --output-format jsonDocs ↗
--input-formatadvancedtext or stream-json (realtime streaming input) for print modeclaude -p --output-format stream-json --input-format stream-json --verboseDocs ↗
--json-schemaadvancedsince , (docs: print mode)Validated structured output in a structured_output field; invalid schema errors out; format is annotation onlyclaude -p "Extract function names" --output-format json --json-schema '{"type":"object",...}'Docs ↗
--include-partial-messagesadvancedStream partial token events (needs --print and stream-json)claude -p --output-format stream-json --verbose --include-partial-messages "query"Docs ↗
--include-hook-eventsadvancedInclude hook lifecycle events in the streamadd to a stream-json runDocs ↗
--replay-user-messagesadvancedEcho stdin user messages back on stdout (stream json in and out)claude -p --input-format stream-json --output-format stream-json --verbose --replay-user-messagesDocs ↗
--forward-subagent-textadvancedsince 2.1.211Emit subagent text and thinking blocks with parent_tool_use_idclaude -p --output-format stream-json --verbose --forward-subagent-text "query"Docs ↗
--prompt-suggestionsadvancedEmit a prompt_suggestion message after each turn (print + stream json + verbose)claude -p --prompt-suggestions --output-format stream-json --verbose "query"Docs ↗
--max-turnsintermediatesince docs only (not in local 2.1.296 `--help`)Limit agentic turns in print mode; errors out when reachedclaude -p --max-turns 3 "query"Docs ↗
--max-budget-usdintermediatesince changelog 2.0.28; cap enforcement on subagents 2.1.217Stop once estimated API spend reaches the cap (client side estimate, can overshoot, includes subagents)claude -p --max-budget-usd 5.00 "query"Docs ↗
--no-session-persistenceintermediateDo not save the session to disk (print only)claude -p --no-session-persistence "query"Docs ↗
--permission-promptsadvancedsince 2.1.259Who answers prompts in print mode: host (default) or none (deny automatically)claude -p --permission-prompts none "query"Docs ↗
--permission-prompt-tooladvancedMCP tool that answers permission prompts non interactivelyclaude -p --mcp-config ./mcp.json --permission-prompt-tool mcp__permissions__approve "query"Docs ↗
--bareintermediatesince changelog 2.1.81Minimal mode for scripts: skips hooks, skills, plugins, MCP, auto memory, CLAUDE.md, keychain/OAuth (auth only via ANTHROPIC_API_KEY or apiKeyHelper)claude --bare -p "query"Docs ↗
--init, --init-only, --maintenanceadvancedsince docs onlyRun Setup hooks (init/maintenance matchers) before a print run, or run Setup and SessionStart hooks then exitclaude --init-onlyDocs ↗
--restrictedadvancedsince 2.1.248For eval harnesses on shared machines: no command running tools, loads only managed settings and --settingsclaude --restricted -p "query"Docs ↗
--exclude-dynamic-system-prompt-sectionsadvancedMove cwd/env/memory-path/git status out of the system prompt for better cross machine cache reuseclaude -p --exclude-dynamic-system-prompt-sections "query"Docs ↗
Exit codesintermediate-p exits 0 on success, non zero on failure; SIGTERM gives 143claude -p "..." ; echo $?Docs ↗
Sessions-c, --continue, -r, --resume [value], --fork-session, -n, --name and 11 more15 features
FeatureWhat it doesHowDocs
-c, --continuebeginnersince changelog 0.2.93Load the most recent conversation in this directory (skips -p/SDK sessions unless combined with -p)claude --continueDocs ↗
-r, --resume [value]beginnersince changelog 0.2.93; names 2.0.64Resume by ID, name, .jsonl transcript path, or open the picker with optional search termclaude --resume auth-refactorDocs ↗
--fork-sessionintermediatesince changelog 2.0.73When resuming, create a new session ID instead of reusing the originalclaude --resume abc123 --fork-sessionDocs ↗
-n, --namebeginnersince changelog 2.0.64 (named sessions)Display name for the session (shown in /resume and terminal title)claude -n "my-feature-work"Docs ↗
--session-id <uuid>advancedsince changelog 2.0.73Use a specific session UUIDclaude --session-id 550e8400-e29b-41d4-a716-446655440000Docs ↗
--from-pr [value]intermediatesince changelog 2.1.27Open the picker filtered to sessions linked to a PR/MR (number, GitHub/GHE URL, GitLab MR URL, Bitbucket PR URL)claude --from-pr 123Docs ↗
-w, --worktree [name]intermediatesince changelog 2.1.49Start in an isolated git worktree at .claude/worktrees/<name>; accepts #123, a GitHub PR URL or GitLab MR URL to branch from a PR (GitLab MR needs 2.1.233)claude -w feature-authDocs ↗
--tmuxadvancedCreate a tmux session for the worktree (requires --worktree; iTerm2 panes when available, --tmux=classic for tmux)claude -w feature-auth --tmuxDocs ↗
--bg, --backgroundintermediatesince changelog 2.1.140 (background agent support 2.0.60)Start as a background agent and return immediately; cannot combine with -p; combine with --exec for shell jobs or --agentclaude --bg "investigate the flaky test"Docs ↗
--execadvancedsince docs onlyRun a shell command as a PTY backed background job (use with --bg)claude --bg --exec 'pytest -x'Docs ↗
--cloud [description|id|url]intermediatesince `--remote` is the deprecated aliasCreate a cloud session, or queue a message into an existing one with -pclaude --cloud "Fix the login bug"Docs ↗
--teleport [session]intermediateResume a cloud session in your local terminalclaude --teleportDocs ↗
--remote-control [name], --rcintermediateStart an interactive session also controllable from claude.ai or the Claude appclaude --remote-control "My Project"Docs ↗
--desktopintermediatesince 2.1.285Open the Claude Desktop app on this directory (with --continue or --resume <id> to open that session); macOS and x64 Windows, subscription onlyclaude --desktopDocs ↗
--system-prompt-snapshot on|offadvancedsince 2.1.257Whether a conversation keeps its first request system prompt on resumeclaude --system-prompt-snapshot offDocs ↗
Model, thinking and prompts--model, --effort, --fallback-model, --advisor <model> and 9 more13 features
FeatureWhat it doesHowDocs
--modelbeginnerModel for this session: alias (sonnet, opus, haiku, fable, best, opusplan, sonnet[1m], opus[1m]) or full nameclaude --model claude-sonnet-5Docs ↗
--effortintermediatesince `ultracode` 2.1.203; `xhigh` changelog 2.1.111Effort for this session: low, medium, high, xhigh, max, ultracode (levels depend on model; not persisted)claude --effort highDocs ↗
--fallback-modeladvancedsince changelog 2.1.143Comma list of models tried in order when the primary is overloaded or unavailableclaude --fallback-model sonnet,haikuDocs ↗
--advisor <model>advancedEnable the server side advisor tool (second model consulted at key moments) for this sessionclaude --advisor opusDocs ↗
--autocompact <auto|tokens>advancedsince 2.1.221Auto compact window for this launch (100K to 1M tokens, or auto)claude --autocompact 500kDocs ↗
--system-promptadvancedReplace the entire default system promptclaude --system-prompt "You are a Python expert"Docs ↗
--system-prompt-fileadvancedsince changelog 1.0.55; docs only (not in local `--help`)Replace the prompt with a file's contentsclaude --system-prompt-file ./prompts/review.txtDocs ↗
--append-system-promptintermediatesince changelog 1.0.51Append text to the default prompt (keeps tool guidance and safety)claude --append-system-prompt "Always use TypeScript"Docs ↗
--append-system-prompt-fileintermediatesince docs onlyAppend a file's contents; both append flags can be combined from 2.1.283claude -p --append-system-prompt-file ./style.md "Summarize README.md"Docs ↗
--append-subagent-system-prompt[-file]advancedsince 2.1.205 / `-file` 2.1.261Append text to every subagent's system prompt (print mode only)claude -p --append-subagent-system-prompt "Cite file paths" "query"Docs ↗
--betasadvancedBeta headers (API key users only)claude --betas interleaved-thinkingDocs ↗
--briefadvancedsince local `--help` only; not in the docs flag table (UNVERIFIED in docs)Enable the SendUserMessage tool for agent to user messagesclaude --briefDocs ↗
--file <specs...>advancedsince local `--help` only; not in the docs flag table (UNVERIFIED in docs)Download file resources at startup, file_id:relative_pathclaude --file file_abc:doc.txtDocs ↗
Permissions and tools--permission-mode, --allowedTools, --allowed-tools, --disallowedTools, --disallowed-tools, --tools and 4 more8 features
FeatureWhat it doesHowDocs
--permission-modebeginnersince `manual` alias 2.1.200Start in default (alias manual), acceptEdits, plan, auto, dontAsk, bypassPermissionsclaude --permission-mode planDocs ↗
--allowedTools, --allowed-toolsintermediateTools that run without prompting; uses permission rule syntaxclaude -p "..." --allowedTools "Bash(git log *)" "Bash(git diff *)" "Read"Docs ↗
--disallowedTools, --disallowed-toolsintermediateDeny rules; a bare tool name removes it from Claude's contextclaude --disallowedTools "Bash(git log *)" "Edit"Docs ↗
--toolsadvancedsince changelog 2.1.0 (interactive)Restrict which built in tools exist: "" none, "default", or namesclaude --tools "Bash,Edit,Read"Docs ↗
--dangerously-skip-permissionsadvancedsince changelog 1.0.7Skip all permission prompts (same as bypassPermissions); sandboxes onlyclaude --dangerously-skip-permissionsDocs ↗
--allow-dangerously-skip-permissionsadvancedAdds bypassPermissions to the Shift+Tab cycle without starting in itclaude --permission-mode plan --allow-dangerously-skip-permissionsDocs ↗
--add-dirintermediatesince changelog 1.0.18Extra working directories Claude can read and edit (most .claude/ config in them is not discovered)claude --add-dir ../apps ../libDocs ↗
--disable-slash-commandsadvancedDisable all skills and commands for the sessionclaude --disable-slash-commandsDocs ↗
Config, MCP, agents, plugins--settings, --setting-sources, --mcp-config, --strict-mcp-config and 6 more10 features
FeatureWhat it doesHowDocs
--settingsintermediatesince changelog 1.0.61Settings JSON file (2 MiB max) or inline JSON overriding file settings for this sessionclaude --settings ./settings.jsonDocs ↗
--setting-sourcesadvancedWhich sources to load: user, project, localclaude --setting-sources user,projectDocs ↗
--mcp-configintermediatesince changelog 0.2.75Load MCP servers from JSON files or strings; with -p it waits for servers (up to MCP_TIMEOUT, 30s)claude --mcp-config ./mcp.jsonDocs ↗
--strict-mcp-configadvancedOnly use servers from --mcp-configclaude --strict-mcp-config --mcp-config ./mcp.jsonDocs ↗
--agentsadvancedsince changelog 2.0.0Define subagents as JSON (file path allowed with --print from 2.1.281)claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'Docs ↗
--agentadvancedsince changelog 2.0.59Run the session as a named agent (overrides agent setting)claude --agent my-custom-agentDocs ↗
--plugin-diradvancedsince folder form 2.1.265Load a plugin directory, .zip, or folder of plugins for this session (repeatable)claude --plugin-dir ./my-pluginDocs ↗
--plugin-urladvancedFetch a plugin .zip from a URL for this sessionclaude --plugin-url https://example.com/plugin.zipDocs ↗
--teammate-modeadvancedsince docs onlyHow agent team teammates display: in-process, auto, tmux, iterm2claude --teammate-mode autoDocs ↗
--channelsadvancedsince docs only(Research preview) MCP channel notifications to listen forclaude --channels plugin:my-notifier@my-marketplaceDocs ↗
Environment, debugging, display--verbose, -d, --debug [filter], --debug-file <path>, --chrome / --no-chrome and 7 more11 features
FeatureWhat it doesHowDocs
--verbosebeginnerFull turn by turn output; required with stream-jsonclaude --verboseDocs ↗
-d, --debug [filter]intermediatesince changelog 0.2.117Debug logs with optional category filter; the filter binds only in = formclaude --debug='mcp,startup' or --debug='!mcp'Docs ↗
--debug-file <path>intermediateWrite debug logs to a file (implies debug)claude --debug-file /tmp/claude-debug.logDocs ↗
--chrome / --no-chromeintermediatesince changelog 2.0.72 (Chrome beta)Enable or disable Claude in Chrome integrationclaude --chromeDocs ↗
--ideintermediateAuto connect to the IDE on startup if exactly one valid IDE is availableclaude --ideDocs ↗
--ax-screen-readerintermediatesince 2.1.181Flat, screen reader friendly output; forces the classic rendererclaude --ax-screen-readerDocs ↗
-v, --versionbeginnerPrint the versionclaude -vDocs ↗
-h, --helpbeginnerList flags and subcommands (not exhaustive)claude --help, claude <sub> --helpDocs ↗
--environment, --refadvancedsince 2.1.224Run a cloud session on a self hosted environment (ccpool_...), optionally from a refclaude -p "Run the smoke test" --environment ccpool_abc123 --ref mainDocs ↗
--dangerously-load-development-channelsadvancedsince docs onlyTest channels not on the allowlist (interactive only)claude --dangerously-load-development-channels server:webhookDocs ↗
--enable-auto-modebeginnersince removed 2.1.111REMOVED in 2.1.111; auto mode is already in the Shift+Tab cycleuse --permission-mode autoDocs ↗

Keyboard shortcuts and input

Interactive mode: keyboard, input, displayInterrupt or clear, Exit, Stop Claude mid turn, Clear draft, or rewind and 52 more56 features
FeatureWhat it doesHowDocs
Interrupt or clearbeginnerInterrupts a running operation; if idle, first press clears the input, second exitsCtrl+CDocs ↗
ExitbeginnerFirst press shows a hint, second within 800 ms exits (deletes a char if the prompt has text)Ctrl+D or /exitDocs ↗
Stop Claude mid turnbeginnerStops the current response or tool call; work done so far is kept; also closes dialogsEscDocs ↗
Clear draft, or rewindbeginnersince changelog 2.1.83 (clear)With text in the prompt, double Esc clears it (saved to history); with an empty prompt it opens the rewind menuEsc EscDocs ↗
Bring back a cleared draftintermediatesince 2.1.288 / 2.1.292 (newer than local)Press Up right after Ctrl+C clears (2.1.288), or Up after sending to step back to one of the last ten cleared drafts (2.1.292)UpDocs ↗
Cycle permission modesbeginnersince changelog 1.0.56 (Windows fix)Manual, acceptEdits, plan, then auto/bypass when availableShift+Tab (or Alt+M on Windows when VT input mode is off)Docs ↗
Reverse history searchbeginnersince changelog 0.2.54 (full output toggle at the time)Searches prompt history; in fullscreen opens a dialog (Ctrl+S cycles session / project / all projects)Ctrl+RDocs ↗
History navigationbeginnerUp/Down moves the cursor first in multiline input, then historyUp / Down or Ctrl+P / Ctrl+NDocs ↗
Background a running taskintermediatesince changelog 2.1.0 (unified)Moves running Bash commands and agents to the background (tmux: press twice)Ctrl+BDocs ↗
Task checklistintermediateShow or hide Claude's to do checklist (up to five items shown)Ctrl+TDocs ↗
Transcript viewerintermediateDetailed tool use and timestamps; expands collapsed linesCtrl+ODocs ↗
Show hidden startup noticesintermediatesince v2.1.326Shows startup notices that were hidden at startupCtrl+ODocs ↗
Toggle extended thinkingintermediatesince changelog 2.0.72 (moved from Tab)Per session switch; no effect on models that always think (Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable)Option+T (macOS) / Alt+TDocs ↗
Switch modelintermediateChanges model without clearing your promptOption+P / Alt+PDocs ↗
Toggle fast modeintermediateOn or offOption+O / Alt+ODocs ↗
Paste an imagebeginnersince changelog 0.2.59Inserts an [Image #N] chipCtrl+V (Cmd+V in iTerm2, Alt+V on Windows/WSL)Docs ↗
Stash and restore promptintermediateStash the text; press again on an empty prompt to restore (including ! shell mode)Ctrl+SDocs ↗
Edit prompt in your editorintermediateOpens the prompt (or a plan) in $EDITORCtrl+G or Ctrl+X Ctrl+EDocs ↗
Redraw screenbeginnerFixes garbled output, keeps input and historyCtrl+LDocs ↗
Suspend (Unix)intermediateSuspends to the shell; fg resumesCtrl+ZDocs ↗
Stop all background subagentsadvancedPress twice within 3 secondsCtrl+X Ctrl+KDocs ↗
Queue messages while Claude worksintermediatePress Enter while Claude is busy; messages go out when tool calls finish or the turn ends; Up takes them backtype + EnterDocs ↗
Send queued messages nowintermediatesince 2.1.275Sends the queue (and your draft) immediatelyCtrl+Enter or Ctrl+X Ctrl+SDocs ↗
Multiline entrybeginnerNewline without sending\ then Enter (any terminal), Ctrl+J (any terminal), Shift+Enter (iTerm2, WezTerm, Ghostty, Kitty, Warp, Windows Terminal 1.25 or later), Option+Enter (macOS with Option as Meta); run /terminal-setup once in VS Code, Cursor, Zed, old AlacrittyDocs ↗
Large pastebeginnerPastes over 800 characters or 3 lines collapse to [Pasted text #1 +120 lines] but Claude sees the full textpaste normallyDocs ↗
/ commands and skillsbeginnerStart of message runs a command or skill; / after a space completes mid prompttype /Docs ↗
! shell modebeginnersince changelog 0.2.66Runs a shell command directly; output enters the conversation and Claude responds; Tab completes from past ! commands; exit with Esc / Backspace / Ctrl+U on empty prompt; runs outside the sandbox in most sessions! npm testDocs ↗
@ file mentionsbeginnersince changelog 0.2.75Autocompletes paths and includes file content (up to 25,000 tokens; text files over 256 KB are not included); directories show listings; @server:resource pulls MCP resourcesExplain @src/utils/auth.jsDocs ↗
: emoji shortcodesbeginner:heart: inserts the emoji; :he shows suggestionstype :name:Docs ↗
? shortcut helpbeginnerShows the shortcut panel on an empty input?Docs ↗
# quick memorybeginnersince UNVERIFIED (treat as not a current feature)Not documented. No # shortcut appears in the interactive mode or memory pages (searched fresh). Use /memory or ask Claude to edit CLAUDE.md.Docs ↗
Prompt suggestionsbeginnersince changelog 2.0.70Greyed next prompt suggestion; Tab or Right arrow places it, Enter submits (Enter to submit added 2.0.70); costs a small cached requestTab / Right arrow; toggle in /configDocs ↗
Vim editor modeintermediatesince `%` 2.1.301, `d0` 2.1.281 (newer than local)Vim style prompt editing: mode keys, hjkl, w/e/b, 0 $ ^, gg G, f/F/t/T, x r dd D cc C yy p >>, etc. (% and d0 need newer versions)Enable in /config then Editor mode (/vim was removed in 2.1.92)Docs ↗
Voice dictationintermediateHold Space to record (or /voice tap); needs a claude.ai login and a local mic; not in SSH/cloud sessions; transcription does not use tokens/voice [hold|tap|off]Docs ↗
Spell checkintermediatesince 2.1.235Underlines misspellings in the prompt box (off by default)see the page (off by default)Docs ↗
Side question /btwbeginnersince changelog 2.1.79 areaQuick question that never enters the conversation history/btw what does X do?Docs ↗
Ask /btw about a subagentintermediatesince 2.1.314With a subagent's transcript open, /btw answers from that transcript, so you can ask what the subagent did; from a teammate's transcript it answers from the main conversationopen the subagent transcript, then /btw what did you change?Docs ↗
/diff panelbeginnersince diff panel changelog 2.1.260Review uncommitted changes without leaving; side panel in fullscreen, dialog otherwise/diffDocs ↗
Session recapbeginnersince changelog 2.1.108One line "while you were away" summary after 3+ minutes; /recap on demand/recapDocs ↗
Auto continue after usage limitintermediatesince 2.1.234Waits for a claude.ai limit reset then continues; Esc cancelsautomatic; /rate-limit-optionsDocs ↗
PR status in footerbeginnerClickable PR #446 link coloured by review state (green approved, yellow pending, red changes requested, gray draft)automatic on a branch with an open PRDocs ↗
Invisible character strippingintermediateRemoves zero width and bidi tag characters from pasted text on Enter, then asks you to press Enter againautomaticDocs ↗
Text editing shortcutsintermediateCtrl+A/E line start/end, Ctrl+K delete to end of line, Ctrl+U delete to line start, Ctrl+W delete back to the previous whitespace (a whole path counts as one), Ctrl+Y paste deleted text, Alt+Y after Ctrl+Y cycles earlier deletions, Alt+B/F move by word, Alt+D delete to the end of the word, Ctrl+_ undo. On macOS the Alt keys need Option set as Metakeys listedDocs ↗
Fullscreen renderingintermediatesince changelog 2.1.110Flicker free alternate screen UI with mouse support, fixed input box, transcript search/tui fullscreen (/tui default to return)Docs ↗
Transcript viewer keys (fullscreen)advanced? help, { } prompt jumps, [ dump to scrollback, v open in editor, q/Esc exitinside Ctrl+O viewDocs ↗
Customize shortcutsadvancedRebind any action by context (Global, Chat, Autocomplete, Confirmation...)edit ~/.claude/keybindings.json or /keybindingsDocs ↗
Confirmation dialog actionsadvancedIn the Confirmation context, confirm:yes (Enter by default) and confirm:no (Escape) accept and cancel dialogs, even ones that do not ask a yes or no question. Binding a bare letter such as y or n there also acts on dialogs that never show it as a key.{"context":"Confirmation","bindings":{"y":"confirm:yes","n":"confirm:no"}}Docs ↗
Selection actionsadvancedsince `selection:clear` 2.1.234In the Scroll context (fullscreen rendering), selection:copy copies the selected text (Ctrl+Shift+C or Cmd+C by default) and selection:clear clears the active selection (unbound by default). selection:extendLeft, extendRight, extendUp and extendDown grow it with Shift+arrow keys.bind the action in keybindings.jsonDocs ↗
Cmd+K clear screenbeginnerCmd+K is bound to chat:clearScreen, which does the same as Ctrl+L (redraw, keeping input and history) when your terminal passes the key to Claude Code. iTerm2 and Terminal.app handle Cmd+K themselves and clear their own screen, and Claude Code repaints the conversation.Cmd+KDocs ↗
"You should know" notesintermediatesince 2.1.287A built in mod, off by default, where a side agent rereads a longer conversation from time to time and shows one short note above the prompt about something you might have missed. The side agent has no tools. /plugin may not list it through an LLM gateway, a Claude apps gateway or an apiKeyHelper, or when feature flags are not fetched./plugin enable cc-plugin-you-should-know@builtinDocs ↗
Status lineintermediatesince changelog 1.0.71Shows model, context %, cost, git etc. at the bottom; your script gets session JSON on stdin and prints the text/statusline show model name and context percentage or "statusLine": {"type":"command","command":"~/.claude/statusline.sh"}Docs ↗
ThemesbeginnerLight/dark/auto, daltonized, ANSI, custom themes from ~/.claude/themes//themeDocs ↗
Terminal bell / notificationsintermediateNotify when Claude finishes or needs permission (use a Notification hook for a sound)see pageDocs ↗
Screen reader modeintermediatesince 2.1.181Flat text, numbered menus, terminal bell on attentionclaude --ax-screen-reader or CLAUDE_AX_SCREEN_READERDocs ↗
Prompt bar colourbeginnersince changelog 2.1.75Per session prompt bar colour (red, blue, green, yellow, purple, orange, pink, cyan)/color blueDocs ↗
Deep linksadvancedclaude-cli://open?... URLs open a session in a directory with a prefilled (never auto run) promptopen "claude-cli://open?..." (see page for params)Docs ↗

Slash commands

Type / in a session to see every command. Some are skills that ship with Claude Code, and the list changes often, so check the changelog below for new ones.

Conversation and context/clear [name] (aliases /reset, /new), /compact [instructions], /context [all], /resume [session] and 22 more26 features
FeatureWhat it doesHowDocs
/clear [name] (aliases /reset, /new)beginnerNew conversation with empty context; the old one stays resumable with /resumeDocs ↗
/compact [instructions]beginnersince changelog 2.0.31 mentionSummarize the conversation to free context; optional focus textDocs ↗
/context [all]beginnersince changelog 1.0.86Coloured grid of context usage plus optimization hints; all expands the breakdownDocs ↗
/resume [session]beginnersince changelog 1.0.27Resume by ID or name, or open the picker (background sessions marked bg)Docs ↗
/rewind (aliases /checkpoint, /undo)beginnersince changelog 2.0.0Roll back code and/or conversation to an earlier prompt, or summarize from a selected messageDocs ↗
/branch [name]intermediatesince changelog 2.1.77 (renamed from `/fork`)Fork the conversation at this point and switch into the branch; original stays in /resumeDocs ↗
/fork [prompt]intermediateCopy the conversation into a new background session and keep working hereDocs ↗
/subtask <task>advancedSpawn a forked subagent that inherits the full conversation; result returns when doneDocs ↗
/rename [name]beginnersince changelog 2.0.64Name the session (auto generates a name with no argument)Docs ↗
/restart (alias /update)intermediatesince v2.1.288Restart Claude Code and resume this session so an installed update applies; run it when the footer offers it. Needs a Pro, Max or Ultra plan and a native install on macOS or Linux, not WSLDocs ↗
/export [filename]beginnersince changelog 1.0.44Export the conversation as plain text to clipboard or a fileDocs ↗
/copy [N]beginnerCopy the last (or Nth latest) response; picker for code blocksDocs ↗
/recapbeginnersince changelog 2.1.108One line summary of the session so farDocs ↗
/btw [question]beginnerSide question that does not enter the conversationDocs ↗
/add-dir <path>intermediatesince changelog 1.0.42Add a working directory for file access this sessionDocs ↗
/cd <path>intermediatesince changelog 2.1.169Move the session to a new working directory, keeping the conversationDocs ↗
/diffbeginnerReview uncommitted changesDocs ↗
/focusintermediatesince changelog 2.1.110Toggle focus view: last prompt, one line tool summary and final answer (fullscreen only)Docs ↗
/plan [description]beginnersince changelog 2.1.0Enter plan mode from the promptDocs ↗
/goal [condition|clear]intermediatesince changelog 2.1.139Keep working across turns until a condition is metDocs ↗
/loop [interval] [prompt] (alias /proactive)intermediatesince changelog 2.1.71Repeat a prompt on an interval while the session is open (skill)Docs ↗
/schedule [description] (alias /routines)intermediateCreate, update, list or run cloud scheduled tasksDocs ↗
/background [prompt] (alias /bg)intermediateDetach this session to run as a background agentDocs ↗
/stopintermediateStop the background session you are attached toDocs ↗
/tasks (alias /bashes)intermediateView and manage background shells and subagentsDocs ↗
/exit (alias /quit)beginnerExit the CLI (in an attached background session, detaches)Docs ↗
Model, behaviour and display/model [model], /effort [level|auto|status|ultracode [on|off]], /fast [on|off], /advisor [model|off] and 14 more18 features
FeatureWhat it doesHowDocs
/model [model]beginnersince changelog 1.0.77Switch model and save it as the default (press s in the picker for this session only); left/right adjusts effortDocs ↗
/effort [level|auto|status|ultracode [on|off]]intermediatesince changelog 2.1.76Set effort low to max or auto; max is session onlyDocs ↗
/fast [on|off]intermediatesince changelog 2.1.36Toggle fast mode (same model, lower latency, higher price)Docs ↗
/advisor [model|off]advancedsince text form changelog 2.1.260Enable a second model that is consulted at key momentsDocs ↗
/autocompact [auto|size]advancedsince 2.1.221Set the auto compact window (100K to 1M tokens)Docs ↗
/output-style [style]intermediatesince 2.1.269Switch output style (Default, Proactive, Concise, Explanatory, Learning, custom)Docs ↗
/config [key=value ...]beginnersince changelog 0.2.34Settings UI; key=value sets directly (also in -p)Docs ↗
/themebeginnerColour theme pickerDocs ↗
/color [color|default]beginnerPrompt bar colourDocs ↗
/tui [default|fullscreen]intermediatesince changelog 2.1.110Switch renderer and relaunch with the conversation intactDocs ↗
/scroll-speedadvancedMouse wheel speed (fullscreen only)Docs ↗
/statuslineintermediatesince changelog 1.0.71Configure the status line from a descriptionDocs ↗
/terminal-setupbeginnerInstall Shift+Enter for VS Code, Cursor, Zed, old Alacritty; Option+Enter in Apple TerminalDocs ↗
/keybindingsadvancedOpen the keybindings fileDocs ↗
/voice [hold|tap|off]intermediateToggle voice dictationDocs ↗
/sandboxadvancedToggle sandbox mode (supported platforms)Docs ↗
/permissionsintermediatesince changelog 1.0.7View and edit allow/ask/deny rules, working directories, recent auto mode denialsDocs ↗
/vimbeginnersince removed 2.1.92REMOVED in 2.1.92; use /config then Editor modeDocs ↗
Account, usage and surfaces/login, /logout, /usage (aliases /cost, /stats), /usage-credits, /rate-limit-options and 14 more18 features
FeatureWhat it doesHowDocs
/login, /logoutbeginnerSign in or outDocs ↗
/usage (aliases /cost, /stats)beginnersince `/usage` changelog 2.0.0Session cost, plan limits, activity statsDocs ↗
/usage-creditsintermediatesince renamed from `/extra-usage` 2.1.144Configure or request usage credits when you hit a limitDocs ↗
/rate-limit-optionsintermediatesince 2.1.284 listed in helpOptions when a claude.ai limit blocks a requestDocs ↗
/upgradebeginnerOpen the plan upgrade pageDocs ↗
/statusbeginnerSettings on the Status tab: version, model, account, connectivityDocs ↗
/privacy-settingsbeginnerView and update privacy settings (Pro, Max and Ultra)Docs ↗
/passesbeginnerShare a free week (only if eligible)Docs ↗
/desktop (alias /app)intermediateContinue the session in the Claude Code Desktop appDocs ↗
/mobile (aliases /ios, /android)beginnerQR code for the Claude mobile appDocs ↗
/teleport (alias /tp)intermediatesince changelog 2.1.0Pull a cloud session into this terminalDocs ↗
/remote-control (alias /rc)intermediateMake this session controllable from claude.aiDocs ↗
/remote-envadvancedDefault cloud environment for CLI cloud sessionsDocs ↗
/web-setupintermediateConnect GitHub for cloud sessions via gh credentialsDocs ↗
/chromeintermediateConfigure Claude in ChromeDocs ↗
/ideintermediateManage IDE integrationsDocs ↗
/install-github-appintermediatesince changelog 1.0.7Install the Claude GitHub App and optional Actions workflowDocs ↗
/install-slack-appintermediateInstall the Claude Slack appDocs ↗
Project setup and extensibility/init, /memory, /mcp [reconnect|enable|disable ...], /hooks and 15 more19 features
FeatureWhat it doesHowDocs
/initbeginnerCreate a CLAUDE.md guide (CLAUDE_CODE_NEW_INIT=1 for the interactive flow)Docs ↗
/memorybeginnerEdit CLAUDE.md files, toggle auto memory, view entriesDocs ↗
/mcp [reconnect|enable|disable ...]intermediatesince changelog 1.0.18Manage MCP servers and OAuthDocs ↗
/hooksintermediatesince changelog 1.0.38View hook configurationDocs ↗
/plugin [subcommand]intermediatesince changelog 2.0.12Manage pluginsDocs ↗
/reload-plugins [--force]intermediatesince changelog 2.1.69Apply plugin changes without restartingDocs ↗
/skillsintermediateList skills (Space cycles visibility, t sorts by tokens)Docs ↗
/reload-skillsintermediateRe scan skill and command directoriesDocs ↗
/agentsintermediateReminder to ask Claude to manage subagents (interactive UI removed after v2.1.197)Docs ↗
/list-agents (alias /peers)advancedsince 2.1.224List sessions and teammates Claude can messageDocs ↗
/import [codex|gemini|cursor] [--dry-run] [--yes]intermediateImport another agent's configDocs ↗
/doctor (alias /checkup)beginnerSetup checkup that proposes fixes (skill)Docs ↗
/skill-doctoradvancedsince 2.1.252Per skill context cost and usageDocs ↗
/setup-bedrock, /setup-vertexadvancedProvider wizards (hidden until CLAUDE_CODE_USE_BEDROCK=1 / CLAUDE_CODE_USE_VERTEX=1)Docs ↗
/auto-mode-setupadvancedsince 2.1.228Draft autoMode.environment entriesDocs ↗
/fewer-permission-promptsintermediateScan transcripts and add a read only allowlist (skill)Docs ↗
/update-config [request]intermediateEdit settings.json from a description (skill)Docs ↗
/plugin-authoring, /workflow-authoringadvancedsince 2.1.287 / 2.1.248Reference skills for writing mods and workflow scriptsDocs ↗
/workflowsadvancedProgress view for dynamic workflowsDocs ↗
Review, quality and help/code-review [low..max|ultra] [--fix] [--comment] [--max-findings n] [target], /review, /security-review, /ultrareview [PR or branch] and 14 more18 features
FeatureWhat it doesHowDocs
/code-review [low..max|ultra] [--fix] [--comment] [--max-findings n] [target]intermediatesince changelog 2.1.147Review the diff, PR or path for bugs (skill)Docs ↗
/reviewintermediateAlias of /code-reviewDocs ↗
/security-reviewintermediateSecurity review of the branch diff against origin's default branchDocs ↗
/ultrareview [PR or branch]advancedsince changelog 2.1.111Cloud multi agent review (3 free runs on Pro, Max and Ultra, then usage credits)Docs ↗
/simplify [target]intermediatesince changelog 2.1.63Cleanup review with four parallel agents, applies fixes (skill)Docs ↗
/batch <instruction>advancedsince changelog 2.1.63Parallel large scale change across 5 to 30 worktree subagents (skill)Docs ↗
/debug [description]intermediateTurn on debug logging and analyze the log (skill)Docs ↗
/run, /verify, /run-skill-generatorintermediateLaunch and drive the app to verify a change works (skills)Docs ↗
/deep-research <question>intermediateWeb fan out research with a cited report (workflow)Docs ↗
/autofix-pr [prompt]advancedCloud session that watches the PR and pushes fixesDocs ↗
/insightsintermediatesince changelog 2.1.101 mentionHTML report analysing your recent sessionsDocs ↗
/helpbeginnerHelp and available commandsDocs ↗
/powerupbeginnersince changelog 2.1.90Interactive lessons with animated demosDocs ↗
/release-notesbeginnersince changelog 0.2.37Version picker for the changelogDocs ↗
/bug [report], /feedback [report]beginnerReport a bug or send feedback (consent screen)Docs ↗
/team-onboardingintermediateGenerate an onboarding guide from your last 30 days of usageDocs ↗
/heapdumpadvancedWrite a heap snapshot for memory diagnosis (hidden; do not share the .heapsnapshot)Docs ↗
/radio, /stickersbeginnerLo fi radio in the browser; order stickersDocs ↗
Other bundled skills and removed commands/design, /design-sync, /design-login, /slides, /artifacts, /artifact-capabilities, /artifact-diagramming, /dataviz, /claude-api, /claude-in-chrome3 features
FeatureWhat it doesHowDocs
/design, /design-sync, /design-login, /slides, /artifactsintermediatesince 2.1.265 for `/design` and `/slides`Claude Design and Slides artifact skills (need artifacts availability)Docs ↗
/artifact-capabilities, /artifact-diagramming, /datavizadvancedsince `/artifact-diagramming` 2.1.221Reference skills for artifacts and chartsDocs ↗
/claude-api, /claude-in-chromeintermediateAPI reference skill; browser task skillDocs ↗

Sessions, context, models and workflows

Shell
#!/usr/bin/env bash
# Pick a conversation back up.
# Source: https://code.claude.com/docs/en/sessions#resume-a-session
claude --continue          # most recent session in this directory
claude --resume            # open the session picker
claude -c -p "Check for type errors"   # continue, non-interactively
Sessions and contextContinue the last session, Resume by name or ID, Session picker, Name sessions and 21 more25 features
FeatureWhat it doesHowDocs
Continue the last sessionbeginnersince changelog 0.2.93Reopens the most recent session in this directoryclaude --continueDocs ↗
Resume by name or IDbeginnerResume a session; ID search covers this project, its worktrees, then every projectclaude --resume <name|id>Docs ↗
Session pickerbeginnerEnter resume, Space preview, Ctrl+R rename, / search (paste a PR URL to find the session), Ctrl+A all projects, Ctrl+W all worktrees, Ctrl+B current branch/resume or claude --resumeDocs ↗
Name sessionsbeginnersince changelog 2.0.64Name at startup, with /rename, or from the pickerclaude -n auth-refactorDocs ↗
Branch a sessionintermediatesince changelog 2.1.77Copy the conversation and switch into the copy; or --continue --fork-session from the shell/branch try-streamingDocs ↗
What a resume restoresintermediateConversation, tool results, compaction state, goals; "Allow for this session" grants are not carried into --fork-session processesautomaticDocs ↗
Resume a running background sessionadvancedsince 2.1.285Resuming a still running background session opens it via attachclaude --resume <name>Docs ↗
Transcripts locationadvancedJSONL at ~/.claude/projects/<project>/<session>.jsonl; claude purge deletesDocs ↗
/clearbeginnerStart fresh in the same terminal; previous session kept for /resume (or the rewind menu's "previous session" entry)/clearDocs ↗
/compact with instructionsbeginnerSummarize to free context, steering what is kept/compact keep the API changes and the test commandsDocs ↗
Auto compactionintermediateHappens automatically near the limit; stops with a "thrashing" error if a single output refills context after a few triesautomaticDocs ↗
What survives compactionintermediatesince skill descriptions re injected needs 2.1.304System prompt, project CLAUDE.md and unscoped rules, auto memory, plan mode plan are re injected; up to 5 recently touched files re read (over 5,000 tokens become path references); skill bodies re injected capped at 5,000 each / 25,000 total; path scoped rules and nested CLAUDE.md reload on demandDocs ↗
Check contextbeginnersince changelog 1.0.86Live breakdown by category with suggestions/contextDocs ↗
Context window sizesintermediateFable models, Sonnet 5+, Haiku 5.5, Opus 4.7+ run a native 1M window; Opus 4.6 and Sonnet 4.6 reach 1M only via [1m]; models with a native 1M window compact automatically at about 967K by default/model sonnet[1m]Docs ↗
Set the auto compact windowadvancedsince 2.1.221100K to 1M tokens; per model with /autocompact, per launch with --autocompact, or CLAUDE_CODE_AUTO_COMPACT_WINDOW/autocompact 500kDocs ↗
Rewind and checkpointsbeginnersince changelog 2.0.0A checkpoint is taken before every prompt that starts a turn; the 100 most recent are kept; restore code, conversation, both, or summarize from/up to a point/rewind or Esc EscDocs ↗
Checkpoint limitsintermediateBash only file changes, subagent edits, external edits, symlinks are not restored; not a replacement for GitDocs ↗
Export a transcriptbeginnersince changelog 1.0.44Plain text to clipboard or file/export notes.txtDocs ↗
Script access to sessionsintermediate--output-format json gives session_id; capture and --resume "$id"id=$(claude -p "..." --output-format json | jq -r .session_id)Docs ↗
Cost and usagebeginnersince `/usage` changelog 2.0.0/usage shows session cost (an estimate at list price), plan limits and activity; totals reset on /clear (since 2.1.211)/usageDocs ↗
Token count beside spinnerbeginner(10m 27s · ↓ 5.5k tokens) shows elapsed time and output tokensvisible while Claude worksDocs ↗
Reduce token useintermediateClear between tasks, compact with a focus, pick the right model, use subagents for noisy work, specific prompts, plan modesee pageDocs ↗
Image inputbeginnerDrag and drop, Ctrl+V paste, or give a path; PNG/JPEG/GIF/WebP; large images are downscaled; refuses over 128 MBAnalyze this image: /path/img.pngDocs ↗
PDF inputintermediateShort PDFs read whole; longer than 10 pages read in ranges of up to 20 pages (needs pdftoppm from poppler)give Claude the PDF path in your prompt (page-range reads call the Read tool)Docs ↗
Prompt cachingadvancedAutomatic; a model switch triggers one slow uncached turn; CLAUDE.md edits do not apply mid sessionDocs ↗
Models, effort, thinking, fast modeModel aliases, Where aliases point (Anthropic API), Default model, Model priority order and 12 more16 features
FeatureWhat it doesHowDocs
Model aliasesbeginnerdefault, best, fable, sonnet, opus, haiku, sonnet[1m], opus[1m], opusplan/model opus or --model sonnetDocs ↗
Where aliases point (Anthropic API)intermediatesince Fable 5.2 needs 2.1.321, Sonnet 5.5 needs 2.1.284, Opus 5.5 needs 2.1.280opus = Opus 5.5, sonnet = Sonnet 5.5, haiku = Haiku 5.5, fable = Fable 5.2 (Fable 5 in Claude apps gateway sessions), best = the same model as opus; older on Bedrock, Vertex, FoundryDocs ↗
Default modelbeginnerPro, Max, Ultra, Team, Enterprise and API default to Opus 5.5/model default clears an overrideDocs ↗
Model priority orderintermediate/model in session, then --model, then ANTHROPIC_MODEL, then settings model, then ANTHROPIC_DEFAULT_MODELDocs ↗
opusplanintermediateOpus in plan mode, Sonnet when executing/model opusplanDocs ↗
Fallback chainsadvancedsince changelog 2.1.143 / 2.1.166Fall back to other models when the primary is overloadedclaude --fallback-model sonnet,haiku or fallbackModel settingDocs ↗
Effort levelsintermediatesince `/effort` changelog 2.1.76Fable and 5.x/4.7/4.8 models: low, medium, high, xhigh, max; Opus 4.6 and Sonnet 4.6: low..max without xhigh; default high (Fable 5.2, Opus 5.5, Sonnet 5.5, Haiku 5.5 default medium; Opus 4.7 defaults xhigh)/effort high, claude --effort high, CLAUDE_CODE_EFFORT_LEVELDocs ↗
ultrathinkbeginnersince 2.1.311 for the rainbow behaviour (newer than local); VS Code, desktop Code tab and the disable variable 2.1.316Put the word in a prompt for deeper reasoning on that turn only; typed in the terminal, and from 2.1.316 in VS Code or a local session in the desktop Code tab, it can also raise that turn to xhigh effort, and in the terminal and VS Code the word turns rainbow when it can (not under an effort cap below xhigh, on an older model, or on Amazon Bedrock, Google Cloud's Agent Platform or a Claude apps gateway). CLAUDE_CODE_DISABLE_ULTRATHINK turns the keyword offinclude ultrathink in the promptDocs ↗
Other "think" phrasesbeginnerthink, think hard, think more are ordinary text, not keywordsDocs ↗
Extended thinking controlsintermediateToggle with Option+T/Alt+T; default in /config (alwaysThinkingEnabled); MAX_THINKING_TOKENS=0 disables where allowed; cannot be turned off on Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable; Ctrl+O shows thinking; thinking tokens are billed as outputsee leftDocs ↗
Fast modeintermediatesince changelog 2.1.36Same model quality, lower latency, higher price per token (Fable 5.2 $16 / $80 per MTok, Opus 5.5 $8 / $40, Opus 5 and 4.8 $10 / $50); available on Fable 5.2 and Opus 5.5, research preview on Opus 5 and 4.8; Anthropic API, subscription with usage credits, or Agent Platform with conditions; not on Bedrock, Foundry or Claude Platform on AWS. On Fable 5.2, a saved fastMode applies only after you run /fast while using Fable 5.2. Fast mode on Opus 4.8 is deprecated as of October 30, 2026 and is removed on November 30, 2026, after which those requests return an error with no fallback, so move to Opus 5.5/fast, Option+O/Alt+O, or "fastMode": trueDocs ↗
Fast mode on Google Cloud's Agent Platformadvancedsince v2.1.322Fable 5.2 only, with its region set to global, us or eu; /fast switches to Fable 5.2 and isn't saved as your default; "fastMode": true in settings has no effect there; Claude Code falls back to standard speed if Agent Platform refusesexport VERTEX_REGION_CLAUDE_FABLE_5_2=global, then /fast, or claude -p --model claude-fable-5-2 --settings '{"fastMode": true}'Docs ↗
AdvisoradvancedA second model consulted at key moments (must rank at or above the main model)/advisor opus, --advisor opus, advisorModel settingDocs ↗
Output stylesintermediatesince 2.1.269Default, Proactive, Concise, Explanatory, Learning, or a custom Markdown file; saved to .claude/settings.local.json/output-style conciseDocs ↗
Check the current modelbeginnerIn the status line, or /status/statusDocs ↗
See why a feature is offintermediatesince v2.1.326/status has a row that says when your provider or an environment variable such as DISABLE_TELEMETRY turns features off/statusDocs ↗
Permission modes and plan modedefault (Manual), acceptEdits, plan, Approve a plan and 7 more11 features
FeatureWhat it doesHowDocs
default (Manual)beginnersince `manual` alias 2.1.200Asks before anything but reads--permission-mode default or manualDocs ↗
acceptEditsbeginnerAuto approves file edits and common filesystem commands (mkdir, touch, rm, mv, cp) in the working directory--permission-mode acceptEditsDocs ↗
planbeginnersince changelog 1.0.33 areaClaude reads and proposes a plan, makes no source edits until you approveclaude --permission-mode plan, /plan, Shift+TabDocs ↗
Approve a planbeginnerChoose "Yes, and use auto mode", "Yes, manually approve edits" or "No, keep planning"; Ctrl+G edits the plan in your editorat the plan promptDocs ↗
autointermediatesince start mode 2.1.283; Windows 2.1.233A classifier model reviews actions and blocks risky ones; the built in start mode for interactive terminal sessions from 2.1.283--permission-mode autoDocs ↗
dontAskadvancedAuto denies anything that would prompt; reads inside the working dirs and pre approved tools only; never in the Shift+Tab cycle--permission-mode dontAskDocs ↗
bypassPermissionsadvancedNo prompts and no safety checks; deny rules still apply; containers and VMs only--dangerously-skip-permissionsDocs ↗
Mode cyclebeginnerdefault then acceptEdits then plan, then bypass (if enabled) and auto; from auto the first press goes to default. Status bar shows the active modeShift+TabDocs ↗
Default mode in settingsintermediateSet the start mode for a project or machinepermissions.defaultMode in settings (auto and bypassPermissions are ignored in shared project files)Docs ↗
Mode in -p runsintermediatesince 2.1.302 (newer than local)claude -p with no mode set starts in Manual mode from v2.1.302, so unapproved calls are deniedadd --allowedTools or --permission-modeDocs ↗
-p inside a runner sessionadvancedsince 2.1.317On a self hosted runner, CLAUDE_CODE_DISABLE_NESTED_SESSION_ID=1 makes a claude -p run inside a session use that session's ID and transcript, as in earlier versionsCLAUDE_CODE_DISABLE_NESTED_SESSION_ID=1Docs ↗
Background work and schedulingBackground Bash, Agent view, Open agent view by default, Code Mode (experimental) and 13 more17 features
FeatureWhat it doesHowDocs
Background Bashintermediatesince changelog 2.1.0Long commands run asynchronously; output is written to a file Claude can read; timed out commands are moved to the backgroundCtrl+B or ask ClaudeDocs ↗
Agent viewintermediatesince changelog 2.1.139 (research preview)One screen listing every session (working, needs input, ready for review, completed) with peek and replyclaude agentsDocs ↗
Open agent view by defaultintermediateclaude with no arguments opens the list/config settingDocs ↗
Code Mode (experimental)advancedsince v2.1.323Claude writes JavaScript that makes several tool calls in one step: commands in parallel, one result used in the next call, only the needed output returned; interactive terminal sessions only, on the native build, with a Claude subscription or Console account (not through Bedrock, a gateway or other clouds); works with agent teams on from v2.1.326, where teammates run in Code Mode in the default in process display mode and start without it in split panesCLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude; Ctrl+O shows the code as collapsed Code rowsDocs ↗
Dispatch to backgroundintermediateStart a background session from the shell, or detach the current oneclaude --bg "task", /background, /forkDocs ↗
Agent view keysadvancedSpace peek, Enter/Right attach, Ctrl+T pin, Ctrl+X stop (twice to delete), Ctrl+S group by state/directory, Alt+1..9 attach, ? helpin agent viewDocs ↗
Agent view restore cleared textadvancedsince 2.1.323In the dispatch input, brings back the text you last cleared, or removed with Ctrl+K, Ctrl+U or Ctrl+W; the text is gone once agent view exitsCtrl+YDocs ↗
Agent view filtersintermediatesince `n:` 2.1.287Start the dispatch input with a filter to narrow the list as you type: a:<name> (named agent), s:<state> (such as s:working or s:blocked), n:<text> (session name or first prompt), o:<text> (result text), a PR number such as #1234, or a URL. Start with a:, s:, n: or o: and add more, separated by spaces, to match all of them.s:blocked a:reviewerDocs ↗
Agent view find and jumpintermediatesince 2.1.288Ctrl+F finds sessions by name with the n: filter, and Alt+Up / Alt+Down jump to the previous or next group header. Both can be rebound in keybindings.json through the Agents context.in agent viewDocs ↗
Background session isolationadvancedA background session moves to a worktree before editing filesautomaticDocs ↗
Turn off agent viewadvanceddisableAgentView setting or CLAUDE_CODE_DISABLE_AGENT_VIEWsettingsDocs ↗
/loopintermediatesince changelog 2.1.71Repeat a prompt on an interval (minimum 1 minute); omit the interval and Claude self paces 1 min to 1 hour; custom default prompt in loop.md; Esc stops/loop 5m check if the deploy finishedDocs ↗
One time remindersintermediateDescribe a one shot task in natural language; it deletes itself after running"remind me at 3pm to ..."Docs ↗
Session scoped schedule limitsadvancedFires only while the session is open and idle; recurring tasks expire after 7 days; CLAUDE_CODE_DISABLE_CRON=1 turns it offDocs ↗
Compare scheduling optionsintermediateCloud tasks (no machine needed, 1 hour minimum), Desktop tasks (local files, 1 minute), /loop (open session, 1 minute)/schedule for cloudDocs ↗
/goalintermediatesince changelog 2.1.139Keep going across turns until a condition holds; a Stop hook evaluator (Haiku by default) judges it each turn; works with -p/goal all tests in test/auth pass and lint is clean; /goal clearDocs ↗
Run Claude on a scheduleintermediatePick cloud, desktop or /loopsee pageDocs ↗
Common workflows (from the docs)Understand a new codebase, Fix a bug, Refactor, Tests and 13 more17 features
FeatureWhat it doesHowDocs
Understand a new codebasebeginnerAsk for an overview, architecture, key filesgive me an overview of this codebaseDocs ↗
Fix a bugbeginnerPaste the error, ask for causes, apply the fixI'm seeing an error when I run npm testDocs ↗
RefactorbeginnerFind legacy patterns, refactor in small steps, run testsrefactor utils.js to use ES2024 features while maintaining the same behaviorDocs ↗
TestsbeginnerFind untested code, scaffold, add edge cases, runfind functions in NotificationsService.swift that are not covered by testsDocs ↗
Pull requestsbeginnersince `--from-pr` changelog 2.1.27Ask Claude to summarize changes and open the PR; sessions are auto linked to the PR (claude --from-pr)create a prDocs ↗
DocumentationbeginnerFind undocumented code and generate docsadd JSDoc comments to the undocumented functions in auth.jsDocs ↗
Notes and non code foldersbeginnerRun in a markdown vault to search and reorganizeclaude in the folderDocs ↗
Resume previous conversationsbeginner--continue, --resume, /resumeclaude --continueDocs ↗
Parallel sessions with worktreesintermediatesince changelog 2.1.49Separate checkout per session, no edit collisions; needs at least one commitclaude --worktree feature-authDocs ↗
Ask Claude to use a worktreeintermediate"work in a worktree" triggers the EnterWorktree toolpromptDocs ↗
Worktree extrasadvancedCleanup prompt on exit, .worktreeinclude copies gitignored files such as .env, worktree.baseRef, WorktreeCreate hook replaces creation; add .claude/worktrees/ to .gitignoresee pageDocs ↗
Plan before editingbeginnerPlan mode first, approve, then editclaude --permission-mode planDocs ↗
Delegate research to subagentsintermediateExploration runs in a separate context and only a summary returnsuse a subagent to investigate how our auth system handles token refreshDocs ↗
Pipe Claude into scriptsintermediatestdin/stdout like any Unix toolcat build-error.txt | claude -p 'concisely explain the root cause of this build error' > output.txtDocs ↗
Use Claude as a linter or commit helperintermediateWrap -p with --allowedTools in a script or package.jsonclaude -p "..." --allowedTools "Bash(git diff *)" "Bash(git commit *)"Docs ↗
Ask about Claude Code itselfbeginnerClaude answers from the current docscan Claude Code create pull requests?Docs ↗
Prompt librarybeginnerCopy paste prompts by task and roleDocs ↗
Best practices (docs page summary)Hooks vs CLAUDE.md, Tell Claude what it cannot see, Interview first, Keep CLAUDE.md short and 7 more11 features
FeatureWhat it doesHowDocs
Hooks vs CLAUDE.mdintermediateCLAUDE.md is guidance Claude may skip; anything that must happen every time belongs in a hook, deny rule or managed settingDocs ↗
Tell Claude what it cannot seebeginnerWrite down only what it cannot learn from the repo; be specific (name the file, symptom, "fixed" criteria)Docs ↗
Interview firstbeginnerAsk Claude to interview you with multiple choice questions when the requirement is vagueDocs ↗
Keep CLAUDE.md shortintermediateEvery line is read on every task; scope rules with paths: frontmatter; put team procedures in skillsDocs ↗
Give Claude a check to runintermediateTests, typecheck or a review prompt so "done" is verifiable; a Stop hook with exit code 2 can enforce itDocs ↗
Steer the sessionbeginnerWatch the first minute, Esc when it drifts, /rewind to undo, after two failed corrections run /clear and rewrite the promptDocs ↗
Change a default only when neededintermediateUse /usage to see where cost went; pick permission mode, model and effort deliberatelyDocs ↗
Unattended runsadvancedDefine done, give a check, limit what it can touch, cap turns or spend, have a person approveDocs ↗
Script templateadvancedclaude --bare -p "..." --allowedTools "..." --permission-mode dontAsk --max-turns 20 in a loop; try on three files firstDocs ↗
Parallel sessionsintermediateclaude -w name per taskDocs ↗
What you can stop doingintermediateOld workarounds the models no longer need; "think hard" phrases are just text, effort is the controlDocs ↗

Topic 3 of 7

Configure

Settings, memory, permissions, security and models.

Settings files and keys

JSON
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "permissions": {
    "allow": [
      "Bash(npm run lint)",
      "Bash(npm run test *)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)"
    ]
  },
  "env": {
    "BASH_DEFAULT_TIMEOUT_MS": "300000"
  },
  "sandbox": {
    "enabled": true
  },
  "companyAnnouncements": [
    "Run /doctor if a setting does not seem to apply"
  ]
}
Settings: files, scopes, precedence, locationsUser settings, Shared project settings, Project local settings, Managed settings (file) and 18 more22 features
FeatureWhat it doesHowDocs
User settingsbeginnerPersonal preferences for every project on this machine~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json)Docs ↗
Shared project settingsbeginnerTeam permissions, hooks, plugins and env for one repo; commit it.claude/settings.json in the project (read from the session's primary working directory)Docs ↗
Project local settingsbeginnersince file lives at the repo root since v2.1.211Your private overrides for one project; Claude Code git excludes it when it writes the file.claude/settings.local.json. Add it to .gitignore yourself if you create it by handDocs ↗
Managed settings (file)advancedOrganization policy that user, project, local and --settings cannot overridemacOS /Library/Application Support/ClaudeCode/managed-settings.json; Linux and WSL /etc/claude-code/managed-settings.json; Windows C:\Program Files\ClaudeCode\managed-settings.json; optional managed-settings.d/*.json merged alphabeticallyDocs ↗
Managed settings (MDM/registry)advancedSame policy delivered by device managementmacOS profile domain com.anthropic.claudecode; Windows HKLM\SOFTWARE\Policies\ClaudeCode value Settings (also an HKCU form)Docs ↗
Server managed settingsadvancedPolicy fetched from the claude.ai admin console or a Claude apps gateway, polled hourlyAdmin consoleDocs ↗
Managed policy helperadvancedRun an executable that computes the managed policy at startuppolicyHelper (managed only)Docs ↗
~/.claude.jsonintermediateFile Claude Code writes itself: account, personal MCP servers, per project trust, and the "global config" keys. Do not hand edit unless needed~/.claude.json; a corrupt copy is moved to ~/.claude/backups/.claude.json.corrupted.<timestamp> and the 5 newest backups are keptDocs ↗
Move the config homeadvancedStore settings, history and plugins somewhere elseenv CLAUDE_CONFIG_DIR (write an absolute path; cannot be set from project or local settings)Docs ↗
Precedence orderbeginnerWhich value wins when a key is in several placesManaged > command line (--settings) > .claude/settings.local.json > .claude/settings.json > ~/.claude/settings.json. Env vars are not a level; decided per pair (for example ANTHROPIC_MODEL beats the model key)Docs ↗
Lists mergeintermediateArray keys such as permissions.allow combine across files instead of overridingExceptions that take the whole value from the winner: fallbackModel, modelPicker, availableModels (managed), modelSettings per modelDocs ↗
Managed exceptionsadvancedA few restrictive values are honored from lower scopes even over managed settingsdisableClaudeAiConnectors, enableArtifact:false, isolatePeerMachines, permissions.blockReadsOutsideWorkingDirectories, permissions.blockWritesOutsideWorkingDirectories, autoMode.classifyAllShell, remoteControlAtStartup:false, crossSessionInbound, useAutoModeDuringPlan:false, syncClaudeAiSkills:false, syncClaudeAiPlugins:false, maxEffortLevelDocs ↗
One session overrideintermediateTry a setting without saving itclaude --settings '{"model":"claude-opus-5-5"}' (JSON or a file path). Applies above user, project and local, below managedDocs ↗
Restrict which sources loadadvancedLoad only chosen settings scopes--setting-sources user,project,localDocs ↗
/configbeginnerOpens the Settings interface (Config tab: theme, editor mode, verbose, output style, Project instructions and more). Not every key is in the menu/config, or set directly /config verbose=true, /config thinking=false. Terminal only (VS Code panel and desktop app have their own settings)Docs ↗
/statusbeginnerShows version, model, account and the Setting sources line (which files loaded, whether managed settings apply)/statusDocs ↗
claude doctor / /doctorbeginnerclaude doctor prints read only install and settings diagnostics; /doctor runs a full checkup that proposes fixes and asks before applyingclaude doctor in a shell; /doctor in a sessionDocs ↗
Live reloadbeginnerEdits to settings files (permissions, hooks, helpers) apply to the running session; model, effortLevel and some others are read once at startEdit and save; use /model, /effort mid-sessionDocs ↗
JSON schemabeginnerAutocomplete and validation in editors"$schema": "https://json.schemastore.org/claude-code-settings.json" (can lag the newest CLI)Docs ↗
Strict JSONbeginnerComments and trailing commas are errors; a bad file shows a Settings Error dialog, a bad entry shows a Settings Warning and is skippedValid JSON onlyDocs ↗
Cloud sessionsintermediateCloud sessions read only the committed .claude/settings.json (and server managed policy), not user or local filesCommit the key to the repoDocs ↗
Example filesbeginnerRealistic personal, team and managed settings filesSee pageDocs ↗
The `.claude/` directory layoutCLAUDE.md / rules/*.md, settings.json, settings.local.json, .mcp.json, skills/<name>/SKILL.md, commands/*.md and 10 more14 features
FeatureWhat it doesHowDocs
CLAUDE.md / rules/*.mdbeginnerInstructions loaded every session / topic scoped rulesproject ./CLAUDE.md or ./.claude/CLAUDE.md; global ~/.claude/CLAUDE.md; rules/ in either .claudeDocs ↗
settings.json, settings.local.jsonbeginnerPermissions, hooks, env, model defaults; local is project only and uncommittedproject .claude/ and global ~/.claude/Docs ↗
.mcp.jsonintermediateTeam shared MCP servers (project only)repo rootDocs ↗
skills/<name>/SKILL.md, commands/*.mdintermediateReusable prompts invoked with /name; commands are the older single file form.claude/skills, ~/.claude/skillsDocs ↗
agents/*.md, workflows/*.js, agent-memory/<name>/advancedSubagents, saved dynamic workflows, per subagent persistent memory.claude/ or ~/.claude/Docs ↗
output-styles/*.mdintermediateCustom output styles.claude/output-styles, ~/.claude/output-stylesDocs ↗
themes/*.json (global only)intermediateCustom color themes~/.claude/themes/<slug>.jsonDocs ↗
keybindings.json (global only)intermediateCustom keyboard shortcuts~/.claude/keybindings.json, open with /keybindingsDocs ↗
.worktreeincludeadvancedGitignored files to copy into new worktreesrepo rootDocs ↗
projects/<project>/memory/ (global only)intermediateAuto memory: Claude's notes to itself~/.claude/projects/<project>/memory/MEMORY.md plus topic filesDocs ↗
Transcripts and historyintermediatePlaintext session transcripts for resume, deleted after cleanupPeriodDays (default 30)~/.claude/projects/<project>/<session>.jsonl, file-history/, plans/, paste-cache/, debug/, backups/, usage-data/, feedback-bundles/Docs ↗
history.jsonlintermediatePrompts you have typed, with timestamp and project path. Read by up arrow recall, Ctrl+R history search and ! shell command completion. Kept until you delete it, apart from entries older than cleanupPeriodDays that the sweep removes when the HIPAA configuration applies to your sessions.~/.claude/history.jsonlDocs ↗
Plain text warningintermediateAnything that passes through a tool (file contents, command output, pasted text) is stored unencrypted on diskTreat ~/.claude as sensitive; clear with claude purgeDocs ↗
Session scratchpadadvancedPer session temp dir Claude uses instead of /tmp, no permission promptautomaticDocs ↗
Model and responsesmodel, modelOverrides, modelSettings, effortLevel and 19 more23 features
FeatureWhat it doesHowDocs
modelbeginnerModel Claude Code starts withalias or full ID: "opus", "claude-opus-5-5". Overridden by ANTHROPIC_MODEL and --modelDocs ↗
modelOverridesadvancedMap model IDs to your provider's IDs (Bedrock ARNs)object: {"claude-opus-4-6":"arn:aws:bedrock:..."}Docs ↗
modelSettingsintermediatesince v2.1.251Saved effort level or auto compact window per model, or a per model effort cap{"claude-opus-5-5":{"effortLevel":"high"}}; /effort writes itDocs ↗
effortLevelintermediateDefault effort for models with no saved level"low", "medium", "high", "xhigh" (not max, not ultracode)Docs ↗
maxEffortLeveladvancedsince v2.1.267Cap the effort level for every model or per model"low" to "max" (max = no cap). Lowest cap from any scope winsDocs ↗
alwaysThinkingEnabledintermediateTurn extended thinking off for every session (thinking is on by default)false to turn off. No effect on Opus 5.5, Sonnet 5.5, Haiku 5.5, FableDocs ↗
showThinkingSummariesintermediateShow summaries of thinking instead of a collapsed stubBoolean; default falseDocs ↗
fastModeintermediateTurn fast mode on where availableBoolean; /fast writes itDocs ↗
fastModePerSessionOptInadvancedRequire opting in to fast mode each sessionBoolean; default falseDocs ↗
fallbackModelintermediateOrdered backup models when the primary is overloaded (max 3)array: ["claude-sonnet-5","claude-haiku-4-5"]; "default" expands. Highest-precedence file wins whole. --fallback-model overridesDocs ↗
switchModelsOnFlagadvancedSwitch models automatically or pause when a safety classifier flags a requestBoolean; unset = switch automaticallyDocs ↗
availableModelsadvancedRestrict which models people can pickarray of aliases or IDs: ["sonnet","haiku"]. Managed list wins as-isDocs ↗
availableModelsMatchadvancedsince v2.1.283Make each model ID entry in availableModels match only the version it names"prefix" (default) or exactDocs ↗
deniedModelsadvancedsince v2.1.283Block specific models even if availableModels permitsarray (managed only)Docs ↗
enforceAvailableModelsadvancedsince v2.1.175Keep the /model Default choice inside availableModelsBoolean; default falseDocs ↗
modelPickeradvancedsince v2.1.242Choose which models /model lists, in your order and labelsobject with options rows and optional replaceBuiltInOptionsDocs ↗
modelPricingadvancedsince v2.1.242Report spend at contracted rates instead of list priceobject with multiplier and overrides (managed)Docs ↗
advisorModeladvancedModel that answers when Claude calls the advisor tool"fable", "opus", "sonnet" or full ID. /advisor writes it; --advisor overridesDocs ↗
outputStylebeginnerActive output style (case sensitive: Concise, Proactive, Explanatory, Learning, or a custom name)string; /output-style writes .claude/settings.local.jsonDocs ↗
languagebeginnerLanguage Claude responds inany language name: "japanese"Docs ↗
promptCacheTtladvancedsince v2.1.242Prompt cache lifetime for the main conversation"5m" or "1h"Docs ↗
subagentPromptCacheTtladvancedsince v2.1.242Cache lifetime for subagents, workflows and helper requests"5m" or "1h"Docs ↗
ultracodeadvancedPlan a dynamic workflow for each substantive task without being askedBooleanDocs ↗
Git and attributionattribution, attribution.commit, attribution.pr, attribution.sessionUrl and 2 more6 features
FeatureWhat it doesHowDocs
attributionbeginnersince v2.1.281 (part)Customize or hide commit and PR attribution{"commit":"...","pr":"","sessionUrl":false} or falseDocs ↗
attribution.commitbeginnerCommit trailer text (default Co-Authored-By: <name> <email>)stringDocs ↗
attribution.prbeginnerPR description line (default "Generated with Claude Code")string, "" hidesDocs ↗
attribution.sessionUrlintermediateOmit the claude.ai session link from cloud/Remote Control commitsBoolean; default trueDocs ↗
includeGitInstructionsintermediateRemove built in commit/PR instructions from contextBoolean; default trueDocs ↗
prUrlTemplateadvancedPoint PR links at an internal review toolURL template with 5 placeholdersDocs ↗
Hooks, automation, plugins, skills, MCPhooks, disableAllHooks, allowManagedHooksOnly, allowedHttpHookUrls and 23 more27 features
FeatureWhat it doesHowDocs
hooksintermediateRun commands at lifecycle eventsobject keyed by event with {matcher, hooks} groupsDocs ↗
disableAllHooksadvancedsince v2.1.309Turn off hooks, custom status line and custom @ file suggestion at onceBooleanDocs ↗
allowManagedHooksOnlyadvancedsince v2.1.310Only run org deployed hooksBoolean (managed)Docs ↗
allowedHttpHookUrlsadvancedLimit URLs HTTP hooks can callarray with *Docs ↗
httpHookAllowedEnvVarsadvancedLimit env vars HTTP hooks can put in headersarray of namesDocs ↗
enableWorkflows / disableWorkflowsadvancedTurn dynamic workflows on/off (disable is for everyone)BooleanDocs ↗
workflowKeywordTriggerEnabledadvancedLet the word ultracode in a prompt start a workflowBoolean; default trueDocs ↗
workflowSizeGuidelineadvancedAgent count Claude aims for in workflows"unrestricted", "small" (<5), "medium" (<10), "large" (<50)Docs ↗
enabledPluginsintermediateTurn individual plugins on/off per scope{"name@marketplace":true}Docs ↗
extraKnownMarketplacesadvancedsince v2.1.238 (part)Register marketplaces for a repo or orgobject name to sourceDocs ↗
strictKnownMarketplacesadvancedAllowlist marketplace sourcesarray (managed)Docs ↗
blockedMarketplacesadvancedsince v2.1.223Block marketplace sourcesarray (managed)Docs ↗
strictPluginOnlyCustomization (+ .agents, .hooks, .mcp, .skills)advancedLock agents/hooks/MCP/skills to plugin and managed sourcestrue or array of kinds (managed)Docs ↗
pluginConfigsadvancedSaved answers to plugin config dialogs; also holds cc-plugin-agents-md@builtinobject (user or managed)Docs ↗
prependPlugins / appendPluginsadvancedRun org mods before/after a user's modsarray name@marketplaceDocs ↗
allowedChannelPlugins / channelsEnabledadvancedsince v2.1.267Allowlist channel plugins / allow channels for the orgmanagedDocs ↗
pluginSuggestionMarketplaces, pluginTrustMessage, disableCommandPluginSourcesadvancedsince v2.1.229 (last)Marketplace install suggestions, trust warning text, block command installed pluginsmanagedDocs ↗
disableBundledSkillsintermediateTurn off skills/workflows shipped with Claude CodeBooleanDocs ↗
skillOverridesintermediateHide or collapse a skill without editing it{"skill":"on"}: "on", "name-only", "user-invocable-only", "off"Docs ↗
disableSkillShellExecutionadvancedStop skills and commands running inline shellBooleanDocs ↗
syncClaudeAiPlugins / syncClaudeAiSkillsadvancedsince v2.1.273 (plugins)Stop loading plugins/skills enabled on your claude.ai accountfalse honored from user, local, managedDocs ↗
enableAllProjectMcpServersadvancedApprove every server in project .mcp.jsonBooleanDocs ↗
enabledMcpjsonServers / disabledMcpjsonServersintermediateApprove / reject named .mcp.json serversarray of namesDocs ↗
allowedMcpServers / deniedMcpServersadvancedAllowlist / blocklist MCP servers by name, URL or commandarrays of single-key objectsDocs ↗
allowManagedMcpServersOnlyadvancedManaged MCP allowlist is the only oneBoolean (managed)Docs ↗
managedMcpServersadvancedsince v2.1.259Provide remote MCP servers to every userobject (managed)Docs ↗
allowAllClaudeAiMcps, allowClaudeInChromeWithManagedMcp, disableClaudeAiConnectorsadvancedsince v2.1.282 (Chrome)claude.ai connector and Chrome behavior alongside managed MCPBooleanDocs ↗
Agents, sessions, worktrees, remote, desktop, notificationsagent, teammateMode, disableAgentView, crossSessionInbound and 16 more20 features
FeatureWhat it doesHowDocs
agentintermediateStart every session as a named subagentstring; --agent overridesDocs ↗
teammateModeintermediateWhere agent team teammates display"in-process", "auto", "tmux", "iterm2"Docs ↗
disableAgentViewadvancedTurn off background agents and agent viewBooleanDocs ↗
crossSessionInboundadvancedsince v2.1.224What to do with messages from your other sessions"accept", "hold", "refuse"Docs ↗
isolatePeerMachinesadvancedsince v2.1.224Ask before messaging a session on another machineBooleanDocs ↗
processWrapperadvancedsince v2.1.210Run background processes through a corporate launcher (macOS, Linux)argv-prefix string (user or managed)Docs ↗
worktreeintermediateConfigure git worktrees{baseRef, symlinkDirectories, sparsePaths, bgIsolation}Docs ↗
worktree.baseRefintermediateBranch worktrees from "fresh" (origin default) or "head"enum; default "fresh"Docs ↗
worktree.symlinkDirectoriesintermediateSymlink big dirs (node_modules) instead of copyingarrayDocs ↗
worktree.sparsePathsadvancedCheck out only the directories you needarrayDocs ↗
worktree.bgIsolationadvancedBackground session edit isolation"worktree" or "none"Docs ↗
worktree.locationadvancedWhere Desktop SSH worktrees gopath (user only)Docs ↗
remoteControlAtStartup, disableRemoteControlintermediateAuto connect Remote Control / disable it everywhereBooleanDocs ↗
remote.defaultEnvironmentIdadvancedDefault cloud environment for claude --cloudenv_... or ccpool_...Docs ↗
preferredNotifChannelbeginnerNotification method"auto", "terminal_bell", "iterm2", "iterm2_with_bell", "kitty", "ghostty", "notifications_disabled"Docs ↗
agentPushNotifEnabled, inputNeededNotifEnabledintermediatePhone push notifications (Claude decided / waiting on you)Boolean; default falseDocs ↗
awaySummaryEnabledbeginnerSession recap when you returnBooleanDocs ↗
voice / voiceEnabledbeginnersince v2.1.92 (old form)Voice dictation (/voice){"enabled":true,"mode":"hold","autoSubmit":false}; voiceEnabled is the older form (since v2.1.92)Docs ↗
disableDeepLinkRegistration, disableArtifact/enableArtifact, disableDesktopLocalSessions, sshConfigs, sshHostCommands, sshHostAllowlist, browserExternalPageTools, disableBrowserExternalNavigation, disableMobileSimulatorToolsadvancedsince Desktop v2.26454.0 (sshHostAllowlist)Deep links, Artifact tool, Desktop sessions and SSH, Browser pane and simulator limitssee each entryDocs ↗
disableRemotePreviewScriptsadvancedsince Desktop v5.1231.0Keep scripts from running in the desktop app's HTML previews of files from SSH and WSL sessions; the terminal CLI ignores ittrue (managed only; only the JSON Boolean true counts)Docs ↗
Authentication, providers, updates, privacy, enterpriseapiKeyHelper, awsAuthRefresh, awsCredentialExport, gcpAuthRefresh, otelHeadersHelper, forceLoginMethod and 13 more17 features
FeatureWhat it doesHowDocs
apiKeyHelperadvancedsince v2.1.246 (part)Generate the API credential with your commandpath or shell command; refresh via CLAUDE_CODE_API_KEY_HELPER_TTL_MSDocs ↗
awsAuthRefresh, awsCredentialExport, gcpAuthRefreshadvancedRefresh Bedrock/GCP credentials with your commandshell command lineDocs ↗
otelHeadersHelperadvancedRotating OpenTelemetry headersexecutable or commandDocs ↗
forceLoginMethodadvancedRestrict login"claudeai", "console", "gateway"Docs ↗
forceLoginOrgUUIDadvancedPin claude.ai logins to an orgUUID or array (managed enforces)Docs ↗
forceLoginGatewayUrl, gatewayInternalNetworksadvancedsince v2.1.268 (CIDRs)Gateway login URL / internal CIDRsURL / up to 4 IPv4 CIDRsDocs ↗
allowedProvidersadvancedsince v2.1.285Limit which API providers a machine may usearray of anthropic, bedrock, vertex, foundry, anthropicAws, mantle, customEndpoint (managed)Docs ↗
autoUpdatesChannelbeginnerRelease channel"latest" or "stable" (about a week old)Docs ↗
minimumVersionadvancedAuto update never installs below thisversion stringDocs ↗
requiredMinimumVersion, requiredMaximumVersionadvancedsince v2.1.163Refuse to start outside a version rangeversion string (managed)Docs ↗
cleanupPeriodDaysbeginnerDays transcripts are keptinteger 1 or more; default 30Docs ↗
desktopSessionCleanupPeriodDaysadvancedsince v2.1.248Age limit for Desktop/Cowork transcriptsinteger 0+; 0 = no limitDocs ↗
feedbackDrafts, feedbackSurveyRateintermediateClaude drafted feedback queue; survey frequency"notify"/"quiet"/"off"; 0 to 1Docs ↗
skipWebFetchPreflightadvancedSkip the WebFetch hostname check when Anthropic is unreachableBooleanDocs ↗
forceRemoteSettingsRefreshadvancedBlock startup until server managed settings are fetchedBoolean (managed)Docs ↗
managedSourcesBehavioradvancedsince v2.1.242"first-wins" (default) or "merge" managed sourcesenum (managed)Docs ↗
parentSettingsBehavior, wslInheritsWindowsSettings, disableSideloadFlags, policyHelper.*advancedsince v2.1.282 (WSL), v2.1.193 (sideload)Embedding host policy, WSL policy inheritance, reject sideload flags, helper path/timeout/refreshmanagedDocs ↗
Global config keys (`~/.claude.json` only)autoConnectIde, autoInstallIdeExtension, claudeInChromeDefaultEnabled, copyFullResponse and 6 more10 features
FeatureWhat it doesHowDocs
autoConnectIdebeginnerConnect to a running IDE from an external terminalBoolean; default false; env CLAUDE_CODE_AUTO_CONNECT_IDE overridesDocs ↗
autoInstallIdeExtensionbeginnersince install on start removed in v2.1.318 (changelog)Let /ide install the IDE extension in a running VS Code, Cursor or Devin Desktop when you run it from an external terminal; Claude Code no longer installs the extension when it startsBoolean; default true; false stops /ide installing itDocs ↗
claudeInChromeDefaultEnabledintermediatesince v2.1.287 (VS Code)Start every CLI session with Chrome integrationBoolean; /chrome sets itDocs ↗
copyFullResponsebeginner/copy copies the whole response with no pickerBoolean; default falseDocs ↗
copyOnSelectbeginnerAuto copy mouse selection in fullscreen/agent viewBoolean; default trueDocs ↗
defaultToAgentsViewintermediateclaude with no args opens agent viewBoolean; default falseDocs ↗
diffToolbeginnerWhere Edit/Write diffs show when an IDE is connected"auto" or "terminal"Docs ↗
externalEditorContextintermediateShow Claude's last reply as # comments when you press Ctrl+GBoolean; default falseDocs ↗
leftArrowOpensAgentsintermediate← on empty prompt backgrounds the session and opens agent viewBoolean; default trueDocs ↗
prStatusFooterEnabledbeginnerPR review status badge in the footerBoolean; default trueDocs ↗

Memory: CLAUDE.md, rules and auto memory

Memory and contextautoMemoryEnabled, autoMemoryDirectory, claudeMd, claudeMdExcludes and 9 more13 features
FeatureWhat it doesHowDocs
autoMemoryEnabledbeginnerTurn auto memory on or off (/memory toggle writes it)Boolean; default onDocs ↗
autoMemoryDirectoryadvancedStore auto memory in a directory you chooseabsolute or ~/ pathDocs ↗
claudeMdadvancedInject org wide CLAUDE.md text from managed settingsstring (managed only)Docs ↗
claudeMdExcludesintermediateSkip specific CLAUDE.md files (monorepos); arrays merge across layers; cannot exclude the managed onearray of globs or absolute pathsDocs ↗
autoCompactEnabledintermediateTurn automatic compaction off or onBoolean; default trueDocs ↗
autoCompactWindowintermediateHow full context gets before compactingtokens 100000 to 1000000; /autocompact 500kDocs ↗
idleCompactionadvancedsince v2.1.302Compact a long conversation you stepped away fromBoolean; default trueDocs ↗
bashOutputMaxCharsadvancedsince v2.1.261How much successful command output Claude receives inline4000+ chars; default 30,000Docs ↗
fileCheckpointingEnabledintermediateFile snapshots that /rewind restoresBoolean; default trueDocs ↗
plansDirectoryintermediateWhere plan mode writes plan filespath relative to project root; default ~/.claude/plansDocs ↗
skillListingBudgetFractionadvancedContext share reserved for the skill listing0 to 1; default 0.01Docs ↗
skillListingMaxDescCharsadvancedCap each skill description in the listingnumber; default 1536Docs ↗
envintermediateEnvironment variables for every session and subprocessobject of strings: {"DISABLE_AUTO_COMPACT":"1"}. Project/local files cannot set some (CONFIG_DIR, telemetry exporters)Docs ↗
Memory: CLAUDE.md, rules, auto memoryTwo memory systems, Managed policy CLAUDE.md, User CLAUDE.md, Project CLAUDE.md and 28 more32 features
FeatureWhat it doesHowDocs
Two memory systemsbeginnerCLAUDE.md = instructions you write; auto memory = notes Claude writes. Both load at the start of every conversation as context, not enforced configUse a hook or permission rule when something must be guaranteedDocs ↗
Managed policy CLAUDE.mdadvancedOrg wide instructions that cannot be excludedmacOS /Library/Application Support/ClaudeCode/CLAUDE.md; Linux/WSL /etc/claude-code/CLAUDE.md; Windows C:\Program Files\ClaudeCode\CLAUDE.md; or the managed claudeMd keyDocs ↗
User CLAUDE.mdbeginnerPersonal preferences for all projects~/.claude/CLAUDE.mdDocs ↗
Project CLAUDE.mdbeginnerTeam shared project instructions./CLAUDE.md or ./.claude/CLAUDE.mdDocs ↗
Local CLAUDE.mdbeginnerPrivate project preferences; add to .gitignore./CLAUDE.local.md (appended after CLAUDE.md in the same directory)Docs ↗
Load orderintermediateAll discovered files are concatenated (not overriding), from filesystem root down to the working directory, so the closest file is read lastAutomatic; check with /context (Memory files)Docs ↗
Subdirectory lazy loadingintermediateCLAUDE.md files below the working directory load on demand when Claude reads, writes or edits a file thereAutomatic; a Loaded line shows in the terminalDocs ↗
@ importsintermediatePull another file into CLAUDE.md@path/to/file, relative to the importing file, max depth 4 hops, backslash-escape spaces; skipped inside code spans and fencesDocs ↗
Import approvalintermediateFirst external import in a project shows an approval dialog; declining disables themAutomaticDocs ↗
Hidden maintainer notesintermediateBlock level HTML comments are stripped before injection (free context)<!-- note -->Docs ↗
/initbeginnerGenerate a starting CLAUDE.md from your codebase; improves an existing one/init; CLAUDE_CODE_NEW_INIT=1 makes it an interactive multi-phase flow (CLAUDE.md, skills, hooks, personal file)Docs ↗
/memorybeginnerList and open CLAUDE.md, CLAUDE.local.md and memory files; toggle auto memory; open the auto memory folder/memoryDocs ↗
/contextbeginnerShows what fills the context window, including the Memory files list/contextDocs ↗
Size guidancebeginnersince per file cap enforced from v2.1.309Target under 200 lines per file; longer files cost context and adherence. Imports do not reduce context. Files over 4 MiB are skipped. Lazy loaded files have a per file cap (40,000 characters on a 200K window)Move specifics to rules or skillsDocs ↗
Writing guidancebeginnerBe concrete and verifiable ("Use 2-space indentation"); avoid conflicts between filesEditDocs ↗
/doctor prompt-auditintermediatesince v2.1.283Claude audits your CLAUDE.md, rules, skills, commands, subagents and output styles for stale or conflicting content/doctor prompt-audit [path]Docs ↗
claudeMdExcludesintermediateSkip other teams' CLAUDE.md files in a monoreposettings array of globsDocs ↗
--add-dir memoryintermediateCLAUDE.md from extra directories is NOT loaded unless env is setCLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 claude --add-dir ../shared-configDocs ↗
Survives compactionintermediateProject root CLAUDE.md and unscoped rules are re injected from disk after /compact; nested CLAUDE.md and paths: rules reload on demandPut must-keep rules in the root fileDocs ↗
Rules directoryintermediateOne topic per markdown file, discovered recursively; no paths = loaded at launch with CLAUDE.md priority.claude/rules/*.mdDocs ↗
Path scoped rulesintermediateRules that load only when Claude touches matching filesfrontmatter paths: (YAML list or comma string); globs like src/**/*.{ts,tsx}, relative to the rule's base directory; *.md matches anywhere under it, /*.md only directly in it; brace expansion budget 1,000 patternsDocs ↗
Rule frontmatterintermediatepaths is the only field read; bad YAML = rule loads unscoped-Docs ↗
User level rulesintermediatePersonal rules for every project, loaded before project rules~/.claude/rules/*.mdDocs ↗
Rule symlinksadvancedShare rules across projects (circular links handled; links outside the project need one time approval; network paths are refused)ln -s ~/shared-claude-rules .claude/rules/sharedDocs ↗
AGENTS.mdintermediatesince v2.1.277Claude reads AGENTS.md when no CLAUDE.md or CLAUDE.local.md exists in or above the working directoryAutomatic; @AGENTS.md import or symlink keeps one file for all toolsDocs ↗
Project instructions settingintermediatesince v2.1.277 (ID renamed v2.1.285)Choose which instruction files load/config > Project instructions: claude-md-or-agents-md (default), claude-md-and-agents-md, claude-md, managed-only; stored under pluginConfigs["cc-plugin-agents-md@builtin"].options.instructionFilesDocs ↗
/import and /init migrationintermediate/init reads Cursor rules and Copilot instructions; /import [codex, gemini, cursor] copies instructions, MCP servers, commands, subagents, skills/import --dry-runDocs ↗
Auto memorybeginnerClaude saves notes (user, feedback, project, reference types) and skips what it can derive from code. On by default/memory toggle writes autoMemoryEnabled; CLAUDE_CODE_DISABLE_AUTO_MEMORY=1Docs ↗
Auto memory storageintermediatePer git repo, shared across worktrees, machine local; plain markdown you can edit; excluded from the transcript cleanup sweep~/.claude/projects/<project>/memory/MEMORY.md plus topic files; autoMemoryDirectory to relocateDocs ↗
How auto memory loadsintermediateFirst 200 lines or 25KB of MEMORY.md load every session; topic files are read on demand; not loaded into subagents (they have their own memory field)Keep MEMORY.md an indexDocs ↗
Ask Claude to rememberbeginner"always use pnpm" is saved to auto memory; "add this to CLAUDE.md" writes the fileNatural languageDocs ↗
TroubleshootingintermediateCheck /context, conflicting files, specificity; use hooks for must run; InstructionsLoaded hook logs what loaded; --append-system-prompt for system prompt level text-Docs ↗

Permissions and modes

Permission settingspermissions, permissions.allow, permissions.ask, permissions.deny and 13 more17 features
FeatureWhat it doesHowDocs
permissionsbeginnerContainer for allow/ask/deny rules and the starting modeobjectDocs ↗
permissions.allowbeginnerApprove listed tool uses without a promptarray of rules: ["Bash(npm run *)"]Docs ↗
permissions.askbeginnerAlways prompt for listed tool usesarray: ["Bash(git push *)"]Docs ↗
permissions.denybeginnerBlock listed tool uses, including reads of secretsarray: ["Read(./.env)"]Docs ↗
permissions.denyInsteadOfPromptingadvancedsince v2.1.319Deny a tool call that would wait on a permission prompt, so a session nobody is watching keeps working; also leaves out AskUserQuestion, EnterPlanMode and ExitPlanModetrue (user, managed or --settings; a repository can't set it); default unsetDocs ↗
permissions.defaultModebeginnerPermission mode new sessions start in"default" (alias manual), "acceptEdits", "plan", "auto", "dontAsk", "bypassPermissions". auto and bypassPermissions do not take effect from project or local filesDocs ↗
permissions.additionalDirectoriesintermediateExtra directories Claude may read and editarray of pathsDocs ↗
permissions.blockReadsOutsideWorkingDirectoriesadvancedsince v2.1.257File tools refuse reads outside the working directories in every modeBoolean; true from any scope is honored even over managedDocs ↗
permissions.blockWritesOutsideWorkingDirectoriesadvancedsince v2.1.314Write, Edit and NotebookEdit refuse paths outside the working directories in every permission mode, including bypassPermissions; Claude Code settings files are refused even inside them, and the EnterWorktree and ExitWorktree tools are removed or refused while it is onBoolean; true from any scope is honored even over managedDocs ↗
permissions.disableBypassPermissionsModeadvancedPrevent anyone entering bypassPermissions"disable"Docs ↗
disableAutoModeadvancedRemove auto mode from the Shift+Tab cycle (also accepted as permissions.disableAutoMode)"disable"Docs ↗
allowManagedPermissionRulesOnlyadvancedManaged settings are the only source of permission rulesBoolean (managed)Docs ↗
autoModeadvancedAdd your own environment, allow, soft_deny and hard_deny prose rules to the auto mode classifierobject of arrays; "$defaults" keeps built-insDocs ↗
autoMode.classifyAllShelladvancedsince v2.1.193Suspend your Bash and PowerShell allow rules while auto mode is active, so the classifier reviews every shell commandBoolean; default falseDocs ↗
useAutoModeDuringPlanadvancedLet the classifier review shell commands in plan modeBoolean; default trueDocs ↗
skipAutoPermissionPromptadvancedSkip the one time notice when you enter auto mode yourselfBooleanDocs ↗
skipDangerousModePermissionPromptadvancedSkip the confirmation dialog before bypassPermissions (Claude sets it to true when you accept)Boolean (user, local or managed)Docs ↗
PermissionsPermission tiers, Comment on a prompt, /permissions, Evaluation order and 31 more35 features
FeatureWhat it doesHowDocs
Permission tiersbeginnerReads are free; Bash, file edits, WebFetch and WebSearch ask (built in read only command set and preapproved doc domains excepted)Automatic. "Yes, and don't ask again" saves a rule: Bash and WebFetch permanently per repo to .claude/settings.local.json; file edits last until session endDocs ↗
Comment on a promptintermediatesince fix v2.1.235Attach a note when you approve or denyPress Tab on Yes/No, type, EnterDocs ↗
/permissionsbeginnersince mid turn since v2.1.234Interactive dialog: rules by scope and source file, add/remove, working directories, recent auto mode denials (the Recently blocked tab); applies mid turn/permissionsDocs ↗
Evaluation orderbeginnerdeny, then ask, then allow; first match wins; specificity does not change it; an allow cannot carve an exception out of a denyRules in permissions.deny/ask/allowDocs ↗
Bare tool denyintermediateA deny rule with just the tool name removes the tool from Claude's context entirely"deny": ["Bash"]Docs ↗
Rule syntaxbeginnerTool or Tool(specifier); parentheses inside are literalBash, Bash(npm run build), Read(./.env), WebFetch(domain:example.com)Docs ↗
Bash wildcardsbeginner* matches any text incl. spaces; trailing * (space then star) also matches the bare command; :* is an equal suffix formBash(npm run *), Bash(git commit *). Put the * after the subcommand: Bash(git * main) warnsDocs ↗
Compound commandsintermediateEvery subcommand (&&, ||, ;, |, &, newline) must be allowed; deny/ask apply to any subcommand, even inside $() or loopsBash(safe-cmd *) does not allow safe-cmd && otherDocs ↗
Wrapper strippingadvancedtimeout, time, nice, nohup, stdbuf, command, builtin, noglob, bare xargs and known safe env assignments are stripped before matching. npx, docker exec, devbox run are notWrite full rule: Bash(devbox run npm test)Docs ↗
What Bash rules do not matchintermediate/usr/bin/curl, sh -c '...', git -C . push bypass Bash(curl *)/Bash(git push *); it is not a security boundaryPair with the sandbox or a PreToolUse hookDocs ↗
Read only commandsbeginnerls, cat, echo, pwd, head, tail, grep, find, wc, which, diff, stat, du, cd, read only git run without a prompt; set not configurable (add ask/deny to change)-Docs ↗
Redirections and teeadvancedsince input redirects v2.1.257; `tee` v2.1.269Output/input redirect targets and tee files are checked against Edit/Read rulesautomaticDocs ↗
Param matchingadvancedDeny/ask by input parameter on built in toolsAgent(model:opus), Agent(isolation:worktree), Bash(run_in_background:true) (not the primary content field)Docs ↗
Tool name globsadvancedDeny/ask accept globs; allow accepts them only after a literal mcp__<server>__"deny": ["mcp__*"], allow mcp__puppeteer__*Docs ↗
PowerShell rulesintermediateSame shape, aliases canonicalized, case insensitivePowerShell(Get-ChildItem *), PowerShell(Remove-Item *)Docs ↗
Read/Edit rulesbeginnersince Read deny covers Write tool v2.1.228; pasted image paths v2.1.290gitignore style path patterns. Edit covers all built in edit tools; Read(path) deny rules are best effort for Grep, Glob, @ mentions and IDE context. Write(...), NotebookEdit(...), Glob(...) and Grep(...) path rules never match; use Edit(...)/Read(...)Read(./.env), Read(./secrets/**), Edit(/src/**/*.ts)Docs ↗
Path anchorsintermediate//path = absolute; ~/path = home; /path = relative to the settings source (project root in project files, ~/.claude in user settings); ./path = cwdRead(//Users/alice/secrets/**)Docs ↗
Depth rulesadvancedBare filenames match at any depth; src/** as allow = only <cwd>/src, as deny/ask = any depth-Docs ↗
! negationadvancedCarve paths out of earlier deny/ask rules from the same sourceRead(*.env) then Read(!sample.env)Docs ↗
Symlinksadvancedsince real path deny v2.1.268Allow needs both requested path and target to match; deny matches eitherautomaticDocs ↗
Network pathsadvancedsince v2.1.292Reads from UNC//net paths always prompt (no allow rule, hook or auto mode skips it)automaticDocs ↗
.claudeignorebeginnerHas no effect; move entries into Read deny rules-Docs ↗
WebFetch rulesintermediatesince wildcards v2.1.172; sandbox bare `*` v2.1.186Match the hostname, case insensitive; *.example.com covers subdomains but not the apex; bare WebFetch allow/deny differs from WebFetch(domain:*) (only the latter changes the sandbox allowlist)WebFetch(domain:docs.python.org)Docs ↗
MCP rulesintermediatemcp__<server> or mcp__<server>__* = whole server; mcp__<server>__<tool> = one tool. Spaces and dots in names become _; plugin servers are mcp__plugin_<plugin>_<server>__*; claude.ai connectors are mcp__claude_ai_<server>__<tool>mcp__puppeteer__puppeteer_navigateDocs ↗
Subagent rulesintermediateControl which subagents Claude may useAgent(Explore), Agent(Plan), Agent(my-agent) in denyDocs ↗
Cd rulesadvancedRestrict where /cd can move the session (a bare Cd deny disables /cd; any allow switches to allowlist mode)Cd(~/code/**)Docs ↗
Working directoriesbeginnersince `/add-dir` of a subdirectory loads its skills v2.1.257Claude can access the launch dir; extend with --add-dir <path>, /add-dir, or additionalDirectories. Settings listed dirs grant file access only (no skills, agents, hooks)claude --add-dir ../libDocs ↗
/cdintermediatesince settings applied v2.1.246Move the session to another primary directory, keeping the conversation; applies the new directory's settings, hooks, MCP servers and asks for trust/cd <path>Docs ↗
blockReadsOutsideWorkingDirectoriesadvancedsince v2.1.257File tools refuse outside reads in every mode; auto mode offers to turn it onsettingDocs ↗
Hooks and permissionsadvancedPreToolUse hooks run before the prompt and can deny, ask or allow; a hook allow cannot override a deny or ask rule; a hook that exits 2 blocks even when an allow rule matchesPreToolUse hookDocs ↗
Plan mode and hooksadvancedIn plan mode a hook allow has no effect on non read only calls (except ExitPlanMode)-Docs ↗
Workspace trustintermediatepermissions.allow and additionalDirectories in a committed .claude/settings.json apply only after you accept the trust dialog; deny/ask apply at once; -p/SDK never show the dialogAccept the dialog; manual: projects["<path>"].hasTrustDialogAccepted in ~/.claude.jsonDocs ↗
Local file trustadvanced.claude/settings.local.json allow rules skip trust unless the file is tracked by git or .claude is a symlink-Docs ↗
What runs before trustadvancedTable of repo content used in untrusted folders and for claude -p (hooks, env, helpers run; .mcp.json asks)--setting-sources user, --bare, --settings '{"disableAllHooks": true}' for untrusted reposDocs ↗
Managed lock inadvancedManaged settings cannot be overridden by any level; a deny at any level beats allow elsewhere; --allowedTools cannot beat a managed denyallowManagedPermissionRulesOnly, permissions.disableBypassPermissionsMode, disableAutoModeDocs ↗
Permission modesdefault (Manual), acceptEdits, plan, auto and 9 more13 features
FeatureWhat it doesHowDocs
default (Manual)beginnerReads only without asking--permission-mode default (alias manual)Docs ↗
acceptEditsbeginnerAlso file edits and mkdir, touch, mv, cp in the working directories--permission-mode acceptEditsDocs ↗
planbeginnerExplore and propose; blocks edits until you approve a plan--permission-mode plan; plansDirectoryDocs ↗
autointermediatesince built in default v2.1.283A background classifier model reviews actions instead of you; built in starting mode for interactive terminal and VS Code sessions--permission-mode auto; set defaultMode:"auto" only in user or managed settingsDocs ↗
dontAskadvancedAuto denies anything that would prompt; runs reads and pre approved tools; for CIclaude -p "..." --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read"Docs ↗
bypassPermissionsadvancedsince not from project files v2.1.257Skips prompts, even for protected paths; use only in containers or VMs. Refused for root/sudo on Linux/macOS; cannot be entered mid session unless enabled at launch--dangerously-skip-permissions, --permission-mode bypassPermissions, --allow-dangerously-skip-permissions (adds it to the cycle without activating)Docs ↗
Switch mode in sessionbeginnersince prompt option v2.1.247Cycle modesShift+Tab (auto, default, acceptEdits, plan; optional modes slot after plan). Prompt option "Yes, and switch to auto mode"Docs ↗
Which mode a session starts inintermediateOrder: --permission-mode flag, then permissions.defaultMode, then built in default (auto where available, default for -p/SDK/HIPAA)-Docs ↗
Actions no mode approvesadvancedExplicit ask rules, AskUserQuestion, MCP tools marked requiresUserInteraction, critical path rm/rmdir, cross session messaging safeguards, outside directory reads when the block is on-Docs ↗
Protected pathsadvancedWrites never auto approved (except in bypass mode): .git, .vscode, .idea, .husky, .cargo, .devcontainer, .yarn, .mvn, .claude (some exceptions), .gitconfig, shell rc files, .npmrc, .mcp.json, .claude.json and more. Allow rules in settings do not pre approve them-Docs ↗
Critical path removalsadvancedrm -rf / and ~ style removals always prompt or are denied; classifier does not review themenv switches in section 3dDocs ↗
Configure auto modeadvancedsince v2.1.228 (setup, Pro/Max/Ultra/Team)Tell the classifier what infrastructure you trustautoMode.environment/allow/soft_deny/hard_deny with "$defaults"; /auto-mode-setup drafts entriesDocs ↗
claude auto-mode CLIadvancedInspect and reset the classifier configclaude auto-mode defaults [--label ...], config, critique, reset (verified locally)Docs ↗

Sandbox, security and privacy

JSON
{
  "sandbox": {
    "enabled": true,
    "autoAllowBashIfSandboxed": true,
    "excludedCommands": ["docker *"],
    "filesystem": {
      "allowWrite": ["/tmp/build", "~/.kube"],
      "denyRead": ["~/.aws/credentials"]
    },
    "network": {
      "allowedDomains": ["github.com", "*.npmjs.org"],
      "deniedDomains": ["uploads.github.com"],
      "allowLocalBinding": true
    },
    "credentials": {
      "files": [
        { "path": "~/.aws/credentials", "mode": "deny" }
      ],
      "envVars": [
        { "name": "NPM_TOKEN", "mode": "deny" }
      ]
    }
  }
}
Sandbox settingssandbox, sandbox.enabled, sandbox.failIfUnavailable, sandbox.autoAllowBashIfSandboxed and 34 more38 features
FeatureWhat it doesHowDocs
sandboxintermediateIsolate Bash/PowerShell/Monitor commands from your filesystem and network (macOS, Linux, WSL2)object; off by defaultDocs ↗
sandbox.enabledintermediateTurn the sandbox onBoolean; default falseDocs ↗
sandbox.failIfUnavailableadvancedExit at startup if the sandbox cannot start (default is to run unsandboxed)BooleanDocs ↗
sandbox.autoAllowBashIfSandboxedintermediatesince v2.1.324 (default became `false`)Run sandboxed commands without a prompt (auto allow mode); a bare Bash ask rule is skipped, while deny rules and content scoped ask rules still applyBoolean; default false (was true before v2.1.324); to turn it on in managed settings, set it to true in the highest ranked managed sourceDocs ↗
sandbox.allowUnsandboxedCommandsadvancedsince v2.1.285 (project `true` no longer beats user `false`)Let Claude retry a blocked command outside the sandbox; false = strict sandbox modeBoolean; default trueDocs ↗
sandbox.excludedCommandsintermediateCommands that run outside the sandboxarray of patterns: ["docker *"]Docs ↗
sandbox.filesystemintermediateContainer for path rulesobjectDocs ↗
sandbox.filesystem.allowWriteintermediateExtra writable pathsarray: ["/tmp/build","~/.kube"] (prefixes: / absolute, ~/ home, ./ project root in project settings)Docs ↗
sandbox.filesystem.denyWriteadvancedBlock writes to pathsarray of pathsDocs ↗
sandbox.filesystem.denyReadadvancedBlock reads of pathsarray: ["~/.aws/credentials"]; narrower allow re-opens inside a denyDocs ↗
sandbox.filesystem.allowReadadvancedRe open reading inside a denyRead regionarrayDocs ↗
sandbox.filesystem.allowManagedReadPathsOnlyadvancedStop developers re opening read paths your org blockedBoolean (managed)Docs ↗
sandbox.filesystem.disabledadvancedTurn off filesystem isolation but keep network isolationBoolean (user or managed)Docs ↗
sandbox.networkintermediateContainer for host, port and socket rulesobjectDocs ↗
sandbox.network.allowedDomainsintermediatesince v2.1.229 (port form)Pre allow domains so commands do not promptarray of domains, wildcards, IP literals, optional :port: ["github.com","*.npmjs.org"]Docs ↗
sandbox.network.deniedDomainsadvancedBlock domains even inside an allowed wildcardarrayDocs ↗
sandbox.network.strictAllowlistadvancedsince v2.1.219Deny hosts outside the allowlist instead of promptingBoolean (user, managed, --settings)Docs ↗
sandbox.network.allowManagedDomainsOnlyadvancedLock the allowlist to managed settingsBoolean (managed)Docs ↗
sandbox.network.allowLocalBindingintermediateLet commands listen on ports and reach localhost (macOS)BooleanDocs ↗
sandbox.network.allowUnixSocketsadvancedUnix socket paths commands can use (macOS)array of pathsDocs ↗
sandbox.network.allowAllUnixSocketsadvancedAllow every Unix socketBoolean; default falseDocs ↗
sandbox.network.allowMachLookupadvancedLet macOS tools (iOS Simulator, Playwright) reach XPC servicesarray of service namesDocs ↗
sandbox.network.httpProxyPortadvancedUse your own HTTP proxy portnumberDocs ↗
sandbox.network.socksProxyPortadvancedUse your own SOCKS proxy portnumberDocs ↗
sandbox.network.tlsTerminateadvancedExperimental: proxy terminates TLS (needed for mask credentials)object with caCertPath, caKeyPathDocs ↗
sandbox.credentialsadvancedHide or mask credential files and variables inside the sandboxobjectDocs ↗
sandbox.credentials.filesadvancedsince v2.1.221Block or mask credential filesarray: {"path":"~/.aws/credentials","mode":"deny"}; mask needs injectHostsDocs ↗
sandbox.credentials.envVarsadvancedsince v2.1.224Unset or mask an environment variablearray: {"name":"NPM_TOKEN","mode":"deny"}Docs ↗
sandbox.credentials.awsPairsadvancedsince v2.1.224Link custom named AWS key variables for re signingarrayDocs ↗
sandbox.credentials.sigv4advancedsince v2.1.224Fail or pass through streaming, presigned or SigV4A AWS requestsobject streaming/presigned/sigv4a: "deny" or "passthrough"Docs ↗
sandbox.credentials.allowPlaintextInjectadvancedLet masked credentials reach plain HTTP on trusted test networksBooleanDocs ↗
sandbox.allowAppleEventsadvancedLet sandboxed commands send Apple Events (macOS)Boolean; removes code-execution isolationDocs ↗
sandbox.allowNestedUserNamespacesadvancedsince v2.1.305Let commands create user namespaces (Linux, WSL2); turns off a security boundaryBooleanDocs ↗
sandbox.enableWeakerNestedSandboxadvancedRun the Linux sandbox inside an unprivileged container (weaker)BooleanDocs ↗
sandbox.enableWeakerNetworkIsolationadvancedLet gh, gcloud, terraform verify TLS behind a MITM proxy on macOSBooleanDocs ↗
sandbox.ignoreViolationsadvancedSilence violation reports for expected probesobject: command substring to path substringsDocs ↗
sandbox.ripgrepadvancedUse your own ripgrep inside the sandboxobject command, args (user or managed)Docs ↗
sandbox.bwrapPath / sandbox.socatPathadvancedPoint at bubblewrap / socat outside PATHabsolute path (managed)Docs ↗
Security, privacy and isolationPermission based architecture, Built in protections, Prompt injection safeguards, Trust verification and 30 more34 features
FeatureWhat it doesHowDocs
Permission based architecturebeginnerAuto mode (classifier) or Manual mode (read only until you approve); fail closed matching; command injection detection asks before running commands it cannot analyzeDefault behaviorDocs ↗
Built in protectionsbeginnerSandboxed bash, working directory boundary prompts, prompt fatigue mitigation via allowlists, Accept Edits mode-Docs ↗
Prompt injection safeguardsbeginnerNetwork commands (curl, wget) are not auto approved; WebFetch answers come from a separate model call, not the raw page; pasted text is marked as pasted so Claude follows instructions in it only where your typed message asksReview commands; avoid piping untrusted contentDocs ↗
Trust verificationbeginnerWorkspace trust dialog on first start in a folder; .mcp.json servers have their own approval; trust in your home directory is session onlyAccept the dialog deliberatelyDocs ↗
Windows WebDAV warningadvancedDo not enable WebDAV or let Claude touch \\* paths (can bypass permissions)-Docs ↗
Credential storageintermediatemacOS Keychain; Linux file mode 0600; Windows file in your profile-Docs ↗
MCP securityintermediateWrite or trust your MCP servers; project servers are in .mcp.json; restrict with allowedMcpServers/deniedMcpServers/managed-mcp.json-Docs ↗
--dangerously-skip-permissions riskbeginnerNo protection against prompt injection or accidents; dev containers do not stop a malicious repo from exfiltrating ~/.claude credentialsUse only in isolated containers/VMs without sensitive mountsDocs ↗
Sandbox (what it is)intermediateOS enforced boundary (Seatbelt on macOS; bubblewrap + socat on Linux/WSL2; none on native Windows) around Bash/PowerShell/Monitor commands and children. Built on @anthropic-ai/sandbox-runtime. Off by default/sandbox or sandbox.enabled: trueDocs ↗
Sandbox defaultsintermediateWrites: working dir, per user temp dir, added dirs. Reads: most of the machine. Network: through a local proxy checking an initially empty allowlist-Docs ↗
What the sandbox does NOT coveradvancedRead/Edit/Write/WebFetch/WebSearch tools, MCP servers, hooks, status line and apiKeyHelper, your own ! commands (mostly), excluded commands and unsandboxed retries. Put Claude Code itself in a container/VM for those-Docs ↗
Linux/WSL2 setupintermediateInstall dependenciessudo apt-get install bubblewrap socat (or dnf); optional seccomp filter blocks Unix socketsDocs ↗
Ubuntu AppArmor checkintermediatesince v2.1.310From v2.1.310 Claude Code checks at startup for Ubuntu's AppArmor restriction on user namespaces, which stops bubblewrap, and /sandbox reports it. Lift it with an AppArmor profile for /usr/bin/bwrap, or with a sysctl that applies to every program until reboot. Until then commands run unsandboxed, or Claude Code refuses to start if sandbox.failIfUnavailable is truesudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0Docs ↗
Sandbox modesintermediateAuto allow: sandboxed commands run without prompts. Regular permissions: normal prompts even when sandboxed. Saved to .claude/settings.local.json/sandbox Mode tabDocs ↗
Unsandboxed retryadvancedClaude may retry a failed command with dangerouslyDisableSandbox; who approves depends on mode; add Bash(dangerouslyDisableSandbox:true) to ask to be promptedStrict mode: allowUnsandboxedCommands:falseDocs ↗
Confirm it worksintermediateAsk Claude to run touch ~/sandbox-probe (should fail) and curl --noproxy '*' https://example.com (should not resolve)-Docs ↗
Filesystem isolationintermediateWrites limited; protected config paths stay write denied even inside allowed dirs; denyRead/allowRead use the narrowest path rulesandbox.filesystem.*; path prefixes /, ~/, ./Docs ↗
Network isolationintermediateSeparate network namespace (Linux) or Seatbelt proxy only (macOS); first new domain prompts; TCP via proxy only (ssh, DB drivers, UDP, ICMP fail)sandbox.network.*Docs ↗
Credential protectionadvancedsince v2.1.221+Hide credential files and env vars; optional mask with proxy substitution (Linux/WSL2)sandbox.credentials.*; env CLAUDE_CODE_SUBPROCESS_ENV_SCRUBDocs ↗
Enforce for an orgadvancedManaged settings with failIfUnavailable, allowUnsandboxedCommands:false, allowManagedDomainsOnly make the sandbox admin required; repo settings that loosen it are ignoredmanaged sandbox blockDocs ↗
Permissions plus sandboxadvancedComplementary layers; sandbox paths and domains merge with permission rules; with autoAllowBashIfSandboxed set to true, a bare Bash ask rule is skipped for sandboxed commands (not in plan mode)-Docs ↗
Sandbox limitationsadvancedDomain fronting risk with broad domains (github.com), Unix socket escalation (docker.sock), weaker nested mode, Apple EventsReview allowlistsDocs ↗
Sandbox environment comparisonadvancedCompare dev containers, custom containers, VMspageDocs ↗
Dev containersadvancedRun Claude Code inside a container with the Dev Container Feature; persist auth with a named volume at ~/.claude plus CLAUDE_CONFIG_DIR; bake policy in /etc/claude-code/managed-settings.json; reference container has a firewall scriptghcr.io/anthropics/devcontainer-features/claude-code:1.0Docs ↗
Data training policybeginnerConsumer (Free/Pro/Max/Ultra): your choice; Commercial (Team/Enterprise/API/3rd-party): no training on Claude Code data unless you opt in (Development Partner Program)claude.ai/settings/data-privacy-controlsDocs ↗
RetentionbeginnerConsumer: 5 years if training allowed, 30 days if not; Commercial: 30 days standard, zero data retention for qualified Enterprise accounts; local transcripts 30 days by defaultcleanupPeriodDaysDocs ↗
/feedback, /bug, /sharebeginnerSends your conversation (with consent step); transcripts retained 5 yearsDISABLE_FEEDBACK_COMMAND=1 to disableDocs ↗
Session surveysbeginnerRating records only the score; separate opt in for transcript uploadCLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1, feedbackSurveyRateDocs ↗
Telemetrybeginnersince error reporting v2.1.198+Metrics (no code, prompts or paths) and error reports (secrets redacted). Opt out per kind or all at onceDISABLE_TELEMETRY=1, DISABLE_ERROR_REPORTING=1, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1Docs ↗
Zero data retentionadvancedPer organization ZDR for qualified Enterprise accountspageDocs ↗
/security-reviewbeginnerSecurity pass over the current branch's diff vs origin's default branch/security-reviewDocs ↗
Reporting vulnerabilitiesbeginnerReport through Anthropic's HackerOne program, not publicly-Docs ↗
Audit settings changesadvancedBlock or log settings changes during sessionsConfigChange hookDocs ↗
Best practicesbeginnerReview changes, project specific permission settings, sandbox/dev container for extra isolation, audit with /permissions, managed settings and OpenTelemetry for teams-Docs ↗

Terminal, themes and the status line

Shell
#!/bin/bash
# Save as ~/.claude/statusline.sh, then: chmod +x ~/.claude/statusline.sh
# Claude Code sends session JSON on stdin and prints whatever this script prints.
# Fields used here (all documented): model.display_name, workspace.current_dir,
# context_window.used_percentage, cost.total_cost_usd, effort.level,
# rate_limits.five_hour.used_percentage (only for Pro/Max after the first reply).
input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
EFFORT=$(echo "$input" | jq -r '.effort.level // empty')
FIVE=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')

# 10-character progress bar for context usage
BAR_WIDTH=10
FILLED=$((PCT * BAR_WIDTH / 100))
EMPTY=$((BAR_WIDTH - FILLED))
BAR=""
[ "$FILLED" -gt 0 ] && printf -v FILL "%${FILLED}s" && BAR="${FILL// /▓}"
[ "$EMPTY" -gt 0 ] && printf -v PAD "%${EMPTY}s" && BAR="${BAR}${PAD// /░}"

# Git branch (cheap call; cache it if your repo is huge)
BRANCH=""
if git -C "$DIR" rev-parse --git-dir > /dev/null 2>&1; then
  BRANCH=" | $(git -C "$DIR" branch --show-current 2>/dev/null)"
fi

LIMIT=""
[ -n "$FIVE" ] && LIMIT=" | 5h limit ${FIVE%.*}%"
EFF=""
[ -n "$EFFORT" ] && EFF=" | effort $EFFORT"

printf '[%s] %s %s%%%s | $%.2f%s%s\n' "$MODEL" "$BAR" "$PCT" "$BRANCH" "$COST" "$EFF" "$LIMIT"
Interface and terminaltheme, editorMode, vimInsertModeRemaps, statusLine and 31 more35 features
FeatureWhat it doesHowDocs
themebeginnerColor theme"auto", "dark", "light", "dark-daltonized", "light-daltonized", "dark-ansi", "light-ansi", "custom:<slug>". Default "dark"Docs ↗
editorModebeginnerPrompt key bindings"normal" or "vim"Docs ↗
vimInsertModeRemapsintermediateMap a two key INSERT sequence to Esc{"jj":"<Esc>"} (user or managed)Docs ↗
statusLineintermediateCustom status line below the prompt{"type":"command","command":"~/.claude/statusline.sh","padding":2,"refreshInterval":30,"hideVimModeIndicator":true}Docs ↗
fileSuggestionadvancedSupply @ file autocomplete from your own command{"type":"command","command":"~/.claude/file-suggestion.sh"} (receives {"query":"..."})Docs ↗
respectGitignoreintermediateKeep gitignored files out of the @ pickerBoolean; default trueDocs ↗
tuiintermediateTerminal renderer"default" or "fullscreen"; /tui fullscreen writes itDocs ↗
viewModeintermediateStart in default, verbose or focus view"default", "verbose", "focus" (focus needs fullscreen)Docs ↗
verbosebeginnerShow full tool output (viewMode wins)BooleanDocs ↗
autoScrollEnabledintermediateFollow new output in fullscreenBoolean; default trueDocs ↗
wheelScrollAccelerationEnabledintermediateMouse wheel acceleration in fullscreenBoolean; default trueDocs ↗
maxProseWidthintermediatesince v2.1.282Wrap prose at N columns in wide terminalsinteger 40+Docs ↗
spinnerTipsEnabledbeginnerTips under the spinnerBoolean; default trueDocs ↗
spinnerTipsOverrideintermediateAdd or replace spinner tips{"label":"Acme tip","tips":[...],"tipsFile":"...","excludeDefault":true}Docs ↗
spinnerVerbsbeginnerAdd or replace the spinner verbs{"mode":"append","verbs":["Pondering"]}Docs ↗
prefersReducedMotionbeginnerReduce spinner, shimmer and flash animationsBoolean; default falseDocs ↗
axScreenReaderintermediateScreen reader friendly plain text outputBoolean (user or managed); flag --ax-screen-reader, env CLAUDE_AX_SCREEN_READERDocs ↗
syntaxHighlightingDisabledbeginnerTurn off syntax highlighting in diffs and codeBooleanDocs ↗
timeFormatintermediatesince v2.1.257Clock style"auto", "12-hour", "24-hour", "24-hour-utc" or a strftime pattern like "%H:%M"Docs ↗
timeZoneintermediatesince v2.1.257Time zone for displayed timesIANA nameDocs ↗
terminalProgressBarEnabledbeginnerTerminal progress barBoolean; default trueDocs ↗
terminalTitleFromRenameintermediateLet /rename and --name set the tab titleBoolean; default trueDocs ↗
showTurnDurationbeginner"Cooked for" duration after each replyBoolean; default trueDocs ↗
showClearContextOnPlanAcceptintermediate"Clear context" option on the plan accept screenBoolean; default falseDocs ↗
promptSuggestionEnabledbeginnerGrayed out prompt suggestionsBoolean; default true; env CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=falseDocs ↗
emojiCompletionEnabledbeginner:shortcode: emoji suggestionsBoolean; default trueDocs ↗
spellcheckintermediatesince v2.1.235Underline misspelled words in the prompt{"enabled":true,"checker":"auto","language":"..."}Docs ↗
defaultShellintermediateShell for ! commands"bash" or "powershell"Docs ↗
respondToBashCommandsintermediateClaude responds after a ! command runsBoolean; default trueDocs ↗
bashEditDiffEnabledadvancedsince v2.1.269Record files changed during a Bash command in every modeBooleanDocs ↗
companyAnnouncementsintermediateShow announcements at startuparray of stringsDocs ↗
askUserQuestionTimeoutadvancedAuto continue an unanswered question after idle time"60s", "5m", "10m", "never" (user or managed)Docs ↗
dialogExpiryadvancedsince v2.1.224How long to wait for a Remote Control/SDK host to answer a dialog"60s", "5m", "10m", "never"; default "5m"Docs ↗
autoContinueAtUsageLimitintermediatesince v2.1.234Wait and continue after a usage limit resetsBoolean; default trueDocs ↗
footerLinksRegexesadvancedClickable badges for issue/review IDs below the inputarray of {type:"regex",pattern,url}Docs ↗
Appearance and terminalThemes, Custom themes, Syntax highlighting toggle, Status line and 26 more30 features
FeatureWhat it doesHowDocs
ThemesbeginnerBuilt in auto, dark, light, dark-daltonized, light-daltonized, dark-ansi, light-ansi plus custom; auto follows terminal background/theme, /config, or theme keyDocs ↗
Custom themesintermediatesince `effortUltra` override v2.1.239JSON files with name, base, overrides (color tokens such as claude, error, diffAdded, planMode, userMessageBackground); live reload from the folder~/.claude/themes/<slug>.json, then "theme":"custom:<slug>"; /theme > New custom theme (Ctrl+E edits)Docs ↗
Syntax highlighting togglebeginnerTurn code coloring offCtrl+T inside /theme; syntaxHighlightingDisabledDocs ↗
Status linebeginnerA bar below the prompt running any script; receives JSON on stdin; output can be multiple lines, ANSI colors and OSC 8 links/statusline <what you want> or statusLine setting; remove with /statusline deleteDocs ↗
Status line JSONintermediatesince `prompt_cache` v2.1.251; `spend_limit` v2.1.251model.id/display_name, cwd, workspace.current_dir/project_dir/added_dirs/git_worktree/repo, cost.total_cost_usd/total_duration_ms/total_api_duration_ms/total_lines_added/removed, context_window.used_percentage/remaining_percentage/context_window_size/current_usage, exceeds_200k_tokens, fast_mode, effort.level, thinking.enabled, rate_limits.five_hour/seven_day/spend_limit, prompt_cache.*, session_id, session_name, prompt_id, transcript_path, version, output_style.name, vim.mode, agent.name, pr.number/url/review_state/kind, worktree.*Read with jq -r '.model.display_name'; guard absent fields with // emptyDocs ↗
Status line refreshintermediateRuns at session start, after each assistant message, /compact, mode change, vim toggle; 300 ms debounce; optional refreshInterval (min 1 s)statusLine.refreshInterval, padding, hideVimModeIndicatorDocs ↗
Status line sizeadvancedScript output is captured, so read COLUMNS and LINES env vars, not tput-Docs ↗
Status line examplesintermediateContext progress bar, git status with colors, cost/duration, multi line, clickable links, rate limits, cached slow commands, Windows (PowerShell/Git Bash)See page; test with echo '{...}' | ./statusline.shDocs ↗
Output stylesbeginnersince switch mid session applies next message since v2.1.251Change role, tone, format for every response. Built in: Default, Proactive, Concise (v2.1.237), Explanatory, Learning/output-style [style] (v2.1.269), /config > Output style, outputStyle key (case-sensitive)Docs ↗
Custom output styleintermediateMarkdown file with frontmatter name, description, keep-coding-instructions, force-for-plugin~/.claude/output-styles/, .claude/output-styles/ (nearest wins) or managed dir; restart to pick up editsDocs ↗
Output style vs other featuresintermediateStyle = every response; CLAUDE.md = knowledge; skill = task procedure; hook = guarantee; subagent = isolated helper; --append-system-prompt = system prompt addition-Docs ↗
Multiline inputbeginnerCtrl+J or \ then Enter work everywhere; Shift+Enter native in Ghostty, Kitty, iTerm2, WezTerm, Warp, Windows Terminal 1.25 or later (kitty protocol terminals from v2.1.269); Option+Enter on macOS with Option as Meta/terminal-setup for VS Code, Cursor, Devin Desktop, old Alacritty, Zed; not available in gnome-terminal, Windows Terminal before 1.25 or JetBrainsDocs ↗
/terminal-setupbeginnerWrites the Shift+Enter binding; in Apple Terminal enables Option as Meta; in iTerm2 enables clipboard access for /copyRun in the host terminal, not inside tmuxDocs ↗
Option as Meta (macOS)beginnerNeeded for Option shortcutsApple Terminal: Profiles > Keyboard; iTerm2: Left/Right Option = "Esc+"; VS Code: terminal.integrated.macOptionIsMetaDocs ↗
NotificationsbeginnerDesktop notification by default only when Claude Code detects Ghostty, Kitty or iTerm2; bell elsewhere via setting; or a Notification hook for custom sounds. Over SSH or inside tmux, set preferredNotifChannel to your local terminal (iterm2, kitty, ghostty); inside tmux also keep allow-passthrough on, and only a visible pane notifies"preferredNotifChannel":"terminal_bell"; hook afplay /System/Library/Sounds/Glass.aiffDocs ↗
Session status in terminaladvancedsince v2.1.295Terminals implementing OSC 7501 show working/waiting/doneautomaticDocs ↗
tmuxintermediateFix Shift+Enter, notifications and progress bar~/.tmux.conf: set -g allow-passthrough on, set -g focus-events on, set -s extended-keys on, set -as terminal-features 'xterm*:extkeys'Docs ↗
Windows Backspace fixadvanced^H read as Ctrl+BackspaceCLAUDE_CODE_BS_AS_CTRL_BACKSPACE=0Docs ↗
Fullscreen renderingintermediateFlicker free alt screen renderer with mouse, virtualized scrollback, search, diff panel (research preview)/tui fullscreen (saves tui), or CLAUDE_CODE_NO_FLICKER=1; /tui default to go back; /focus viewDocs ↗
Wide terminalsintermediatesince v2.1.282Cap prose widthmaxProseWidthDocs ↗
PastingbeginnerOver 800 characters or 3 lines collapses to [Pasted text #N]; cached under ~/.claude/paste-cache/; Claude is told pasted text may hold instructions you did not writeUse a file for huge inputsDocs ↗
Vim modeintermediatesince `%` v2.1.301NORMAL/INSERT/VISUAL editing in the prompt: hjkl, w e b, 0 $ ^, gg G, f F t T ; ,, %, x, dd D dw, cc C cw, yy, p P, >> <<, J, u, ., text objects iw aw i" a" i( a( i[ a[ i{ a{, v/V. Enter still submits in INSERT (use o/O or Ctrl+J for newlines)/config > Editor mode, "editorMode":"vim", remap {"vimInsertModeRemaps":{"jj":"<Esc>"}}. The old /vim command was removed in v2.1.92Docs ↗
Editor modebeginnerNormal vs vim key bindingseditorModeDocs ↗
Open prompt in editorintermediateEdit the prompt in $VISUAL/$EDITORCtrl+G; externalEditorContext adds Claude's last reply as commentsDocs ↗
Spinner tips and verbsbeginnerHide, replace or extend the tips and verbs while Claude worksspinnerTipsEnabled:false, spinnerTipsOverride, spinnerVerbsDocs ↗
Voice dictationbeginnerSpeak prompts (hold or tap key); needs a claude.ai account and a local microphone; not on API key or cloud providers/voice [hold, tap, off]; voice setting; rebind the keyDocs ↗
Screen reader modeintermediatePlain linear text with labels (you:, claude:, tool:...), numbered menus, announced permission modesclaude --ax-screen-reader, CLAUDE_AX_SCREEN_READER=1, or "axScreenReader": true (not allowed from project settings)Docs ↗
Other accessibility optionsbeginnerScreen magnifier cursor, reduced motion, colorblind themes, terminal bellCLAUDE_CODE_ACCESSIBILITY=1, prefersReducedMotion, theme:"dark-daltonized", preferredNotifChannelDocs ↗
Prompt bar colorbeginnerPer session color/color [red, blue, green, yellow, purple, orange, pink, cyan, default]Docs ↗
KeybindingsintermediateRemap any shortcut (other agent's slice; listed for completeness)/keybindings, ~/.claude/keybindings.jsonDocs ↗

Models, effort and cost

JSON
{
  "model": "opusplan",
  "fallbackModel": ["claude-sonnet-5", "claude-haiku-4-5"],
  "modelSettings": {
    "claude-opus-5-5": { "effortLevel": "high" }
  },
  "alwaysThinkingEnabled": true,
  "showThinkingSummaries": true,
  "promptCacheTtl": "1h",
  "subagentPromptCacheTtl": "5m",
  "autoCompactWindow": 500000,
  "fastMode": false,
  "advisorModel": "opus"
}
Models, effort and costModel aliases, Alias resolution, Model setting priority, /model picker and 32 more36 features
FeatureWhat it doesHowDocs
Model aliasesbeginnerdefault (clears override), best, fable, sonnet, opus, haiku, sonnet[1m], opus[1m], opusplan/model <alias>, --model, model keyDocs ↗
Alias resolutionintermediatesince Sonnet 5.5 needs v2.1.284, Opus 5.5 v2.1.280, Haiku 5.5 v2.1.293On the Anthropic API: opus = Opus 5.5, sonnet = Sonnet 5.5, haiku = Haiku 5.5; other providers resolve to older versions (Bedrock/Vertex sonnet = 4.5, Foundry opus = 4.6)Pin with ANTHROPIC_DEFAULT_*_MODELDocs ↗
Model setting priorityintermediate1 /model in session, 2 --model, 3 ANTHROPIC_MODEL, 4 model setting, 5 ANTHROPIC_DEFAULT_MODEL-Docs ↗
/model pickerbeginnersince `s` key per sessionEnter switches and saves as default; s switches for this session only; arrows adjust effort/model, /model sonnetDocs ↗
default modelbeginnersince v2.1.280Pro, Max, Ultra, Team, Enterprise, API: Opus 5.5 (Foundry: Sonnet 4.5)-Docs ↗
opusplanintermediatesince `/model opusplan[1m]` v2.1.265Opus in plan mode, Sonnet for execution; opusplan[1m] for 1M both phases/model opusplanDocs ↗
Fallback chainsintermediatesince subagents v2.1.247Up to 3 backup models when the primary is overloaded; one turn only; also covers compaction and subagentsclaude --fallback-model sonnet,haiku, fallbackModelDocs ↗
Flagged requests in subagentsadvancedsince v2.1.318A subagent started with the Agent tool never pauses to ask about a flagged request: with Switch automatically the request re runs on the fallback model, with Ask each time the subagent fails and Claude decides what to do next; with no fallback model available it fails under either choice/config > Switch models when a message is flaggedDocs ↗
Effort levelsintermediatesince `s` per session v2.1.257low, medium, high, xhigh, max (Opus 4.6/Sonnet 4.6 stop at max without xhigh); defaults: high, but Opus 5.5/Sonnet 5.5/Haiku 5.5 medium, Opus 4.7 xhigh/effort [level, auto, status], --effort, CLAUDE_CODE_EFFORT_LEVEL, modelSettings, effortLevel; skill and subagent frontmatter effortDocs ↗
ultrathinkbeginnersince rainbow/xhigh v2.1.311; VS Code, desktop Code tab and disable variable v2.1.316Put the word in a prompt for deeper reasoning for that turn; typed in the terminal, or from v2.1.316 in VS Code or a local desktop Code tab session, it can raise the turn to xhigh, and in the terminal and VS Code the word turns rainbow when it can (not under an effort cap below xhigh, on older models, or on Bedrock, Agent Platform or a Claude apps gateway); CLAUDE_CODE_DISABLE_ULTRATHINK turns the keyword offIn promptDocs ↗
Ultracodeadvancedsince v2.1.203 flag; toggle v2.1.284Claude plans a dynamic workflow for each substantive task, at any effort/effort ultracode [on, off], --effort ultracode, ultracode keyDocs ↗
Extended thinkingintermediateThinking on by default; toggle for the sessionOption+T (macOS) or Alt+T; /config; alwaysThinkingEnabled; MAX_THINKING_TOKENS=0; cannot be turned off on Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable. Ctrl+O shows reasoningDocs ↗
Extended contextintermediate1M context: opus[1m], sonnet[1m] (native on newer models); turn off with CLAUDE_CODE_DISABLE_1M_CONTEXT=1; append [1m] to a full model name/model opus[1m]Docs ↗
Auto compactintermediateCompacts near the limit; set the trigger/autocompact 500k or auto, autoCompactWindow, CLAUDE_CODE_AUTO_COMPACT_WINDOW, CLAUDE_AUTOCOMPACT_PCT_OVERRIDE; DISABLE_AUTO_COMPACT=1Docs ↗
Check current modelbeginnerHeader and /status/statusDocs ↗
Custom model optionadvancedAdd one entry to /modelANTHROPIC_CUSTOM_MODEL_OPTION (+ _NAME, _DESCRIPTION)Docs ↗
Restrict modelsadvancedAllowlist/blocklist, org default model, effort limits, picker lineupavailableModels, deniedModels, modelPicker, maxEffortLevelDocs ↗
Fast modeintermediatesince Opus 5.5 default v2.1.280Up to 2.5x faster Opus at higher token price (Opus 5.5 $8/$40 per MTok, Opus 5 and 4.8 $10/$50); bills as usage credits on subscriptions; research preview. Deprecated on Opus 4.8 as of October 30, 2026 and removed on November 30, 2026 with no fallback, so move to Opus 5.5/fast [on, off], fastMode key, ↯ iconDocs ↗
AdvisoradvancedA second model consulted at key moments/advisor [fable, opus, sonnet, off], --advisor, advisorModelDocs ↗
/usage (/cost, /stats)beginnersince `f` fix v2.1.305; cache line v2.1.251Session cost (estimated at list price, or your contracted rates when modelPricing is set), duration, tokens per model, prompt cache line, plan usage breakdown with recommendations; press d/w for 24 h / 7 d; f applies fixes/usageDocs ↗
Token count beside spinnerbeginnerLive approximate output tokens of the current turnautomaticDocs ↗
/insightsintermediateHTML report on how you work, written to ~/.claude/usage-data/report.html/insightsDocs ↗
Usage creditsbeginnerBuy or request extra usage beyond plan limits/usage-credits (replaces /extra-usage, not in the docs command list)Docs ↗
Typical costbeginnerAbout $13 per developer per active day, $150-250 per month; below $30 per day for 90% of users (enterprise average)-Docs ↗
Rate limit sizingadvancedConsole TPM/RPM per user by team size, e.g. 1-5 users: 200k-300k TPM and 5-7 RPM; 500+ users: 10k-15k TPM and 0.25-0.35 RPM; limits are org levelConsole workspace limitsDocs ↗
Limit headroomintermediatesince v2.1.234Wait for a usage limit to reset and continue automaticallyautoContinueAtUsageLimitDocs ↗
Reduce tokensbeginner/clear between tasks, /compact [focus], smaller model for simple work, fewer MCP servers (tool definitions deferred by default), hooks that pre filter output, move rarely used instructions from CLAUDE.md to skills, lower effort, subagents for verbose work, plan mode, specific promptsSee pageDocs ↗
Agent team costadvancedAbout 7x the tokens of a standard session when teammates run in plan mode-Docs ↗
Spend limits for orgsadvancedConsole workspace spend limits and Claude Code Analytics API; modelPricing for contracted rates-Docs ↗
Prompt caching: what it isintermediateReuses unchanged prefix (system prompt, tools, CLAUDE.md, history) at lower cost; each model has its own cacheSee pageDocs ↗
Actions that invalidate the cacheadvancedSwitching models, changing effort, turning on fast mode, connecting/removing MCP servers, enabling/disabling plugins, denying an entire tool, compacting, many images, upgrading-Docs ↗
Actions that keep the cacheadvancedEditing repo files, editing CLAUDE.md mid session, changing permission mode or output style, invoking skills, /recap, rewinding-Docs ↗
Cache TTLadvancedsince v2.1.2425 minutes or 1 hour; order of control: FORCE_PROMPT_CACHING_5M, bucket env var, bucket setting, subagent cacheTtl, ENABLE_PROMPT_CACHING_1H, defaultpromptCacheTtl, subagentPromptCacheTtl, CLAUDE_CODE_PROMPT_CACHE_TTL, ENABLE_PROMPT_CACHING_1H=1Docs ↗
Disable cachingadvancedAll or per model familyDISABLE_PROMPT_CACHING=1, DISABLE_PROMPT_CACHING_{OPUS,SONNET,HAIKU,FABLE}=1Docs ↗
Check cache performanceadvancedsince v2.1.251/usage cache line and status line prompt_cache object-Docs ↗
Context window explorerintermediateWhat loads at start and what survives compactionpageDocs ↗
Providers, gateways and networkChoose a provider, Amazon Bedrock, Pin model versions, Bedrock extras and 17 more21 features
FeatureWhat it doesHowDocs
Choose a providerintermediateAnthropic API, Amazon Bedrock, Google Cloud Agent Platform (Vertex), Claude Models on Google Cloud (Anthropic managed), Microsoft Foundry, Claude Platform on AWS, Bedrock Mantlepages belowDocs ↗
Amazon BedrockadvancedRun on Bedrock with AWS credentialsexport CLAUDE_CODE_USE_BEDROCK=1, AWS_REGION=us-east-1 (region order: AWS_REGION, AWS_DEFAULT_REGION, profile region, us-east-1). /logout unavailable; WebSearch unavailableDocs ↗
Pin model versionsadvancedAliases drift; pin IDs/ARNs on every third party providerANTHROPIC_DEFAULT_OPUS_MODEL, _SONNET_, _HAIKU_, modelOverridesDocs ↗
Bedrock extrasadvancedCross region prefix, service tier, Guardrails, Mantle endpointANTHROPIC_BEDROCK_REGION_PREFIX, ANTHROPIC_BEDROCK_SERVICE_TIER, CLAUDE_CODE_USE_MANTLEDocs ↗
Google Cloud Agent Platform (Vertex)advancedRun on VertexCLAUDE_CODE_USE_VERTEX=1, CLOUD_ML_REGION=global, ANTHROPIC_VERTEX_PROJECT_ID, per-model VERTEX_REGION_CLAUDE_*Docs ↗
Microsoft FoundryadvancedRun on FoundryCLAUDE_CODE_USE_FOUNDRY=1, ANTHROPIC_FOUNDRY_RESOURCE=<name> (name only, not URL) or ANTHROPIC_FOUNDRY_BASE_URL; Entra token or API keyDocs ↗
Claude Platform on AWSadvancedAnthropic operated platform billed through AWSCLAUDE_CODE_USE_ANTHROPIC_AWS=1, ANTHROPIC_AWS_WORKSPACE_IDDocs ↗
Claude Models on Google Cloud (Anthropic managed)advancedsince v2.1.307Claude API run by Anthropic and reached through your Google Cloud project, with Google IAM and Marketplace billinggcloud auth application-default login, then CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD=1, ANTHROPIC_GOOGLE_CLOUD_PROJECT, ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID in envDocs ↗
LLM gatewayadvancedsince allowedProviders v2.1.285Route through a gateway you run; gateway credentials replace the subscription login; set base URL and tokenANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN; allowedProviders:["customEndpoint"] to lock itDocs ↗
Gateway rollout and protocoladvancedConnect, roll out, and compatibility guidepagesDocs ↗
Claude apps gatewayadvancedAnthropic built self hosted gateway with spend limits and per group managed settingsforceLoginMethod:"gateway", claude gatewayDocs ↗
ProxyintermediateStandard proxy variables (SOCKS unsupported)HTTPS_PROXY, HTTP_PROXY, NO_PROXY; lowercase worksDocs ↗
Custom CA and mTLSadvancedsince rotation reload v2.1.232Trust a CA, present a client certificate (rotation picked up on connection errors)NODE_EXTRA_CA_CERTS, CLAUDE_CODE_CERT_STORE, CLAUDE_CODE_CLIENT_CERT/KEY/KEY_PASSPHRASEDocs ↗
Looped cross certificatesadvancedsince v2.1.316Keep system cross certificates that certify each other in a loop, for servers whose private CA needs one; by default such a loop is droppedCLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP=1Docs ↗
Verify network configadvancedTest proxy and certificate setuppageDocs ↗
Network settings for background agentsadvancedPut network variables in settings env, not the shellenv blockDocs ↗
Streaming idle watchdogsadvancedDeadlines that close stalled streamsCLAUDE_STREAM_IDLE_TIMEOUT_MS and relativesDocs ↗
Network access requirementsadvancedHosts Claude Code must reachpageDocs ↗
Rate limits for 3rd party providersadvancedRaise via your cloud provider (AWS or Google Cloud support)-Docs ↗
MonitoringadvancedOpenTelemetry metrics and eventsCLAUDE_CODE_ENABLE_TELEMETRY=1 and OTEL_*Docs ↗
OTel account attributesadvancedsince v2.1.317Metrics, events and spans carry anthropic.plan, anthropic.seat_type, anthropic.provider and anthropic.custom_base_urltelemetry onDocs ↗

Environment variables

Set these in your shell before claude, or in the env block of a settings file. Each row links to the official environment variables page. The groups run from sign in and models to network, permissions, terminal, tools and telemetry. Use the search box to jump to one by name.

Env vars: Authentication, endpoints and providersANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, ANTHROPIC_CUSTOM_HEADERS and 34 more38 features
FeatureWhat it doesHowDocs
ANTHROPIC_API_KEYbeginnerAPI key sent as X-Api-Key; overrides your subscription (interactive mode asks once)Docs ↗
ANTHROPIC_AUTH_TOKENadvancedCustom Authorization: Bearer value (gateways)Docs ↗
ANTHROPIC_BASE_URLadvancedRoute requests through a proxy or gateway (changes where, not which model)Docs ↗
ANTHROPIC_CUSTOM_HEADERSadvancedExtra request headers (Name: Value)Docs ↗
ANTHROPIC_BETASadvancedExtra anthropic-beta header valuesDocs ↗
ANTHROPIC_PROFILEadvancedAnthropic profile to authenticate with (from ant auth login)Docs ↗
ANTHROPIC_ORGANIZATION_ID, ANTHROPIC_WORKSPACE_ID, ANTHROPIC_FEDERATION_RULE_IDadvancedWorkload Identity Federation IDsDocs ↗
CLAUDE_CODE_OAUTH_TOKENintermediateOAuth access token for claude.ai (from claude setup-token)Docs ↗
CLAUDE_CODE_OAUTH_REFRESH_TOKEN, CLAUDE_CODE_OAUTH_SCOPESadvancedRefresh token and its space separated scopesDocs ↗
CLAUDE_CODE_API_KEY_HELPER_TTL_MSadvancedHow often apiKeyHelper credentials refreshDocs ↗
CLAUDE_CODE_USE_BEDROCKintermediateUse Amazon BedrockDocs ↗
CLAUDE_CODE_USE_MANTLEadvancedUse the Bedrock Mantle endpointDocs ↗
CLAUDE_CODE_USE_VERTEXintermediateUse Google Cloud Agent Platform (Vertex)Docs ↗
CLAUDE_CODE_USE_FOUNDRYintermediateUse Microsoft FoundryDocs ↗
CLAUDE_CODE_USE_ANTHROPIC_AWSintermediateUse Claude Platform on AWSDocs ↗
ANTHROPIC_BEDROCK_BASE_URL, ANTHROPIC_BEDROCK_MANTLE_BASE_URLadvancedOverride Bedrock / Mantle endpointDocs ↗
ANTHROPIC_BEDROCK_REGION_PREFIXadvancedCross region inference prefix to try first (us, eu, apac, jp, au, global)Docs ↗
ANTHROPIC_BEDROCK_SERVICE_TIERadvancedBedrock service tier (default, flex, priority)Docs ↗
AWS_BEARER_TOKEN_BEDROCKintermediateBedrock API keyDocs ↗
ANTHROPIC_SMALL_FAST_MODEL_AWS_REGIONadvancedAWS region override for the Haiku class model (Bedrock, Mantle)Docs ↗
CLAUDE_CODE_SKIP_BEDROCK_AUTH, CLAUDE_CODE_SKIP_MANTLE_AUTHadvancedSkip AWS auth (gateway signs requests)Docs ↗
CLAUDE_CODE_SKIP_AWS_CRED_CACHEadvancedResolve the AWS credential chain on every requestDocs ↗
CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MSadvancedWait for the AWS default credential chainDocs ↗
CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT, CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARDadvancedGateway workarounds for Bedrock streaming content type handlingDocs ↗
CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACKadvancedDo not fall back to an older model when Bedrock/Vertex access is lostDocs ↗
CLAUDE_CODE_SKIP_MODEL_ACCESS_MEMORYadvancedDo not remember models your account cannot invokeDocs ↗
ANTHROPIC_VERTEX_BASE_URL, ANTHROPIC_VERTEX_PROJECT_IDintermediateVertex endpoint override and project IDDocs ↗
CLAUDE_CODE_SKIP_VERTEX_AUTHadvancedSkip Google auth (gateway)Docs ↗
ANTHROPIC_FOUNDRY_RESOURCE, ANTHROPIC_FOUNDRY_BASE_URLintermediateFoundry resource name / full base URLDocs ↗
ANTHROPIC_FOUNDRY_API_KEY, ANTHROPIC_FOUNDRY_AUTH_TOKENintermediateFoundry API key / Entra bearer tokenDocs ↗
CLAUDE_CODE_SKIP_FOUNDRY_AUTHadvancedSkip Azure auth (proxy injects its own)Docs ↗
ANTHROPIC_AWS_API_KEY, ANTHROPIC_AWS_BASE_URL, ANTHROPIC_AWS_WORKSPACE_IDintermediateClaude Platform on AWS key, endpoint, required workspace IDDocs ↗
CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTHadvancedSkip client side auth for Claude Platform on AWSDocs ↗
CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUDintermediateUse Claude Models on Google Cloud (Anthropic managed); requires v2.1.307Docs ↗
ANTHROPIC_GOOGLE_CLOUD_PROJECT, ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID, ANTHROPIC_GOOGLE_CLOUD_LOCATION, ANTHROPIC_GOOGLE_CLOUD_BASE_URLintermediateGoogle Cloud (Anthropic managed) project ID, workspace ID (required unless the base URL is set), location (default global) and endpoint overrideDocs ↗
CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTHadvancedSkip Google auth for Google Cloud (Anthropic managed) when a gateway attaches the credentialsDocs ↗
CLAUDE_CODE_PROVIDER_MANAGED_BY_HOSTadvancedSet by embedding hosts that manage provider routingDocs ↗
MCP_CLIENT_SECRETadvancedOAuth client secret for MCP servers needing pre configured credentialsDocs ↗
Env vars: Models, effort, thinking, context, prompt cachingANTHROPIC_MODEL, ANTHROPIC_DEFAULT_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL / _SONNET_MODEL / _HAIKU_MODEL / _FABLE_MODEL, ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU,FABLE}_MODEL_NAME and 48 more52 features
FeatureWhat it doesHowDocs
ANTHROPIC_MODELbeginnerModel setting to use (beats the model key; --model beats it)Docs ↗
ANTHROPIC_DEFAULT_MODELintermediateModel new sessions start on when no file sets modelDocs ↗
ANTHROPIC_DEFAULT_OPUS_MODEL / _SONNET_MODEL / _HAIKU_MODEL / _FABLE_MODELintermediatePin the model each alias resolves to (Opus one also drives opusplan plan phase)Docs ↗
ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU,FABLE}_MODEL_NAMEadvancedDisplay name in the /model pickerDocs ↗
ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU,FABLE}_MODEL_DESCRIPTIONadvancedDisplay description in the pickerDocs ↗
ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU,FABLE}_MODEL_SUPPORTED_CAPABILITIESadvancedCapabilities list, for example effort,thinkingDocs ↗
ANTHROPIC_CUSTOM_MODEL_OPTION (+ _NAME, _DESCRIPTION, _SUPPORTED_CAPABILITIES)advancedAdd one custom entry to /modelDocs ↗
ANTHROPIC_SMALL_FAST_MODELadvancedDeprecated: Haiku class model for background tasksDocs ↗
CLAUDE_CODE_SUBAGENT_MODELadvancedDefault model for subagents, teammates and workflow agentsDocs ↗
CLAUDE_CODE_SUBAGENT_MODEL_FORCEadvancedForce one model onto all of themDocs ↗
CLAUDE_CODE_SUBAGENT_EFFORTadvancedEffort level subagents run at when nothing else names one, instead of inheriting the session's; requires v2.1.316Docs ↗
CLAUDE_CODE_EFFORT_LEVELintermediateEffort level for supported models; beats --effort and /effort; set to auto or unset and Claude Code sends no effort level, so the API default appliesDocs ↗
CLAUDE_CODE_ALWAYS_ENABLE_EFFORTadvancedSend the effort parameter even for unrecognized model IDsDocs ↗
MAX_THINKING_TOKENSintermediateFixed thinking budget; 0 turns thinking off where allowedDocs ↗
CLAUDE_CODE_DISABLE_THINKINGadvancedOmit the thinking parameter entirelyDocs ↗
CLAUDE_CODE_DISABLE_ULTRATHINKintermediateTurn the ultrathink keyword off; requires v2.1.316Docs ↗
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKINGadvancedUse the fixed budget on Opus 4.6 / Sonnet 4.6Docs ↗
DISABLE_INTERLEAVED_THINKINGadvancedDo not send the interleaved thinking beta headerDocs ↗
CLAUDE_CODE_DISABLE_1M_CONTEXTintermediateTurn off 1M context supportDocs ↗
CLAUDE_CODE_MAX_CONTEXT_TOKENSadvancedOverride the assumed context window (gateway or custom IDs)Docs ↗
CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENTadvancedSkip proactive compaction for unknown model IDsDocs ↗
CLAUDE_CODE_MAX_OUTPUT_TOKENSintermediateMax output tokens for most requestsDocs ↗
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENSadvancedToken cap for file reads (default 25,000)Docs ↗
CLAUDE_CODE_AUTO_COMPACT_WINDOWintermediateAuto compact window 100000 to 1000000 tokensDocs ↗
CLAUDE_AUTOCOMPACT_PCT_OVERRIDEintermediatePercentage (1-100) of the window that triggers compactionDocs ↗
DISABLE_AUTO_COMPACTintermediateDisable automatic and idle compactionDocs ↗
DISABLE_COMPACTadvancedDisable all compactionDocs ↗
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENSadvancedContext size at which idle compaction appliesDocs ↗
DISABLE_PROMPT_CACHINGintermediateDisable prompt caching for all models (wins over per model)Docs ↗
DISABLE_PROMPT_CACHING_OPUS / _SONNET / _HAIKU / _FABLEadvancedDisable caching per model familyDocs ↗
ENABLE_PROMPT_CACHING_1HintermediateRequest a 1-hour cache TTL (both buckets)Docs ↗
ENABLE_PROMPT_CACHING_1H_BEDROCKadvancedDeprecated; use ENABLE_PROMPT_CACHING_1HDocs ↗
FORCE_PROMPT_CACHING_5MadvancedForce 5-minute TTL (wins over every other control)Docs ↗
CLAUDE_CODE_PROMPT_CACHE_TTLadvanced5m or 1h for the main conversationDocs ↗
CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTLadvanced5m or 1h for subagents, workflows, helpersDocs ↗
CLAUDE_CODE_AUTO_MODE_MODELadvancedModel for auto mode classifier requestsDocs ↗
CLAUDE_CODE_AUTO_MODE_SERVERadvancedWhether the server reviews auto mode actionsDocs ↗
CLAUDE_CODE_DISABLE_FAST_MODEintermediateDisable fast modeDocs ↗
CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS, CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECKadvancedFast mode availability check workarounds for blocked/intercepted networksDocs ↗
CLAUDE_CODE_DISABLE_ADVISOR_TOOLintermediateTurn off the advisor tool (settings cannot re enable)Docs ↗
CLAUDE_CODE_DISABLE_REFUSAL_FALLBACKadvancedTurn off the model switch when a safety classifier flags a requestDocs ↗
CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAPadvancedStop remapping Opus 4 / 4.1 to the current OpusDocs ↗
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASadvancedStrip pre release beta headers and fieldsDocs ↗
CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTSadvancedStop sending output_config.format (gateway compatibility)Docs ↗
CLAUDE_CODE_EXTRA_BODYadvancedJSON merged into every API request bodyDocs ↗
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMINGadvancedStream tool call inputs as generatedDocs ↗
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERYadvancedFill /model from the gateway's /v1/modelsDocs ↗
CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MSadvancedTimeout for that discovery requestDocs ↗
CLAUDE_CODE_GATEWAY_HINT_HEADERSadvancedSend gateway hint headers on custom proxiesDocs ↗
CLAUDE_CODE_ATTRIBUTION_HEADERadvanced0 omits the attribution block from the system prompt startDocs ↗
CLAUDE_CODE_SIMPLE, CLAUDE_CODE_SIMPLE_SYSTEM_PROMPTadvancedMinimal prompt with only Bash/read/edit tools; choose a shorter system promptDocs ↗
MAX_STRUCTURED_OUTPUT_RETRIESadvancedRetries when a -p --json-schema response fails validationDocs ↗
Env vars: Network, proxy, TLS, timeouts and retriesHTTPS_PROXY, HTTP_PROXY, NO_PROXY, CLAUDE_CODE_PROXY_RESOLVES_HOSTS, NODE_EXTRA_CA_CERTS and 16 more20 features
FeatureWhat it doesHowDocs
HTTPS_PROXY, HTTP_PROXYintermediateProxy servers (lowercase forms also work; SOCKS unsupported)Docs ↗
NO_PROXYintermediateHosts that bypass the proxy (* for all)Docs ↗
CLAUDE_CODE_PROXY_RESOLVES_HOSTSadvancedLet the proxy do DNSDocs ↗
NODE_EXTRA_CA_CERTSintermediateTrust a custom CA file (standard Node variable, documented on network config)Docs ↗
CLAUDE_CODE_CERT_STOREadvancedCA sources: bundled, system (default both)Docs ↗
CLAUDE_CODE_CLIENT_CERT, CLAUDE_CODE_CLIENT_KEY, CLAUDE_CODE_CLIENT_KEY_PASSPHRASEadvancedmTLS client certificate, key, passphraseDocs ↗
CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTIONadvancedStop re reading mTLS files on connection errorsDocs ↗
CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROPadvancedKeep system cross certificates that certify each other in a loop, for servers whose private CA needs one; requires v2.1.316Docs ↗
CLAUDE_CODE_GZIP_REQUEST_BODIESadvanced0 turns off gzip of request bodies (TLS inspecting proxies)Docs ↗
API_TIMEOUT_MSintermediateTime each API attempt has to return response headersDocs ↗
API_FORCE_IDLE_TIMEOUTadvancedOverride the 5-minute streaming body idle timeoutDocs ↗
CLAUDE_STREAM_IDLE_TIMEOUT_MS, CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS, CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MSadvancedStreaming watchdog deadlinesDocs ↗
CLAUDE_ENABLE_STREAM_WATCHDOG, CLAUDE_ENABLE_BYTE_WATCHDOG, CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCKadvancedForce-enable/disable the streaming idle watchdogsDocs ↗
CLAUDE_CODE_MAX_RETRIESadvancedOverride retries for failed API requestsDocs ↗
CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS, CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MSadvancedBackoff bounds for overloaded errors (defaults 500 and 32000)Docs ↗
CLAUDE_CODE_RETRY_WATCHDOG (+ _MAX_WAIT_MS, _USAGE_LIMIT_RECHECK_MS)advancedUnattended sessions wait out 429/529 and usage limitsDocs ↗
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACKadvancedNo non streaming retry after a mid stream failureDocs ↗
CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIESadvancedLimit re sends of a timed out non streaming requestDocs ↗
CLAUDE_CODE_PROPAGATE_TRACEPARENTadvancedPropagate W3C trace context to a custom proxyDocs ↗
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICintermediateAny non empty value disables nonessential network traffic (telemetry, error reports, surveys, feedback)Docs ↗
Env vars: Permissions, safety, sandbox and identityCLAUDE_CODE_RESTRICTED, CLAUDE_CODE_SAFE_MODE, CLAUDE_CODE_SUBPROCESS_ENV_SCRUB, CLAUDE_CODE_SCRIPT_CAPS and 11 more15 features
FeatureWhat it doesHowDocs
CLAUDE_CODE_RESTRICTEDadvancedStart in restricted mode (same as --restricted)Docs ↗
CLAUDE_CODE_SAFE_MODEintermediateStart in safe mode (all customizations off)Docs ↗
CLAUDE_CODE_SUBPROCESS_ENV_SCRUBadvancedStrip credentials from subprocess environments (Bash, hooks, stdio MCP); on Linux Bash subprocesses also run in an isolated PID namespace, so ps, pgrep and kill cannot see or signal host processesDocs ↗
CLAUDE_CODE_SCRIPT_CAPSadvancedJSON limit on per session script invocations when scrub is onDocs ↗
CLAUDE_CODE_MCP_ALLOWLIST_ENVadvancedSpawn stdio MCP servers with only a safe baseline environmentDocs ↗
CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONSadvancedRun dangerous rm with no prompt in bypassPermissionsDocs ↗
CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUTadvancedTurn off the auto/bypass time limit and denials on critical path removalsDocs ↗
CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPTadvancedStop reading bash -c scripts for critical path rmDocs ↗
CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPTadvancedSkip the critical path check for rm -rf "$(pwd)" style targetsDocs ↗
CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPTadvancedTurn off the mounted drive removal prompt (/Volumes/USB)Docs ↗
CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENYadvancedTurn off the PowerShell rd/rmdir/del/erase system path denyDocs ↗
CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKSadvancedNo Notification hooks for unanswered SDK permission requestsDocs ↗
CLAUDE_CODE_PERFORCE_MODEadvancedPerforce aware write protectionDocs ↗
CLAUDE_CODE_TOOL_MEMORY_LIMIT, CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDEadvancedLinux/WSL memory cap for Bash/PowerShell/Monitor commands and process kinds excluded from itDocs ↗
CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECKadvancedLet claude ultrareview skip its trust dialog checkDocs ↗
Env vars: Memory, session and project dataCLAUDE_CONFIG_DIR, CLAUDE_CODE_PROJECT_DIR_NAME, CLAUDE_CODE_AUTOMOUNT_ROOTS, CLAUDE_CODE_RESUME_HINT_COMMAND and 15 more19 features
FeatureWhat it doesHowDocs
CLAUDE_CONFIG_DIRintermediateMove the whole config directory (use absolute path)Docs ↗
CLAUDE_CODE_PROJECT_DIR_NAMEadvancedWith CLAUDE_CONFIG_DIR, choose the projects/<name> dir (v2.1.234+)Docs ↗
CLAUDE_CODE_AUTOMOUNT_ROOTSadvancedAutomount root folders to skip when Claude Code looks above the working directory for files such as CLAUDE.md, skills and .mcp.json; separate paths with : on Unix or ; on Windows, each absolute with no symlink; requires v2.1.323Docs ↗
CLAUDE_CODE_RESUME_HINT_COMMANDadvancedIn a wrapper script, the name printed in the exit hint, so a session prints mytool --resume <session-id> instead of claude --resume <session-id>; ignored in a settings file env block; requires v2.1.323Docs ↗
CLAUDE_CODE_DISABLE_AUTO_MEMORYintermediateDisable auto memoryDocs ↗
CLAUDE_CODE_DISABLE_CLAUDE_MDSintermediateNever load any CLAUDE.md (user, project, auto memory)Docs ↗
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MDintermediateLoad memory files from --add-dir directoriesDocs ↗
CLAUDE_CODE_NEW_INITintermediate/init runs the interactive multi phase flowDocs ↗
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTINGintermediateDisable file checkpointingDocs ↗
CLAUDE_CODE_SKIP_PROMPT_HISTORYadvancedSkip writing prompt history and transcriptsDocs ↗
CLAUDE_CODE_FORCE_SESSION_PERSISTENCEadvancedPersist even when launched inside another Claude sessionDocs ↗
CLAUDE_CODE_TRANSCRIPT_LOCAL_GCadvancedLimit transcript growth in long -p/SDK sessionsDocs ↗
CLAUDE_CODE_RESUME_INTERRUPTED_TURN (+ _MAX_AGE_MS, CLAUDE_CODE_RESUME_PROMPT, CLAUDE_CODE_RESUME_SHOWS_CUT_OFF_CALLS)advancedAuto continue a turn the last session ended mid wayDocs ↗
CLAUDE_CODE_TMPDIRadvancedOverride the internal temp directoryDocs ↗
CLAUDE_CODE_DISABLE_ATTACHMENTS, CLAUDE_CODE_DISABLE_FILE_MENTIONSadvancedDisable attachment processing / @ expansionDocs ↗
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONSintermediateRemove built in git instructions and the git status snapshotDocs ↗
CLAUDE_CODE_DISABLE_BUNDLED_SKILLS, CLAUDE_CODE_DISABLE_POLICY_SKILLSadvancedDisable bundled skills / system wide managed skillsDocs ↗
CLAUDE_CODE_SYNC_SKILLS (+ _INSTALL_TIMEOUT_MS, _WAIT_TIMEOUT_MS)advanced-p runs download and wait for claude.ai skillsDocs ↗
CLAUDE_CODE_SEND_FEEDBACK, CLAUDE_CODE_ENABLE_SHARE_BUNDLEadvancedClaude drafted feedback toggle / save /share locallyDocs ↗
Env vars: Terminal, display, accessibility, IDECLAUDE_CODE_NO_FLICKER, CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN, CLAUDE_CODE_FORCE_SYNC_OUTPUT, CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT and 23 more27 features
FeatureWhat it doesHowDocs
CLAUDE_CODE_NO_FLICKERintermediate1 enables fullscreen renderingDocs ↗
CLAUDE_CODE_DISABLE_ALTERNATE_SCREENintermediate1 forces the classic rendererDocs ↗
CLAUDE_CODE_FORCE_SYNC_OUTPUTadvancedForce DEC 2026 synchronized output to stop flickerDocs ↗
CLAUDE_CODE_ALT_SCREEN_FULL_REPAINTadvancedRepaint the whole screen every frame in fullscreenDocs ↗
CLAUDE_CODE_DISABLE_MOUSE, CLAUDE_CODE_DISABLE_MOUSE_CLICKSintermediateDisable mouse tracking / clicks (wheel stays) in fullscreenDocs ↗
CLAUDE_CODE_DISABLE_VIRTUAL_SCROLLadvancedRender every message in the transcriptDocs ↗
CLAUDE_CODE_SCROLL_SPEEDintermediateMouse wheel multiplier in fullscreenDocs ↗
CLAUDE_CODE_NATIVE_CURSORadvancedUse the terminal's own cursorDocs ↗
CLAUDE_CODE_ACCESSIBILITYintermediate1 keeps the native cursor visible for screen magnifiersDocs ↗
CLAUDE_AX_SCREEN_READERintermediate1 screen reader mode (flag --ax-screen-reader wins)Docs ↗
CLAUDE_AX_STARTUP_QUIET_MS, CLAUDE_AX_PREPARK_MSadvancedScreen reader startup wait and line prepark timingDocs ↗
CLAUDE_CODE_BS_AS_CTRL_BACKSPACEintermediate0 reads ^H as Backspace, 1 as Ctrl+BackspaceDocs ↗
CLAUDE_CODE_DISABLE_TERMINAL_TITLEintermediateNo automatic terminal title (also stops OSC 7501 status)Docs ↗
CLAUDE_CODE_FORCE_STRIKETHROUGH, CLAUDE_CODE_FORCE_TERMINAL_IMAGES, FORCE_HYPERLINK, CLAUDE_CODE_TMUX_TRUECOLORadvancedForce enable strikethrough, kitty images, OSC 8 links, tmux truecolor; FORCE_HYPERLINK=0 turns hyperlinks off; the changelog says false, no and off also do from v2.1.314, while the env vars page still lists them as enablingDocs ↗
CLAUDE_CODE_SYNTAX_HIGHLIGHTintermediatefalse disables diff syntax highlightingDocs ↗
CLAUDE_CODE_HIDE_CWDbeginnerHide the working directory in the startup logoDocs ↗
CLAUDE_CODE_NONBLOCKING_STDOUTadvancedNon blocking stdout so a stalled terminal cannot freeze outputDocs ↗
CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECKadvancedSend desktop notification even while you are focusedDocs ↗
CLAUDE_CODE_WARN_DISK_FREE_GIB, CLAUDE_CODE_WARN_MEMORY_FREE_GIBadvancedWarn Claude when free disk/memory drops below N GiBDocs ↗
CLAUDE_CODE_AUTO_CONNECT_IDEintermediateOverride automatic IDE connectionDocs ↗
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL, CLAUDE_CODE_IDE_SKIP_VALID_CHECK, CLAUDE_CODE_IDE_HOST_OVERRIDEadvancedIDE extension install/lockfile/host controlsDocs ↗
CLAUDE_CODE_ENABLE_CFC, CLAUDE_CODE_DISABLE_CFC_PROMPTintermediateChrome integration on/off at start; omit Chrome system prompt sectionDocs ↗
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTIONbeginnerfalse turns off prompt suggestionsDocs ↗
CLAUDE_CODE_ENABLE_AWAY_SUMMARYintermediateOverride session recap availabilityDocs ↗
CLAUDE_CODE_GIT_BASH_PATHintermediateWindows: path to Git BashDocs ↗
CLAUDE_CODE_USE_POWERSHELL_TOOL, CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY, CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHERadvancedPowerShell tool controls on WindowsDocs ↗
CLAUDE_CODE_SHELL, CLAUDE_CODE_SHELL_PREFIXadvancedChoose the shell for Bash tool commands; command prefix that wraps spawned shellsDocs ↗
Env vars: Tools, shells, MCP, agents, workflows, pluginsBASH_DEFAULT_TIMEOUT_MS, BASH_MAX_TIMEOUT_MS, CLAUDE_CODE_EXPERIMENTAL_CODE_MODE, BASH_MAX_OUTPUT_LENGTH, CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR and 38 more42 features
FeatureWhat it doesHowDocs
BASH_DEFAULT_TIMEOUT_MS, BASH_MAX_TIMEOUT_MSintermediateDefault and maximum timeout of foreground Bash/PowerShell commandsDocs ↗
CLAUDE_CODE_EXPERIMENTAL_CODE_MODEadvanced1 starts sessions in Code Mode (experimental); 0 keeps it off, and 0 in managed settings blocks it for an organization; does not count in every settings file, so a cloned project cannot turn it onDocs ↗
BASH_MAX_OUTPUT_LENGTHintermediateCharacters of bash output read back into a resultDocs ↗
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIRintermediateReturn to the original directory after each commandDocs ↗
CLAUDE_CODE_BASH_EDIT_DIFFadvanced0 off, 1 record changed file diff in every modeDocs ↗
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSintermediateRemove run_in_background and Ctrl+BDocs ↗
CLAUDE_AUTO_BACKGROUND_TASKS, CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE, CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDSadvancedAuto background long agent tasks; check in schedule (the SECONDS form was removed in v2.1.283)Docs ↗
CLAUDE_CODE_BG_TASKS_REPORT_RUNNING, CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS, CLAUDE_CODE_EXIT_AFTER_STOP_DELAYadvancedIdle status reporting and wait/exit timing for non interactive runsDocs ↗
CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF, CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP, CLAUDE_JOB_DIR, CLAUDE_SUBAGENT_BG_SHELL_MAX_MSadvancedBackground session handoff, memory pressure reaping, job dir (set by Claude); last is removed v2.1.260Docs ↗
CLAUDE_CODE_DISABLE_BG_STABLE_PATHadvancedmacOS native installer: run each background session host process from the installed binary instead of ~/.local/share/claude/ClaudeCode.app (macOS may ask for folder access again); set it in a settings env block, not your shell; v2.1.295+Docs ↗
CLAUDE_CODE_DISABLE_AGENT_VIEWadvancedTurn off background agents and agent viewDocs ↗
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSintermediateEnable agent teamsDocs ↗
CLAUDE_CODE_FORK_SUBAGENT, CLAUDE_CODE_FORWARD_SUBAGENT_TEXTadvancedFork mode; emit subagent text in stream jsonDocs ↗
CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS, CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH, CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSIONadvancedSubagent concurrency and depth limits (last removed v2.1.224)Docs ↗
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS, CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS, CLAUDE_AGENT_SDK_MCP_NO_PREFIXadvancedDisable built in subagents; skip mcp__server__ prefix for SDK serversDocs ↗
CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS, CLAUDE_CODE_STOP_HOOK_BLOCK_CAP, CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MSadvancedSubagent stall timeout; max consecutive Stop hook blocks; SessionEnd hook budgetDocs ↗
CLAUDE_CODE_DISABLE_WORKFLOWS, CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS, CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MSadvancedDisable workflows; concurrent workflow agents (1-256); first request staggerDocs ↗
CLAUDE_CODE_MAX_TURNSadvancedCap agentic turns when no explicit limitDocs ↗
CLAUDE_CODE_ENABLE_TASKS, CLAUDE_CODE_ENABLE_TODO_TOOLS, CLAUDE_CODE_TASK_LIST_IDintermediateTask tracking tools; share a task list across sessionsDocs ↗
CLAUDE_CODE_GOAL_CHECKIN_MINUTESadvancedMinutes before Claude is asked to check on a waiting goalDocs ↗
CLAUDE_CODE_DISABLE_CRONintermediateDisable session scoped scheduled tasksDocs ↗
CLAUDE_CODE_DISABLE_WEB_FETCHintermediateTurn off WebFetchDocs ↗
CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS, CLAUDE_CODE_WEBFETCH_DEADLINE_MSadvancedWebFetch cache TTL and download deadlineDocs ↗
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION, CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOURadvancedWebSearch cap and refill rateDocs ↗
CLAUDE_CODE_GLOB_HIDDEN, CLAUDE_CODE_GLOB_NO_IGNORE, CLAUDE_CODE_GLOB_TIMEOUT_SECONDSadvancedGlob dotfiles / Glob gitignore / timeout for Glob and Grep searchesDocs ↗
USE_BUILTIN_RIPGREPadvanced0 uses system rgDocs ↗
SLASH_COMMAND_TOOL_CHAR_BUDGETadvancedCharacter budget for skill metadata shown to the Skill toolDocs ↗
ENABLE_TOOL_SEARCHadvancedMCP tool search controlDocs ↗
ENABLE_CLAUDEAI_MCP_SERVERSintermediatefalse stops fetching claude.ai MCP serversDocs ↗
MAX_MCP_OUTPUT_TOKENS, CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTHintermediateMCP response token cap; MCP description length capDocs ↗
MCP_TIMEOUT, MCP_TOOL_TIMEOUT, CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT, MCP_CONNECT_TIMEOUT_MSintermediateMCP startup, tool, idle and connect timeouts (ms)Docs ↗
MCP_CONNECTION_NONBLOCKING, CLAUDE_CODE_MCP_STARTUP_WAIT_MS, MCP_SERVER_CONNECTION_BATCH_SIZE, MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZEadvancedMCP startup behavior and parallelismDocs ↗
CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS, CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUNDadvancedMove long MCP calls to background tasks / wait insteadDocs ↗
CLAUDE_CODE_CONFIG_LOCK_WAIT_MSadvancedMilliseconds that claude mcp add and other commands that add or remove a user or local MCP server keep trying for the ~/.claude.json lock; unset waits about 10 to 20 seconds, and a shorter value changes nothing (v2.1.318)Docs ↗
CLAUDE_CODE_DROP_UNAVAILABLE_DEFERRED_TOOLadvanced1 drops a deferred tool call whose tool isn't available when you resume with -p; otherwise the call stays pending and your prompt doesn't reach Claude (v2.1.319)Docs ↗
MCP_DISCOVERY_CACHE (+ _TTL_S, _MAX_STALE_S, _STRIKES)advancedMCP discovery cache controlsDocs ↗
MCP_OAUTH_CALLBACK_PORT, MCP_PROTOCOL_NEGOTIATION, MCP_SDK_GENERATIONadvancedMCP OAuth port, protocol probing, client runtime pinDocs ↗
CLAUDE_CODE_PLUGIN_CACHE_DIR, CLAUDE_CODE_PLUGIN_SEED_DIR, CLAUDE_CODE_PLUGIN_DIRS, CLAUDE_CODE_PLUGIN_DIR_WATCHadvancedPlugin root, read only seed dirs, dirs to load, reload on changeDocs ↗
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS, CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE, CLAUDE_CODE_PLUGIN_PREFER_HTTPSadvancedMarketplace clone timeout / keep checkout on failure / HTTPS clonesDocs ↗
CLAUDE_CODE_SYNC_PLUGIN_INSTALL (+ _TIMEOUT_MS), CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH, CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL, FORCE_AUTOUPDATE_PLUGINSadvancedPlugin install and update behavior in -p and with the auto updater offDocs ↗
CLAUDE_CODE_ARTIFACT_AUTO_OPEN, _COMMENTS, _COMMENTS_AUTOREACT, _PUBLISH_EDITS, CLAUDE_CODE_DISABLE_ARTIFACTintermediateArtifact tool behavior and kill switchDocs ↗
CLAUDE_CODE_YOU_SHOULD_KNOW_DEBUGadvancedShow the last three "You should know" checks above the promptDocs ↗
Env vars: Updates, telemetry, privacy, commands, debugDISABLE_AUTOUPDATER, DISABLE_UPDATES, CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE, DISABLE_INSTALLATION_CHECKS and 26 more30 features
FeatureWhat it doesHowDocs
DISABLE_AUTOUPDATERintermediateDisable background auto updatesDocs ↗
DISABLE_UPDATESadvancedBlock all updates including manual claude updateDocs ↗
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATEadvancedLet Claude Code run your package manager's upgrade in the backgroundDocs ↗
DISABLE_INSTALLATION_CHECKSintermediateDisable installation warningsDocs ↗
DISABLE_TELEMETRYintermediateOpt out of telemetry (also stops feature flag fetching, which can make Remote Control unavailable)Docs ↗
DO_NOT_TRACKintermediate1 same effect as DISABLE_TELEMETRYDocs ↗
DISABLE_ERROR_REPORTINGintermediateOpt out of error reportingDocs ↗
CLAUDE_CODE_DISABLE_FEATURE_FLAGSadvanced1 turns off feature flag fetching (v2.1.319); Remote Control and other features that need it become unavailable; telemetry stays on unless DISABLE_TELEMETRY is setDocs ↗
DISABLE_GROWTHBOOKadvancedOlder name for CLAUDE_CODE_DISABLE_FEATURE_FLAGS; still works, and is the only name that v2.1.124 through v2.1.318 readDocs ↗
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYbeginnerDisable the "How is Claude doing?" surveyDocs ↗
CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTELadvancedRoute survey ratings to your own OTel collector when other traffic is blockedDocs ↗
DISABLE_FEEDBACK_COMMANDintermediateDisable /feedback and Claude drafted feedbackDocs ↗
DISABLE_COST_WARNINGSintermediateHide cost warningsDocs ↗
DISABLE_DOCTOR_COMMAND, DISABLE_LOGIN_COMMAND, DISABLE_LOGOUT_COMMAND, DISABLE_UPGRADE_COMMAND, DISABLE_EXTRA_USAGE_COMMAND, DISABLE_INSTALL_GITHUB_APP_COMMANDadvancedHide /doctor, /login, /logout, /upgrade, /usage-credits, /install-github-appDocs ↗
CLAUDE_CODE_ENABLE_TELEMETRYadvanced1 enables OpenTelemetry collectionDocs ↗
OTEL_LOG_USER_PROMPTS, OTEL_LOG_ASSISTANT_RESPONSES, OTEL_LOG_TOOL_CONTENT, OTEL_LOG_TOOL_DETAILS, OTEL_LOG_RAW_API_BODIES, OTEL_LOG_MANAGED_SETTINGSadvancedOpt in to more content in OTel events (prompts, responses, tool content/args, raw bodies, managed settings)Docs ↗
OTEL_METRICS_INCLUDE_ACCOUNT_UUID, _ENTRYPOINT, _REPOSITORY, _RESOURCE_ATTRIBUTES, _SESSION_ID, _VERSIONadvancedWhich attributes tag OTel metricsDocs ↗
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTHadvancedAttribute length limitsDocs ↗
CLAUDE_CODE_OTEL_DIAG_STDERR, CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS, CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS, CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MSadvancedExporter diagnostics and timingDocs ↗
ENABLE_BETA_TRACING_DETAILED, BETA_TRACING_ENDPOINTadvancedDetailed beta tracing to an OTLP/HTTP collectorDocs ↗
DEBUGintermediate1 equals --debugDocs ↗
CLAUDE_CODE_DEBUG_LOGS_DIR, CLAUDE_CODE_DEBUG_LOG_LEVELintermediateDebug log path / minimum levelDocs ↗
CLAUDE_CODE_STARTUP_FAILURE_RESULTSadvancedstream json writes a result when Claude refuses to startDocs ↗
CLAUDE_CODE_EMIT_SESSION_STATE_EVENTSadvancedEmit session_state_changed eventsDocs ↗
IS_DEMObeginnerDemo mode (hides personal info)Docs ↗
CLAUDE_CODE_USER_DIALOG_TIMEOUT_MSadvancedDeadline before a forwarded dialog is cancelledDocs ↗
CCR_FORCE_BUNDLEadvancedForce claude --cloud to bundle the local repoDocs ↗
CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIXintermediatePrefix for auto named Remote Control sessionsDocs ↗
CLAUDE_CLIENT_PRESENCE_FILEadvancedFile an external tool (screen lock listener) creates when you are presentDocs ↗
CLAUDE_CODE_PROCESS_WRAPPERadvancedLaunch background processes through a corporate launcherDocs ↗
Env vars: Set by Claude Code for subprocesses (read-only)CLAUDECODE, CLAUDE_CODE_CHILD_SESSION, CLAUDE_CODE_SESSION_ID, CLAUDE_PID4 features
FeatureWhat it doesHowDocs
CLAUDECODEintermediate1 in Bash, hooks, status line and stdio MCP subprocessesDocs ↗
CLAUDE_CODE_CHILD_SESSIONadvanced1 in subprocesses spawned via Bash/PowerShell/Monitor, hooks, status lineDocs ↗
CLAUDE_CODE_SESSION_IDintermediateCurrent session ID in subprocessesDocs ↗
CLAUDE_PIDadvancedClaude Code's process ID in spawned subprocessesDocs ↗

Topic 4 of 7

Extend

Hooks, MCP, skills, subagents and plugins.

Hooks: events, matchers and exit codes

1 Concepts, configuration, scopesHook basics, Three level config shape, Scope: user, Scope: project (shared) and 13 more17 features
FeatureWhat it doesHowDocs
Hook basicsbeginnersince not statedRun your own code at fixed points in a session, deterministically (unlike CLAUDE.md, which is only advice).Add a hooks block to a settings file, then check it with /hooks.Docs ↗
Three level config shapebeginnersince not statedEvent, then matcher group, then handler list.{"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"..."}]}]}}Docs ↗
Scope: userbeginnersince not statedHooks for all your projects, local to your machine.~/.claude/settings.jsonDocs ↗
Scope: project (shared)beginnersince not statedHooks committed to the repo for the team..claude/settings.jsonDocs ↗
Scope: project (private)beginnersince not statedPer project hooks that are gitignored..claude/settings.local.jsonDocs ↗
Scope: managed policyadvancedsince not statedOrganization wide hooks that user settings cannot remove.Managed settings; disableAllHooks in lower scopes cannot disable them.Docs ↗
Scope: pluginintermediatesince not statedHooks that load when the plugin is enabled.hooks/hooks.json in the plugin (optional top-level description), or the manifest hooks key.Docs ↗
Scope: skill frontmatteradvancedsince not statedHooks registered when the skill is invoked, kept for the rest of the session.hooks: key in SKILL.md frontmatter; once: true removes after first success.Docs ↗
Scope: subagent frontmatteradvancedsince not statedHooks that live only while that subagent runs; a Stop hook is converted to SubagentStop.hooks: key in the agent file.Docs ↗
Hooks merge, not replaceintermediatesince not statedUser, project, local and plugin hooks add to managed ones. Identical handlers across files run once.Automatic.Docs ↗
/hooks browserbeginnersince not statedRead only list of all configured hooks, labelled by source; "All events" shows events with no hooks.Type /hooks.Docs ↗
Turn hooks offintermediatesince not statedDisable all hooks without deleting them (cannot disable managed hooks from user scope)."disableAllHooks": true, or claude --settings '{"disableAllHooks": true}' for one run.Docs ↗
Managed only hooksadvancedsince not statedAdmin setting that blocks user, project, local and plugin hooks.allowManagedHooksOnly in managed settings.Docs ↗
HTTP hook allowlistsadvancedsince not statedRestrict which URLs HTTP hooks may call and which env vars may go in headers.allowedHttpHookUrls, httpHookAllowedEnvVars settings.Docs ↗
Plugin only lockadvancedsince not statedAdmins can lock hooks to plugins and managed settings.strictPluginOnlyCustomization managed setting.Docs ↗
Hooks run in subagents toointermediatesince not statedSettings, managed and plugin hooks fire inside subagents; input carries agent_id and agent_type.Automatic.Docs ↗
Workspace trust gateintermediatesince not statedInteractive sessions hold back ALL settings file hooks until you accept the folder trust dialog. -p and SDK runs never show the dialog and treat the folder as trusted.Review .claude/ first; use --bare or disableAllHooks for untrusted repos.Docs ↗
2 Matchers and filtersMatch all, Exact name or list, Regex matcher, MCP tool matchers and 4 more8 features
FeatureWhat it doesHowDocs
Match allbeginnersince not stated"*", "" or omitted matcher fires on every occurrence.omit matcherDocs ↗
Exact name or listbeginnersince not statedLetters, digits, _, -, spaces, ,, | are treated as exact strings."Edit|Write" or "Edit, Write"Docs ↗
Regex matcherintermediatesince not statedAny other character makes it an unanchored JavaScript regex."^Notebook", "mcp__memory__.*"Docs ↗
MCP tool matchersintermediatesince not statedMCP tools are named mcp__<server>__<tool>; the .* suffix is required to match a whole server."mcp__github__.*"; plugin servers: mcp__plugin_<plugin>_<server>__.*Docs ↗
Bash matcher also covers Monitoradvancedsince v2.1.314On PreToolUse and PermissionRequest, a Bash matcher also runs for shell commands Claude starts with the Monitor tool. It can deny or ask, but its allow and updatedInput have no effect there; to allow or rewrite a Monitor command, use a matcher that includes Monitor."matcher": "Bash|Monitor" with "if": "Monitor(tail *)"Docs ↗
if fieldintermediatesince not statedOne permission rule filter per handler, so the command only runs for matching calls. Tool events only."if": "Bash(git *)" or "Edit(*.ts)"; no &&/||, use separate handlers.Docs ↗
if is best effort for Bashadvancedsince not statedIf Claude Code cannot parse the command it runs the hook anyway. Use permissions for hard enforcement.See the Bash matching table.Docs ↗
Events with no matcherintermediatesince not statedA matcher on these is silently ignored.UserPromptSubmit, PostToolBatch, Stop, TeammateIdle, TaskCreated, TaskCompleted, WorktreeCreate, WorktreeRemove, MessageDisplay, CwdChangedDocs ↗
3 Handler types and fieldscommand hook, Exec form (args), shell field, http hook and 13 more17 features
FeatureWhat it doesHowDocs
command hookbeginnersince not statedRuns a shell command; JSON arrives on stdin; result via exit code, stdout, stderr.{"type":"command","command":"./check.sh"}Docs ↗
Exec form (args)intermediatesince not statedSpawn an executable directly with an argument array, no shell, safe with spaces in paths.{"type":"command","command":"node","args":["${CLAUDE_PLUGIN_ROOT}/x.js"]}Docs ↗
shell fieldadvancedsince not statedPick bash or powershell for shell form hooks."shell": "powershell"Docs ↗
http hookadvancedsince not statedPOSTs the event JSON to a URL; response body uses the same JSON output format. Non-2xx and connection failures are non blocking.{"type":"http","url":"http://localhost:8080/hook","headers":{"Authorization":"Bearer $MY_TOKEN"},"allowedEnvVars":["MY_TOKEN"]}Docs ↗
mcp_tool hookadvancedsince not statedCalls a tool on a configured MCP server; text output is read like stdout. Skipped for SessionStart at launch and Setup.{"type":"mcp_tool","server":"my_server","tool":"security_scan","input":{"file_path":"${tool_input.file_path}"}}Docs ↗
prompt hookintermediatesince not statedSingle turn LLM judgment; model replies {"ok":true/false,"reason":"..."}. Default timeout 30 s.{"type":"prompt","prompt":"Evaluate if Claude should stop: $ARGUMENTS"}Docs ↗
agent hookadvancedsince not statedSpawns a subagent with Read/Grep/Glob, up to 50 turns, returns {ok}. Experimental. Default timeout 60 s.{"type":"agent","prompt":"Verify all unit tests pass. $ARGUMENTS","timeout":120}Docs ↗
Which events accept which typesadvancedsince not statedAll five types: PermissionDenied, PostToolBatch, PostToolUse, PostToolUseFailure, PreToolUse, Stop, SubagentStop, TaskCompleted, TaskCreated, TeammateIdle, UserPromptExpansion, UserPromptSubmit. PermissionRequest: no agent. SessionStart: command and mcp_tool only. Setup: command only. All others: command, http, mcp_tool.See the lists.Docs ↗
continueOnBlock (prompt hooks)advancedsince not statedFeed an ok:false reason back to Claude and continue instead of ending the turn."continueOnBlock": trueDocs ↗
timeoutintermediatesince not statedSeconds before cancel. Defaults: 600 command/http/mcp_tool, 30 prompt, 60 agent; lowered to 30 on UserPromptSubmit, PreModelSwitch, PostModelSwitch and 10 on MessageDisplay. SessionEnd shares a 1.5 s budget."timeout": 10Docs ↗
statusMessageintermediatesince not statedCustom spinner text while the hook runs."statusMessage": "Linting..."Docs ↗
onceadvancedsince not statedRemove the hook after its first successful run; only honored in skill frontmatter."once": trueDocs ↗
asyncintermediatesince not statedRun a command hook in the background; cannot block or decide. Output arrives next turn."async": trueDocs ↗
asyncRewakeadvancedsince not statedBackground hook that wakes Claude when it exits 2; stderr (or stdout) is shown as a system reminder."asyncRewake": trueDocs ↗
onFailureadvancedsince v2.1.295Make a failing, crashing or timed out hook block the action ("block") or let it through ("continue"). Does nothing on Stop, SubagentStop, TaskCompleted, TeammateIdle or async hooks."onFailure": "block"Docs ↗
Agent SDK onFailure on a hook matcheradvancedsince TypeScript Agent SDK v0.3.317, Python Agent SDK v0.2.177Make an Agent SDK hook callback that throws, returns invalid output or returns nothing block the action instead of letting it through. Stop, SubagentStop, TaskCompleted and TeammateIdle ignore it. With "block" set, the query fails at startup if Claude Code cannot honour it.onFailure: "block" (TypeScript) or on_failure="block" (Python) on the matcherDocs ↗
Parallel executionadvancedsince not statedMatching hooks run in parallel; at most 12 prompt/agent hooks at once.Automatic.Docs ↗
4 Environment variables and path placeholders for hooks${CLAUDE_PROJECT_DIR}, ${CLAUDE_PLUGIN_ROOT} / ${CLAUDE_PLUGIN_DATA}, $CLAUDE_PLUGIN_OPTION_<KEY>, $CLAUDE_ENV_FILE and 4 more8 features
FeatureWhat it doesHowDocs
${CLAUDE_PROJECT_DIR}intermediatesince not statedProject root where the session started. Also set for stdio MCP servers and plugin LSP servers. Does not follow into worktrees (use cwd in the input)."command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/x.sh"Docs ↗
${CLAUDE_PLUGIN_ROOT} / ${CLAUDE_PLUGIN_DATA}intermediatesince not statedPlugin install dir and its persistent data dir (survives updates). Exported to the process too.Use in plugin hooks.json.Docs ↗
$CLAUDE_PLUGIN_OPTION_<KEY>advancedsince v2.1.207 (shell form `${user_config.*}` removed)Plugin userConfig values for shell form hooks. ${user_config.*} works in exec form only.$CLAUDE_PLUGIN_OPTION_WEBHOOK_URLDocs ↗
$CLAUDE_ENV_FILEintermediatesince not statedIn SessionStart hooks (the guide's direnv example also writes it from a CwdChanged hook), a file path; append export lines to persist env vars for later Bash commands.echo 'export NODE_ENV=production' >> "$CLAUDE_ENV_FILE"Docs ↗
$CLAUDE_CODE_REMOTEintermediatesince not stated"true" in remote web environments, unset in the local CLI.Read in the script.Docs ↗
$CLAUDE_CODE_BRIDGE_SESSION_IDadvancedsince v2.1.199Remote Control session id while a connection is active.Read in the script.Docs ↗
No $CLAUDE_MODELintermediatesince not statedThere is no model variable. Use PostModelSwitch (from_model/to_model) or the SessionStart model field.Docs ↗
Environment inheritanceadvancedsince not statedHooks inherit Claude Code's environment, minus OTEL_* exporter vars; CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 strips more.Docs ↗
5 Input, exit codes and outputCommon input fields, permission_mode values, Exit 0, Exit 2 and 18 more22 features
FeatureWhat it doesHowDocs
Common input fieldsbeginnersince `scratchpad_dir` v2.1.257Every event gets session_id, prompt_id, transcript_path, cwd, scratchpad_dir, permission_mode, effort, hook_event_name, plus agent_id/agent_type inside subagents.Read JSON from stdin.Docs ↗
permission_mode valuesintermediatesince not stateddefault (shown as Manual), plan, acceptEdits, auto, dontAsk, bypassPermissions.Read permission_mode.Docs ↗
Exit 0beginnersince not statedSuccess. Plain stdout is only shown to Claude on UserPromptSubmit, UserPromptExpansion, SessionStart, PostModelSwitch; JSON stdout is applied.exit 0Docs ↗
Exit 2beginnersince not statedBlocking error on events that can block; stderr becomes the reason shown to Claude. Even JSON allow cannot override it.echo "reason" >&2; exit 2Docs ↗
Other exit codesbeginnersince not statedNon blocking error; the action goes ahead. Exit 1 does NOT block, use 2 for policy.Docs ↗
Exit 2 per eventadvancedsince not statedCan block: PreToolUse, UserPromptSubmit, UserPromptExpansion, Stop, SubagentStop, TeammateIdle, TaskCreated, TaskCompleted, ConfigChange (not policy), PostToolBatch, PreCompact, PreModelSwitch, Elicitation, ElicitationResult, WorktreeCreate/Remove (any non zero). Cannot block: PermissionRequest, PostToolUse(+Failure), PermissionDenied, Notification, SubagentStart, SessionStart, Setup, SessionEnd, CwdChanged, DirectoryAdded, FileChanged, PostCompact, PostModelSwitch, StopFailure, InstructionsLoaded, MessageDisplay.See table.Docs ↗
JSON output rulesintermediatesince not statedPrint exactly one JSON object and nothing else; shell profile noise breaks parsing. Choose exit codes OR JSON per hook.jq -nc '{...}'Docs ↗
Universal JSON fieldsintermediatesince not statedcontinue (false stops Claude, but does not block a PreToolUse call; also return permissionDecision: "deny" for that), stopReason, systemMessage (warning for the user), terminalSequence; suppressOutput is accepted but has no effect.{"continue":false,"stopReason":"Build failed"}Docs ↗
terminalSequenceintermediatesince not statedHave Claude Code emit a desktop notification, window title or bell for you (hooks have no /dev/tty). Allowed OSC 0/1/2/9/99/777 and BEL. Interactive sessions only.{"terminalSequence":"\u001b]777;notify;T;msg\u0007"}Docs ↗
additionalContextintermediatesince not statedInjects text into Claude's context as a system reminder next to the event. 10,000 character cap, then saved to a file with a 2,000 char preview. Write facts, not commands.hookSpecificOutput.additionalContextDocs ↗
Top level decision: "block"intermediatesince not statedBlock pattern for UserPromptSubmit, UserPromptExpansion, PostToolUse, PostToolUseFailure, PostToolBatch, Stop, SubagentStop, ConfigChange, PreCompact.{"decision":"block","reason":"Tests must pass"}Docs ↗
PreToolUse decisionsintermediatesince not statedpermissionDecision allow, deny, ask, defer, plus updatedInput and additionalContext. Precedence deny > defer > ask > allow. Old top level decision/reason are deprecated for this event.{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"..."}}Docs ↗
Rewrite tool inputadvancedsince not statedupdatedInput replaces the whole input object before the tool runs. Do not rewrite from two hooks at once. In auto mode, a changed input with no permissionDecision can be denied with a hook changed this call's input after auto mode reviewed it, because the server reviewed the input Claude wrote; Claude can then send the call again for review.Include unchanged fields too.Docs ↗
Defer for SDK hostsadvancedsince resume in plan mode v2.1.246"defer" pauses a claude -p run at a tool call so a host app can collect an answer, then --resume. Single tool call turns only.permissionDecision:"defer"Docs ↗
PermissionRequest decisionsadvancedsince not statedAllow or deny on the user's behalf with decision.behavior, optional updatedInput, updatedPermissions, message, interrupt. Does not override deny rules.{"hookSpecificOutput":{"hookEventName":"PermissionRequest","decision":{"behavior":"allow"}}}Docs ↗
Replace a tool resultadvancedsince not statedupdatedToolOutput (all tools) or updatedMCPToolOutput (MCP only) changes what Claude sees after the tool ran. Value must match the tool's output shape. The tool already ran.hookSpecificOutput.updatedToolOutputDocs ↗
classifierContextadvancedsince v2.1.236Note for the auto mode classifier about a tool result.hookSpecificOutput.classifierContextDocs ↗
Stop feedback without an errorintermediatesince not statedhookSpecificOutput.additionalContext on Stop keeps the conversation going and is labelled "Stop hook feedback".{"hookSpecificOutput":{"hookEventName":"Stop","additionalContext":"Run the tests"}}Docs ↗
Stop loop protectionintermediatesince not statedCheck stop_hook_active; Claude Code overrides a Stop hook after 8 consecutive blocks with no tool call between.if event["stop_hook_active"]: exit 0Docs ↗
Hook starts a background processadvancedsince not statedPrint the decision first and redirect the child's stdout/stderr, else Claude Code blocks the call with "refusing to honor the suspect capture"../x.sh >/dev/null 2>&1 &Docs ↗
Hooks can never loosen denyadvancedsince not statedA hook "allow" does not bypass settings deny rules, and deny from a PreToolUse hook holds in every mode including bypassPermissions.Docs ↗
@ file mentions skip PreToolUseadvancedsince not statedFiles referenced with @ are inserted with no tool call, so PreToolUse cannot see them.Block paths in permissions or set CLAUDE_CODE_DISABLE_FILE_MENTIONS=1.Docs ↗
6 Hook events (33)SessionStart, Setup, InstructionsLoaded, UserPromptSubmit and 29 more33 features
FeatureWhat it doesHowDocs
SessionStartbeginnersince not statedSession begins or resumes.Matcher startup|resume|clear|compact|fork. Input: source, model, context_tokens, prompt_cache_likely_expired. Output: additionalContext, initialUserMessage (-p), sessionTitle, watchPaths, reloadSkills. Cannot block. Only command/mcp_tool types.Docs ↗
Setupadvancedsince not statedOne time prep for CI and scripts: --init-only, or --init/--maintenance with -p.Matcher init|maintenance. Input: trigger. No decision control.Docs ↗
InstructionsLoadedadvancedsince not statedA CLAUDE.md or .claude/rules/*.md file enters context.Matcher session_start|nested_traversal|path_glob_match|include|compact. Input: file_path, memory_type, load_reason. Side effects only.Docs ↗
UserPromptSubmitintermediatesince not statedPrompt submitted, before Claude sees it (also on turns Claude Code starts itself).No matcher. Input: prompt. Exit 2 or decision:"block" rejects it; additionalContext adds context. Cannot rewrite the prompt. Default timeout 30 s.Docs ↗
UserPromptExpansionadvancedsince not statedA typed slash command or skill expands into a prompt.Matcher = command name. Input: expansion_type, command_name, command_args, command_source, prompt. Can block.Docs ↗
MessageDisplayadvancedsince not statedWhile assistant text is displayed.No matcher. Input: turn_id, message_id, index, final, delta. hookSpecificOutput.displayContent changes the on-screen text only. Default timeout 10 s.Docs ↗
PreToolUsebeginnersince not statedBefore a tool call runs.Matcher = tool name. Input: tool_name, tool_input, tool_use_id. Control: exit 2 or permissionDecision allow/deny/ask/defer, updatedInput.Docs ↗
PermissionRequestadvancedsince not statedA tool call needs a permission decision.Matcher = tool name. Input: tool_name, tool_input, permission_suggestions. Control: decision.behavior. Exit 2 is not honored. No agent hooks.Docs ↗
PermissionDeniedadvancedsince not statedAuto mode denied a call.Matcher = tool name. Input: tool_name, tool_input, tool_use_id, reason. hookSpecificOutput.retry: true lets the model retry (ignored when the classifier gave no verdict).Docs ↗
PostToolUsebeginnersince not statedAfter a tool call succeeds.Matcher = tool name. Input: tool_name, tool_input, tool_response, tool_use_id, duration_ms. decision:"block", additionalContext, updatedToolOutput. Exit 2 shows stderr to Claude (tool already ran).Docs ↗
PostToolUseFailureintermediatesince not statedAfter a tool call fails.Matcher = tool name. Input: error, is_interrupt, duration_ms plus tool fields.Docs ↗
PostToolBatchadvancedsince not statedOnce after a whole batch of parallel tool calls resolves, before the next model call.No matcher. Input: tool_calls array. Exit 2 or block stops the loop.Docs ↗
Notificationbeginnersince not statedClaude Code sends a notification.Matcher = type: permission_prompt, idle_prompt, auth_success, auth_storage_failure (v2.1.288+, fires instead of auth_success when new credentials can't be saved), elicitation_dialog, elicitation_url_dialog, elicitation_complete, elicitation_response, agent_needs_input, agent_completed, quota_auto_resume_*, plugin_notification. Input: message, title, notification_type. Side effects only.Docs ↗
SubagentStartintermediatesince not statedA subagent is spawned.Matcher = agent type (general-purpose, Explore, Plan, custom, or ^plugin:name$). Can add additionalContext. Cannot block.Docs ↗
SubagentStopintermediatesince not statedA subagent finishes.Matcher = agent type. Input: stop_hook_active, agent_transcript_path, last_assistant_message, background_tasks, session_crons. Blocks like Stop.Docs ↗
TaskCreatedadvancedsince not statedA task is created via TaskCreate.No matcher. Input: task_id, task_subject, task_description, teammate_name, team_name. Exit 2 or decision:"block" rolls it back.Docs ↗
TaskCompletedadvancedsince not statedA task is marked complete.No matcher. Same input fields. Exit 2 or {"decision": "block", "reason": "..."} keeps the task open and Claude keeps working; {"continue": false} at the end of a teammate's turn lets the teammate go idle with the task still in progress (ignored on a TaskUpdate call).Docs ↗
Stopbeginnersince not statedClaude finishes responding (not on user interrupt).No matcher. Input: stop_hook_active, last_assistant_message, background_tasks, session_crons. Exit 2 / decision:"block" makes Claude keep working.Docs ↗
StopFailureintermediatesince `cloud_credential_error` v2.1.267Turn ended because of an API error.Matcher = error type (rate_limit, authentication_failed, oauth_org_not_allowed, account_on_hold, billing_error, invalid_request, model_not_found, server_error, max_output_tokens, cloud_credential_error, unknown; an HTTP 529 overloaded response reports server_error). Input: error, error_details, last_assistant_message. Output ignored except terminalSequence.Docs ↗
TeammateIdleadvancedsince not statedAn agent team teammate is about to go idle.No matcher. Input: teammate_name, team_name. Exit 2 or {"decision": "block", "reason": "..."} keeps it working; {"continue": false} lets it go idle even if another of your TeammateIdle hooks blocks.Docs ↗
ConfigChangeadvancedsince not statedA config file changes mid session.Matcher user_settings|project_settings|local_settings|policy_settings|skills. Input: source, file_path. Can block (except policy_settings).Docs ↗
CwdChangedadvancedsince not statedWorking directory changes (e.g. Claude runs cd). Handy for direnv.No matcher. Input: old_cwd, new_cwd.Docs ↗
DirectoryAddedadvancedsince not statedDirectory added via /add-dir or SDK register_repo_root.Matcher slash_command|register_repo_root. Input: directory, source.Docs ↗
FileChangedadvancedsince not statedA watched file changes on disk, whoever changed it.Matcher = literal filenames split on | (.envrc|.env), which also builds the watch list. Input: file_path, event.Docs ↗
WorktreeCreateadvancedsince not statedA worktree is created (--worktree, EnterWorktree, isolation: "worktree", background session). Replaces default git behaviour.No matcher. Input: name. Command hook prints the path on stdout; HTTP hook returns hookSpecificOutput.worktreePath. Any non-zero exit fails creation.Docs ↗
WorktreeRemoveadvancedsince not statedA hook created worktree is being removed.No matcher. Input: worktree_path. Non-zero exit fails removal if the directory remains.Docs ↗
PreCompactintermediatesince not statedBefore context compaction.Matcher manual|auto. Input: trigger, custom_instructions. Can block. On exit 0, stdout becomes instructions for the compaction summary, cut at 10,000 characters per hook.Docs ↗
PostCompactintermediatesince not statedAfter compaction completes.Matcher manual|auto. Input: trigger, compact_summary. Side effects only.Docs ↗
PreModelSwitchadvancedsince not statedBefore a requested model switch is applied.Matcher = canonical model name (claude-opus-5, .*opus.*). Input: from_model, to_model, requested_model, source, context_tokens, prompt_cache_warm, cache_ttl, estimated_cache_write_usd, pricing. permissionDecision allow/deny/ask or decision:"block". A timeout blocks the switch. Default 30 s.Docs ↗
PostModelSwitchadvancedsince not statedAfter the session model changes, including automatic changes such as restore on resume.Matcher = model name. Input: from_model, to_model. additionalContext or plain stdout is added to context.Docs ↗
SessionEndintermediatesince not statedSession terminates.Matcher clear|resume|logout|prompt_input_exit|other. Input: reason. 1.5 s shared budget.Docs ↗
Elicitationadvancedsince not statedAn MCP server asks the user for input mid tool call.Matcher = MCP server name. Input: mcp_server_name, message, mode, requested_schema, url. Reply action accept/decline/cancel + content, or exit 2 to decline.Docs ↗
ElicitationResultadvancedsince not statedAfter the user answers an elicitation, before it goes to the server.Matcher = MCP server name. Input: mcp_server_name, action, content, mode. Can override or block (becomes decline).Docs ↗
7 Official hook examples and securityExample: desktop notification, Example: auto format after edits, Example: protect files, Example: re inject context after compaction and 9 more13 features
FeatureWhat it doesHowDocs
Example: desktop notificationbeginnersince not statedPing you when Claude waits for input.Notification hook with osascript -e 'display notification ...' (macOS); guide also covers Linux and Windows.Docs ↗
Example: auto format after editsbeginnersince not statedRun a formatter after each file edit.PostToolUse matcher Edit|Write, command jq -r '.tool_input.file_path' | xargs npx prettier --writeDocs ↗
Example: protect filesintermediatesince not statedBlock edits to .env, .git/ and similar.PreToolUse Edit|Write script that exits 2.Docs ↗
Example: re inject context after compactionintermediatesince not statedRe add key facts after /compact.SessionStart matcher compact with stdout or additionalContext.Docs ↗
Example: audit config changesadvancedsince not statedLog every settings change.ConfigChange hook.Docs ↗
Example: reload env on cd or file changeadvancedsince not stateddirenv style reload.CwdChanged and FileChanged hooks.Docs ↗
Example: auto approve a permission promptadvancedsince not statedSkip the dialog for one tool, the guide's example is ExitPlanMode.PermissionRequest hook with matcher ExitPlanMode returning decision.behavior: "allow".Docs ↗
Official repo example scriptintermediatesince not statedPython PreToolUse validator that tells Claude to use rg instead of grep/find.examples/hooks/bash_command_validator_example.py in anthropics/claude-code.Docs ↗
Security warningbeginnersince not statedCommand hooks run with your full user permissions and can modify or delete anything you can.Review every command; validate input, quote variables ("$VAR"), block .. paths, use absolute paths, skip .env/.git//keys.Docs ↗
Debug a hookintermediatesince per hook duration lines v2.1.296Hook execution is written to the debug log, not the terminal.claude --debug-file /tmp/x.log, or claude --debug then ~/.claude/debug/<session-id>.txt; CLAUDE_CODE_DEBUG_LOG_LEVEL=verbose for matcher detail; /debug mid-session.Docs ↗
Hook not firing checklistbeginnersince not statedConfirm it appears under the right event in /hooks (skill frontmatter hooks only show after the skill is invoked); matchers are case sensitive; check you chose the right event (PreToolUse before, PostToolUse after)./hooks, then debug log.Docs ↗
Hook JSON has no effectintermediatesince not statedUsually shell profile output before the JSON, or decision fields at the wrong nesting level.Silence ~/.zshrc echoes for non-interactive shells; use hookSpecificOutput where required.Docs ↗
hookify pluginintermediatesince not statedOfficial plugin that creates hook rules from conversation patterns or markdown rule files./plugin install hookify@claude-plugins-officialDocs ↗

MCP servers

JSON
{
  "mcpServers": {
    "api-server": {
      "type": "http",
      "url": "${API_BASE_URL:-https://api.example.com}/mcp",
      "headers": {
        "Authorization": "Bearer ${API_KEY}"
      }
    },
    "local-tool": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@example/mcp-server"],
      "env": {
        "PROJECT_ROOT": "${CLAUDE_PROJECT_DIR:-.}"
      }
    },
    "slow-server": {
      "type": "http",
      "url": "https://mcp.example.com/mcp",
      "timeout": 120000,
      "alwaysLoad": true
    }
  }
}
1 CLI commandsAdd remote HTTP server, Header auth, Add SSE server, Add stdio server and 13 more17 features
FeatureWhat it doesHowDocs
Add remote HTTP serverbeginnersince not statedConnect a cloud MCP server (recommended transport). streamable-http is accepted as an alias for http in JSON.claude mcp add --transport http notion https://mcp.notion.com/mcpDocs ↗
Header authbeginnersince not statedPass a static token header.--header "Authorization: Bearer ..." (or -H)Docs ↗
Add SSE serverintermediatesince SSE auto fallback v2.1.265Legacy transport, deprecated. HTTP is tried first and falls back to SSE.claude mcp add --transport sse asana https://mcp.asana.com/sseDocs ↗
Add stdio serverbeginnersince not statedRun a local process as the server. -- separates Claude's flags from the server command.claude mcp add --env KEY=val --transport stdio airtable -- npx -y airtable-mcp-serverDocs ↗
Add WebSocket serveradvancedsince not statedPersistent two way server; no OAuth, header auth only; only via JSON.claude mcp add-json events '{"type":"ws","url":"wss://...","headers":{...}}'Docs ↗
claude mcp add-jsonintermediatesince not statedAdd a server from a JSON string (stdio, SSE, HTTP, ws). url entries need type.claude mcp add-json <name> '<json>' [--scope user]Docs ↗
claude mcp add-from-claude-desktopbeginnersince not statedImport servers from Claude Desktop through an interactive picker. macOS and WSL only; names must be letters, digits, -, _.claude mcp add-from-claude-desktop --scope userDocs ↗
claude mcp listbeginnersince not statedList servers with health: Connected, Needs authentication, Failed, Pending approval, Disabled.claude mcp listDocs ↗
claude mcp getbeginnersince not statedShow one server's details.claude mcp get <name>Docs ↗
claude mcp removebeginnersince not statedRemove a server and delete its stored OAuth tokens.claude mcp remove <name> [--scope local|user|project]Docs ↗
claude mcp login / logoutintermediatesince not statedRun or clear OAuth from the shell. --no-browser prints the URL for SSH.claude mcp login <name> [--no-browser]; claude mcp logout <name>Docs ↗
claude mcp reset-project-choicesintermediatesince not statedForget approved and rejected .mcp.json servers for the project.claude mcp reset-project-choicesDocs ↗
claude mcp serveadvancedsince not statedRun Claude Code itself as a stdio MCP server exposing its tools to another client. Prints nothing while waiting. Your client must handle per tool confirmation.claude mcp serve; Claude Desktop config {"mcpServers":{"claude-code":{"type":"stdio","command":"claude","args":["mcp","serve"],"env":{}}}}Docs ↗
-s, --scopebeginnersince not statedWhere the config is stored: local (default), project, user.--scope projectDocs ↗
-e, --envintermediatesince not statedEnvironment variables for the server; put another option between --env and the name.-e API_KEY=xxxDocs ↗
--client-id, --client-secret, --callback-portadvancedsince not statedPre registered OAuth credentials and a fixed redirect port for HTTP/SSE servers. Secret via prompt or MCP_CLIENT_SECRET.claude mcp add --transport http --callback-port 8080 --client-id ID --client-secret srv URLDocs ↗
--mcp-config, --strict-mcp-configintermediatesince strict skip approval v2.1.246Load servers for one session from JSON files; strict mode ignores every other MCP source.claude --mcp-config a.json --strict-mcp-configDocs ↗
2 Scopes, config files, env expansionLocal scope (default), Project scope, User scope, Precedence and 10 more14 features
FeatureWhat it doesHowDocs
Local scope (default)beginnersince not statedPrivate to you, this project only; stored in ~/.claude.json under the project path.defaultDocs ↗
Project scopebeginnersince not statedShared with the team via a committed .mcp.json at the project root; Claude asks you to approve each server first.--scope projectDocs ↗
User scopebeginnersince not statedAvailable in all your projects; stored in ~/.claude.json.--scope userDocs ↗
Precedenceintermediatesince managedMcpServers v2.1.259Same name in several places: local, then project, then user, then plugin, then claude.ai connectors. First wins whole; fields are not merged. A managedMcpServers entry outranks all.Docs ↗
.mcp.json formatbeginnersince not stated{"mcpServers": {"<name>": {"type":"http","url":"..."}}}. url with no type is a config error. Server names: letters, digits, -, _.See snippets/mcp_json.json.Docs ↗
Env var expansionintermediatesince not stated${VAR} and ${VAR:-default} in command, args, env, url, headers. Unset vars with no default load with a warning."Authorization": "Bearer ${API_KEY}"Docs ↗
Credential vars read as emptyadvancedsince not statedIn remote url/headers, names like ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, AWS_BEARER_TOKEN_BEDROCK, HTTPS_PROXY, NPM_TOKEN expand to empty so a repo cannot exfiltrate them. Copy into your own variable name.Docs ↗
$CLAUDE_PROJECT_DIR in serversadvancedsince not statedSet in a stdio server's environment to the project root; use ${CLAUDE_PROJECT_DIR:-.} when referencing it in .mcp.json. Servers can also implement roots/list."env":{"ROOT":"${CLAUDE_PROJECT_DIR:-.}"}Docs ↗
Per server fieldsadvancedsince not statedtimeout (ms hard wall clock, min 1000), alwaysLoad, headers, headersHelper, oauth (clientId, callbackPort).JSON keys in the entryDocs ↗
Dynamic headersadvancedsince `headersHelper` v2.1.238 (marketplaces)A headersHelper command prints short lived auth headers as JSON; needs folder trust."headersHelper": "./get-headers.sh"Docs ↗
Project approvalsintermediatesince not statedProject servers need approval; claude -p and cloud sessions load them without asking. Approve or reject via settings.enabledMcpjsonServers, disabledMcpjsonServers, enableAllProjectMcpServersDocs ↗
Disable without removingbeginnersince not statedTurn a server off per project./mcp panel or /mcp disable <server|all>Docs ↗
claude.ai connectorsbeginnersince not statedMCP servers you added at claude.ai/customize/connectors appear automatically when you are logged in with that account./mcp to view; disable with the connector setting.Docs ↗
Plugin provided serversintermediatesince not statedPlugins bundle servers in .mcp.json; tools appear as mcp__plugin_<plugin>_<server>__<tool>.In the plugin.Docs ↗
4 Managed MCP policy (organizations)managed-mcp.json, managedMcpServers, allowedMcpServers / deniedMcpServers, allowManagedMcpServersOnly and 3 more7 features
FeatureWhat it doesHowDocs
managed-mcp.jsonadvancedsince not statedExclusive control: users get only these servers (plus managedMcpServers). An empty server map disables MCP.macOS /Library/Application Support/ClaudeCode/managed-mcp.json, Linux/WSL /etc/claude-code/managed-mcp.json, Windows C:\Program Files\ClaudeCode\managed-mcp.jsonDocs ↗
managedMcpServersadvancedsince v2.1.259Provide remote servers to every user while they keep their own. Managed settings only.setting in managed settingsDocs ↗
allowedMcpServers / deniedMcpServersadvancedsince URL match on Anthropic provided servers 2.1.318 (changelog)Allowlist and denylist by serverName, serverCommand (exact array) or serverUrl (wildcards). Denylist always applies. From 2.1.318 a denied URL also blocks Anthropic provided servers whose upstream URL matches, and connectors in cloud sessions and on self hosted runners when the session is given the connector's own URL; otherwise deny a connector by name.See snippets/mcp_managed_policy.jsonDocs ↗
allowManagedMcpServersOnlyadvancedsince not statedLock the allowlist to managed sources.managed settingDocs ↗
Related switchesadvancedsince not statedallowClaudeInChromeWithManagedMcp, allowAllClaudeAiMcps.managed settingsDocs ↗
Plugin servers onlyadvancedsince not statedBlock ~/.claude.json and .mcp.json servers but keep plugin ones.strictPluginOnlyCustomizationDocs ↗
No built in registryintermediatesince not statedClaude Code has no browsable MCP registry; share an approved list yourself or ship servers as plugins.Docs ↗

Skills and custom commands

1 Format, locations, loadingCreate a skill, Location: personal, Location: project, Location: nested and 13 more17 features
FeatureWhat it doesHowDocs
Create a skillbeginnersince not statedA folder with SKILL.md (YAML frontmatter + Markdown). Type /skill-name or let Claude load it.~/.claude/skills/<name>/SKILL.mdDocs ↗
Location: personalbeginnersince not statedAvailable in all your projects on this machine (not Cowork or cloud sessions).~/.claude/skills/<name>/SKILL.mdDocs ↗
Location: projectbeginnersince not statedShared by committing it; not loaded in cloud threads of a Project..claude/skills/<name>/SKILL.mdDocs ↗
Location: nestedintermediatesince not statedLoaded when you work in or below that subdirectory (monorepos).<subdir>/.claude/skills/<name>/SKILL.mdDocs ↗
Location: additional directoryintermediatesince name clash prefix v2.1.309Skills from a dir passed with --add-dir..claude/skills/ inside that dirDocs ↗
Location: enterpriseadvancedsince not statedManaged settings directory, loaded for all users..claude/skills/ in the managed settings directoryDocs ↗
Location: pluginintermediatesince not statedNamespaced as /plugin-name:skill-name.<plugin>/skills/<name>/SKILL.mdDocs ↗
Location: claude.ai accountintermediatesince `!` restriction v2.1.228Skills enabled on your claude.ai account sync to Cowork, cloud and terminal sessions; command prefix anthropic-skills:. ! commands never run for synced skills.claude.ai settingsDocs ↗
Reserved namesadvancedsince not statedDo not name a folder synced or anthropic-skills; names with zero width or control characters do not load.Docs ↗
Live editingbeginnersince not statedEdits to existing skills are picked up during a session.edit the fileDocs ↗
Progressive disclosurebeginnersince not statedLevel 1 metadata (about 100 tokens per skill) is always loaded; Level 2 SKILL.md body (under 5k tokens) loads when triggered; Level 3 supporting files and script output load only when used.Keep SKILL.md short, link to reference.md, put scripts in scripts/.Docs ↗
Skills in Claude Code: listing budgetadvancedsince not statedDescriptions are listed for Claude; combined description + when_to_use is truncated at 1,536 characters; total listing budget is 1% of the context window (fallback 8,000 characters).SLASH_COMMAND_TOOL_CHAR_BUDGET overridesDocs ↗
How Claude choosesbeginnersince not statedClaude matches your request against each skill's description (and when_to_use); write what it does AND when to use it. paths limits auto activation to matching files.Docs ↗
Invoke directlybeginnersince not stated/name args at the start of a message runs the skill; a name after plain text only grants permission./deploy stagingDocs ↗
Content lifecycleadvancedsince not statedThe rendered body enters the conversation once and stays; auto compaction re attaches the latest invocation (first 5,000 tokens each).Docs ↗
Supporting filesbeginnersince not statedPut big references, examples and scripts next to SKILL.md and link them.my-skill/{SKILL.md,reference.md,scripts/}Docs ↗
Skill folder as pluginadvancedsince not statedAdd .claude-plugin/plugin.json to a personal or project skill folder to load it as <name>@skills-dir with its own agents, hooks, MCP servers.claude plugin init <name> scaffolds oneDocs ↗
2 SKILL.md frontmatter, every field (from the official table)name, description, when_to_use, argument-hint and 17 more21 features
FeatureWhat it doesHowDocs
namebeginnersince not statedCommand name shown in /. Defaults to the directory name. (Agent Skills spec: max 64 chars, lowercase letters, digits, hyphens, no anthropic/claude.)name: deployDocs ↗
descriptionbeginnersince not statedWhat it does and when to use it; Claude uses it to decide. Recommended. Spec max 1,024 chars.description: Deploy to productionDocs ↗
when_to_useintermediatesince not statedExtra trigger phrases, appended to the description (the only field name with an underscore).when_to_use: "deploy to staging"Docs ↗
argument-hintbeginnersince not statedAutocomplete hint.argument-hint: "[issue-number]"Docs ↗
argumentsintermediatesince not statedNamed positional args for $name substitution; string or YAML list.arguments: [issue, branch]Docs ↗
disable-model-invocationbeginnersince not statedtrue stops Claude from loading the skill on its own (description leaves context; also blocks preload into subagents and scheduled task runs).disable-model-invocation: trueDocs ↗
user-invocableintermediatesince not statedfalse hides it from the / menu so only Claude can use it.user-invocable: falseDocs ↗
allowed-toolsintermediatesince not statedTools usable without a prompt during the invoking turn only; space/comma string or YAML list.allowed-tools: Bash(git *) ReadDocs ↗
disallowed-toolsadvancedsince not statedTools removed from Claude's pool while the skill is active.disallowed-tools: AskUserQuestionDocs ↗
modelintermediatesince not statedModel for the rest of the turn; inherit keeps the current one.model: sonnetDocs ↗
effortintermediatesince not statedEffort level while active: low, medium, high, xhigh, max.effort: highDocs ↗
contextintermediatesince not statedfork runs the skill in a separate subagent that does not see your chat history.context: forkDocs ↗
agentintermediatesince not statedSubagent type for context: fork.agent: ExploreDocs ↗
backgroundadvancedsince not statedWith fork: false waits for the result instead of running in the background (default true).background: falseDocs ↗
hooksadvancedsince not statedHooks registered when the skill is invoked and kept for the session.see Hooks 1.1Docs ↗
pathsintermediatesince not statedGlobs that limit automatic activation to matching files (comma string or list).paths: "src/**/*.ts"Docs ↗
shelladvancedsince not statedShell for ! blocks: bash (default) or powershell.shell: bashDocs ↗
metadataadvancedsince not statedFree form map for your own tooling; ignored by Claude Code.metadata: {team: platform}Docs ↗
license, compatibilityadvancedsince not statedAgent Skills spec fields; accepted, not acted on (compatibility max 500 chars).license: MITDocs ↗
Unknown fieldsadvancedsince not statedIgnored silently by Claude Code, but claude.ai uploads and the Skills API fail on anything outside name, description, license, compatibility, metadata, allowed-tools.Docs ↗
Booleansadvancedsince not statedyes/no/on/off/1/0 accepted besides true/false.Docs ↗
3 Substitutions, dynamic context, control$ARGUMENTS, $ARGUMENTS[N], $N, $name, Escape a literal, ${CLAUDE_SESSION_ID}, ${CLAUDE_EFFORT} and 14 more18 features
FeatureWhat it doesHowDocs
$ARGUMENTSbeginnersince not statedAll arguments as typed; appended as ARGUMENTS: ... if the body has no placeholder.Fix $ARGUMENTSDocs ↗
$ARGUMENTS[N], $N, $nameintermediatesince not statedIndexed (0 based) and named arguments; quote multi word values.$0, $1, $issueDocs ↗
Escape a literaladvancedsince not statedBackslash before $1, $ARGUMENTS or a declared name.\$1.00Docs ↗
${CLAUDE_SESSION_ID}, ${CLAUDE_EFFORT}intermediatesince not statedSession id and current effort level.in the bodyDocs ↗
${CLAUDE_SKILL_DIR}intermediatesince not statedThe skill's own directory; also works inside allowed-tools Bash rules so a bundled script runs without a prompt.allowed-tools: Bash(${CLAUDE_SKILL_DIR}/scripts/x.sh *)Docs ↗
${CLAUDE_PROJECT_DIR}, ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}intermediatesince not statedProject root; plugin root and data dir (plugin skills only).in the bodyDocs ↗
Shell injectionintermediatesince not stated !cmd runs a command before the prompt is sent and replaces the placeholder with its output; ! fences for multi-line. ! must start a line or follow whitespace. - Branch: !git branch --show-current Docs ↗
Disable shell injectionadvancedsince v2.1.228Replace every injected command with a placeholder."disableSkillShellExecution": trueDocs ↗
@ file referencesintermediatesince not stated@path in a local skill body attaches the file (implied by the docs on synced skills). The syntax is not otherwise documented on the skills page.@docs/api.mdDocs ↗
ultrathinkintermediatesince not statedInclude the word in a skill to request deeper reasoning for that run.in the bodyDocs ↗
Permission rules for skillsintermediatesince not statedAllow or deny by name; Skill(name) exact, Skill(name *) prefix; Skill alone denies all./permissionsDocs ↗
skillOverrides settingintermediatesince not statedHide or collapse skills without editing them: on, name-only, user-invocable-only, off. Not applied to plugin skills."skillOverrides":{"deploy":"off"} or /skills + SpaceDocs ↗
/skills menubeginnersince not statedList and filter skills, t sorts by token count, Space cycles visibility./skillsDocs ↗
/skill-doctorintermediatesince v2.1.252Shows each skill's context cost and usage so you can drop unused ones; opens the /plugin Stats tab./skill-doctorDocs ↗
Disable all skillsadvancedsince not statedTurn off every skill and command for a session; or disable only bundled ones.claude --disable-slash-commands; disableBundledSkills; CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1Docs ↗
Eval a skilladvancedsince not statedEvaluate and iterate with the skill creator skill.skill-creatorDocs ↗
Verify/simplify before commitadvancedsince v2.1.286If a skill named verify or simplify exists at personal, project or enterprise level, Claude runs it before each commit.create the skillDocs ↗
Skill vs subagent vs CLAUDE.mdbeginnersince not statedSkills are reusable content in your main context; subagents are isolated workers that return a summary; CLAUDE.md loads every session. They combine: subagent skills: preloads, skill context: fork runs isolated.Docs ↗
4 Bundled skills (marked "Skill" in the commands reference)/doctor (alias /checkup), /code-review (alias /review), /batch, /debug and 9 more13 features
FeatureWhat it doesHowDocs
/doctor (alias /checkup)beginnersince usage check v2.1.305; prompt audit v2.1.283Setup checkup: install health, extensions cost, CLAUDE.md duplication, permissions, usage advice. Asks before changing anything. prompt-audit audits instructions./doctor or /doctor prompt-audit [path]; terminal-only claude doctorDocs ↗
/code-review (alias /review)beginnersince not statedReview the diff, a PR, branch or path for correctness bugs at a chosen effort; --fix applies findings, --comment posts inline PR comments./code-review high --fixDocs ↗
/batchintermediatesince not statedSplit a large change into 5 to 30 independent units, plan, then run one background worktree isolated subagent per unit./batch migrate all callers of X to YDocs ↗
/debugintermediatesince not statedTurn on debug logging for the session and troubleshoot from the log./debug [description]Docs ↗
/loopintermediatesince not statedRe run a prompt on an interval; omit the interval to let Claude self pace./loop 5m check the deployDocs ↗
/claude-apiintermediatesince subcommand versions from before v2.1.221 to v2.1.319Load Claude API and Managed Agents reference; subcommands migrate, upgrade, api-version, managed-agents-onboard, managed-agents-secure, prompt-audit, cost-optimize, latency-optimize, build-eval, hillclimb, preserved-thinking-migration. latency-optimize finds where your Claude API code makes people wait and proposes changes. Activates on its own when code imports anthropic./claude-api latency-optimizeDocs ↗
/runintermediatesince not statedLaunch and drive your app to see a change working./runDocs ↗
/verifyintermediatesince not statedBuild and run the app to confirm a change works, not just tests. Records its own recipe in .claude/skills/verify/SKILL.md./verifyDocs ↗
/run-skill-generatoradvancedsince not statedWrites a per project skill (.claude/skills/run-<name>/) teaching /run and /verify how to launch your app./run-skill-generatorDocs ↗
/simplifyintermediatesince not statedFour parallel review agents (reuse, simplification, efficiency, altitude) then apply fixes. Quality only, not bugs./simplify [target]Docs ↗
/deep-research (bundled workflow)intermediatesince not statedFans out web searches, cross checks sources, votes on claims, returns a cited report. Needs WebSearch./deep-research <question>Docs ↗
/workflow-authoring, /plugin-authoringadvancedsince not statedReference skills for writing a Workflow script or a mod. Available only when workflows or built in plugins are enabled./plugin-authoringDocs ↗
Turn bundled skills offadvancedsince not statedRemove bundled skills entirely (/doctor stays typable).disableBundledSkills settingDocs ↗
Custom slash commandsProject command, Personal command, Namespacing by subfolder, Plugin commands and 9 more13 features
FeatureWhat it doesHowDocs
Project commandbeginnersince not statedMarkdown file whose body is the prompt; filename (no extension) is the command..claude/commands/review.md then /reviewDocs ↗
Personal commandbeginnersince not statedSame, available in every project.~/.claude/commands/review.mdDocs ↗
Namespacing by subfolderbeginnersince not statedSubdirectory path with / replaced by :..claude/commands/frontend/component.md gives /frontend:componentDocs ↗
Plugin commandsintermediatesince not statedPlugin commands/ files are namespaced /plugin:command. The manifest can also define commands inline (source or content).commands/status.md; manifest commands.status.sourceDocs ↗
Command frontmatterintermediatesince not stateddescription, argument-hint, arguments, allowed-tools, model, effort, disable-model-invocation, user-invocable, context, agent, hooks, shell, when_to_use, disallowed-tools, background, metadata, license, compatibility.YAML between ---Docs ↗
Plugin command manifest fieldsadvancedsince not statedInline command object keys: source, content, description, argumentHint, model, allowedTools.in plugin.jsonDocs ↗
$ARGUMENTS, $1, $Nbeginnersince not statedArguments typed after the command; $ARGUMENTS is the whole string, $0/$1 positional./fix-issue 123 high with $1 = 123Docs ↗
Bash execution with !intermediatesince not stated !git status runs before the prompt is sent and inlines the output. Pre approve with allowed-tools: Bash(git status:*).see snippets/command_example.mdDocs ↗
File references with @beginnersince not statedTyping @file in a prompt attaches the file; adds CLAUDE.md from that directory. Within a command or skill body, local files attach the same way (see UNVERIFIED note in 3.3).@src/utils.jsDocs ↗
Official example commandbeginnersince not stated.claude/commands/commit-push-pr.md in anthropics/claude-code: allowed-tools for git/gh, ! context lines, a numbered task. Repo also ships dedupe.md and triage-issue.md.read the fileDocs ↗
Type /beginnersince not statedThe menu lists built in commands, skills, your commands and MCP prompts (/mcp__server__prompt)./Docs ↗
Disable allintermediatesince not statedTurn off every skill and custom command for one session.claude --disable-slash-commandsDocs ↗
Output styles (related)beginnersince `/output-style` v2.1.269Persistent role and tone for a whole session; markdown files with name, description, keep-coding-instructions, force-for-plugin; built ins Default, Proactive, Concise, Explanatory, Learning./output-style concise; files in ~/.claude/output-styles/ or .claude/output-styles/; outputStyle settingDocs ↗

Subagents and agent teams

2 Subagent frontmatter, every fieldname (required), description (required), tools, disallowedTools and 17 more21 features
FeatureWhat it doesHowDocs
name (required)beginnersince not statedUnique id up to 256 chars; no : (reserved for plugin scoping); becomes agent_type in hooks.name: code-reviewerDocs ↗
description (required)beginnersince not statedWhen Claude should delegate. Add "use proactively" to encourage auto delegation. Combined descriptions over 15,000 tokens trigger a warning.description: Reviews code ...Docs ↗
toolsbeginnersince not statedAllowlist; comma string or YAML list. Omitted = inherit all.tools: Read, Grep, BashDocs ↗
disallowedToolsintermediatesince not statedDenylist removed from the inherited or listed tools. Bash(git push *) still removes all of Bash.disallowedTools: Write, EditDocs ↗
modelbeginnersince not statedsonnet, opus, haiku, fable, full model ID or inherit.model: haikuDocs ↗
permissionModeintermediatesince `bypassPermissions` rule v2.1.267default (alias manual), acceptEdits, auto, dontAsk, bypassPermissions, plan. The parent's mode can override it.permissionMode: planDocs ↗
maxTurnsintermediatesince partial marking v2.1.246Turn cap; output is marked partial and can be resumed.maxTurns: 20Docs ↗
autoCompactWindowadvancedsince v2.1.296Lower the auto compact window to 100000 to 1000000 tokens.autoCompactWindow: 200000Docs ↗
skillsintermediatesince not statedPreload full skill content at startup.skills: [api-conventions]Docs ↗
mcpServersadvancedsince not statedServer names or inline definitions scoped to this agent.mcpServers: [slack]Docs ↗
hooksadvancedsince not statedHooks that run only while this agent runs.see Hooks 1.1Docs ↗
memoryintermediatesince not statedPersistent cross session memory: user (~/.claude/agent-memory/<name>/), project (.claude/agent-memory/<name>/), local (.claude/agent-memory-local/<name>/). First 200 lines or 25 KB of MEMORY.md loads. Needs auto memory on.memory: projectDocs ↗
backgroundintermediatesince not statedtrue keeps it in the background even when Claude asks to wait.background: trueDocs ↗
omitClaudeMdadvancedsince not statedStart without user/project/local CLAUDE.md.omitClaudeMd: trueDocs ↗
effortintermediatesince `CLAUDE_CODE_SUBAGENT_EFFORT` v2.1.316, other model effort v2.1.317 (changelog)low to max; CLAUDE_CODE_EFFORT_LEVEL takes precedence. From v2.1.316 CLAUDE_CODE_SUBAGENT_EFFORT sets the level subagents run at when nothing else names one, instead of inheriting the session's. From v2.1.317 a subagent or teammate on a different model from the main conversation uses that model's saved effort level or its default, not the session's.effort: high, or CLAUDE_CODE_SUBAGENT_EFFORTDocs ↗
isolationintermediatesince not statedworktree gives the agent its own temporary git worktree, cleaned up automatically.isolation: worktreeDocs ↗
colorbeginnersince not statedDisplay colour: red, blue, green, yellow, purple, orange, pink, cyan.color: blueDocs ↗
initialPromptadvancedsince not statedAuto submitted first user turn when the agent runs as the main session agent.initialPrompt: "List migrations first"Docs ↗
experimental.cacheTtladvancedsince not statedChoose 5m or 1h prompt cache lifetime for this agent.experimental: {cacheTtl: 1h}Docs ↗
Model orderintermediatesince order changed v2.1.251Resolved as: per invocation model parameter, then frontmatter model (inherit = parent), then CLAUDE_CODE_SUBAGENT_MODEL, then the main conversation's model. A user agent named Explore with model: haiku makes exploration cheap.see "Choose a model"Docs ↗
Unknown fieldsintermediatesince not statedIgnored silently; find typos with claude --debug and search the log for does not recognize or apply.Docs ↗
3 Invoking and running subagentsAutomatic delegation, Natural language, @ mention, Session wide agent and 15 more19 features
FeatureWhat it doesHowDocs
Automatic delegationbeginnersince not statedClaude delegates based on your request, agent descriptions and context.write good descriptionsDocs ↗
Natural languagebeginnersince not statedName the agent in your prompt.Use the test-runner subagent to fix failing testsDocs ↗
@ mentionbeginnersince not statedGuarantees that specific subagent runs for one task. Plugin agents show scoped names.@"code-reviewer (agent)" look at auth or @agent-<name>Docs ↗
Session wide agentintermediatesince not statedRun the whole session as that agent (its prompt replaces the default system prompt). Persists on resume.claude --agent code-reviewer; setting "agent": "code-reviewer"Docs ↗
Foreground vs backgroundintermediatesince not statedSubagents Claude spawns start in the background by default; permission prompts surface in your session. Turn fork mode off (CLAUDE_CODE_FORK_SUBAGENT=0) to let Claude wait.Ctrl+B, settingsDocs ↗
Parallel researchbeginnersince not statedAsk for several agents at once so each explores a different area."Research A, B and C in parallel with separate subagents"Docs ↗
Chain subagentsintermediatesince not statedFeed one agent's output into the next.prompt patternDocs ↗
Nested subagentsadvancedsince not statedSubagents can spawn their own, 3 layers deep by default.CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH (1 turns it off)Docs ↗
Concurrent limitadvancedsince not statedDefault cap of 20 running subagents ("Concurrent subagent limit reached").CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTSDocs ↗
Fork the conversationintermediatesince not statedA subagent that inherits the whole conversation instead of starting fresh./subtask <task> (in-session fork); /fork copies the session to a background sessionDocs ↗
Resume a subagentadvancedsince not statedContinue a finished subagent with its context; message by name after a restart.ask Claude to continue itDocs ↗
Per invocation effort parameterintermediatesince v2.1.292When you ask Claude to run a non fork subagent at a specific effort level, it can pass an effort parameter for that invocation. The parameter overrides the subagent's effort field and stays in effect when the subagent is resumed; the CLAUDE_CODE_EFFORT_LEVEL environment variable takes precedence over both."Run the reviewer subagent at high effort"Docs ↗
Subagent auto compactionadvancedsince v2.1.296Per agent compaction window via autoCompactWindow.frontmatterDocs ↗
Restrict spawnable agentsadvancedsince v2.1.63 (rename)For an agent running as the main thread (claude --agent), allowlist which subagent types it may spawn with Agent(type) in tools. Plain Agent allows all. The old Task(...) name still works (renamed in v2.1.63).tools: Agent(worker, researcher), Read, BashDocs ↗
Disable one agentadvancedsince not statedDeny a specific agent type.permissions.deny: ["Agent(Explore)"] or claude --disallowedTools "Agent(Explore)"Docs ↗
Project hooks for subagent eventsadvancedsince not statedSubagentStart and SubagentStop in settings fire for every subagent.settings.jsonDocs ↗
Subagents vs main conversationbeginnersince not statedUse subagents for verbose output, tool restrictions, self contained work. Use /btw for a question about the current chat (no tools, not saved to history).Docs ↗
Subagent output scanningadvancedsince not statedClaude Code scans each subagent's final report for text imitating its own output (such as <system-reminder>); it inserts a backslash and may prepend a [harness: ...] marker line. It removes nothing and is not a substitute for permissions or sandboxing.automaticDocs ↗
Official example agentsbeginnersince not statedCode reviewer, debugger, data scientist, database query validator.copy from docsDocs ↗
4 Agent teams and other parallel toolsAgent teams (experimental), Teammate display, Quality gates for teams, Teammate permission modes and 8 more12 features
FeatureWhat it doesHowDocs
Agent teams (experimental)advancedsince not statedA lead session plus teammates, each its own Claude Code session, with a shared task list and direct messaging. Disabled by default. One team per session, no nested teams, no /resume of in process teammates.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 (env or settings env)Docs ↗
Teammate displayadvancedsince not statedIn process (default; arrows select, Enter opens) or split panes (tmux or iTerm2 with it2; not VS Code terminal, Windows Terminal, Ghostty)."teammateMode": "auto" or claude --teammate-mode auto (flag hidden from --help)Docs ↗
Quality gates for teamsadvancedsince not statedTeammateIdle, TaskCreated, TaskCompleted hooks.see Hooks 1.6Docs ↗
Teammate permission modesadvancedsince not statedA new teammate starts with the lead's mode, including bypassPermissions, but a dontAsk lead gives it Manual. Press Shift+Tab in a split pane teammate's pane, or while viewing an in process teammate's session, to cycle its mode. An in process teammate outside plan mode runs in the lead's mode while the lead is in acceptEdits, auto or bypassPermissions.Shift+TabDocs ↗
Agent view and background sessionsintermediatesince not statedDispatch and watch many background sessions in one screen (research preview).claude agents, claude --bg, /backgroundDocs ↗
Dynamic workflowsadvancedsince not statedA script that runs many subagents and cross checks results; run bundled /deep-research, save your own, ship in plugins (workflows/*.js)./workflows to watch; ask Claude for a workflowDocs ↗
Worktreesintermediatesince not statedGive each session a separate git checkout.claude --worktree [name] (-w)Docs ↗
ListAgents and SendMessage toolsadvancedsince v2.1.224 on macOS and Linux, v2.1.234 on native WindowsClaude finds the agents it can message with ListAgents and sends with SendMessage: subagents in the session, agent team teammates, your other local sessions, and cloud and Remote Control sessions on other machines when connected. You never call either tool yourself. Permission deny rules naming both stop this session from sending and listing (denying SendMessage also removes messaging to subagents and teammates), and crossSessionInbound set to refuse stops it receiving; /list-agents (also /peers) checks what a session can reach.Ask Claude: "Ask the session running in my other terminal whether the migration finished"Docs ↗
notify_when_idleadvancedsince v2.1.236Claude can ask another session on this machine for one notice when it next goes idle or exits, using the notify_when_idle input of SendMessage. It is opt in and one shot with no polling; on its own it starts no turn and spends no tokens in the watched session."Tell me when the migration session finishes what it's working on"Docs ↗
Cross session messagingadvancedsince not statedClaude can list and message your other sessions on this or another machine.docsDocs ↗
/goalintermediatesince not statedSet a completion condition; Claude keeps working turn after turn until a model judges it met./goal all tests pass / /goal clearDocs ↗
Compare all five ways to parallelisebeginnersince not statedSubagents, agent view, agent teams, projects, dynamic workflows.read the tableDocs ↗

Plugins and marketplaces

JSON
{
  "name": "deploy-tools",
  "displayName": "Deploy Tools",
  "version": "1.2.0",
  "description": "Deployment commands, a review agent, and a status monitor",
  "author": {
    "name": "Example Team",
    "email": "dev@example.com",
    "url": "https://example.com"
  },
  "homepage": "https://example.com/docs/deploy-tools",
  "repository": "https://github.com/example/deploy-tools",
  "license": "MIT",
  "keywords": ["deployment", "ci"],
  "defaultEnabled": true,
  "skills": ["./extra-skills/"],
  "commands": {
    "status": {
      "source": "./commands/status.md",
      "description": "Show the current deployment status"
    },
    "about": {
      "content": "Explain what the deploy-tools plugin provides.",
      "description": "Describe this plugin"
    }
  },
  "agents": ["./agents/reviewer.md"],
  "hooks": "./config/extra-hooks.json",
  "mcpServers": {
    "deploy-api": {
      "command": "node",
      "args": ["${CLAUDE_PLUGIN_ROOT}/server.js"]
    }
  },
  "lspServers": "./.lsp.json",
  "outputStyles": "./styles/",
  "userConfig": {
    "api_token": {
      "type": "string",
      "title": "API token",
      "description": "Token for the deployment API",
      "sensitive": true
    }
  }
}
1 Installing and managing (`/plugin` and `claude plugin`)/plugin panel, Install in a session, Install scopes, claude plugin install and 14 more18 features
FeatureWhat it doesHowDocs
/plugin panelbeginnersince not statedOpens the Discover tab; other tabs for Installed, Marketplaces, Stats. Aliases /plugins, /marketplace. Interactive sessions only./pluginDocs ↗
Install in a sessionbeginnersince not statedOpens the plugin's details so you review components, context cost and pick a scope./plugin install commit-commands@claude-plugins-officialDocs ↗
Install scopesintermediatesince not statedUser (~/.claude/settings.json), project (.claude/settings.json, committed; teammates still run claude plugin install), local (.claude/settings.local.json). Local beats project beats user.choose in the panel or --scope user|project|localDocs ↗
claude plugin installintermediatesince `--marketplace` in session v2.1.275, shell v2.1.292Install from the shell; default scope user; loads next start or after /reload-plugins. Flags include --config key=value, --json, --marketplace <source>, --accept-command <sha256>.claude plugin install formatter@your-org --scope projectDocs ↗
claude plugin uninstall / enable / disable / updateintermediatesince not statedManage installed plugins; enable/disable act on the most specific scope that lists the plugin; update needs a restart.claude plugin disable name@mktDocs ↗
claude plugin list / detailsintermediatesince not statedList installed (--json, --available); details <name> shows component inventory and projected token cost.claude plugin details nameDocs ↗
claude plugin configureadvancedsince not statedShow a plugin's userConfig options or save values from stdin with --values-stdin. In session: /plugin configure <plugin>.claude plugin configure nameDocs ↗
claude plugin install --config <server>.<key>=<value>advancedsince 2.1.285Sets a setting that a bundled .mcpb MCP server declares in its own user_config, for a bundle file shipped inside the plugin. Repeat the flag for each option. A plain --config key=value sets a userConfig option the plugin manifest declares.claude plugin install name@mkt --config myserver.region=euDocs ↗
claude plugin enable [--json]intermediatesince `--json` 2.1.268Enables a disabled plugin and the dependencies it declares. Fails when a dependency is not installed, is blocked by your organization's plugin policy, or is set to false at a scope with higher precedence. --json prints the result as one JSON object on the last line of stdout; an already enabled plugin exits 1, or reports alreadyInGoalState with --json.claude plugin enable formatter --jsonDocs ↗
<name>@synced pluginsintermediatesince 2.1.239 in cloud sessions, 2.1.273 in the terminalA plugin you turn on for your claude.ai account (or that your organization turns on for its members) loads in Claude Code as <name>@synced, with no marketplace and no install record. Pass that name to claude plugin enable or disable to manage it. Terminal sync needs a claude.ai sign in, and does not run when ANTHROPIC_AUTH_TOKEN, CLAUDE_CODE_OAUTH_TOKEN or an apiKeyHelper supplies the credential, or in bare mode.claude plugin disable name@syncedDocs ↗
claude plugin pruneadvancedsince not statedRemove auto installed dependencies no longer needed.claude plugin pruneDocs ↗
/reload-pluginsbeginnersince not statedApply plugin changes without restart; reports counts and load errors; --force./reload-pluginsDocs ↗
Load for one sessionintermediatesince `CLAUDE_CODE_PLUGIN_DIRS` v2.1.280Test a plugin without installing from a directory, zip or URL. Repeatable.claude --plugin-dir ./my-plugin; claude --plugin-url "https://x/a.zip"; CLAUDE_CODE_PLUGIN_DIRSDocs ↗
Auto updateintermediatesince not statedOn by default for official marketplaces, off for others; toggle per marketplace in /plugin > Marketplaces; refresh now with claude plugin update.settings autoUpdateDocs ↗
Plugin dependenciesadvancedsince not stateddependencies array in the manifest or marketplace entry; cross marketplace deps need allowCrossMarketplaceDependenciesOn."dependencies": ["secrets-vault"]Docs ↗
Plugins from claude.aiintermediatesince not statedPlugins on your claude.ai account sync to Claude Code./pluginDocs ↗
enabledPlugins settingintermediatesince not statedTurn plugins on or off per scope, keyed name@marketplace. A plugin set false in managed settings is blocked everywhere."enabledPlugins":{"x@team":true}Docs ↗
Reading before installingbeginnersince not statedPlugins can run hooks and MCP servers. Read the details pane and the security page.Docs ↗
2 MarketplacesAdd a marketplace, Other marketplace commands, Official marketplace, Community marketplace and 10 more14 features
FeatureWhat it doesHowDocs
Add a marketplacebeginnersince not statedA catalog defined by .claude-plugin/marketplace.json. Sources: GitHub owner/repo[#ref], any git URL, local path, hosted JSON URL. --scope user|project|local, --sparse./plugin marketplace add owner/repo or claude plugin marketplace add owner/repoDocs ↗
Other marketplace commandsintermediatesince not statedlist, update [name], remove (alias rm); session alias /plugin market .... Removing a marketplace uninstalls its plugins and deletes their data.claude plugin marketplace listDocs ↗
Official marketplacebeginnersince not statedclaude-plugins-official from anthropics/claude-plugins-official; registered automatically on first interactive start (blockable by managed policy or CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)./plugin install <name>@claude-plugins-officialDocs ↗
Community marketplaceintermediatesince not statedThird party plugins authors submitted to Anthropic; name claude-community./plugin marketplace add anthropics/claude-plugins-communityDocs ↗
Demo marketplace (deprecated)intermediatesince not statedclaude-code-plugins from anthropics/claude-code is deprecated; add plugins with claude plugin install <plugin>@claude-plugins-official instead. ralph-wiggum is now ralph-loop (commands start with /ralph-loop:). Example plugins (agent sdk dev, code-review, commit commands, explanatory output style, feature dev, frontend design, hookify, learning output style, plugin dev, pr review toolkit, ralph-loop, security-guidance). Plugin code actually lives in claude plugins official.claude plugin install <plugin>@claude-plugins-officialDocs ↗
Team marketplacesintermediatesince not statedPre register a marketplace for everyone who opens a repo, or org wide via managed settings. Needs folder trust.extraKnownMarketplaces (alias additionalMarketplaces) with source github, git, url, file, directoryDocs ↗
Restrict marketplacesadvancedsince not statedAllowlist or blocklist sources users may add.strictKnownMarketplaces (managed)Docs ↗
marketplace.json top levelintermediatesince not statedname (required, no reserved words), owner (name required, email, url), plugins (required), description, version, forceRemoveDeletedPlugins, allowCrossMarketplaceDependenciesOn, renames..claude-plugin/marketplace.jsonDocs ↗
Marketplace plugin entryintermediatesince `metadata` v2.1.222, `headersHelper` v2.1.238name, source, description, version, category, tags, strict (default true), relevance, dependencies, defaultEnabled, displayName, metadata, headers, headersHelper.in plugins[]Docs ↗
Plugin source typesadvancedsince archive v2.1.224, command v2.1.229Relative path string, github (repo, ref, sha), url, git-subdir (url, path, ref), npm (package, version, registry), archive (url, sha256), command (runs a command that prints a directory)."source":{"source":"github","repo":"o/r"}Docs ↗
Reserved marketplace namesadvancedsince not statedOfficial looking names such as claude-plugins-official, anthropic-marketplace, agent-skills, and anything starting claudeai- cannot be used.Docs ↗
Create and hostadvancedsince not statedGuides for building a marketplace repo, hosting it (including private, archive downloads) and publishing to Anthropic's directory.docsDocs ↗
Recommend pluginsadvancedsince not statedrelevance signals tell Claude Code when to suggest a plugin to your org.marketplace entryDocs ↗
Org rolloutadvancedsince not statedAllow the official marketplace plus your own, pre seed plugins in containers (CLAUDE_CODE_PLUGIN_SEED_DIR), measure usage.managed settingsDocs ↗
3 Authoring: manifest, components, CLIScaffold, plugin.json location, Identity fields, Directory listing fields and 29 more33 features
FeatureWhat it doesHowDocs
Scaffoldbeginnersince not statedCreate a plugin at ~/.claude/skills/<name>/ that auto loads as <name>@skills-dir.claude plugin init my-pluginDocs ↗
plugin.json locationbeginnersince not stated.claude-plugin/plugin.json; optional (components in default folders load without it). Only name is required; everything else sits at the plugin root, not inside .claude-plugin/.see snippets/plugin_manifest.jsonDocs ↗
Identity fieldsbeginnersince not statedname (kebab case, no spaces, @, :), displayName, version (pins users until you change it), description, author {name,email,url}, homepage, repository, license, keywords, $schema.JSON keysDocs ↗
Directory listing fieldsadvancedsince not statedicon, documentationUrl, supportUrl, privacyPolicyUrl, termsOfServiceUrl are for Anthropic's directory; Claude Code does not read them.JSON keysDocs ↗
Behaviour fieldsadvancedsince not stateddefaultEnabled (start off or on), dependencies, userConfig, channels, metadata, types.JSON keysDocs ↗
Component path keysintermediatesince not statedskills, commands, agents, hooks, mcpServers, lspServers, outputStyles, workflows, experimental.{themes,monitors,evals}. Paths start with ./. commands/agents/outputStyles replace the default scan; skills/hooks/mcpServers/lspServers add to it.JSON keysDocs ↗
Standard layoutbeginnersince not statedskills/, commands/, agents/, hooks/hooks.json, .mcp.json, .lsp.json, output-styles/, workflows/, themes/, monitors/monitors.json, bin/, settings.json. A root CLAUDE.md is NOT loaded.folder treeDocs ↗
Bundle: skills and commandsbeginnersince not statedPlugin skills are /plugin:skill; prefer skills/ over commands/ for new work.skills/<name>/SKILL.mdDocs ↗
Bundle: agentsintermediatesince not statedSupported fields: name, description, model, effort, maxTurns, autoCompactWindow, tools, disallowedTools, skills, memory, background, omitClaudeMd, isolation, color, experimental.cacheTtl.agents/*.mdDocs ↗
Bundle: hooksintermediatesince not statedhooks/hooks.json fires from plugin load, not only when its skills run.see snippets/plugin_hooks.jsonDocs ↗
Bundle: MCP serversintermediatesince not stated.mcp.json or inline mcpServers; also .mcpb/.dxt bundles; tools get scoped names.${CLAUDE_PLUGIN_ROOT} in pathsDocs ↗
Bundle: LSP serversadvancedsince `requestTimeout` v2.1.288Give Claude diagnostics and code navigation for a language. Required command, extensionToLanguage; optional args, transport, env, initializationOptions, settings, workspaceFolder, startupTimeout, shutdownTimeout, requestTimeout, restartOnCrash, maxRestarts, diagnostics..lsp.json (see snippets/plugin_lsp.json)Docs ↗
Official code intelligence pluginsbeginnersince not statedPrebuilt language server plugins; install instead of writing your own./pluginDocs ↗
Bundle: output stylesintermediatesince not statedMarkdown style files; force-for-plugin: true applies automatically when enabled.output-styles/*.mdDocs ↗
Bundle: executablesadvancedsince not statedFiles in bin/ join the Bash tool's PATH while enabled (after user PATH entries). claude.ai and Cowork do not install plugins with bin/.bin/hello-pluginDocs ↗
Bundle: themes, monitors, channelsadvancedsince not statedTheme JSON; background monitor commands (name, command, description, when); message channels bound to an MCP server. Themes and monitors live under experimental.manifestDocs ↗
Bundle: workflowsadvancedsince not statedReusable workflow .js files in workflows/.plugin dirDocs ↗
userConfigadvancedsince `options` v2.1.271Prompt the user for values on enable; field type string/number/boolean/directory/file, title, description, required, default, options, multiple, sensitive. Reference as ${user_config.KEY} (exec form) or $CLAUDE_PLUGIN_OPTION_KEY.manifest userConfigDocs ↗
Path variablesintermediatesince not stated${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA} (persistent), ${CLAUDE_PROJECT_DIR}.in hooks, skills, MCP configDocs ↗
claude plugin validateintermediatesince not statedValidate a plugin, marketplace manifest or a directory of skills/agents/commands; --strict fails on warnings; --json. Verified locally: the snippet manifest, marketplace, agents dir and skills dir all passed.claude plugin validate ./my-plugin --strictDocs ↗
claude plugin tagintermediatesince not statedCreate {name}--v{version} git tag after checking plugin.json and the marketplace entry agree; in session /plugin tag [path] [--push] [--dry-run] [--force].claude plugin tag ./my-pluginDocs ↗
claude plugin eval / eval initadvancedsince not statedRun eval suites (prompts + graders) against a plugin and score them, with a no plugin baseline arm. Runs as you; evaluate only trusted plugins.claude plugin eval ./my-pluginDocs ↗
claude plugin eval --disallow-toolsadvancedsince 2.1.299Keeps specific built in tools, such as Agent, out of eval runs. A disallowed_tools field in a case does the same for that case.--disallow-tools flag or disallowed_tools case fieldDocs ↗
claude plugin testadvancedsince not statedRun a mod's tests.claude plugin test [dir]Docs ↗
Convert .claude/ setupbeginnersince not statedStep by step guide to turn existing .claude/ files into a plugin.docsDocs ↗
Publishintermediatesince not statedShare via your own marketplace repo or submit to Anthropic's directory; measure adoption.docsDocs ↗
Modsadvancedsince not statedA mod is a plugin whose behaviour lives in a JavaScript hooks module (register(on, options)) that can draw in the interface. Four ship built in (sec-default, diff, telemetry, agents-md) with source in anthropics/claude-code/mods. Only the overview was read, details UNVERIFIED./plugin-authoring; claude plugin testDocs ↗
Mod agent.spawn on resumed subagentsadvancedsince v2.1.299The agent.spawn hook also runs when a subagent that finished or stopped is about to run again, such as after a SendMessage call. e.resume is then { agentId }; return { deny: reason } to refuse the run, and skip these events if your hook counts subagents.check e.resume in the agent.spawn hookDocs ↗
Mod $.model.fork effort optionadvancedsince 2.1.318 (changelog)A mod's side job through $.model.fork can set its own effort, such as low, whatever effort the session uses; the result reports the effort senteffort: "low" in the $.model.fork optionsDocs ↗
Policy mod: drop only a user's hooks moduleadvancedsince v2.1.326In a plugin.register hook, pass next the event with provides.modules emptied to leave out a user mod's hooks module and load the rest of its plugin; from v2.1.326 returning { refuse } keeps the whole plugin out, including its MCP servers and hooks/hooks.jsonreturn next({ ...e, provides: { ...e.provides, modules: [] } })Docs ↗
Plugin troubleshootingintermediatesince not statedMarketplace not found, git clone timeout (CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS), offline marketplaces (CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE), HTTPS clone (CLAUDE_CODE_PLUGIN_PREFER_HTTPS).env varsDocs ↗
Plugin env varsadvancedsince PLUGIN_DIR_WATCH v2.1.287CLAUDE_CODE_PLUGIN_CACHE_DIR (root dir, default ~/.claude/plugins), CLAUDE_CODE_PLUGIN_SEED_DIR, CLAUDE_CODE_PLUGIN_DIRS, CLAUDE_CODE_PLUGIN_DIR_WATCH.env varsDocs ↗
Admin lockadvancedsince command sources v2.1.229disableSideloadFlags rejects --plugin-dir, --plugin-url and CLAUDE_CODE_PLUGIN_DIRS; disableCommandPluginSources blocks command plugin sources.managed settingsDocs ↗

The Agent SDK

The Agent SDK runs the same agent loop as a library, in Python and TypeScript. I keep a separate cheat sheet for it.

Agent SDK and headless (pointer only)Agent SDK, Headless CLI, Bare mode, Safe mode and 2 more6 features
FeatureWhat it doesHowDocs
Agent SDKadvancedsince not statedThe Claude Code agent loop, built in tools, permissions, sessions, hooks, MCP, skills and plugins as a library for Python and TypeScript. Another sheet covers it in depth.pip install claude-agent-sdk or npm install @anthropic-ai/claude-agent-sdk (from the Agent SDK quickstart)Docs ↗
Headless CLIbeginnersince not statedRun Claude Code non interactively from scripts and CI with -p; add --output-format json or stream-json. Other languages can drive it as a subprocess.claude -p "Find and fix the bug in auth.py" --allowedTools "Read,Edit,Bash"Docs ↗
Bare modeintermediatesince not statedSkip auto discovery of hooks, skills, commands, subagents, plugins, MCP, memory and CLAUDE.md for fast scripted runs. Hooks passed with --settings or in a plugin loaded with a flag still don't run, so skip bare mode for runs that need them.claude --bare -p "..."Docs ↗
Safe modeintermediatesince not statedStart with every customization disabled to debug a broken config.claude --safe-modeDocs ↗
Related SDK pagesadvancedsince not statedHooks, subagents, skills, plugins, MCP and permissions each have an SDK page.docsDocs ↗
Reload plugins in an SDK sessionadvancedsince not statedApply a change to a plugin's skills, commands, agents or hooks without starting a new session. The Python SDK has no equivalent method; send /reload-plugins as a prompt instead.reloadPlugins() on the TypeScript SDK's Query objectDocs ↗

Topic 5 of 7

Where it runs

Editors, desktop, web, CI and automation.

Editors: VS Code, JetBrains and others

VS Code extension (also Cursor and other VS Code forks)Install the extension, Install in Cursor and VS Code forks, Editors that cannot install the extension, Windsurf as an extension target and 63 more67 features
FeatureWhat it doesHowDocs
Install the extensionbeginnersince not statedAdds a graphical Claude Code panel to VS Code (needs VS Code 1.94.0 or later and a paid Claude plan or Console account)Cmd/Ctrl+Shift+X, search "Claude Code", Install; or open vscode:extension/anthropic.claude-code. Extension version equals the Claude Code version it bundlesDocs ↗
Install in Cursor and VS Code forksbeginnersince not statedSame extension in Cursor, Devin Desktop, KiroCursor: cursor:extension/anthropic.claude-code. Forks: search the Extensions view or use the Open VSX registryDocs ↗
Editors that cannot install the extensionbeginnersince not statedRun the CLI in any editor's integrated terminalInstall the CLI, run claude in the terminalDocs ↗
Windsurf as an extension targetbeginnersince UNVERIFIED for the extension; rename is in the changelog onlyWindsurf is not named on the VS Code page; the changelog says Windsurf was renamed Devin DesktopSee Devin Desktop row aboveDocs ↗
Open the Claude panelbeginnersince not statedSpark icon in editor toolbar (file must be open), Activity Bar sessions list, Command Palette "Claude Code: Open in New Tab", status bar "Claude Code"Click the Spark icon, or Cmd/Ctrl+Shift+P then type "Claude Code"Docs ↗
Sign in and onboarding checklistbeginnersince not statedBrowser sign in, then a "Learn Claude Code" checklistClick Sign in; reopen checklist by unchecking Hide Onboarding in Extensions > Claude CodeDocs ↗
Suggested prompts in the panelbeginnersince v2.1.325After Claude replies, a suggested next prompt shows as gray italic text in the empty prompt box; each one uses a short background request that counts toward usageTab turns it into editable text; turn off with promptSuggestionEnabled: false in ~/.claude/settings.jsonDocs ↗
Walkthroughbeginnersince not statedGuided tour of the basicsCommand Palette: "Claude Code: Open Walkthrough"Docs ↗
Automatic selection and open file contextbeginnersince not statedClaude sees your highlighted lines and the active file; footer shows the line countSelect text in the editorDocs ↗
Insert @-mention with line rangebeginnersince not statedAdds @file.ts#5-10 to the promptOption+K (Mac) / Alt+K (Win/Linux) with editor focusedDocs ↗
Turn off selection or open file sharingintermediatesince v2.1.300 and v2.1.271Stops selection or active file going into messagesSettings claudeCode.attachSelection (v2.1.300) and claudeCode.attachOpenFile (v2.1.271); also applies to claude in the integrated terminalDocs ↗
Selection withheld from excluded filesadvancedsince not statedFiles matching files.exclude, search.exclude or git ignored send only a path; Read deny rules protect the terminal pathSetting respectGitIgnore (default true)Docs ↗
@-mention files and foldersbeginnersince not statedFuzzy file or folder referencesType @auth, or @src/components/ with trailing slashDocs ↗
@-mention terminal outputintermediatesince not statedGives Claude the output of a named terminal@terminal:nameDocs ↗
Read specific PDF pagesintermediatesince not statedAsk for page 1, pages 1-10 or page 3 onwardNeeds poppler-utils on the machine running Claude CodeDocs ↗
Attach images and filesbeginnersince not statedPaste images; Shift+drag files into the prompt boxClipboard paste; hold Shift while draggingDocs ↗
Inline diff reviewbeginnersince not statedSide by side original vs proposed edit with accept, reject or "tell Claude what to do instead"; your edits in the diff are reported to ClaudeHappens in Manual mode before each editDocs ↗
Per change accept and rejectintermediatesince v2.1.275Review one change at a time (not for diffs over 100 changes)Buttons under each change; Command Palette "Claude Code: Accept Change at Cursor" / "Reject Change at Cursor"Docs ↗
Permission mode switcherbeginnersince v2.1.283 (Auto default)Auto, Manual, Plan, Edit automatically from the prompt boxClick the mode indicator; Auto is the built-in start mode from v2.1.283Docs ↗
Plan mode with commentsintermediatesince `/plan` v2.1.280Opens the plan as a Markdown document where you add inline comments before Claude startsChoose Plan, or type /plan, /plan fix the auth bug, /plan openDocs ↗
Model and effort pickerbeginnersince name button and Effort row v2.1.257; `/model` picker v2.1.284Switch model mid session; Effort row saves a default per model (except max)Click the model name; /model alone opens the pickerDocs ↗
Ultracode switchadvancedsince v2.1.284Plans a dynamic workflow for each substantive taskSwitch under the Effort row when workflows are enabled and the model supports itDocs ↗
Command menubeginnersince not statedAttach files, switch model, toggle extended thinking, Customize section (MCP, hooks, memory, instructions, permissions, plugins)Click / or type /Docs ↗
Slash commands dialog and /skillsintermediatesince dialog v2.1.257; `/skills` v2.1.280Filterable list of commands; skill rows show visibility (On, Name only) you can changeCustomize > Slash commands; type /skillsDocs ↗
Output styles pickerintermediatesince v2.1.257, builder v2.1.261Pick a built in or custom output style; "Build a custom style" writes the file for youCustomize > Output stylesDocs ↗
Hooks and Permissions viewersintermediatesince v2.1.269See hooks and permission rules by event or Allow/Ask/Deny; edit user, project and local entriesCustomize > Hooks, Customize > PermissionsDocs ↗
Memory and Instructions editorsintermediatesince v2.1.274 (view/edit/delete memory v2.1.275)Turn auto memory on or off, browse, edit or delete saved memories; open CLAUDE.md filesCustomize > Memory, Customize > InstructionsDocs ↗
/status, /sandbox, /chrome, /export in the panelintermediatesince v2.1.280Version/account/MCP status; sandbox mode toggle and excluded commands; Chrome connection; export conversationCustomize section or type the commandDocs ↗
Enable Remote Control for all sessionsintermediatesince v2.1.203 (all windows v2.1.261)Toggle that sets remoteControlAtStartup, applies to sessions already openCommand menu, Settings sectionDocs ↗
Focus viewbeginnersince v2.1.221Hides tool calls, results and thinking behind expandable rowsCtrl+Option+F (Mac) / Ctrl+Alt+F; Command Palette "Claude Code: Toggle Focus view"; setting focusViewDocs ↗
Sign outbeginnersince v2.1.277Sign out of the Anthropic accountSettings section or /logout (not shown on third-party providers)Docs ↗
Sign in to a Claude apps gatewayadvancedsince 2.1.316Sign in to a self hosted Claude apps gateway from the chat panel, with no terminal neededChat panel sign inDocs ↗
Report a problembeginnersince v2.1.229; local archive v2.1.284Sends a bug report (or saves a local archive under ~/.claude/feedback-bundles/ on third party providers)"Report a problem", /bug or /feedbackDocs ↗
Side questions with /btwintermediatesince v2.1.227Ask about the session without adding to it; answer opens in a side panel; thread survives reloadsType /btw your questionDocs ↗
Copy response and Bookmarksbeginnersince `/copy` v2.1.277; bookmarks v2.1.286Copy a response; bookmark responses and review themHover buttons, /copy, /copy 2, /bookmarksDocs ↗
Files Claude sends youintermediatesince v2.1.295"Sent report.md" rows you can click to open (Remote Control sessions)Click the file nameDocs ↗
Context indicator and prompt cache clockintermediatesince not statedShows context use and minutes left on the prompt cache; red when expiredPrompt box footerDocs ↗
Agent mapintermediatesince map v2.1.269; `/tasks` v2.1.277Tree of subagents with status, time, tokens; open transcripts, stop agents; also lists background tasksClick the "N agents" count, or type /tasksDocs ↗
Extended thinking toggle and Ctrl+Ointermediatesince not statedToggle thinking via / menu; Ctrl+O expands or collapses all thinking blocksCommand menu; Ctrl+ODocs ↗
Multi line inputbeginnersince not statedNew line without sendingShift+EnterDocs ↗
LaTeX math renderingbeginnersince v2.1.301Typesets $$...$$, \[...\], $...$, \(...\) and fenced math blocksAutomatic in the chat panel (not terminal mode)Docs ↗
Session history and resumebeginnersince plan restore v2.1.246Search or browse past conversations; plan mode is restored on resumeSession history button; titles are AI generated; rename or archive on hoverDocs ↗
Auto archive inactive sessionsintermediatesince v2.1.265Moves sessions idle for 14 days (default) to ArchivedSetting claudeCode.archiveInactiveSessions (1, 2, 7, 14, 0 to turn off)Docs ↗
Change the panel fontbeginnersince not statedThe Claude panel uses VS Code's chat font settings: chat.fontSize and chat.fontFamily set the conversation and prompt box text (VS Code 1.104 or later), chat.editor.fontSize sets diffs (Claude Code v2.1.300 or later) and chat.editor.fontFamily sets code blocks and tool outputVS Code settings, search chat fontDocs ↗
Turn off prompt suggestions in VS Codeintermediatesince v2.1.326The claudeCode.promptSuggestions setting turns prompt suggestions off in the extensionSetting claudeCode.promptSuggestionsDocs ↗
Resume cloud sessions in VS Codeintermediatesince not statedPull a claude.ai session into the editor; Remote Control sessions also listedSession history > Web tab (needs claude.ai sign-in)Docs ↗
Account and usage dialogintermediatesince fix button v2.1.305; session totals v2.1.277Plan usage bars, attribution by skill/subagent/plugin/MCP, Recommendations and a Fix button/usage; Day/Week toggleDocs ↗
Checkpoints and rewindintermediatesince not statedFork conversation, rewind code, or both from any messageHover a message, click rewindDocs ↗
Move the panelbeginnersince lock setting v2.1.274Dock in secondary sidebar, primary sidebar, or editor areaDrag the panel tab; lockEditorGroups settingDocs ↗
Multiple conversationsbeginnersince not statedParallel tabs or windows; blue dot = permission pending, orange = finished while hiddenCommand Palette "Open in New Tab" / "Open in New Window"Docs ↗
Session groups and filtersintermediatesince groups v2.1.229; filters v2.1.271; group from tab v2.1.257Named collapsible groups; Active toggle and status filter in the Activity BarRight-click a session; funnel iconDocs ↗
Continue after reloadintermediatesince v2.1.274Claude continues an interrupted step after a window reloadSetting continueAfterReload (default true)Docs ↗
Terminal modeintermediatesince not statedCLI style interface instead of the chat panelSetting claudeCode.useTerminal; Command Palette "Open in Terminal"Docs ↗
Manage plugins in the panelintermediatesince not statedInstall, uninstall, manage marketplaces; share a plugin install linkManage plugins dialog; handler vscode://anthropic.claude-code/install-pluginDocs ↗
Chrome from VS Codeintermediatesince auto connect v2.1.287@browser drives your Chrome (needs extension 1.0.36+); "Enabled by default" auto connects each session@browser go to localhost:3000 and check the consoleDocs ↗
Run in backgroundintermediatesince v2.1.287Moves a long command or subagent to a background task after ~2 sClick "Run in background" under the tool callDocs ↗
Keyboard shortcutsbeginnersince rename/group/unread v2.1.257Focus toggle Cmd/Ctrl+Esc; new tab Cmd/Ctrl+Shift+Esc; new conversation Cmd/Ctrl+N (needs enableNewConversationShortcut); reopen closed tab Cmd/Ctrl+Shift+T; insert @-mention Option/Alt+KCommand Palette lists all "Claude Code" commands; also Show Logs, Rename Session Tab, Mark Session as UnreadDocs ↗
URI handleradvancedsince not statedOpen a tab from scripts, bookmarklets or aliases, with prompt (prefilled, not sent) and sessionopen "vscode://anthropic.claude-code/open?prompt=review%20my%20changes"Docs ↗
Extension settingsintermediatesince per settinguseTerminal, initialPermissionMode, preferredLocation, autosave, useCtrlEnterToSend, showMessageTimestamps, spinnerVerbs, usePythonEnvironment, environmentVariables, disableLoginPrompt, allowDangerouslySkipPermissions, claudeProcessWrapper and moreSettings > Extensions > Claude CodeDocs ↗
Settings JSON schemaintermediatesince not statedAutocomplete and validation for settings.jsonAdd "$schema": "https://json.schemastore.org/claude-code-settings.json"Docs ↗
Third party providers in VS Codeadvancedsince not statedUse Bedrock, Agent Platform or Foundry; no plan usage bars, voice dictation or Web tabEnable "Disable Login Prompt", configure provider in ~/.claude/settings.jsonDocs ↗
Screen reader supportintermediatesince focus command v2.1.268Announces conversation activity; "Focus last message" commandAutomaticDocs ↗
Extension vs CLIintermediatesince not statedCLI only: ! Bash shortcut, tab completion, full command set; extension has checkpoints and MCP dialogRun claude in the integrated terminal (needs standalone CLI install)Docs ↗
Share history with CLIbeginnersince not statedExtension and CLI share one historyclaude --resume in a terminalDocs ↗
MCP dialogintermediatesince add/remove v2.1.261Add, remove (local/user/project), enable/disable, reconnect, OAuthType /mcp in the panel; or claude mcp add in the terminalDocs ↗
Built in IDE MCP serveradvancedsince claude vscode server v2.1.285Local ide server (loopback only, random port, auth token in ~/.claude/ide/<port>.lock) exposes mcp__ide__getDiagnostics and mcp__ide__executeCode (Jupyter, always asks via Quick Pick); chat panel uses mcp__claude-vscode__getDiagnosticsAutomatic; deny with permissions.deny rules naming both toolsDocs ↗
Fix common issuesbeginnersince not statedExtension won't install, Spark icon missing, Cmd+Esc does nothing, Ctrl+J newline, blank panel, TLS proxySee headingsDocs ↗
JetBrains plugin (IntelliJ IDEA, PyCharm, Android Studio, WebStorm, PhpStorm, GoLand)Install, Quick launch, IDE diff viewer, Selection and tab context and 10 more14 features
FeatureWhat it doesHowDocs
Installbeginnersince not statedPlugin runs claude in the IDE terminal and connects; it does not bundle the CLIInstall the CLI, then the "Claude Code [Beta]" plugin from JetBrains Marketplace (plugin 27310); restart the IDEDocs ↗
Quick launchbeginnersince not statedOpens Claude Code from the editorCmd+Esc (Mac) / Ctrl+Esc, or the Claude Code buttonDocs ↗
IDE diff viewerbeginnersince not statedShows changes in the IDE diff, not the terminal/config > Diff tool: auto or terminal (shows only when connected)Docs ↗
Selection and tab contextbeginnersince not statedCurrent selection or tab shared automatically; Read deny rules block it per fileAutomaticDocs ↗
File reference shortcutbeginnersince not statedInserts @src/auth.ts#L1-99Cmd+Option+K (Mac) / Alt+Ctrl+KDocs ↗
Diagnostic sharingintermediatesince not statedClaude reads IDE inspection errors by calling getDiagnostics (not requested automatically after edits)AutomaticDocs ↗
/ide from an external terminalbeginnersince not statedConnect a terminal claude to the IDE; also claude --ide auto connects when exactly one IDE is availableRun claude, then /ide; start from the project rootDocs ↗
Plugin settingsintermediatesince not statedCustom Claude command path, suppress "not found" notice, Option+Enter multi line (macOS), auto update pluginSettings > Tools > Claude Code [Beta]Docs ↗
ESC key fixintermediatesince not statedLets ESC interrupt Claude in the JetBrains terminalSettings > Tools > Terminal: untick "Move focus to the editor with Escape"Docs ↗
Remote development and WSLadvancedsince not statedInstall the plugin on the remote host; WSL command wsl -d Ubuntu -- bash -lic "claude"; WSL2 firewall/mirrored networking stepsPlugin settings > Claude commandDocs ↗
Security noteadvancedsince not statedacceptEdits and auto mode can edit IDE config files that auto run; prefer Manual mode in JetBrainsPermission modeDocs ↗
Built in IDE MCP serveradvancedsince not statedSame ide MCP server, ephemeral port, getDiagnostics only tool visible to the modelAutomaticDocs ↗
Third party providers in JetBrainsintermediatesince not statedWorks because it runs the CLI in the IDE terminalConfigure the provider as for the CLIDocs ↗
Troubleshootingbeginnersince not statedPlugin not working, IDE not detected ("No available IDEs detected"), command not foundRestart IDE, check root dir, set Claude command pathDocs ↗
Other editors and containersAny terminal or editor, /ide command, /terminal-setup, Dev containers4 features
FeatureWhat it doesHowDocs
Any terminal or editorbeginnersince not statedCLI works in any integrated terminalclaudeDocs ↗
/ide commandbeginnersince not statedManage IDE integrations and show status/ideDocs ↗
/terminal-setupbeginnersince not statedInstalls a Shift+Enter keybinding in VS Code, Cursor, Devin Desktop, Alacritty, Zed; Option+Enter in Apple Terminal/terminal-setupDocs ↗
Dev containersintermediatesince not statedRun Claude Code (and the VS Code extension) inside a dev container, Codespaces, JetBrains or CursorDev Container Feature ghcr.io/anthropics/devcontainer-features/claude-code:1.0 (see snippet devcontainer.json)Docs ↗

Desktop, web, mobile and the browser

Desktop app (the Code tab)Install, Start a session, Permission modes, Auto mode availability and 36 more40 features
FeatureWhat it doesHowDocs
Installbeginnersince Linux betaClaude app for macOS (universal), Windows x64 (and ARM64), Linux beta (.deb via apt for Ubuntu 22.04+/Debian 12+)Download from the docs page, sign in, click the Code tabDocs ↗
Start a sessionbeginnersince not statedPick environment (Local, Cloud, SSH, WSL), project folder, permission mode, model in the row under the prompt boxType the task and press EnterDocs ↗
Permission modesbeginnersince not statedManual (default), Accept edits, Plan, Auto, Bypass permissions; mode remembered per folder; dontAsk is CLI onlyMode selector or permissions.defaultModeDocs ↗
Auto mode availabilityintermediatesince not statedNeeds Opus 4.6+, Sonnet 4.6+, Haiku 5.5 or a Fable model; admins can disable with disableAutoModeMode selectorDocs ↗
Suggested promptsbeginnersince not statedAccept the suggested next promptTab or Right arrow in an empty prompt boxDocs ↗
App preview (Browser pane)intermediatesince not statedClaude starts the dev server, opens it in the pane, takes screenshots, inspects DOM, fixes issues; edit .claude/launch.json for custom dev commandsAsk to preview, or click Open on the server card; Dev servers menuDocs ↗
Browse external sitesintermediatesince not statedBrowser pane can open external sites; restrictable with browserExternalPageTools and disableBrowserExternalNavigationBrowser paneDocs ↗
Diff view with line commentsbeginnersince not statedReview changes per file, comment on lines, send all comments at onceClick +12 -1 in the Changes card; hover a line and click +; submit with Cmd/Ctrl+EnterDocs ↗
/code-review cardintermediatesince not statedFindings grouped by file; "Walk through in diff", "Fix this one", "Apply fixes"Type /code-review in the prompt boxDocs ↗
PR monitoring: Auto fix and Merge when readyintermediatesince not statedWatches CI, fixes failures and review comments, turns on GitHub auto merge (squash unless merge queue); needs ghChanges card, PR title menuDocs ↗
Workspace panesintermediatesince pop out: What's new week 37Drag and drop chat, diff, browser, terminal and file editor; pop panes out into their own windowSession details panel, view modesDocs ↗
Minimize a panebeginnersince Desktop v4.0.0+Keep the Terminal, Browser or iOS Simulator pane in view at a small size, below the session details panel cards or floating in a corner of the chat; needs a Claude account, and the Browser pane has it only in local sessionsMinimize in the pane header; Expand to restoreDocs ↗
Keyboard shortcutsbeginnersince not statedCmd+/ shows all; Cmd+N new session; Cmd+Shift+D diff; Cmd+Shift+B browser; Ctrl+\ terminal; Cmd+; side chat; Cmd+Shift+M/I/E mode/model/effort menus; Shift+Tab does NOT cycle modes in DesktopCmd/Ctrl+/Docs ↗
Parallel sessions and split viewbeginnersince not statedSeveral sessions at once; split view with Option/Alt-click; own window with Cmd/Ctrl-click+ New, Cmd/Ctrl+N, Ctrl+TabDocs ↗
Worktree per sessionintermediatesince not statedIsolated git worktree under <project>/.claude/worktrees/; branch prefix and location in Settings; .worktreeinclude copies gitignored filesTurn on Worktree before startingDocs ↗
Add folders to a sessionintermediatesince not statedExtra directories (like --add-dir)Session UIDocs ↗
Notificationsbeginnersince not statedOS notification when a session finishes while you are elsewhereAutomaticDocs ↗
Side chatintermediatesince not statedQuestion that uses session context without adding to it; not saved to diskCmd/Ctrl+; or /btwDocs ↗
Background tasks paneintermediatesince not statedSubagents, background shell commands, dynamic workflowsTitle bar ⋮ > Background tasksDocs ↗
Work across sessionsadvancedsince not statedClaude lists, reads, messages, renames and archives your other Code tab sessions (local, SSH, WSL only)Ask in plain languageDocs ↗
Suggested tasksintermediatesince not statedClaude proposes side tasks with Start, Do it here, Options, Start allCards in chatDocs ↗
Cloud sessions from Desktopintermediatesince not statedPick a Cloud environment; runs on Anthropic infrastructure and continues if you close the app; multiple reposEnvironment selector > CloudDocs ↗
Continue in another surfaceintermediatesince not statedMove a local session to Cloud (summary carried over) or open its folder in an editorSession menu > Open inDocs ↗
Remote Control from Desktopintermediatesince not statedPer session switch or Connect new sessions to Remote Control; disableRemoteControl blocks itSettings > Code, /remote-controlDocs ↗
Dispatchbeginnersince not statedMessage a task from the phone; Dispatch (in Cowork) can spawn a Code session on your Desktop; Pro, Max and Ultra onlyPair the mobile app with DesktopDocs ↗
Computer use in Desktopadvancedsince background mode: What's new week 36Claude opens apps, clicks and types on macOS or Windows; macOS can run it in the background; Pro, Max and Ultra only; off by defaultSettings, then grant Accessibility and Screen Recording on macOSDocs ↗
Connectorsintermediatesince not statedConnect GitHub, Slack, Linear and other services through connectors UIConnectors in the Code tabDocs ↗
Skills, plugins, preview serversintermediatesince not statedUse skills, plugin manager UI, .claude/launch.jsonDesktop UIDocs ↗
Saved environmentsintermediatesince not statedLocal, SSH, WSL or Cloud entries; Desktop auto creates up to eight from your recent foldersEnvironment selector > New environmentDocs ↗
SSH sessionsadvancedsince Create another machine: Claude Desktop v4.4212.0; Windows host commands: v4.16336.0Run on a remote machine, task can keep going while Desktop is disconnected; preconfigure via sshConfigs, restrict via sshHostAllowlist; sshHostCommands creates a machine from a command, and from Claude Desktop v4.4212.0 the selector offers Create another machine instead of Replace host, so sessions on earlier machines keep working (continue them from the sidebar); Claude has no Browser pane tools there, so no app preview, auto verify, Dev servers menu or configured preview servers (start the server remotely and forward its port to view it); on Windows, sshHostCommands works from Claude Desktop v4.16336.0 when Desktop connects through the OpenSSH client, and the command must start with the full path of an .exe, .cmd or .bat fileNew environment > SSHDocs ↗
WSL sessionsintermediatesince not statedRun in a WSL 2 distribution (WSL 1 unsupported)Environment selectorDocs ↗
iOS Simulator paneintermediatesince not statedLive simulator next to the chat, no screen takeover (macOS; public beta; Desktop v1.24012.0+). If your prompt names no simulator, Claude uses one already running, even one another session opened, so name a different one per session to keep them apart; installing and launching the app follows your permission modeOpens when Claude builds or runs your appDocs ↗
Test on an iPhone Duointermediatesince Desktop v4.29.0Run your app on an iPhone Duo simulator in the pane and fold it closed, half open or open with the pose buttons next to the rotate button, or ask Claude for a pose or a hinge angle from 1 to 179 degrees; needs Claude Desktop v4.29.0 or later and Xcode 27.1 or later with its iOS simulator runtimeName the iPhone Duo in your request, or pick it in the device menuDocs ↗
Scheduled tasks (local)intermediatesince Desktop 1.1.5368+Recurring sessions that run on your machine while the app is openSidebar > Scheduled > New taskDocs ↗
Move CLI session to Desktopintermediatesince `claude --desktop` v2.1.285Continue a terminal session in the app/desktop (alias /app), or claude --desktop, claude --desktop --resume <id>; in Desktop /resumeDocs ↗
Shared config with CLIintermediatesince not statedSame CLAUDE.md, settings, hooks, skills, MCP in ~/.claude.json and .mcp.json; claude_desktop_config.json servers also load; claude mcp add-from-claude-desktop imports themAutomaticDocs ↗
Settings that behave differently in the Code tabadvancedsince not statedSome settings.json keys have another effect or none in a local Code tab session but still apply in the terminal: askUserQuestionTimeout does not time out, defaultShell is replaced by the login shell (PowerShell on Windows) for ! commands, the @ picker ignores fileSuggestion and respectGitignore, modelPicker is ignored (use availableModels), skipDangerousModePermissionPrompt does not skip the Bypass permissions confirmation, and worktree.baseRef, worktree.sparsePaths and worktree.symlinkDirectories are not used for the worktree the Code tab creates for a sessionAutomatic; leave the keys set for the CLIDocs ↗
Not in Desktopintermediatesince not stated--print/Agent SDK, agent teams, inline code suggestions, terminal dialog commands such as /permissionsUse CLIDocs ↗
Enterprise controlsadvancedsince per keyAdmin console toggles for Desktop, cloud sessions, Remote Control; managed keys (disableDesktopLocalSessions, sshConfigs, managedMcpServers for 3P); MDM via com.anthropic.claudefordesktop, Windows registry SOFTWARE\Policies\Claude, Linux /etc/claude-desktop/managed-settings.jsonAdmin settings, MDMDocs ↗
Desktop troubleshootingbeginnersince not stated403 in the Code tab, blank screen, "Failed to load session", missing tools, Git LFS, SSH host keys, app won't quitSee pageDocs ↗
Claude Code on the web and cloud sessionsCloud session, Plan requirement, Quickstart, Connect GitHub (App or /web-setup) and 33 more37 features
FeatureWhat it doesHowDocs
Cloud sessionbeginnersince not statedClaude Code runs on Anthropic managed VMs (or your self hosted environment) and keeps going after you disconnect; counts toward plan limitsStart at claude.ai/code, the mobile Code tab, Desktop > Cloud, claude --cloud, or a scheduled taskDocs ↗
Plan requirementbeginnersince not statedPro, Max, Ultra, Team; Enterprise needs a premium or Chat + Claude Code seat; custom roles need the cloud sessions permissionSign in with claude.ai (not Console, not Bedrock/Vertex/Foundry)Docs ↗
Quickstartbeginnersince not statedConnect GitHub, create the Default environment, pick repo and branch, set mode (Auto, Accept edits, Plan), describe the taskclaude.ai/codeDocs ↗
Connect GitHub (App or /web-setup)beginnersince not statedGitHub App gives access to repos where installed (and enables Auto fix and Projects); /web-setup sends your local gh token/web-setup in the terminalDocs ↗
Quick setup (org setting)advancedsince not statedOwners remove GitHub App and environment prompts for membersOrganization settings > Claude Code > Quick setupDocs ↗
Prefill sessions by URLadvancedsince not statedBuild buttons that open a new session with prompt, repos and environmenthttps://claude.ai/code?prompt=Fix%20the%20login%20bug&repositories=acme/webapp (params prompt/q, prompt_url, repositories/repo, environment)Docs ↗
Start from the terminalintermediatesince not statedCreate a cloud session for the current repo/branch (push first); parallel tasks each get a sessionclaude --cloud "Fix the authentication bug in src/auth/login.ts" (--remote deprecated alias)Docs ↗
Cloud session with no repositorybeginnersince 2.1.318 (changelog)A cloud session on an Anthropic hosted environment can start without picking a repositoryNo repository option when starting the sessionDocs ↗
Send local repos without GitHubadvancedsince not statedBundles and uploads your repo when there is no remote or the GitHub App is missing; CCR_FORCE_BUNDLE=1 for GitLab or BitbucketAutomatic with --cloudDocs ↗
Send a follow up from the CLIadvancedsince not statedQueue one message into a running cloud session from any logged in machineclaude -p "your message" --cloud <session-id> (--output-format json returns {ok, session_id, url})Docs ↗
Teleport: cloud to terminalintermediatesince `/teleport` inside cloud session needs v2.1.223Pull a cloud session, its branch and history into your terminal as a local copy (one way); needs clean git state, same repo and accountclaude --teleport (picker), claude --teleport <id>, /teleport or /tp, /tasks then t, claude.ai "Open in > Terminal", or /teleport inside the cloud sessionDocs ↗
Push terminal session to cloudintermediatesince not statedNot possible from the CLI; handoff is one way. Desktop "Open in > Cloud" carries a summaryDesktop session menuDocs ↗
Cloud permission modesbeginnersince not statedAccept edits, Plan, Auto (no Manual, no Bypass)Mode dropdownDocs ↗
Review and comment on diffsbeginnersince not statedChanges card, diff view, inline comments, "Compare against" any branchClick the line countsDocs ↗
Take back a queued messagebeginnersince not statedUnsend a queued messageClick the ✕ on itDocs ↗
MCP form requests in cloud sessionsintermediatesince 2.1.316When an MCP server asks for a form, a form card lets you fill it in or decline it instead of the request being cancelled unseen; a Catching up line shows while a cloud or Remote Control session you switch back to is still loading its messagesFill in or decline the cardDocs ↗
Share sessionsbeginnersince not statedTeam/Enterprise: Private or Team. Pro/Max/Ultra: Private or Public (signed in users)Session visibility toggle; Slack sessions auto-shared with TeamDocs ↗
Archive and delete sessionsbeginnersince not statedArchive hides from the sidebar (claude.ai/code/sessions, Archived tab); delete is permanentSession ⋯ menuDocs ↗
Auto fix pull requestsintermediatesince not statedClaude watches a PR, fixes CI failures and review comments, asks when ambiguous; does not react to merge conflictsPR ⋮ menu > Auto-fix; /autofix-pr in the terminal; ask on mobile; paste a PR URLDocs ↗
Security and isolationadvancedsince not statedIsolated VMs, network controls, credentials via GitHub proxy never enter the VM, network secretsDefaultDocs ↗
Limitationsintermediatesince not statedShares rate limits; GitHub required for clone and PR (GHES for Team/Enterprise); IP allowlists affect cloud runs; not for ZDR, HIPAA or CMEK orgsSee pageDocs ↗
Cloud environmentsintermediatesince not statedSaved config: network access, env vars, setup script; Default environment is Trusted accessEnvironment selector; /remote-env picks the default from the CLIDocs ↗
Browser in cloud sessionsintermediatesince not statedThe cloud image includes Chrome for Testing at /usr/bin/google-chrome, with CHROME_PATH set to that path$CHROME_PATH in your test or browser commandsDocs ↗
Network access levelsintermediatesince not statedNone, Trusted (allowlisted registries, GitHub, cloud SDKs), Full, Custom allowlistEnvironment dialogDocs ↗
Environment variables and network secretsadvancedsince member edits 2.1.316 (changelog)Set vars; network secrets are attached to matching requests outside the sandbox; from 2.1.316 Enterprise members can add and delete network secrets on their own cloud environments instead of only viewing themEnvironment dialogDocs ↗
Setup scripts and cachingintermediatesince Bash editor in 2.1.312Bash script run as root on Ubuntu 24.04 before Claude starts; cached if it finishes in about 5 minutes; cache refreshes after about 7 daysEnvironment > Setup script (exit zero)Docs ↗
Installed tools and limitsintermediatesince not statedPython, Node 20/21/22, Ruby, PHP 8.3, Java 21, Go, Rust, C/C++, Docker, Postgres 16, Redis 7; about 4 vCPU, 16 GB RAM, 30 GB disk; ask Claude to run check-toolsAutomaticDocs ↗
Organization shared environmentsadvancedsince not statedOwners define shared environments and the org defaultclaude.ai/admin-settings/claude-codeDocs ↗
Self hosted environmentsadvancedsince public betaCloud sessions run on your runners inside your network; public beta for Team/Enterprise, off by default; not for ZDR or HIPAA orgsOwner enables "Allow self-hosted environments", deploy runnersDocs ↗
Self hosted runner flagsadvancedsince `--client-label` 2.1.248; `--remove-session-state` 2.1.268; `--drain-marker-file` and `--host-config-snapshot` 2.1.271; `--hold-idle-file` 2.1.311claude self-hosted-runner flags include --client-label (name sent at registration, defaults to the hostname), --kill-session-after-min <n> (wall clock limit per session, default 0), --remove-session-state (delete a session's directories under <base-dir>/_sessions/ when it ends), --drain-marker-file <path> (host writes it to announce a graceful drain), --host-config-snapshot disk|memory (default disk) and --hold-idle-file with --max-hold-min (keep an idle session while its processes run).claude self-hosted-runner --kill-session-after-min 480 --remove-session-stateDocs ↗
Self hosted orchestrator --shutdown-drain-secadvancedsince 2.1.299On SIGTERM, the orchestrator stops polling for spawn requests and gives running spawn-runner hooks up to this many seconds to finish (maximum 3600). At the default 0 it stops immediately.claude self-hosted-runner orchestrator --shutdown-drain-sec 70Docs ↗
Self hosted CLAUDE_RUNNER_SPAWN_REASONadvancedsince 2.1.318 (changelog)The orchestrator's spawn-runner hook gets CLAUDE_RUNNER_SPAWN_REASON, why Anthropic sent the request, such as runner_lost or resumed; unset when none was sentread $CLAUDE_RUNNER_SPAWN_REASON in the spawn-runner hookDocs ↗
Self hosted post-session hookadvancedsince not statedA lifecycle hook that runs after the Claude Code child exits and before the runner tears down the workspace. It is the only chance to save uncommitted work, for example by pushing a snapshot branch. It sets CLAUDE_RUNNER_EXIT_REASON and does not fire if the runner is terminated abruptly.script in the runner's --hooks-dirDocs ↗
Self hosted checkout hook timeoutadvancedsince 2.1.307Checkout hooks are stopped after 30 minutes by default and the session's setup then fails. Raise --checkout-hook-timeout-min, or set it to 0, if yours needs longer.--checkout-hook-timeout-minDocs ↗
Projectsintermediatesince public betaOne conversation where Claude coordinates many cloud session threads with shared instructions; public beta on Pro, Max and Ultra onlyclaude.ai/code sidebar > Projects (or More)Docs ↗
Project auto continue at usage limitsintermediatesince not statedA thread or the project conversation that stops at the five hour or weekly limit continues on its own when the limit resets; on by default, and turning it off applies to the whole projectProject settings > General > Auto-continue when usage limits resetDocs ↗
Web troubleshootingbeginnersince not statedSession creation failed, branch not on GitHub, environment expired, org UUIDSee pageDocs ↗
Mobile, Remote Control, Dispatch, ChannelsClaude app as Claude Code client, Cloud sessions from the phone, Remote Control from the phone, Push notifications and 13 more17 features
FeatureWhat it doesHowDocs
Claude app as Claude Code clientbeginnersince not statedThe iOS and Android apps are a client; there is no separate Claude Code mobile app. Open the Code tabInstall the Claude app; /mobile (aliases /ios, /android) shows a QR codeDocs ↗
Cloud sessions from the phonebeginnersince not statedPick repo and branch, submit; steer anytime; ask Claude to watch a PRCode tab, claude.ai/code/newDocs ↗
Remote Control from the phoneintermediatesince not statedDrive a session running on your computer; photos saved under ~/.claude/uploads/claude remote-control or /remote-controlDocs ↗
Push notificationsbeginnersince not statedClaude pings the phone when long work finishes or needs a decision/config: "Push when Claude decides", "Push when actions required"; or say "notify me when the tests finish"Docs ↗
Remote Control: exit codesadvancedsince v2.1.325claude remote-control exits with status 4 when it stops by itself (single session runs still exit 0) and 69 when it cannot register, so a service manager can start it againRun claude remote-control under a service managerDocs ↗
Remote Control: interactive sessionbeginnersince not statedNormal session also reachable from claude.ai or the appclaude --remote-control "My Project" (--rc)Docs ↗
Remote Control: from a running sessionbeginnersince not statedMake the current session remote/remote-control or /rcDocs ↗
Auto connect every sessionintermediatesince not statedEach interactive session registers remotely/config > Enable Remote Control for all sessions, or remoteControlAtStartup: trueDocs ↗
Remote Control requirementsintermediatesince not statedPro, Max, Ultra, Team, Enterprise (Team/Enterprise: Owner enables); claude.ai login; not on API keys, Bedrock/Vertex/Foundry, gateways or non Anthropic ANTHROPIC_BASE_URL/loginDocs ↗
What connected devices seeadvancedsince model switching v2.1.238Model and effort switching, diff pane, subagents, files; some commands are local only (/plugin, /resume)Use arguments such as /model sonnet, /effort high from mobileDocs ↗
Security modelintermediatesince not statedOutbound HTTPS only, no inbound ports, short lived credentials; transcript stored on Anthropic servers while connectedDefaultDocs ↗
Trusted Devicesadvancedsince not statedOrg option requiring enrolled devices for Remote ControlAdmin settingDocs ↗
Remote Control vs cloud sessionsbeginnersince not statedLocal execution and MCP vs no setup cloudChoose by where files liveDocs ↗
Dispatchbeginnersince not statedMessage Cowork a task; it can start a Desktop Code session; Pro, Max and Ultra onlyPair app with Desktop (Help Center)Docs ↗
Channelsadvancedsince research previewPush events from Telegram, Discord, iMessage or your own MCP server into a running session; research preview; Anthropic auth only; admins must enable on Team/Enterpriseclaude --channels plugin:telegram@claude-plugins-official (also discord, imessage, fakechat); build your own per the referenceDocs ↗
Cross session messagingadvancedsince v2.1.224 macOS/Linux, v2.1.234 WindowsClaude lists and messages your other sessions (same machine, other machines, cloud)Ask Claude; /list-agents (alias /peers)Docs ↗
Platforms comparisonbeginnersince not statedTable of Dispatch, Remote Control, Channels, Slack, self hosted, scheduled tasksRead the tableDocs ↗
Chrome, computer use, deep linksClaude in Chrome integration, Capabilities, /chrome, Enable by default and 7 more11 features
FeatureWhat it doesHowDocs
Claude in Chrome integrationbeginnersince not statedControls your logged in Chrome or Edge (Brave, Arc, Vivaldi, Opera detected); pauses on logins and CAPTCHAs; not in WSLInstall the extension (1.0.36+), start claude --chromeDocs ↗
Capabilitiesbeginnersince not statedConsole and DOM debugging, design verification, form testing, authenticated apps, data extraction, file uploads, GIF recordingAsk in plain languageDocs ↗
/chromebeginnersince not statedCheck connection, manage permissions, reconnect, pick a browser, set Enabled by default/chromeDocs ↗
Enable by defaultintermediatesince VS Code auto connect v2.1.287Every session connects without --chrome; costs extra context/chrome > Enabled by defaultDocs ↗
--chrome / --no-chromebeginnersince not statedTurn the integration on or off for a sessionclaude --chromeDocs ↗
Requirementsintermediatesince not statedNeeds a direct Anthropic plan (Pro, Max, Ultra, Team, Enterprise) and /login; API key or setup-token auth keeps it off; not on Bedrock/Vertex/Foundry/loginDocs ↗
Site permissionsintermediatesince not statedInherited from the extension settingsExtension settingsDocs ↗
Computer use (CLI)advancedsince not statedBuilt in computer-use MCP server: open apps, click, type, screenshots on macOS; research preview, Pro, Max and Ultra only, interactive only/mcp > computer-use > Enable; grant Accessibility and Screen RecordingDocs ↗
Computer use priorityadvancedsince not statedClaude prefers connector, then Bash, then Chrome, then iOS Simulator pane, then screen controlAutomaticDocs ↗
Deep linksadvancedsince not statedclaude-cli://open?repo=owner/name&q=...&cwd=... opens a terminal session with a prefilled prompt (not sent until you press Enter; 5,000 character limit)Embed in runbooks, alerts, READMEs; open "claude-cli://..."Docs ↗
VS Code launch linkadvancedsince not statedvscode://anthropic.claude-code/open?prompt=...&session=...URL handlerDocs ↗
Slack and Claude TagClaude Code in Slack (earlier version), Routing mode, Thread context and session flow, Claude Tag (public beta) and 1 more5 features
FeatureWhat it doesHowDocs
Claude Code in Slack (earlier version)beginnersince not stated@Claude in a channel starts a cloud session under your own account; Pro, Max and Ultra only, only in workspaces not connected to Claude Tag; channels only, not DMsAdmin installs the Claude app from the Slack Marketplace; you click Connect in the App Home; /invite @Claude; or /install-slack-appDocs ↗
Routing modeintermediatesince not stated"Code only" or "Code + Chat" (auto detect); on a Chat reply, Switch to code repo... picks a repository and starts a Claude Code session with your messageClaude App Home > Routing ModeDocs ↗
Thread context and session flowbeginnersince not statedClaude reads your messages and its own in the thread, or in a channel your recent messages and its own plus the channel name, topic and description (paste a teammate's text to include it), posts progress, @mentions you with summary and buttons; Team visibility share; trust warning about instructions in contextMention @Claude with a taskDocs ↗
Claude Tag (public beta)intermediatesince public betaRuns @Claude as the organization's shared identity with admin configured access, checklists in thread, usage based billing under a spend limit; Team and Enterprise only (not Free, Pro, Max, or third party deployments)Owner pairs Slack workspace with the Claude orgDocs ↗
Platforms table entrybeginnersince not statedSlack vs Claude Tag guidanceTableDocs ↗

GitHub Actions, GitLab and code review

YAML
# .github/workflows/claude.yml
# Respond to @claude mentions in issue and PR comments (interactive mode).
# Source: https://code.claude.com/docs/en/github-actions#respond-to-claude-mentions
# Setup: run /install-github-app in Claude Code, or install https://github.com/apps/claude
# and add the ANTHROPIC_API_KEY repository secret yourself.
# Subscription auth instead of an API key: replace the anthropic_api_key line with
#   claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}   (token from `claude setup-token`)
name: Claude Code
on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]
jobs:
  claude:
    if: contains(github.event.comment.body, '@claude')
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      issues: write
      id-token: write
      actions: read
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 1
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
GitHub Actions, GitLab and other CIClaude Code GitHub Action, /install-github-app quick setup, Manual setup, Auth: API key or OAuth token and 16 more20 features
FeatureWhat it doesHowDocs
Claude Code GitHub Actionintermediatesince v1 GA; beta upgrade notesRuns Claude Code in workflows; @claude in PR or issue comments, reviews, or new issues; or any event with a promptuses: anthropics/claude-code-action@v1 (repo https://github.com/anthropics/claude-code-action)Docs ↗
/install-github-app quick setupbeginnersince review workflow posts on the PR from v2.1.229Installs the Claude GitHub App, stores the secret (ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN), pushes workflow files and opens a PR; github.com only; needs ghRun /install-github-app in the repo; Esc stops setupDocs ↗
Manual setupintermediatesince not statedInstall https://github.com/apps/claude, add secret, copy examples/claude.ymlRepo admin access requiredDocs ↗
Auth: API key or OAuth tokenbeginnersince not statedanthropic_api_key from Console, or claude_code_oauth_token from claude setup-token (Pro, Max, Ultra, Team, Enterprise)Repository or org secretDocs ↗
Auth: workload identity federationadvancedsince not statedExchange the workflow OIDC token for API access; inputs anthropic_federation_rule_id, anthropic_organization_id, anthropic_service_account_id, anthropic_workspace_id; needs id-token: writeConsole service account and federation ruleDocs ↗
GitHub App permissionsadvancedsince not statedActions, Checks, Contents, Discussions, Issues, Pull requests, Workflows (read/write) plus Administration, Members, Merge queues, Metadata, Statuses (read), Repository hooks (read/write); shared by all Claude GitHub features; use a custom app for a subsetInstall the appDocs ↗
Interactive vs automation modeintermediatesince not statedNo prompt = waits for trigger phrase (default @claude); prompt set = runs on the eventWorkflow configDocs ↗
Who can trigger runsadvancedsince not statedNeeds write access (allowed_non_write_users to override) and a human actor (allowed_bots to allow bots)InputsDocs ↗
Action parametersintermediatesince not statedprompt, claude_args, anthropic_api_key, claude_code_oauth_token, github_token, plugin_marketplaces, plugins, settings, trigger_phrase, use_bedrock, use_vertex, use_foundry; action.yml also has assignee_trigger, label_trigger, base_branch, branch_prefix, allowed_bots, track_progress, use_sticky_comment, use_commit_signing, additional_permissionswith: blockDocs ↗
claude_argsintermediatesince not statedPass CLI args: --max-turns, --model, --mcp-config, --allowedTools, --debugclaude_args: "--max-turns 5 --model claude-sonnet-5"Docs ↗
Run a skill or plugin in CIadvancedsince not statedPrompt can be /skill-name or /plugin:skill; install plugins via plugin_marketplaces and pluginsSee snippet github_action_review.ymlDocs ↗
Scheduled workflowintermediatesince not statedCron triggered automationSee snippet github_action_schedule.ymlDocs ↗
Cloud providers in Actionsadvancedsince not stateduse_bedrock, use_vertex, use_foundry with OIDC; custom GitHub App token stepSee snippet github_action_bedrock.ymlDocs ↗
Cost control in Actionsintermediatesince not statedConcise @claude, concise CLAUDE.md, --max-turns, workflow timeouts, concurrency limits; OAuth token runs use your subscriptionWorkflow configDocs ↗
Troubleshootingintermediatesince not statedNo response (check app, secrets, @claude as a whole word, write access); CI not running on Claude commits (do not pass GITHUB_TOKEN)See pageDocs ↗
Upgrade from betaintermediatesince not stated@beta to @v1, drop mode, direct_prompt becomes prompt, CLI options move into claude_argsEdit workflowDocs ↗
GitHub Enterprise Serveradvancedsince not statedCloud sessions, Code Review, Claude Security, teleport, plugin marketplaces and Actions (manual workflow) work with GHES for Team/Enterprise; GitHub MCP server and contribution metrics do notOwner: Organization settings > Git providersDocs ↗
GitLab CI/CDintermediatesince betaBeta, maintained by GitLab: a job in .gitlab-ci.yml running claude -p, triggered manually, by merge request events or @claude comments via webhook; Claude API, Bedrock (OIDC) or Agent Platform (WIF)Masked ANTHROPIC_API_KEY variable; see snippet gitlab_ci.ymlDocs ↗
Other CIintermediatesince `--permission-prompts` v2.1.259Any CI can run claude -p with --bare, --allowedTools, --permission-mode, --permission-prompts none, --max-turns, --max-budget-usd, --output-format json; token from claude setup-tokenSee snippet headless_ci.shDocs ↗
Bitbucket and other hostsintermediatesince GitLab URLs: What's new week 33--from-pr and --worktree accept GitLab MR and Bitbucket PR URLs; cloud sessions need GitHub (bundle fallback)CLI flagsDocs ↗
Code review and security reviewCode Review (managed), Availability limits, Setup steps, Review levels and 16 more20 features
FeatureWhat it doesHowDocs
Code Review (managed)intermediatesince not statedSeveral agents review each GitHub PR on Anthropic infrastructure, a verification step drops false positives, findings post inline with a "Claude Code Review" check run; never approves or blocks; Team and Enterprise, GitHub onlyOwner: Admin settings > Claude Code > Allow code reviewDocs ↗
Availability limitsadvancedsince not statedNot available with ZDR, HIPAA configuration or CMEK; GHES supportedCheck before setupDocs ↗
Setup stepsintermediatesince not statedAllow switch, connect GitHub, install the app, choose repos, Finish, test with a non draft PRAdmin pageDocs ↗
Review levelsintermediatesince not statedQuick, Standard (default), Deep; set per org or per repoAdmin pageDocs ↗
When reviews runintermediatesince not statedOnce after PR creation, After every push (default for new repos), or ManualRepository "Review runs" settingDocs ↗
Severity levelsbeginnersince not statedImportant (red), Nit (yellow), Pre existing (purple); "Why this was flagged" sectionRead findingsDocs ↗
Customize with REVIEW.md and CLAUDE.mdintermediatesince not statedREVIEW.md (root, plus most subdirectories on a protected branch) sets review only rules: cap nits, do not report, always check; read from the base/default branch only. Subdirectory files in or below test, example, generated or third party folders (such as tests, fixtures, vendor, node_modules) are skipped, and the other subdirectory files share a 150,000 byte limitCommit REVIEW.mdDocs ↗
Drafts and forksintermediatesince not statedSkipped by automatic reviews; request by commentComment commandDocs ↗
Analytics: findings by severityadvancedsince 2.1.316The Code Review analytics page shows the period's total findings, a daily chart stacked by severity and each severity's countCode Review analytics pageDocs ↗
Costs and spend limitadvancedsince not statedBilled on token usage through usage credits to the org; set a monthly Code Review limitclaude.ai/admin-settings/usageDocs ↗
Troubleshootingintermediatesince not statedNo check run, failed or timed out, skipped for budgetRe-run from the check runDocs ↗
--comment and GitLabintermediatesince not statedPosts findings as inline comments on a GitHub PR or a single note on a GitLab MR/code-review --commentDocs ↗
Ultrareviewadvancedsince `--post` v2.1.227Deep multi agent review in a cloud sandbox; each finding independently reproduced; research preview; needs claude.ai login; 3 free runs on Pro, Max and Ultra then usage credits/code-review ultra, /code-review ultra develop, /code-review ultra 1234; or claude ultrareview [target]; --post posts to a github.com PRDocs ↗
/security-reviewbeginnersince not statedSingle pass security review of the diff between your branch and origin's default branch (injection, auth, data exposure); needs an origin remote/security-reviewDocs ↗
Security review GitHub Actionintermediatesince not statedanthropics/claude-code-security-review@main: diff aware PR security scan with false positive filtering. Inputs claude-api-key, comment-pr, exclude-directories, claude-model, claudecode-timeout (default 20), run-every-commit, false-positive-filtering-instructions, custom-security-scan-instructions. Repo last pushed 2026-02-11Workflow with uses: anthropics/claude-code-security-review@mainDocs ↗
Customize /security-reviewadvancedsince not statedCopy security-review.md into .claude/commands/ and editProject command fileDocs ↗
security-guidance pluginintermediatesince not statedClaude reviews its own edits for vulnerabilities while it works and fixes them in the same session; per edit, end of turn and commit reviews; needs Python 3.7+ (3.10+ for agentic commit review)/plugin install security-guidance@claude-plugins-official; team: enabledPlugins in .claude/settings.jsonDocs ↗
Claude Security pluginadvancedsince not statedMulti agent whole repo or change scoped vulnerability scan with threat model and patch generation; runs locally on your models; needs Python 3.9+ and dynamic workflows/plugin install claude-security@claude-plugins-officialDocs ↗
Defense in depth tableintermediatesince not statedWhich tool covers which layer: security-guidance (as written), /security-review (on demand), Code Review (PR), Claude Security (deep scan)Read the tableDocs ↗
Compare review optionsbeginnersince not statedCode Review vs /code-review vs ultrareview vs your own CI vs your own subagent or skillRead the tableDocs ↗

Scheduling and background work

Shell
#!/usr/bin/env bash
# Background sessions: dispatch, watch, reattach, stop.
# The prompt is the positional argument; --bg cannot be combined with -p.
# Source: https://code.claude.com/docs/en/agent-view#manage-sessions-from-the-shell
claude --bg "investigate the flaky SettingsChangeDetector test"   # prints a short session id
claude agents                    # full-screen list of all sessions (interactive terminal needed)
claude agents --json             # active sessions as JSON for scripts
claude logs 7c5dcf5d             # recent output of one background session
claude attach 7c5dcf5d           # open it in this terminal (Left arrow returns to agent view)
claude stop 7c5dcf5d             # stop it; conversation is kept
Scheduling, background work and automationThree scheduling options, /loop, Skills in unattended runs, loop.md and 20 more24 features
FeatureWhat it doesHowDocs
Three scheduling optionsbeginnersince not statedCloud (runs with your machine off, min 1 hour), Desktop (your machine, 1 minute if Claude sets it, 1 hour in forms), /loop (open session, 1 minute)Pick from the comparison tableDocs ↗
/loopbeginnersince not statedRe run a prompt or skill on an interval inside the session: /loop 5m check the deploy; no interval = Claude paces itself (1 minute to 1 hour); bare /loop = built in maintenance prompt/loop [interval] [prompt]; units s, m, h, d; cancel fixed loops by asking Claude; Esc stops self-paced onesDocs ↗
Skills in unattended runsadvancedsince v2.1.325Scheduled tasks and /loop ask before running a skill that declares allowed-tools or hooks; add Skill(name) to permissions.allow to run it unattended"permissions": {"allow": ["Skill(name)"]}Docs ↗
loop.mdintermediatesince not statedReplaces the built in maintenance prompt: .claude/loop.md (project) or ~/.claude/loop.md (user); edits apply next iteration; 25,000 byte capCreate the fileDocs ↗
One time remindersbeginnersince not statedSingle fire tasks in natural language"remind me at 3pm to push the release branch"Docs ↗
Cron toolsintermediatesince not statedCronCreate (5-field cron), CronList, CronDelete; up to 50 tasks per session; local time zoneAsk Claude to list or cancelDocs ↗
Jitter and 7-day expiryintermediatesince not statedRecurring tasks run up to half the gap late (max 30 min), */5 runs 15 s sooner, one shots at :00/:30 up to 90 s early; recurring tasks expire after 7 daysSchedule off the hourDocs ↗
Disable the scheduleradvancedsince not statedTurns off cron tools and /loopCLAUDE_CODE_DISABLE_CRON=1Docs ↗
Cloud scheduled tasks (formerly routines)intermediatesince research previewSaved prompt + repos + connectors that run as cloud sessions on a schedule, an API call or a GitHub event; research preview; Pro, Max, Ultra, Team, Enterpriseclaude.ai/code/routines, Desktop > Scheduled, or /schedule (alias /routines)Docs ↗
Create from the CLIbeginnersince GitHub trigger from CLI v2.1.225Conversational creation: /schedule daily PR review at 9am; one off: /schedule in 2 weeks, open a cleanup PR; manage with /schedule update/schedule [description]Docs ↗
Schedule triggerintermediatesince not statedHourly/daily/weekly presets, custom cron (CRON_TZ= prefix, otherwise UTC), one off timestamps; minimum interval 1 hourEdit dialog on the webDocs ↗
API triggeradvancedsince not statedHTTP POST to the task's fire URL with a bearer token starts a session; token shown once; web onlyEdit task > Trigger row > + APIDocs ↗
GitHub triggeradvancedsince not statedStart a session on repo events such as pull_request.opened; needs the Claude GitHub App; per task and per account hourly capsEdit task on the webDocs ↗
Limitsadvancedsince not stated100 scheduled runs per hour per account; Run now/API/one-off rerun 30 per hour per task; no overage on these capsPlan accordinglyDocs ↗
Permissions in scheduled runsadvancedsince not statedAuto mode by default for cloud runs; connectors and environments define reachTask settingsDocs ↗
Org controladvancedsince not statedOwners toggle "Scheduled tasks (Was Routines)" under Remote sessions; custom roles need the permissionAdmin settingsDocs ↗
Desktop scheduled tasksintermediatesince Desktop 1.1.5368+Local recurring sessions with access to files and tools; fire only while the app is open and the computer awake; optional Worktree per run; to let a task change its own schedule or prompt with update_scheduled_task, click Run now and approve the call each timeSidebar > Scheduled > New taskDocs ↗
Disable agent viewadvancedsince not statedAdmin switchdisableAgentView managed settingDocs ↗
Run agents in parallelintermediatesince not statedCompare subagents, agent view, agent teams (experimental), dynamic workflows, projects, worktrees, /batch, /subtaskRead the tableDocs ↗
Headless mode (-p)beginnersince not statedNon interactive runs for scripts and CI; exit code 0 on successclaude -p "prompt" --allowedTools "Read,Edit,Bash"Docs ↗
Bare modeintermediatesince tighter limits v2.1.286Skips hooks, skills, plugins, MCP, auto memory and CLAUDE.md for fast reproducible runs; recommended for scripts and will become the -p defaultclaude --bare -p ...; load things explicitly with --settings, --mcp-config, --agents, --plugin-dir (hooks passed through --settings or a flag loaded plugin still don't run)Docs ↗
Budget and turn capsintermediatesince not stated--max-turns, --max-budget-usd (print mode only)CLI flagsDocs ↗
Hooks in CIadvancedsince not statedHooks are the same format; use --bare to avoid loading a teammate's hooks; admins can restrict with allowManagedHooksOnlysettings.json hooksDocs ↗
Agent SDKadvancedsince not statedPython and TypeScript packages with the same engine; the GitHub Action and GitLab job are built on ithttps://code.claude.com/docs/en/agent-sdk/overviewDocs ↗

Topic 6 of 7

Teams and enterprise

Cloud providers, admin, cost and troubleshooting.

Amazon Bedrock, Google Cloud, Foundry and gateways

Shell
#!/usr/bin/env bash
# Claude Code on Amazon Bedrock (manual setup via environment variables).
# Source: https://code.claude.com/docs/en/amazon-bedrock#set-up-manually
# Interactive alternative: run `claude`, choose "3rd-party platform" > "Amazon Bedrock",
# or run /setup-bedrock inside a session (wizard writes ~/.claude/settings.json).

# 1) Credentials: use the default AWS SDK chain. Pick ONE of these.
#    SSO profile:
#      aws sso login --profile=your-profile-name
#      export AWS_PROFILE=your-profile-name
#    Bedrock API key (bearer token, skips the credential chain):
#      export AWS_BEARER_TOKEN_BEDROCK=your-bedrock-api-key

# 2) Turn on Bedrock
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-east-1   # optional if your AWS profile already sets a region

# 3) Optional: different region for the small/fast model, or a custom endpoint or gateway
# export ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION=us-west-2
# export ANTHROPIC_BEDROCK_BASE_URL=https://bedrock-runtime.us-east-1.amazonaws.com

# 4) Pin model versions when rolling out to a team (aliases lag the newest release otherwise).
#    Example IDs from the docs; use the cross-region prefix for your region group (us., eu., apac., global.).
export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-8'
export ANTHROPIC_DEFAULT_SONNET_MODEL='us.anthropic.claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='us.anthropic.claude-haiku-4-5-20251001-v1:0'

# 5) Optional: keep built-in defaults but change the prefix, or pick a service tier
# export ANTHROPIC_BEDROCK_REGION_PREFIX=eu          # us | eu | apac | jp | au | global
# export ANTHROPIC_BEDROCK_SERVICE_TIER=priority     # default | flex | priority

# 6) Optional: Mantle endpoint (native Anthropic API shape on Bedrock)
# export CLAUDE_CODE_USE_MANTLE=1

# Verify: start `claude`, then run /status. The provider line should read "Amazon Bedrock".
ProvidersDeployment overview, Amazon Bedrock wizard, Bedrock manual setup, Bedrock credentials and 10 more14 features
FeatureWhat it doesHowDocs
Deployment overviewintermediatesince not statedCompare Teams/Enterprise, Console, Bedrock, Claude Platform on AWS, Agent Platform (Vertex), FoundryRead the tableDocs ↗
Amazon Bedrock wizardbeginnersince not statedGuided sign in for Bedrock (profile, API key, access key or env credentials), region and model pinsLogin screen > 3rd-party platform > Amazon Bedrock; /setup-bedrockDocs ↗
Bedrock manual setupintermediatesince not statedCLAUDE_CODE_USE_BEDROCK=1, AWS_REGION, optional ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION, ANTHROPIC_BEDROCK_BASE_URL; /logout unavailable; WebSearch unavailableSee snippet bedrock_env.shDocs ↗
Bedrock credentialsintermediatesince not statedAWS SDK chain, aws configure, access keys, SSO profile, console credentials, or AWS_BEARER_TOKEN_BEDROCK API key; awsAuthRefresh auto refresh; credential cachingAWS_PROFILE, settings awsAuthRefreshDocs ↗
Pin model versionsintermediatesince not statedPin ANTHROPIC_DEFAULT_OPUS_MODEL, _SONNET_, _HAIKU_ before team rollout; aliases otherwise use built in defaults that can lagEnv vars or settings envDocs ↗
Cross region prefixesadvancedsince not statedus., eu., apac., global., us-gov.; ANTHROPIC_BEDROCK_REGION_PREFIX (us, eu, apac, jp, au, global)Env varDocs ↗
Bedrock IAMadvancedsince not statedbedrock:InvokeModel, InvokeModelWithResponseStream, ListInferenceProfiles, GetInferenceProfile, plus Marketplace subscribeIAM policy in the docsDocs ↗
Bedrock extrasadvancedsince 1M default v2.1.2871M context by default for Fable, Sonnet 5+, Opus 4.7+; service tiers via ANTHROPIC_BEDROCK_SERVICE_TIER (default, flex, priority); Guardrails via ANTHROPIC_CUSTOM_HEADERS; Mantle endpoint via CLAUDE_CODE_USE_MANTLE=1Env varsDocs ↗
Agent Platform (Vertex) setupintermediatesince not statedCLAUDE_CODE_USE_VERTEX=1, CLOUD_ML_REGION, ANTHROPIC_VERTEX_PROJECT_ID, per model VERTEX_REGION_CLAUDE_*; role roles/aiplatform.user; wizard /setup-vertex; gcpAuthRefreshSee snippet vertex_env.shDocs ↗
Microsoft Foundry setupintermediatesince not statedCLAUDE_CODE_USE_FOUNDRY=1, ANTHROPIC_FOUNDRY_RESOURCE (name only) or ANTHROPIC_FOUNDRY_BASE_URL; auth via ANTHROPIC_FOUNDRY_API_KEY, Entra ID (az login) or ANTHROPIC_FOUNDRY_AUTH_TOKEN; no wizard; roles Azure AI User or Cognitive Services UserSee snippet foundry_env.shDocs ↗
Claude Platform on AWSadvancedsince not statedAnthropic operated API with AWS auth, IAM and Marketplace billingCLAUDE_CODE_USE_ANTHROPIC_AWS=1, ANTHROPIC_AWS_WORKSPACE_ID, optional ANTHROPIC_AWS_API_KEYDocs ↗
Claude Models on Google Cloud (Anthropic managed)advancedsince v2.1.307Claude API run by Anthropic and reached through your Google Cloud project with Google IAM and Marketplace billing; needs role roles/claude.user; /status shows on Google Cloud; no fast mode, Remote Control, cloud sessions, claude.ai connectors, Channels or server managed settingsgcloud auth application-default login; CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD=1, ANTHROPIC_GOOGLE_CLOUD_PROJECT, ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_IDDocs ↗
Feature availability matrixintermediatesince not statedWhich features work per provider: web search not on Bedrock, Advisor not on Bedrock, Agent Platform or Foundry, fast mode not on Bedrock, Foundry or Claude Platform on AWS (Fable 5.2 on Agent Platform with conditions), Channels, Remote Control, cloud sessions, Chrome, Ultrareview need a claude.ai loginRead the tablesDocs ↗
Claude Desktop on 3Padvancedsince not statedRuns the Code tab on Bedrock, Agent Platform, Foundry or a self hosted gatewayclaude.com/docs/third-party/claude-desktop/overviewDocs ↗
Gateways, network, containersLLM gateway (bring your own), Gateway rollout and protocol, Claude apps gateway, Gateway pooled group budgets and 20 more24 features
FeatureWhat it doesHowDocs
LLM gateway (bring your own)advancedsince not statedOne place for credentials, usage, budgets, audit logs, provider switchingANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY or apiKeyHelper; see snippet gateway_env.shDocs ↗
Gateway rollout and protocoladvancedsince `allowedProviders` v2.1.285Admin checklist, compatibility guide (endpoints, headers, feature pass through); allowedProviders: ["customEndpoint"] locks machines to the gatewayManaged settingsDocs ↗
Claude apps gatewayadvancedsince 2.1.312 optionSelf hosted gateway built into the claude binary: IdP SSO, short lived tokens, group model access, managed settings delivery, OTLP telemetry, routes to Bedrock, Claude Platform on AWS, Agent Platform, Foundry or Anthropic APIclaude gateway --config gateway.yaml; oidc.user_id_claim added in 2.1.312Docs ↗
Gateway pooled group budgetsadvancedsince 2.1.316One monthly budget that a group's members share, on top of each member's own limitpooled_budget on the spend limits admin APIDocs ↗
Gateway spend limits in Claude Desktopadvancedsince Desktop 4.23118.0+Members of admin.admin_groups manage spend limits from Claude Desktop connected to the gateway; all other configuration stays in the YAML fileClaude Desktop connected to the gatewayDocs ↗
Gateway layered policy modeadvancedsince 2.1.316Every managed policy that matches a developer applies, each merged over the ones listed below it, instead of only the firstmanaged.policy_mode: layered in the gateway configDocs ↗
Gateway Bedrock guardrail input taggingadvancedsince 2.1.316Wraps prompts in the input tags an Amazon Bedrock guardrail's prompt attacks filter needs; all_messages_and_system also tags the system promptguardrail.input_tagging on a Bedrock upstreamDocs ↗
Gateway guardrail traceadvancedsince 2.1.314Writes a guardrail.trace event to the audit log naming which Amazon Bedrock guardrail filter fired, without the matched text; an earlier gateway refuses to start when it finds the keyguardrail_trace: true on the Bedrock upstream, beside guardrailDocs ↗
Gateway per team upstreamsadvancedsince 2.1.314Only developers in a listed IdP group reach an upstream, on the first try and on failover, so each team can use its own AWS account or Google Cloud project; put an upstream with no groups list last, because it serves everyone and listed earlier takes a team's requests ahead of its own upstreamgroups: [payments-eng] on an upstream in gateway.yamlDocs ↗
Gateway assume_role on mantle upstreamsadvancedsince 2.1.318Set assume_role on a mantle upstream so its requests go through a role in another AWS account, with session_name for per developer AWS cost attribution. Give the role Mantle's IAM actions. An earlier gateway exits at startup with Unrecognized key(s) in object: 'assume_role'.assume_role: on the mantle upstream in gateway.yamlDocs ↗
Gateway cost reportadvancedsince 2.1.317Admin API that reads past spend over a date range in total, per developer, per day or per IdP group; with admin: set the gateway keeps a daily record of each developer's IdP groups for admin.identity_retention_daysGET /v1/organizations/analytics/costDocs ↗
Gateway pricing blockadvancedsince 2.1.227; markup above 1 from 2.1.271Tells the spend meter what to charge instead of USD list price, so caps and /effective reflect contracted rates. multiplier (default 1, above 1 is a markup, at most 10) scales every amount and overrides rows set input, output, cache_read and cache_write per upstream and model. Needs an admin: block, or a managed: block with at least one policy.pricing: {multiplier: 0.85} in gateway.yamlDocs ↗
Gateway static upstream headersadvancedsince 2.1.277Adds fixed headers to the requests the gateway sends to one upstream, for a proxy you run that routes or attributes traffic by a header. A gateway on an earlier version refuses to start when it finds the key.headers: on an upstream in gateway.yamlDocs ↗
Gateway forward_user_identityadvancedsince 2.1.233On a provider: anthropic upstream whose base_url is a proxy you run, adds x-litellm-end-user-id, x-claude-gateway-user-id and x-claude-gateway-user-email headers so the proxy can attribute spend per developer. Default false; the gateway refuses to start if base_url is the Anthropic API.forward_user_identity: true on an upstreamDocs ↗
Gateway oidc.scope_on_refreshadvancedsince not statedAlso sends scope with the sign in scope list when the gateway exchanges a refresh token. Default false. Set it to true when your IdP returns an id token on refresh only if asked for openid again, which Okta documents for its refresh grant.oidc.scope_on_refresh: trueDocs ↗
Gateway anthropicGoogleCloud upstreamadvancedsince v2.1.307Sends model requests to Claude Models on Google Cloud (Anthropic managed) through your Google Cloud project; both project_id and workspace_id are required, auth: {} uses Application Default Credentials, gateway replicas need Claude Code v2.1.307 or later, and the gateway's Google identity needs roles/claude.user on the projectprovider: anthropicGoogleCloud under upstreams:Docs ↗
Gateway desktop block plugin keysadvancedsince 2.1.260The gateway validates a desktop policy block against its bundled schema, so settings introduced by a newer Claude Desktop need a newer gateway. userPluginMarketplacesEnabled and userPluginUploadsEnabled need Claude Code 2.1.260 or later on the gateway server and Claude Desktop 1.37937.0 or later on members' machines.desktop: block in the gateway policyDocs ↗
Corporate proxyintermediatesince not statedHTTPS_PROXY, HTTP_PROXY, NO_PROXY; no SOCKSSee snippet proxy_ca_env.shDocs ↗
CA certificatesintermediatesince not statedBundled Mozilla CAs plus OS store by default (CLAUDE_CODE_CERT_STORE); extra CA with NODE_EXTRA_CA_CERTSEnv varsDocs ↗
mTLSadvancedsince not statedCLAUDE_CODE_CLIENT_CERT, CLAUDE_CODE_CLIENT_KEY, CLAUDE_CODE_CLIENT_KEY_PASSPHRASE; hot reload after connection errorsEnv varsDocs ↗
Network allowlistintermediatesince not statedapi.anthropic.com, claude.ai, claude.com, platform.claude.com, sso.claude.com, mcp-proxy.anthropic.com, downloads.claude.ai, registry.npmjs.org, github.com, raw.githubusercontent.com, bridge.claudeusercontent.com, code.claude.com, optional Datadog hostsFirewall rulesDocs ↗
Turn off nonessential trafficadvancedsince not statedStops telemetry, version checks and release notes; disables auto update, fast mode check and feature flags (so also Remote Control)CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1Docs ↗
Dev containersadvancedsince not statedDev Container Feature, persistent ~/.claude volume with CLAUDE_CONFIG_DIR, /etc/claude-code/managed-settings.json in the image, init-firewall.sh egress rules in the reference container, --dangerously-skip-permissions allowed only as non rootSee snippet devcontainer.jsonDocs ↗
Sandboxingintermediatesince not statedOS level filesystem and network isolation; /sandbox toggles it; sandbox.enabled, sandbox.network.allowedDomains/sandbox or settingsDocs ↗

Admin, identity, plans and limits

JSON
{
  "permissions": {
    "deny": [
      "Bash(curl *)",
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(./secrets/**)"
    ],
    "disableBypassPermissionsMode": "disable"
  },
  "allowManagedPermissionRulesOnly": true,
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc",
    "OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.example.com:4317",
    "OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Bearer example-token"
  }
}
Admin, identity, dataAdmin setup map, Managed settings delivery, Server managed settings, Enforcement keys and 14 more18 features
FeatureWhat it doesHowDocs
Admin setup mapintermediatesince not statedDecision list: provider, settings delivery, enforcement, usage visibility, data handlingRead the pageDocs ↗
Managed settings deliveryadvancedsince not statedPriority: server managed (admin console or Claude apps gateway), plist/HKLM registry, managed file, HKCU. File paths: macOS /Library/Application Support/ClaudeCode/managed-settings.json, Linux/WSL /etc/claude-code/managed-settings.json, Windows C:\Program Files\ClaudeCode\managed-settings.jsonPick one mechanismDocs ↗
Server managed settingsadvancedsince doctor line v2.1.248; no approval prompt 2.1.316Owners edit JSON at Organization settings > Claude Code > Managed settings; clients fetch at startup and hourly; Team and Enterprise only; claude doctor reports Managed settings (remote); from 2.1.316 settings fetched from Anthropic's API apply without an approval prompt, and a stored copy that fails verification is refused; the cached copy expires 24 hours after the last successful fetch, and a failed startup fetch after that starts the session without server managed settings unless forceRemoteSettingsRefresh is setclaude.ai/admin-settings/claude-codeDocs ↗
Enforcement keysadvancedsince per keypermissions.allow/deny, allowManagedPermissionRulesOnly, permissions.disableBypassPermissionsMode, disableAutoMode, sandbox.*, allowedMcpServers/deniedMcpServers/managedMcpServers, strictPluginOnlyCustomization, allowManagedHooksOnly, forceLoginMethod, forceLoginOrgUUID, allowedProviders, availableModels, maxEffortLevel, minimumVersion, requiredMinimumVersion, requiredMaximumVersion, disableAgentView, wslInheritsWindowsSettingsManaged settings JSON (see snippet managed_settings.json)Docs ↗
Managed policy CLAUDE.mdadvancedsince not statedOrganization wide guidance file at the managed policy pathDeploy the fileDocs ↗
Organization model controlsadvancedsince not statedDisable models, set org default model, cap effort per role, enforced server side for Enterprise subscription loginsAdmin settingsDocs ↗
SSO, SCIM, seatsadvancedsince not statedSSO on Team and Enterprise; SCIM and Compliance API on Enterprise; configured at the Claude account level, not in Claude CodeClaude admin console, Help CenterDocs ↗
Restrict loginadvancedsince applies on all login paths from v2.1.212forceLoginMethod (claudeai, console, gateway) and forceLoginOrgUUID; blocks env var credentials when setDeploy via MDMDocs ↗
Authentication precedenceintermediatesince not statedCloud provider vars, then ANTHROPIC_AUTH_TOKEN, then ANTHROPIC_API_KEY, then apiKeyHelper, then subscription loginKnow the orderDocs ↗
Long lived token for CIintermediatesince not statedOne year OAuth token for Pro, Max, Ultra, Team, Enterprise; set as CLAUDE_CODE_OAUTH_TOKEN; cannot start Remote Controlclaude setup-tokenDocs ↗
Credential storageintermediatesince not statedmacOS Keychain (falls back to ~/.claude/.credentials.json), Linux and Windows file with restricted accessAutomaticDocs ↗
Data usageintermediatesince not statedFree, Pro, Max: choose whether data trains models (5-year vs 30-day retention); Team, Enterprise, API: no training by default, 30-day retention; local transcripts under ~/.claude/projects/ for 30 days (cleanupPeriodDays)claude.ai/settings/data-privacy-controlsDocs ↗
Telemetry opt outsintermediatesince error reporting v2.1.198+DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, DISABLE_FEEDBACK_COMMAND, CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC; all default off on Bedrock, Agent Platform, Foundry, Claude Platform on AWSEnv varsDocs ↗
Zero Data Retentionadvancedsince not statedPrompts and responses not stored after the response; Claude for Enterprise, qualified accounts, enabled per org by AnthropicContact sales; enforce with forceLoginMethod + forceLoginOrgUUIDDocs ↗
HIPAA configurationadvancedsince not statedOrg setting on Claude Enterprise with a BAA; covers CLI and the Code tab (local mode), not cloud sessions, Remote Control, mobile, gateways, VS Code or JetBrainsPrimary Owner applies it; follow the prep guideDocs ↗
Legal and complianceadvancedsince not statedCommercial vs Consumer terms, BAA, embedding Claude Code in products (unmodified binary, users bring their own credentials), AUP, Trust Center, HackerOne reportingRead the pageDocs ↗
Security overviewintermediatesince not statedThreat model and safeguardsRead the pageDocs ↗
Rollout kitsbeginnersince not statedChampion kit and communications kit for internal adoptionRead the pagesDocs ↗
Plans, access and usage limits (as the docs and pricing page state them, fetched 2026-10-28)Free plan, Pro, Max, Ultra and 12 more16 features
FeatureWhat it doesHowDocs
Free planbeginnersince not statedNo Claude Code (pricing comparison shows "No")claude.com/pricingDocs ↗
Probeginnersince not statedClaude Code included; $17 per month with annual billing ($200 up front) or $20 if billed monthlyclaude.com/pricingDocs ↗
Maxbeginnersince not statedEverything in Pro with 5x Pro usage every 5 hours and every week, $100 a month in API credits, early access to advanced Claude features and priority access at high traffic times; $100 per month. Max is the new name for the former Max 5x planclaude.com/pricingDocs ↗
Ultrabeginnersince not statedThe new name for the former Max 20x plan; $200 per month on the pricing page. In Claude Code, Max and Ultra have the same features, listed in the Max and Ultra columns of the availability tableclaude.com/pricingDocs ↗
Teamintermediatesince not statedStandard seat $20 per seat per month billed annually ($25 monthly); Premium seat (5x standard usage) $100 annual ($125 monthly); for 2 to 150 people; Claude Code included in paid plansclaude.com/pricingDocs ↗
Enterpriseintermediatesince not stated$20 per seat per month billed annually plus usage at API rates, 20-seat minimum (as shown on the pricing page); adds SCIM, audit logs, custom retention, role based accessclaude.com/pricingDocs ↗
API / Consoleintermediatesince not statedPay as you go through a Console account; workspaces with spend limitsSign in with Console or set ANTHROPIC_API_KEYDocs ↗
Plan feature matrixintermediatesince not statedCloud sessions and scheduled tasks on all paid plans; Remote Control and Channels admin enabled on Team/Enterprise; computer use and Dispatch Pro/Max/Ultra only; Code Review, analytics, server managed settings and SSO Team/Enterprise; SCIM, Compliance API, ZDR EnterpriseRead the tableDocs ↗
Usage limitsbeginnersince message wording "5-hour limit" in 2.1.312All plans have limits on a rolling 5-hour window; paid plans add weekly limits; chat and Claude Code share one pool; no fixed message countCheck Settings > Usage or /usageDocs ↗
When you hit a limitintermediatesince auto wait v2.1.234Wait for reset, upgrade (/upgrade), or turn on usage credits (/usage-credits); Claude Code can wait and continue after the reset/rate-limit-options; autoContinueAtUsageLimitDocs ↗
Usage creditsintermediatesince not statedKeep working past plan limits at API rates; admins set spend limits per org, group or member/usage-credits; claude.ai/settings/usageDocs ↗
Team and Enterprise allowanceintermediatesince not statedPer seat allowance on 5-hour and weekly windows, shared with chat and CoworkSeat tierDocs ↗
API rate limit guidance (TPM and RPM)advancedsince not statedPer user: 1-5 users 200k-300k TPM and 5-7 RPM; 5-20: 100k-150k and 2.5-3.5; 20-50: 50k-75k and 1.25-1.75; 50-100: 25k-35k and 0.62-0.87; 100-500: 15k-20k and 0.37-0.47; 500+: 10k-15k and 0.25-0.35Request org limits accordinglyDocs ↗
Typical spendintermediatesince not statedAverage about $13 per developer per active day and $150-250 per developer per month; under $30 per active day for 90% of usersPilot firstDocs ↗
Which features need a claude.ai loginbeginnersince not statedCloud sessions, mobile, Slack, Desktop, /schedule, ultrareview, Code Review, Remote Control, Chrome, computer use, Artifacts, voice dictationSign in with /loginDocs ↗
Share a free weekbeginnersince not stated/passes shares a free week of Claude Code (only if your account is eligible)/passesDocs ↗

Cost, usage and monitoring

Shell
#!/usr/bin/env bash
# OpenTelemetry monitoring for Claude Code.
# Source: https://code.claude.com/docs/en/monitoring-usage#quick-start
# Org-wide: put the same keys in the "env" block of managed settings (see managed_settings.json).
# Claude Code ignores OTEL exporter variables set in a repo's .claude/settings.json.

# 1) Enable telemetry (required)
export CLAUDE_CODE_ENABLE_TELEMETRY=1

# 2) Exporters (configure only what you need)
export OTEL_METRICS_EXPORTER=otlp          # otlp | prometheus | console | none
export OTEL_LOGS_EXPORTER=otlp             # otlp | console | none   (events are emitted as logs)

# 3) OTLP endpoint. Claude Code has no default protocol, so set one.
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc    # grpc | http/json | http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317

# 4) Auth, if your collector needs it
# export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer your-token"

# 5) Debugging: shorter export intervals (defaults: metrics 60000 ms, logs 5000 ms)
export OTEL_METRIC_EXPORT_INTERVAL=10000
export OTEL_LOGS_EXPORT_INTERVAL=5000

# 6) Privacy gates, all OFF by default. Turn on only if you need the content.
# export OTEL_LOG_USER_PROMPTS=1       # prompt text
# export OTEL_LOG_TOOL_DETAILS=1       # Bash commands, MCP/skill names, tool inputs
# export OTEL_LOG_TOOL_CONTENT=1       # tool output in span events (needs tracing)

# 7) Optional distributed tracing (beta)
# export CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1
# export OTEL_TRACES_EXPORTER=otlp

# Verify: look for the metric claude_code.session.count in your backend, or the
# claude_code.user_prompt event after sending a prompt. If nothing arrives:
#   claude --debug-file /tmp/claude-otel.log   and search the log for "[3P telemetry]" errors.
claude
Observability, cost and usage tracking/usage (aliases /cost, /stats), /insights, Status line cost display, Status line cache fields and 18 more22 features
FeatureWhat it doesHowDocs
/usage (aliases /cost, /stats)beginnersince cache line v2.1.251; loops v2.1.242; `f` v2.1.305; totals reset on `/clear` v2.1.211Session cost (client side list price), tokens by model, prompt cache line, plan usage bars, attribution by skill, subagent, plugin and MCP server, /loop rows, recommendations; d/w toggle 24 h or 7 days/usage; f applies fixesDocs ↗
/insightsintermediatesince not statedHTML report on how you use Claude Code on this machine/insightsDocs ↗
Status line cost displaybeginnersince not statedCustom bottom bar fed JSON including cost.total_cost_usd, duration, lines changed, context use/statusline or statusLine in settings; see the statusline pageDocs ↗
Status line cache fieldsadvancedsince not statedprompt_cache object available to scriptsStatus line scriptDocs ↗
Token count by the spinnerbeginnersince not statedLive token counterDefault UIDocs ↗
Cost reduction tipsbeginnersince not statedContext management, model choice, MCP overhead, hooks, skills over CLAUDE.md, thinking budget, subagentsRead the pageDocs ↗
Analytics dashboard (Team, Enterprise)intermediatesince contribution metrics public betaUsage metrics, contribution metrics via GitHub integration, leaderboard, CSV exportclaude.ai/analytics/claude-code (Admin or Owner)Docs ↗
Console analytics (API)intermediatesince not statedUsage, spend tracking, team insightsplatform.claude.com/claude-codeDocs ↗
Enterprise Analytics APIadvancedsince Enterprise onlyPer user usage and cost across surfacesKey with read:analytics scope at claude.ai/analytics/api-keysDocs ↗
OpenTelemetry quick startadvancedsince not statedExport metrics and events to any OTLP backendCLAUDE_CODE_ENABLE_TELEMETRY=1, OTEL_METRICS_EXPORTER, OTEL_LOGS_EXPORTER, OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_EXPORTER_OTLP_ENDPOINT; see snippet otel_env.shDocs ↗
Host attributes in OTel resourcesadvancedsince v2.1.326OTEL_RESOURCE_INCLUDE_HOST adds host.name and host.id to OpenTelemetry resource attributes; off by defaultOTEL_RESOURCE_INCLUDE_HOST env varDocs ↗
OTel metricsadvancedsince not statedclaude_code.session.count, .lines_of_code.count, .pull_request.count, .commit.count, .cost.usage (USD), .token.usage, .code_edit_tool.decision, .active_time.total (s)Backend queriesDocs ↗
OTel eventsadvancedsince `OTEL_LOG_MANAGED_SETTINGS` v2.1.274Logs/events include claude_code.user_prompt, assistant_response, tool_result, tool_decision, api_request, api_error, api_refusal, api_retries_exhausted, permission_mode_changed, auth, mcp_server_connection, plugin_installed, plugin_loaded, skill_activated, at_mention, hook_*, compaction, subagent_completed, feedback_survey, retention_sweep, managed_settings_resolved, internal_error, safety_event; prompt.id links all events from one promptOTEL_LOGS_EXPORTER=otlpDocs ↗
Content privacy gatesadvancedsince not statedOff by default: OTEL_LOG_USER_PROMPTS, OTEL_LOG_ASSISTANT_RESPONSES, OTEL_LOG_TOOL_DETAILS, OTEL_LOG_TOOL_CONTENT, OTEL_LOG_RAW_API_BODIES; content cap CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH (60 KB)Env varsDocs ↗
Traces (beta)advancedsince betaSpans link a prompt to API requests and tool runs; TRACEPARENT passed to Bash/PowerShellCLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1 + OTEL_TRACES_EXPORTER=otlpDocs ↗
Admin configured telemetryadvancedsince not statedPut the env block in managed settings; OTLP destination is locked; repo level OTEL vars are ignoredSee snippet managed_settings.jsonDocs ↗
Dynamic headers, multi team, cardinality control, mTLSadvancedsince not statedRotating OTLP headers via a helper; team attributes; reduce metric cardinality; client certs for exportersSee headingsDocs ↗
Security audit eventsadvancedsince not statedMap security questions to events, send to a SIEM, check the retention sweepSee headingsDocs ↗
Cloud sessions and Claude Tag telemetryadvancedsince not statedTelemetry from cloud sessions with attributionSee pageDocs ↗
Bedrock monitoringadvancedsince not statedAWS guidance project for Bedrock monitoringLink on the pageDocs ↗
Code Review spend viewintermediatesince not statedReview activity and spend in its own dashboardAdminDocs ↗
Cost caps for runsadvancedsince not stated--max-budget-usd, --max-turns, modelPricing managed table for accurate cost figuresCLI flags, managed settingsDocs ↗

Troubleshooting and diagnostics

Diagnostics, debug flags, feedback, logs/doctor, claude doctor, /context, /status and 10 more14 features
FeatureWhat it doesHowDocs
/doctorbeginnersince not statedIn session setup checkup of install health, invalid settings, unused extensions, duplicate subagent names, redundant CLAUDE.md content; proposes fixes you confirm; /doctor prompt-audit [path] audits instructions/doctorDocs ↗
claude doctorbeginnersince remote settings line v2.1.248Read only installation and settings diagnostics without starting a session (install health, validation errors, Remote Control eligibility, remote managed settings)claude doctor in the shellDocs ↗
/contextbeginnersince not statedBreakdown of everything in the context window/contextDocs ↗
/statusbeginnersince session kind row v2.1.221Version, model, account, connectivity, setting sources, provider, session kind/statusDocs ↗
/debug [issue]intermediatesince not statedTurns on debug logging for the session and diagnoses from the log/debugDocs ↗
--debug, --debug-file, DEBUG=1intermediatesince not statedDebug mode with category filter (--debug='mcp,startup', '!mcp'); log to a path; default log ~/.claude/debug/<session-id>.txtclaude --debug-file /tmp/claude-debug.log; CLAUDE_CODE_DEBUG_LOGS_DIR (a file path), CLAUDE_CODE_DEBUG_LOG_LEVELDocs ↗
--verbosebeginnersince not statedFull turn by turn outputclaude --verboseDocs ↗
--safe-modeintermediatesince not statedStarts with CLAUDE.md, skills, plugins, hooks, MCP, commands, agents, styles, themes, keybindings, status line, LSP and auto memory all disabledclaude --safe-modeDocs ↗
/heapdumpadvancedsince not statedWrites a heap snapshot and diagnostics JSON to ~/Desktop/heapdumpDocs ↗
/bug and /feedbackbeginnersince not statedSend a report (consent screen, choose how much history); stored 5 years when sent; on third party providers saved to ~/.claude/feedback-bundles/; DISABLE_FEEDBACK_COMMAND=1 turns off/bug [report], /feedback [report]Docs ↗
Claude drafted feedbackintermediatesince What's new week 35Claude drafts a report for you to review and send/feedback opens the drafts queueDocs ↗
Where logs liveintermediatesince not statedDebug: ~/.claude/debug/<session-id>.txt; transcripts: ~/.claude/projects/; credentials: ~/.claude/.credentials.json (non macOS); background supervisor: ~/.claude/daemon.log; background jobs: ~/.claude/jobs/<id>/; IDE lock files: ~/.claude/ide/<port>.lock; feedback: ~/.claude/feedback-bundles/Inspect the pathsDocs ↗
Error referenceintermediatesince not statedMessage by message fixesSearch the pageDocs ↗
Get helpbeginnersince not stated/doctor, /mcp, /feedback, GitHub issues, ask Claude itself; account and billing questions go to support.claude.comSee pageDocs ↗

More features

3 Auth, in-session use, limits/mcp panel, OAuth 2.0 flow, OAuth callback port, MCP resources via @ and 17 more21 features
FeatureWhat it doesHowDocs
/mcp panelbeginnersince not statedCheck server status, authenticate (OAuth in the browser), re authenticate, clear auth, reconnect, enable or disable./mcp, or /mcp reconnect <server|all>, /mcp enable|disable <server|all>Docs ↗
OAuth 2.0 flowbeginnersince not statedA 401/403 from a remote server flags it "Needs authentication"; tokens are stored securely and refreshed automatically; a rejected refresh token gives a notice pointing at /mcp. claude -p cannot run OAuth, so sign in interactively first./mcp or claude mcp login <name>Docs ↗
OAuth callback portadvancedsince not statedFix the redirect port.--callback-port 8080 or MCP_OAUTH_CALLBACK_PORTDocs ↗
MCP resources via @beginnersince not statedType @ to list resources from connected servers; reference one as @server:protocol://path. Fetched and attached automatically.Analyze @github:issue://123Docs ↗
MCP prompts as commandsbeginnersince not statedServer prompts show up as /mcp__<server>__<prompt>; arguments are space separated./mcp__github__pr_review 456Docs ↗
Elicitationintermediatesince `elicitation` capability for user config servers v2.1.287Servers can ask you for form input or to open a URL mid task. Auto answer with an Elicitation hook.automaticDocs ↗
Elicitation in a cloud sessionintermediatesince link card 2.1.317 (changelog)When an MCP server request shows as a card at claude.ai/code or in the Desktop Code tab, fill a form and click Submit, or click Open link, finish the flow and click I’m done, continue; Decline refuses. With no card, the request cannot be answered thereanswer on the cardDocs ↗
Tool search (lazy loading)intermediatesince not statedMCP tool definitions are deferred; only names load at start and Claude searches on demand. On by default for Opus 4, Sonnet 4, Haiku 4.5 and later.ENABLE_TOOL_SEARCH=true|auto|auto:N|false; exempt a server with "alwaysLoad": true; deny the ToolSearch tool to load all upfront.Docs ↗
Output limitsintermediatesince not statedWarning above 10,000 tokens; default max 25,000 tokens (MAX_MCP_OUTPUT_TOKENS); text over 50,000 characters is saved to a file; servers can raise a tool's cap with _meta["anthropic/maxResultSizeChars"]; responses over 16 MiB fail.export MAX_MCP_OUTPUT_TOKENS=50000Docs ↗
bareElicitationCapabilityadvancedsince 2.1.287If an MCP server no longer connects after the update that added URL prompts from servers on the 2025-11-25 protocol (for example to sign in), add this key set to true in that server's MCP config entry."bareElicitationCapability": trueDocs ↗
MCP_TIMEOUTintermediatesince not statedServer startup timeout in ms (default 30000).MCP_TIMEOUT=60000 claudeDocs ↗
MCP_TOOL_TIMEOUTintermediatesince not statedTool execution timeout in ms (default 100000000, about 28 hours); HTTP/SSE requests also time out at 60 s unless raised.MCP_TOOL_TIMEOUT=120000Docs ↗
Idle timeoutadvancedsince not statedAborts a call that sends no response or progress for 5 minutes (HTTP/SSE/WS) by default; 0 disables.CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT (ms)Docs ↗
Auto backgroundingintermediatesince not statedAn MCP call still running after two minutes moves to a background task (see /tasks).automaticDocs ↗
Startup tuningadvancedsince not statedNon blocking startup by default; MCP_CONNECTION_NONBLOCKING=0, MCP_CONNECT_TIMEOUT_MS, MCP_SERVER_CONNECTION_BATCH_SIZE (3 local), MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE (20).env varsDocs ↗
Tool level approvaladvancedsince not statedServers can force a prompt on every call with _meta["anthropic/requiresUserInteraction"]: true, even in bypass mode.server sideDocs ↗
Push messages with channelsadvancedsince not statedA server declaring claude/channel can push events (CI results, alerts) into your session; opt in with --channels.claude --channels ...Docs ↗
Server side MCP tasksadvancedsince not statedLong server tasks that survive leaving the session; stop or fetch them from /tasks.automaticDocs ↗
Automatic reconnectionintermediatesince not statedRemote servers reconnect after drops; retry failed ones yourself with /mcp reconnect./mcp reconnect allDocs ↗
MCP client runtimesadvancedsince v2 default from v2.1.232 / v2.1.274 depending on session typev1 (SDK 1.x) or v2 (SDK 2.0, protocol revision 2026-07-28). Pin with MCP_SDK_GENERATION.env varDocs ↗
MCP quickstartbeginnersince not statedWalk through connecting a server end to end.claude mcp add --transport http sentry https://mcp.sentry.dev/mcp, then /mcpDocs ↗
1 Built-in subagents and managing agentsExplore, Plan, general-purpose, Other built ins and 10 more14 features
FeatureWhat it doesHowDocs
Explorebeginnersince not statedFast read only search agent (Write/Edit denied); starts without CLAUDE.md and git status; thoroughness quick, medium, very thorough.Claude delegates automaticallyDocs ↗
Planbeginnersince not statedRead only research agent used in plan mode to gather context.automatic in plan modeDocs ↗
general-purposebeginnersince not statedAll tools agent for multi step research plus changes.automaticDocs ↗
Other built insintermediatesince not statedclaude (catch all, default for background sessions), statusline-setup (Sonnet, runs on /statusline), claude-code-guide (Haiku, answers Claude Code questions).automaticDocs ↗
Remove built insadvancedsince v2.1.198Block a type with permissions.deny, deny Agent to stop all delegation, or drop Explore and Plan.CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS=1 (v2.1.198); SDK/-p: CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1Docs ↗
/agents commandbeginnersince changed after v2.1.197In current docs it only prints a reminder to ask Claude to create or manage subagents or to edit .claude/agents/. Before v2.1.197 it opened an interactive editor./agentsDocs ↗
claude agentsintermediatesince not statedDifferent feature: the background agent view (research preview). --json lists sessions; flags --model, --effort, --agent, --cwd, --mcp-config, --add-dir.claude agents, claude --bg, /backgroundDocs ↗
Create a file agentbeginnersince not statedMarkdown with YAML frontmatter (name, description required) and the system prompt as body. Changes are picked up within seconds (restart needed for a brand new agents dir)..claude/agents/code-reviewer.mdDocs ↗
Scope: managedadvancedsince not statedHighest priority (1), org wide..claude/agents/ in the managed settings dirDocs ↗
Scope: --agents flagintermediatesince file form v2.1.281Session only, priority 2. JSON of name -> {description, prompt, tools, model ...}; file form with --print. color and experimental ignored here.claude --agents '{...}'Docs ↗
Scope: projectbeginnersince not statedPriority 3. Walks up from cwd; closest definition wins. Commit it..claude/agents/Docs ↗
Scope: userbeginnersince not statedPriority 4, all your projects; subfolders allowed (identity comes from name).~/.claude/agents/Docs ↗
Scope: pluginintermediatesince not statedPriority 5 (lowest); appears as plugin:agent. Plugin agents ignore hooks, mcpServers, permissionMode, initialPrompt.plugin agents/Docs ↗
Validate agent filesintermediatesince not statedFind files whose frontmatter does not parse.claude plugin validate .claude/agentsDocs ↗

Topic 7 of 7

Reference

The PDF, latest releases, 2026 changes and answers.

Get the PDF and release alerts

PDF · 65 pages · 7.3 MB

Get the PDF and release alerts

The whole sheet in one file: a beginner, an intermediate and an advanced poster, the recipes, and every feature with its link to the official page. Tick the box and I will also email you when Claude Code ships a new feature, at most once a week.

Enter your email and the PDF arrives in your inbox.

A fan of pages from the Claude Code cheat sheet

Latest releases

The latest Claude Code release is 2.1.327. This list comes from the official changelog and is refreshed every day, so it can be newer than the rest of the page. Last check: Nov 18, 2026.

  1. 2.1.327 · Nov 17, 20266 changes
    • Added a confirmation before /install-github-app changes a repository
    • Added claude mcp add-json <name> - to read the server's JSON from stdin, so tokens can stay off the command line; not available inside a Claude Code session
    • Added a line when a resumed session's earlier messages can't be loaded
    • Added a list in /status of broken agent, skill, command and output style files, keybinding errors, an unavailable sandbox, ignored permission settings and hook matchers that never match
    • Added a note in /config when other settings override a row
    • Added x-claude-code-managed-settings-checksum to the gateway hint headers; sent where managed settings set CLAUDE_CODE_GATEWAY_HINT_HEADERS=1, including where they already do
  2. 2.1.326 · Nov 16, 20266 changes
    • Added support for turning on Code Mode while agent teams are enabled; if you already turned it on, sessions with teams on now start in Code Mode
    • Added a startup warning when an --allowedTools, --disallowedTools or --tools value has an entry that doesn't look like a complete rule
    • Added a message explaining why MCP servers stop loading when an administrator adds managed-mcp.json during a session
    • Added a row to /status that says when your provider or an environment variable such as DISABLE_TELEMETRY turns features off
    • Added a note in /plugin and claude plugin list when a malformed plugin.json field such as author or homepage is ignored
    • Added Ctrl+O to show hidden startup notices
  3. 2.1.325 · Nov 13, 20266 changes
    • Added a spinner tip in VS Code and similar integrated terminals about re running a notebook cell, shown once Claude has read or edited a Jupyter notebook
    • Added a line under the error shown when your organization's policy blocks a request, saying how to continue: run /rewind and change the message, or run /clear
    • Added a note for Claude when a sandboxed git checkout, git stash or autostash pull cannot update protected files such as those in .claude
    • Windows: Fixed a start up stall that could last about a second when a PATH entry sits under a folder your account cannot open
    • Linux: Fixed sandboxed Bash commands failing with bwrap: Can't create file when the working directory was below an allowRead folder inside a denyRead, such as under a symlinked home directory
    • Improved subagents cut off at the output token limit: they are now asked for the whole answer again, more briefly, instead of returning only its end
  4. 2.1.323 · Nov 12, 20266 changes
    • Added Code Mode, an experimental opt in in which Claude writes JavaScript to call its tools; see https://code.claude.com/docs/en/code mode to turn it on, or to turn it off for an organization
    • Added engines["claude-code"] to plugin.json: plugins outside their stated Claude Code version range are not installed, updated or loaded, and install and update pick the newest version that fits
    • Added type checking of a plugin's TypeScript hooks module to claude plugin validate; each finding is a warning, and --strict fails on it
    • Added to claude plugin validate the $ nouns a mod's engine.create hook adds, withholds or replaces
    • Added support for CLAUDE_CODE_AUTO_MODE_MODEL in managed settings for Claude Desktop sessions on third party providers (takes effect once Claude Desktop includes this version)
    • Added an options menu (stop, switch to usage credits, upgrade) when a model needs usage credits that are turned off or used up
  5. 2.1.321 · Nov 9, 20266 changes
    • Added Claude Fable 5.2 (claude-fable-5-2), now the default Fable model, 1M context, $8/$40 per Mtok with $0.20/Mtok cache reads
    • Added --settings <file> to claude remote-control, which applies a settings file to every session it starts; if the file changes, no new session starts until you restart claude remote-control
    • Windows: Fixed FileChanged hooks stopping for paths set through watchPaths after the first shell command, when the session's working directory had a lowercase drive letter
    • macOS: Fixed "Unable to read managed policy settings" at startup when a valid MDM profile was slow to read: the read is retried once, and a timeout is now reported as a timeout
    • Improved the /model picker: "More models" is now an unnumbered row below every other, and older models open under it without renumbering the rest
    • Gateway: Improved spend limits on a busy replica, which now skips fewer checks and records spend sooner
  6. 2.1.319 · Nov 6, 20266 changes
    • Changed auto mode with telemetry or feature flags off, including behind LLM gateways: calls the server can't check are asked about or denied, with no fallback to the built in classifier; set CLAUDE_CODE_AUTO_MODE_SERVER=0 to keep using it (Bedrock, Vertex and Foundry are unchanged)
    • Changed auto mode behind an LLM gateway: CLAUDE_CODE_AUTO_MODE_SERVER=1 turns on the server side check even with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS set; if managed settings set the latter, they must set the 1 too
    • Added support for MCP tasks in the terminal: when an MCP server runs a tool call as a task, Claude Code moves it to the background right away and tells Claude the result when it finishes
    • Added the CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND environment variable to make Claude Code wait for an MCP task inside its tool call instead of moving it to the background right away
    • Added permissions.denyInsteadOfPrompting setting: a tool call that would wait on a permission prompt is denied and the turn continues, in terminal sessions, subagents and teammates
    • Added /claude-api latency-optimize to find where your Claude API code makes people wait and try faster settings against your eval
  7. 2.1.318 · Nov 3, 20266 changes
    • Added a record of your answer when Claude Code asks to turn on the mods it writes in a session
    • Added assume_role on mantle upstreams of the Claude apps gateway, for a role in another AWS account and for per developer AWS cost attribution
    • Added an effort option to a mod's $.model.fork, so a quick side job can run at low whatever effort the session uses; the result reports the effort sent
    • Added the date a stored claude.ai sign in ends to claude auth status (loginExpiresAt) and to claude -p JSON results (credential_expires_at)
    • Added a one line stderr warning to claude -p text output, starting 10 days before a stored claude.ai sign in ends
    • Improved how ~/.claude.json, settings files and the stored login survive saves on shared network home directories: they are less often deleted, briefly emptied or replaced by a near empty or older copy
  8. 2.1.317 · Nov 2, 20266 changes
    • Added a warning to /schedule when a new cloud scheduled task gets connectors you did not ask for, with how to remove them
    • Added a check that asks before a web or shell tool call sends your account email address to the network
    • Added onFailure: "block" for Agent SDK hook callbacks, so a callback that fails blocks the action instead of letting it run
    • Added a notice in Claude Desktop's Code tab when your organization's remote managed settings haven't loaded for the session, and another once they do
    • Added a notice when auto mode's check has no answer for a subagent's tool call, which used to leave nothing in the main view
    • Added anthropic.plan, anthropic.seat_type, anthropic.provider and anthropic.custom_base_url to OTel metrics, events and spans
  9. 2.1.316 · Oct 31, 20266 changes
    • Added CLAUDE_CODE_DISABLE_ULTRATHINK, which turns the ultrathink keyword off
    • Added pooled group budgets to the Claude apps gateway: one monthly budget that a group's members share, on top of each member's own limit, set with pooled_budget on the spend limits admin API
    • Added CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP to keep system cross certificates that certify each other in a loop, for servers whose private CA needs one
    • Added CLAUDE_CODE_SUBAGENT_EFFORT to set the effort level subagents run at when nothing else names one, instead of inheriting the session's
    • Added managed.policy_mode: layered to the Claude apps gateway: every policy that matches a developer applies, each merged over the ones listed below it, not only the first
    • Added guardrail.input_tagging on Claude apps gateway Bedrock upstreams, which wraps prompts in the input tags that an Amazon Bedrock guardrail's prompt attacks filter needs; all_messages_and_system also tags the system prompt
  10. 2.1.314 · Oct 30, 20266 changes
    • Added permissions.blockWritesOutsideWorkingDirectories: Write, Edit and NotebookEdit refuse paths outside the working directories in every permission mode
    • Added an optional groups list to Claude apps gateway upstreams: only developers in the listed IdP groups are sent to that upstream, on failover too
    • Added guardrail_trace to Claude apps gateway Bedrock upstreams, to log which Amazon Bedrock guardrail filter fired on a request, without the matched text
    • Added idle compaction to VS Code and Claude Desktop's Code tab: a 200K+ token conversation left idle is summarized, and the summary is used on your next message if the prompt cache has expired
    • Self hosted runner: Fixed an idle session moving to another runner instead of pausing when the runner's request to pause it lost its connection before Anthropic answered
    • Improved memory use in long headless and SDK turns that run many subagents: the parent session no longer keeps each subagent's tool results until the turn ends

Full history: CHANGELOG.md on GitHub

What changed in 2026

  1. Jan 7 · 2.1.0

    Skills hot reload, wildcard Bash permission rules such as Bash(npm *), hooks in agent and skill frontmatter, and /teleport. CHANGELOG.md on GitHub

  2. Feb 5 to 6 · 2.1.32 and 2.1.33

    Claude Opus 4.6, agent teams as a research preview, and memory frontmatter for agents. CHANGELOG.md on GitHub

  3. Feb 19 · 2.1.49

    --worktree and -w for an isolated git worktree. CHANGELOG.md on GitHub

  4. Mar 6 · 2.1.71

    /loop and in session scheduling tools. CHANGELOG.md on GitHub

  5. Mar 20 · 2.1.81

    --bare for scripted -p calls. CHANGELOG.md on GitHub

  6. Apr 4 · 2.1.92

    /tag and /vim were removed. Vim mode is under /config now. CHANGELOG.md on GitHub

  7. Apr 22 · 2.1.118

    /cost and /stats merged into /usage. CHANGELOG.md on GitHub

  8. May 11 · 2.1.139

    Agent view (claude agents) as a research preview, and /goal. CHANGELOG.md on GitHub

  9. May 21 · 2.1.147

    /simplify was renamed /code-review. /review became an alias of it on Aug 5. CHANGELOG.md on GitHub

  10. Jun 24 to 30 · 2.1.191 to 2.1.197

    /rewind can resume from before /clear, admins can set an organization default model, and Claude Sonnet 5 became the default model. CHANGELOG.md on GitHub

  11. Jul 1 · 2.1.198

    The /agents wizard was removed. Ask Claude or edit .claude/agents/. CHANGELOG.md on GitHub

  12. Jul 8 · 2.1.205

    /doctor became a full setup checkup. CHANGELOG.md on GitHub

  13. Aug 4 · 2.1.222

    The ultraplan feature was removed. Use plan mode. CHANGELOG.md on GitHub

  14. Aug 7 · 2.1.224

    Self hosted environments for Team and Enterprise, and the 200 subagent per session cap was removed. CHANGELOG.md on GitHub

  15. Sep 1 · 2.1.257

    Claude Fable 5.1 became the default Fable model. CHANGELOG.md on GitHub

  16. Sep 4 · 2.1.261

    /skill-doctor shows each skill's context cost and usage. CHANGELOG.md on GitHub

  17. Sep 22 and 28 · 2.1.280 and 2.1.284

    Claude Opus 5.5 and Claude Sonnet 5.5 became the default Opus and Sonnet models. CHANGELOG.md on GitHub

  18. Nov 9 · 2.1.321

    Claude Fable 5.2 became the default Fable model. CHANGELOG.md on GitHub

  19. Nov 12 · 2.1.323

    Code Mode arrived as an experimental feature: Claude writes JavaScript that makes several tool calls in one step. CHANGELOG.md on GitHub

  20. Nov 13 · 2.1.325

    Sandboxed Bash commands now follow the normal permission flow by default; set sandbox.autoAllowBashIfSandboxed: true to run them without prompts. Claude Code changelogCHANGELOG.md on GitHub

  21. Nov 16 · 2.1.326

    Code Mode can run with agent teams on, and Ctrl+O shows hidden startup notices. The latest release at the time of this check. See the live list above for anything newer. Claude Code changelogCHANGELOG.md on GitHub

All dates are 2026. These libraries release often, so read each changelog before you take a minor release.

Questions people ask

How do I install Claude Code?

Run curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux or WSL, or the PowerShell installer on Windows. Homebrew, WinGet, apt, dnf and apk are also documented. The native install updates itself.

How do I undo something Claude changed?

Press Esc twice on an empty prompt, or type /rewind. You can restore the code, the conversation or both. Changes made only through Bash or outside Claude Code are not restored, so keep using Git.

What is the difference between a skill, a subagent and a hook?

A skill is a workflow Claude loads when the task matches. A subagent is a helper with its own context window and tools. A hook is your own script that runs at a fixed point, such as before a tool call, so a rule always holds.

Why did my hook not block the tool call?

A hook blocks only with exit code 2, or with a JSON deny. Exit code 1 is a non blocking error and the tool still runs. @ file mentions also bypass PreToolUse hooks.

How do I use Claude Code in a script or CI?

Use print mode: claude -p "prompt" --output-format json. Add --json-schema for a checked result, --max-budget-usd to cap spend and --bare to skip hooks, skills, plugins and MCP.

How do I keep Claude out of my secrets?

Use Read(...) deny rules for the files, and turn on the sandbox. A .claudeignore file does nothing, and Bash deny rules are not a security boundary on their own.

How often does Claude Code change?

Very often. There were 273 npm releases between Jan 6 and Oct 31, 2026, about six a week. That is why the release list on this page refreshes daily, and why the PDF carries a date.

Can I get an email when Claude Code ships a new feature?

Yes. Use the form on this page and tick the alerts box. I check the official changelog every day and email you at most once a week, only when there is a new feature. You confirm by email first and every email has an unsubscribe link.

Sources

Your AI agents, built by an AI engineer. No handoffs, no lock in. Start my agent build.