modified Claude Code on Amazon Bedrock View current →
--- a/amazon-bedrock.md +++ b/amazon-bedrock.md @@ -11,28 +11,43 @@ * AWS CLI installed and configured (optional - only needed if you don’t have another mechanism for getting credentials) * Appropriate IAM permissions -If you are deploying Claude Code to multiple users, pin your model versions to prevent breakage when Anthropic releases new models. - -## - -​ - -Set up with the interactive wizard - -The login screen includes an interactive Bedrock setup wizard for first-time configuration. Select **3rd-party platform** at the `claude` login prompt, then choose **Amazon Bedrock** to launch it. The wizard guides you through each step and writes the resulting configuration to your settings: - - * AWS authentication - * Region selection - * Credential verification - * Model pinning - -Once Bedrock is active, use `/setup-bedrock` to return to the wizard and update your credentials, region, or model pins. - -## - -​ - -Setup +To sign in with your own Bedrock credentials, follow Sign in with Bedrock below. To deploy Claude Code across a team, use the manual setup steps and pin your model versions before rolling out. + +## + +​ + +Sign in with Bedrock + +If you have AWS credentials and want to start using Claude Code through Bedrock, the login wizard walks you through it. You complete the AWS-side prerequisites once per account; the wizard handles the Claude Code side. + +1 + +Enable Anthropic models in your AWS account + +In the [Amazon Bedrock console](<https://console.aws.amazon.com/bedrock/>), open the Model catalog, select an Anthropic model, and submit the use case form. Access is granted immediately after submission. See Submit use case details for AWS Organizations and IAM configuration for the permissions your role needs. + +2 + +Start Claude Code and choose Bedrock + +Run `claude`. At the login prompt, select **3rd-party platform** , then **Amazon Bedrock**. + +3 + +Follow the wizard prompts + +Choose how you authenticate to AWS: an AWS profile detected from your `~/.aws` directory, a Bedrock API key, an access key and secret, or credentials already in your environment. The wizard picks up your region, verifies which Claude models your account can invoke, and lets you pin them. It saves the result to the `env` block of your [user settings file](</docs/en/settings>), so you don’t need to export environment variables yourself. + +After you’ve signed in, run `/setup-bedrock` any time to reopen the wizard and change your credentials, region, or model pins. + +## + +​ + +Set up manually + +To configure Bedrock through environment variables instead of the wizard, for example in CI or a scripted enterprise rollout, follow the steps below. ### @@ -140,7 +155,7 @@ 4\. Pin model versions -Pin specific model versions for every deployment. If you use model aliases (`sonnet`, `opus`, `haiku`) without pinning, Claude Code may attempt to use a newer model version that isn’t available in your Bedrock account, breaking existing users when Anthropic releases updates. +Pin specific model versions when deploying to multiple users. Without pinning, model aliases such as `sonnet` and `opus` resolve to the latest version, which may not yet be available in your Bedrock account when Anthropic releases an update. Claude Code falls back to the previous version at startup when the latest is unavailable, but pinning lets you control when your users move to a new model. Set these environment variables to specific Bedrock model IDs: @@ -186,6 +201,14 @@ } When a user selects one of these versions in `/model`, Claude Code calls Bedrock with the mapped ARN. Versions without an override fall back to the built-in Bedrock model ID or any matching inference profile discovered at startup. See [Override model IDs per version](</docs/en/model-config#override-model-ids-per-version>) for details on how overrides interact with `availableModels` and other model settings. + +## + +​ + +Startup model checks + +When Claude Code starts with Bedrock configured, it verifies that the models it intends to use are accessible in your account. This check requires Claude Code v2.1.94 or later. If you have pinned a model version that is older than the current Claude Code default, and your account can invoke the newer version, Claude Code prompts you to update the pin. Accepting writes the new model ID to your [user settings file](</docs/en/settings>) and restarts Claude Code. Declining is remembered until the next default version change. Pins that point to an application inference profile ARN are skipped, since those are managed by your administrator. If you have not pinned a model and the current default is unavailable in your account, Claude Code falls back to the previous version for the current session and shows a notice. The fallback is not persisted. Enable the newer model in your Bedrock account or pin a version to make the choice permanent. ##
modified Authentication View current →
--- a/authentication.md +++ b/authentication.md @@ -155,6 +155,23 @@ 2. `ANTHROPIC_AUTH_TOKEN` environment variable. Sent as the `Authorization: Bearer` header. Use this when routing through an [LLM gateway or proxy](</docs/en/llm-gateway>) that authenticates with bearer tokens rather than Anthropic API keys. 3. `ANTHROPIC_API_KEY` environment variable. Sent as the `X-Api-Key` header. Use this for direct Anthropic API access with a key from the [Claude Console](<https://platform.claude.com>). In interactive mode, you are prompted once to approve or decline the key, and your choice is remembered. To change it later, use the “Use custom API key” toggle in `/config`. In non-interactive mode (`-p`), the key is always used when present. 4. [`apiKeyHelper`](</docs/en/settings#available-settings>) script output. Use this for dynamic or rotating credentials, such as short-lived tokens fetched from a vault. - 5. Subscription OAuth credentials from `/login`. This is the default for Claude Pro, Max, Team, and Enterprise users. + 5. `CLAUDE_CODE_OAUTH_TOKEN` environment variable. A long-lived OAuth token generated by `claude setup-token`. Use this for CI pipelines and scripts where browser login isn’t available. + 6. Subscription OAuth credentials from `/login`. This is the default for Claude Pro, Max, Team, and Enterprise users. If you have an active Claude subscription but also have `ANTHROPIC_API_KEY` set in your environment, the API key takes precedence once approved. This can cause authentication failures if the key belongs to a disabled or expired organization. Run `unset ANTHROPIC_API_KEY` to fall back to your subscription, and check `/status` to confirm which method is active. [Claude Code on the Web](</docs/en/claude-code-on-the-web>) always uses your subscription credentials. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` in the sandbox environment do not override them. + +### + +​ + +Generate a long-lived token + +For CI pipelines, scripts, or other environments where interactive browser login isn’t available, generate a one-year OAuth token with `claude setup-token`: + + claude setup-token + +The command walks you through OAuth authorization and prints a token to the terminal. It does not save the token anywhere; copy it and set it as the `CLAUDE_CODE_OAUTH_TOKEN` environment variable wherever you want to authenticate: + + export CLAUDE_CODE_OAUTH_TOKEN=your-token + +This token authenticates with your Claude subscription and requires a Pro, Max, Team, or Enterprise plan. It is scoped to inference only and cannot establish [Remote Control](</docs/en/remote-control>) sessions. [Bare mode](</docs/en/headless#start-faster-with-bare-mode>) does not read `CLAUDE_CODE_OAUTH_TOKEN`. If your script passes `--bare`, authenticate with `ANTHROPIC_API_KEY` or an `apiKeyHelper` instead.
modified Changelog View current →
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,68 @@ This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Run `claude --version` to check your installed version. + +​ + +2.1.98 + +April 9, 2026 + + * Added interactive Google Vertex AI setup wizard accessible from the login screen when selecting “3rd-party platform”, guiding you through GCP authentication, project and region configuration, credential verification, and model pinning + * Added `CLAUDE_CODE_PERFORCE_MODE` env var: when set, Edit/Write/NotebookEdit fail on read-only files with a `p4 edit` hint instead of silently overwriting them + * Added Monitor tool for streaming events from background scripts + * Added subprocess sandboxing with PID namespace isolation on Linux when `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` is set, and `CLAUDE_CODE_SCRIPT_CAPS` env var to limit per-session script invocations + * Added `--exclude-dynamic-system-prompt-sections` flag to print mode for improved cross-user prompt caching + * Added `workspace.git_worktree` to the status line JSON input, set whenever the current directory is inside a linked git worktree + * Added W3C `TRACEPARENT` env var to Bash tool subprocesses when OTEL tracing is enabled, so child-process spans correctly parent to Claude Code’s trace tree + * LSP: Claude Code now identifies itself to language servers via `clientInfo` in the initialize request + * Fixed a Bash tool permission bypass where a backslash-escaped flag could be auto-allowed as read-only and lead to arbitrary code execution + * Fixed compound Bash commands bypassing forced permission prompts for safety checks and explicit ask rules in auto and bypass-permissions modes + * Fixed read-only commands with env-var prefixes not prompting unless the var is known-safe (`LANG`, `TZ`, `NO_COLOR`, etc.) + * Fixed redirects to `/dev/tcp/...` or `/dev/udp/...` not prompting instead of auto-allowing + * Fixed stalled streaming responses timing out instead of falling back to non-streaming mode + * Fixed 429 retries burning all attempts in ~13s when the server returns a small `Retry-After` — exponential backoff now applies as a minimum + * Fixed MCP OAuth `oauth.authServerMetadataUrl` config override not being honored on token refresh after restart, affecting ADFS and similar IdPs + * Fixed capital letters being dropped to lowercase on xterm and VS Code integrated terminal when the kitty keyboard protocol is active + * Fixed macOS text replacements deleting the trigger word instead of inserting the substitution + * Fixed `--dangerously-skip-permissions` being silently downgraded to accept-edits mode after approving a write to a protected path via Bash + * Fixed managed-settings allow rules remaining active after an admin removed them, until process restart + * Fixed `permissions.additionalDirectories` changes not applying mid-session — removed directories lose access immediately and added ones work without restart + * Fixed removing a directory from `additionalDirectories` revoking access to the same directory passed via `--add-dir` + * Fixed `Bash(cmd:*)` and `Bash(git commit *)` wildcard permission rules failing to match commands with extra spaces or tabs + * Fixed `Bash(...)` deny rules being downgraded to a prompt for piped commands that mix `cd` with other segments + * Fixed false Bash permission prompts for `cut -d /`, `paste -d /`, `column -s /`, `awk '{print $1}' file`, and filenames containing `%` + * Fixed permission rules with names matching JavaScript prototype properties (e.g. `toString`) causing `settings.json` to be silently ignored + * Fixed agent team members not inheriting the leader’s permission mode when using `--dangerously-skip-permissions` + * Fixed a crash in fullscreen mode when hovering over MCP tool results + * Fixed copying wrapped URLs in fullscreen mode inserting spaces at line breaks + * Fixed file-edit diffs disappearing from the UI on `--resume` when the edited file was larger than 10KB + * Fixed several `/resume` picker issues: `--resume <name>` opening uneditable, filter reload wiping search state, empty list swallowing arrow keys, cross-project staleness, and transient task-status text replacing conversation summaries + * Fixed `/export` not honoring absolute paths and `~`, and silently rewriting user-supplied extensions to `.txt` + * Fixed `/effort max` being denied for unknown or future model IDs + * Fixed slash command picker breaking when a plugin’s frontmatter `name` is a YAML boolean keyword + * Fixed rate-limit upsell text being hidden after message remounts + * Fixed MCP tools with `_meta["anthropic/maxResultSizeChars"]` not bypassing the token-based persist layer + * Fixed voice mode leaking dozens of space characters into the input when re-holding the push-to-talk key while the previous transcript is still processing + * Fixed `DISABLE_AUTOUPDATER` not fully suppressing the npm registry version check and symlink modification on npm-based installs + * Fixed a memory leak where Remote Control permission handler entries were retained for the lifetime of the session + * Fixed background subagents that fail with an error not reporting partial progress to the parent agent + * Fixed prompt-type Stop/SubagentStop hooks failing on long sessions, and hook evaluator API errors showing “JSON validation failed” instead of the real message + * Fixed feedback survey rendering when dismissed + * Fixed Bash `grep -f FILE` / `rg -f FILE` not prompting when reading a pattern file outside the working directory + * Fixed stale subagent worktree cleanup removing worktrees that contain untracked files + * Fixed `sandbox.network.allowMachLookup` not taking effect on macOS + * Improved `/resume` filter hint labels and added project/worktree/branch names in the filter indicator + * Improved footer indicators (Focus, notifications) to stay on the mode-indicator row instead of wrapping at narrow terminal widths + * Improved `/agents` with a tabbed layout: a Running tab shows live subagents, and the Library tab adds Run agent and View running instance actions + * Improved `/reload-plugins` to pick up plugin-provided skills without requiring a restart + * Improved Accept Edits mode to auto-approve filesystem commands prefixed with safe env vars or process wrappers + * Improved Vim mode: `j`/`k` in NORMAL mode now navigate history and select the footer pill at the input boundary + * Improved hook errors in the transcript to include the first line of stderr for self-diagnosis without `--debug` + * Improved OTEL tracing: interaction spans now correctly wrap full turns under concurrent SDK calls, and headless turns end spans per-turn + * Improved transcript entries to carry final token usage instead of streaming placeholders + * Updated the `/claude-api` skill to cover Managed Agents alongside Claude API + * [VSCode] Fixed false-positive “requires git-bash” error on Windows when `CLAUDE_CODE_GIT_BASH_PATH` is set or Git is installed at a default location + * Fixed `CLAUDE_CODE_MAX_CONTEXT_TOKENS` to honor `DISABLE_COMPACT` when it is set. + * Dropped `/compact` hints when `DISABLE_COMPACT` is set. ​
modified Checkpointing View current →
--- a/checkpointing.md +++ b/checkpointing.md @@ -113,5 +113,5 @@ See also * [Interactive mode](</docs/en/interactive-mode>) \- Keyboard shortcuts and session controls - * [Built-in commands](</docs/en/commands>) \- Accessing checkpoints using `/rewind` + * [Commands](</docs/en/commands>) \- Accessing checkpoints using `/rewind` * [CLI reference](</docs/en/cli-reference>) \- Command-line options
modified Use Claude Code on the web View current →
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -751,7 +751,7 @@ There are a few ways to turn on auto-fix depending on where the PR came from and what device you’re using: * **PRs created in Claude Code on the web** : open the CI status bar and select **Auto-fix** - * **From your terminal** : run [`/autofix-pr`](</docs/en/commands#built-in-commands>) while on the PR’s branch. Claude Code detects the open PR with `gh`, spawns a web session, and turns on auto-fix in one step + * **From your terminal** : run [`/autofix-pr`](</docs/en/commands>) while on the PR’s branch. Claude Code detects the open PR with `gh`, spawns a web session, and turns on auto-fix in one step * **From the mobile app** : tell Claude to auto-fix the PR, for example “watch this PR and fix any CI failures or review comments” * **Any existing PR** : paste the PR URL into a session and tell Claude to auto-fix it
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -24,6 +24,7 @@ `claude mcp`| Configure Model Context Protocol (MCP) servers| See the [Claude Code MCP documentation](</docs/en/mcp>). `claude plugin`| Manage Claude Code [plugins](</docs/en/plugins>). Alias: `claude plugins`. See [plugin reference](</docs/en/plugins-reference#cli-commands-reference>) for subcommands| `claude plugin install code-review@claude-plugins-official` `claude remote-control`| Start a [Remote Control](</docs/en/remote-control>) server to control Claude Code from Claude.ai or the Claude app. Runs in server mode (no local interactive session). See [Server mode flags](</docs/en/remote-control#start-a-remote-control-session>)| `claude remote-control --name "My Project"` +`claude setup-token`| Generate a long-lived OAuth token for CI and scripts. Prints the token to the terminal without saving it. Requires a Claude subscription. See [Generate a long-lived token](</docs/en/authentication#generate-a-long-lived-token>)| `claude setup-token` ## @@ -54,6 +55,7 @@ `--disable-slash-commands`| Disable all skills and commands for this session| `claude --disable-slash-commands` `--disallowedTools`| Tools that are removed from the model’s context and cannot be used| `"Bash(git log *)" "Bash(git diff *)" "Edit"` `--effort`| Set the [effort level](</docs/en/model-config#adjust-effort-level>) for the current session. Options: `low`, `medium`, `high`, `max` (Opus 4.6 only). Session-scoped and does not persist to settings| `claude --effort high` +`--exclude-dynamic-system-prompt-sections`| Move per-machine sections from the system prompt (working directory, environment info, memory paths, git status) into the first user message. Improves prompt-cache reuse across different users and machines running the same task. Only applies with the default system prompt; ignored when `--system-prompt` or `--system-prompt-file` is set. Use with `-p` for scripted, multi-user workloads| `claude -p --exclude-dynamic-system-prompt-sections "query"` `--fallback-model`| Enable automatic fallback to specified model when default model is overloaded (print mode only)| `claude -p --fallback-model sonnet "query"` `--fork-session`| When resuming, create a new session ID instead of reusing the original (use with `--resume` or `--continue`)| `claude --resume abc123 --fork-session` `--from-pr`| Resume sessions linked to a specific GitHub PR. Accepts a PR number or URL. Sessions are automatically linked when created via `gh pr create`| `claude --from-pr 123`
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -1,12 +1,14 @@ -Type `/` in Claude Code to see all available commands, or type `/` followed by any letters to filter. Not all commands are visible to every user. Some depend on your platform, plan, or environment. For example, `/desktop` only appears on macOS and Windows, `/upgrade` and `/privacy-settings` are only available on Pro and Max plans, and `/terminal-setup` is hidden when your terminal natively supports its keybindings. Claude Code also includes [bundled skills](</docs/en/skills#bundled-skills>) like `/simplify`, `/batch`, `/debug`, and `/loop` that appear alongside built-in commands when you type `/`. To create your own commands, see [skills](</docs/en/skills>). In the table below, `<arg>` indicates a required argument and `[arg]` indicates an optional one. +Commands control Claude Code from inside a session. They provide a quick way to switch models, manage permissions, clear context, run a workflow, and more. Type `/` to see every command available to you, or type `/` followed by letters to filter. The table below lists all the commands included in Claude Code. Entries marked **[Skill](</docs/en/skills#bundled-skills>)** are bundled skills. They use the same mechanism as skills you write yourself: a prompt handed to Claude, which Claude can also invoke automatically when relevant. Everything else is a built-in command whose behavior is coded into the CLI. To add your own commands, see [skills](</docs/en/skills>). Not every command appears for every user. Availability depends on your platform, plan, and environment. For example, `/desktop` only shows on macOS and Windows, and `/upgrade` only shows on Pro and Max plans. In the table below, `<arg>` indicates a required argument and `[arg]` indicates an optional one. Command| Purpose ---|--- `/add-dir <path>`| Add a working directory for file access during the current session. Most `.claude/` configuration is [not discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from the added directory `/agents`| Manage [agent](</docs/en/sub-agents>) configurations `/autofix-pr [prompt]`| Spawn a [Claude Code on the web](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>) session that watches the current branch’s PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with `gh pr view`; to watch a different PR, check out its branch first. By default the remote session is told to fix every CI failure and review comment; pass a prompt to give it different instructions, for example `/autofix-pr only fix lint and type errors`. Requires the `gh` CLI and access to [Claude Code on the web](</docs/en/claude-code-on-the-web#who-can-use-claude-code-on-the-web>) +`/batch <instruction>`| **[Skill](</docs/en/skills#bundled-skills>).** Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one background agent per unit in an isolated [git worktree](</docs/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees>). Each agent implements its unit, runs tests, and opens a pull request. Requires a git repository. Example: `/batch migrate src/ from Solid to React` `/btw <question>`| Ask a quick [side question](</docs/en/interactive-mode#side-questions-with-btw>) without adding to the conversation `/chrome`| Configure [Claude in Chrome](</docs/en/chrome>) settings +`/claude-api`| **[Skill](</docs/en/skills#bundled-skills>).** Load Claude API reference material for your project’s language (Python, TypeScript, Java, Go, Ruby, C#, PHP, or cURL). Covers tool use, streaming, batches, structured outputs, Managed Agents, and common pitfalls. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk` `/clear`| Clear conversation history and free up context. Aliases: `/reset`, `/new` `/color [color|default]`| Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset `/compact [instructions]`| Compact conversation with optional focus instructions @@ -14,6 +16,7 @@ `/context`| Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings `/copy [N]`| Copy the last assistant response to clipboard. Pass a number `N` to copy the Nth-latest response: `/copy 2` copies the second-to-last. When code blocks are present, shows an interactive picker to select individual blocks or the full response. Press `w` in the picker to write the selection to a file instead of the clipboard, which is useful over SSH `/cost`| Show token usage statistics. See [cost tracking guide](</docs/en/costs#using-the-cost-command>) for subscription-specific details +`/debug [description]`| **[Skill](</docs/en/skills#bundled-skills>).** Enable debug logging for the current session and troubleshoot issues by reading the session debug log. Debug logging is off by default unless you started with `claude --debug`, so running `/debug` mid-session starts capturing logs from that point forward. Optionally describe the issue to focus the analysis `/desktop`| Continue the current session in the Claude Code Desktop app. macOS and Windows only. Alias: `/app` `/diff`| Open an interactive diff viewer showing uncommitted changes and per-turn diffs. Use left/right arrows to switch between the current git diff and individual Claude turns, and up/down to browse files `/doctor`| Diagnose and verify your Claude Code installation and settings @@ -34,6 +37,7 @@ `/keybindings`| Open or create your keybindings configuration file `/login`| Sign in to your Anthropic account `/logout`| Sign out from your Anthropic account +`/loop [interval] <prompt>`| **[Skill](</docs/en/skills#bundled-skills>).** Run a prompt repeatedly on an interval while the session stays open. Useful for polling a deployment, babysitting a PR, or periodically re-running another skill. Example: `/loop 5m check if the deploy finished`. See [Run prompts on a schedule](</docs/en/scheduled-tasks>) `/mcp`| Manage MCP server connections and OAuth authentication `/memory`| Edit `CLAUDE.md` memory files, enable or disable [auto-memory](</docs/en/memory#auto-memory>), and view auto-memory entries `/mobile`| Show QR code to download the Claude mobile app. Aliases: `/ios`, `/android` @@ -57,6 +61,8 @@ `/schedule [description]`| Create, update, list, or run [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>). Claude walks you through the setup conversationally `/security-review`| Analyze pending changes on the current branch for security vulnerabilities. Reviews the git diff and identifies risks like injection, auth issues, and data exposure `/setup-bedrock`| Configure [Amazon Bedrock](</docs/en/amazon-bedrock>) authentication, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_BEDROCK=1` is set. First-time Bedrock users can also access this wizard from the login screen +`/setup-vertex`| Configure [Google Vertex AI](</docs/en/google-vertex-ai>) authentication, project, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_VERTEX=1` is set. First-time Vertex AI users can also access this wizard from the login screen +`/simplify [focus]`| **[Skill](</docs/en/skills#bundled-skills>).** Review your recently changed files for code reuse, quality, and efficiency issues, then fix them. Spawns three review agents in parallel, aggregates their findings, and applies fixes. Pass text to focus on specific concerns: `/simplify focus on memory efficiency` `/skills`| List available [skills](</docs/en/skills>) `/stats`| Visualize daily usage, session history, streaks, and model preferences `/status`| Open the Settings interface (Status tab) showing version, model, account, and connectivity. Works while Claude is responding, without waiting for the current response to finish
modified Common workflows View current →
--- a/common-workflows.md +++ b/common-workflows.md @@ -664,7 +664,7 @@ * **No changes** : the worktree and its branch are removed automatically * **Changes or commits exist** : Claude prompts you to keep or remove the worktree. Keeping preserves the directory and branch so you can return later. Removing deletes the worktree directory and its branch, discarding all uncommitted changes and commits -Subagent worktrees orphaned by a crash or an interrupted parallel run are removed automatically at startup once they are older than your [`cleanupPeriodDays`](</docs/en/settings#available-settings>) setting, provided they have no modifications to tracked files and no unpushed commits. Untracked files (new files never staged with `git add`) are not checked and do not prevent removal. Worktrees you create with `--worktree` are never removed by this sweep. To clean up worktrees outside of a Claude session, use manual worktree management. +Subagent worktrees orphaned by a crash or an interrupted parallel run are removed automatically at startup once they are older than your [`cleanupPeriodDays`](</docs/en/settings#available-settings>) setting, provided they have no uncommitted changes, no untracked files, and no unpushed commits. Worktrees you create with `--worktree` are never removed by this sweep. To clean up worktrees outside of a Claude session, use manual worktree management. Add `.claude/worktrees/` to your `.gitignore` to prevent worktree contents from appearing as untracked files in your main repository.
modified Explore the context window View current →
--- a/context-window.md +++ b/context-window.md @@ -11,7 +11,27 @@ * **Before you type anything** : CLAUDE.md, auto memory, MCP tool names, and skill descriptions all load into context. Your own setup may add more here, like an [output style](</docs/en/output-styles>) or text from [`--append-system-prompt`](</docs/en/cli-reference>), which both go into the system prompt the same way. * **As Claude works** : each file read adds to context, [path-scoped rules](</docs/en/memory#path-specific-rules>) load automatically alongside matching files, and a [PostToolUse hook](</docs/en/hooks-guide>) fires after each edit. * **The follow-up prompt** : a [subagent](</docs/en/sub-agents>) handles the research in its own separate context window, so the large file reads stay out of yours. Only the summary and a small metadata trailer come back. - * **At the end** : `/compact` replaces the conversation with a structured summary. Most startup content reloads automatically. The [skill](</docs/en/skills>) listing is the one exception. + * **At the end** : `/compact` replaces the conversation with a structured summary. Most startup content reloads automatically; the table below shows what happens to each mechanism. + +## + +​ + +What survives compaction + +When a long session compacts, Claude Code summarizes the conversation history to fit the context window. What happens to your instructions depends on how they were loaded: + +Mechanism| After compaction +---|--- +System prompt and output style| Unchanged; not part of message history +Project-root CLAUDE.md and unscoped rules| Re-injected from disk +Auto memory| Re-injected from disk +Rules with `paths:` frontmatter| Lost until a matching file is read again +Nested CLAUDE.md in subdirectories| Lost until a file in that subdirectory is read again +Invoked skill bodies| Re-injected, capped at 5,000 tokens per skill and 25,000 tokens total; oldest dropped first +Hooks| Not applicable; hooks run as code, not context + +Path-scoped rules and nested CLAUDE.md files load into message history when their trigger file is read, so compaction summarizes them away with everything else. They reload the next time Claude reads a matching file. If a rule must persist across compaction, drop the `paths:` frontmatter or move it to the project-root CLAUDE.md. Skill bodies are re-injected after compaction, but large skills are truncated to fit the per-skill cap, and the oldest invoked skills are dropped once the total budget is exceeded. Truncation keeps the start of the file, so put the most important instructions near the top of `SKILL.md`. ##
modified Manage costs effectively View current →
--- a/costs.md +++ b/costs.md @@ -29,7 +29,7 @@ When using Claude API, you can [set workspace spend limits](<https://platform.claude.com/docs/en/build-with-claude/workspaces#workspace-limits>) on the total Claude Code workspace spend. Admins can [view cost and usage reporting](<https://platform.claude.com/docs/en/build-with-claude/workspaces#usage-and-cost-tracking>) in the Console. -When you first authenticate Claude Code with your Claude Console account, a workspace called “Claude Code” is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace; it is exclusively for Claude Code authentication and usage. +When you first authenticate Claude Code with your Claude Console account, a workspace called “Claude Code” is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace; it is exclusively for Claude Code authentication and usage.For organizations with custom rate limits, Claude Code traffic in this workspace counts toward your organization’s overall API rate limits. You can set a [workspace rate limit](<https://platform.claude.com/docs/en/api/rate-limits#setting-lower-limits-for-workspaces>) on this workspace’s Limits page in the Claude Console to cap Claude Code’s share and protect other production workloads. On Bedrock, Vertex, and Foundry, Claude Code does not send metrics from your cloud. To get cost metrics, several large enterprises reported using [LiteLLM](</docs/en/llm-gateway#litellm-configuration>), which is an open-source tool that helps companies [track spend by key](<https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend>). This project is unaffiliated with Anthropic and has not been audited for security.
modified Use Claude Code Desktop View current →
--- a/desktop.md +++ b/desktop.md @@ -286,7 +286,7 @@ Install plugins -[Plugins](</docs/en/plugins>) are reusable packages that add skills, agents, hooks, MCP servers, and LSP configurations to Claude Code. You can install plugins from the desktop app without using the terminal. For local and SSH sessions, click the **+** button next to the prompt box and select **Plugins** to see your installed plugins and their commands. To add a plugin, select **Add plugin** from the submenu to open the plugin browser, which shows available plugins from your configured [marketplaces](</docs/en/plugin-marketplaces>) including the official Anthropic marketplace. Select **Manage plugins** to enable, disable, or uninstall plugins. Plugins can be scoped to your user account, a specific project, or local-only. Plugins are not available for remote sessions. For the full plugin reference including creating your own plugins, see [plugins](</docs/en/plugins>). +[Plugins](</docs/en/plugins>) are reusable packages that add skills, agents, hooks, MCP servers, and LSP configurations to Claude Code. You can install plugins from the desktop app without using the terminal. For local and SSH sessions, click the **+** button next to the prompt box and select **Plugins** to see your installed plugins and their skills. To add a plugin, select **Add plugin** from the submenu to open the plugin browser, which shows available plugins from your configured [marketplaces](</docs/en/plugin-marketplaces>) including the official Anthropic marketplace. Select **Manage plugins** to enable, disable, or uninstall plugins. Plugins can be scoped to your user account, a specific project, or local-only. Plugins are not available for remote sessions. For the full plugin reference including creating your own plugins, see [plugins](</docs/en/plugins>). ###
modified Discover and install prebuilt plugins through marketplaces View current →
--- a/discover-plugins.md +++ b/discover-plugins.md @@ -101,7 +101,7 @@ Development workflows -Plugins that add commands and agents for common development tasks: +Plugins that add skills and agents for common development tasks: * **commit-commands** : Git commit workflows including commit, push, and PR creation * **pr-review-toolkit** : Specialized agents for reviewing pull requests @@ -160,7 +160,7 @@ * **Project scope** : install for all collaborators on this repository * **Local scope** : install for yourself in this repository only -For example, select **commit-commands** (a plugin that adds git workflow commands) and install it to your user scope.You can also install directly from the command line: +For example, select **commit-commands** (a plugin that adds git workflow skills) and install it to your user scope.You can also install directly from the command line: /plugin install commit-commands@anthropics-claude-code @@ -170,11 +170,11 @@ Use your new plugin -After installing, run `/reload-plugins` to activate the plugin. Plugin commands are namespaced by the plugin name, so **commit-commands** provides commands like `/commit-commands:commit`.Try it out by making a change to a file and running: +After installing, run `/reload-plugins` to activate the plugin. Plugin skills are namespaced by the plugin name, so **commit-commands** provides skills like `/commit-commands:commit`.Try it out by making a change to a file and running: /commit-commands:commit -This stages your changes, generates a commit message, and creates the commit.Each plugin works differently. Check the plugin’s description in the **Discover** tab or its homepage to learn what commands and capabilities it provides. +This stages your changes, generates a commit message, and creates the commit.Each plugin works differently. Check the plugin’s description in the **Discover** tab or its homepage to learn what skills and capabilities it provides. The rest of this guide covers all the ways you can add marketplaces, install plugins, and manage your configuration. @@ -408,7 +408,7 @@ 1. **Check your version** : Run `claude --version` to see what’s installed. 2. **Update Claude Code** : - * **Homebrew** : `brew upgrade claude-code` + * **Homebrew** : `brew upgrade claude-code` (or `brew upgrade claude-code@latest` if you installed that cask) * **npm** : `npm update -g @anthropic-ai/claude-code` * **Native installer** : Re-run the install command from [Setup](</docs/en/setup>) 3. **Restart Claude Code** : After updating, restart your terminal and run `claude` again.
modified Environment variables View current →
--- a/env-vars.md +++ b/env-vars.md @@ -95,16 +95,18 @@ `CLAUDE_CODE_NO_FLICKER`| Set to `1` to enable [fullscreen rendering](</docs/en/fullscreen>), a research preview that reduces flicker and keeps memory flat in long conversations `CLAUDE_CODE_OAUTH_REFRESH_TOKEN`| OAuth refresh token for Claude.ai authentication. When set, `claude auth login` exchanges this token directly instead of opening a browser. Requires `CLAUDE_CODE_OAUTH_SCOPES`. Useful for provisioning authentication in automated environments `CLAUDE_CODE_OAUTH_SCOPES`| Space-separated OAuth scopes the refresh token was issued with, such as `"user:profile user:inference user:sessions:claude_code"`. Required when `CLAUDE_CODE_OAUTH_REFRESH_TOKEN` is set -`CLAUDE_CODE_OAUTH_TOKEN`| OAuth access token for Claude.ai authentication. Alternative to `/login` for SDK and automated environments. Takes precedence over keychain-stored credentials +`CLAUDE_CODE_OAUTH_TOKEN`| OAuth access token for Claude.ai authentication. Alternative to `/login` for SDK and automated environments. Takes precedence over keychain-stored credentials. Generate one with [`claude setup-token`](</docs/en/authentication#generate-a-long-lived-token>) `CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS`| Timeout in milliseconds for flushing pending OpenTelemetry spans (default: 5000). See [Monitoring](</docs/en/monitoring-usage>) `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS`| Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes). See [Dynamic headers](</docs/en/monitoring-usage#dynamic-headers>) `CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS`| Timeout in milliseconds for the OpenTelemetry exporter to finish on shutdown (default: 2000). Increase if metrics are dropped at exit. See [Monitoring](</docs/en/monitoring-usage>) +`CLAUDE_CODE_PERFORCE_MODE`| Set to `1` to enable Perforce-aware write protection. When set, Edit, Write, and NotebookEdit fail with a `p4 edit <file>` hint if the target file lacks the owner-write bit, which Perforce clears on synced files until `p4 edit` opens them. This prevents Claude Code from bypassing Perforce change tracking `CLAUDE_CODE_PLUGIN_CACHE_DIR`| Override the plugins root directory. Despite the name, this sets the parent directory, not the cache itself: marketplaces and the plugin cache live in subdirectories under this path. Defaults to `~/.claude/plugins` `CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS`| Timeout in milliseconds for git operations when installing or updating plugins (default: 120000). Increase this value for large repositories or slow network connections. See [Git operations time out](</docs/en/plugin-marketplaces#git-operations-time-out>) `CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE`| Set to `1` to keep the existing marketplace cache when a `git pull` fails instead of wiping and re-cloning. Useful in offline or airgapped environments where re-cloning would fail the same way. See [Marketplace updates fail in offline environments](</docs/en/plugin-marketplaces#marketplace-updates-fail-in-offline-environments>) `CLAUDE_CODE_PLUGIN_SEED_DIR`| Path to one or more read-only plugin seed directories, separated by `:` on Unix or `;` on Windows. Use this to bundle a pre-populated plugins directory into a container image. Claude Code registers marketplaces from these directories at startup and uses pre-cached plugins without re-cloning. See [Pre-populate plugins for containers](</docs/en/plugin-marketplaces#pre-populate-plugins-for-containers>) `CLAUDE_CODE_PROXY_RESOLVES_HOSTS`| Set to `1` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution `CLAUDE_CODE_RESUME_INTERRUPTED_TURN`| Set to `1` to automatically resume if the previous session ended mid-turn. Used in SDK mode so the model continues without requiring the SDK to re-send the prompt +`CLAUDE_CODE_SCRIPT_CAPS`| JSON object limiting how many times specific scripts may be invoked per session when `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` is set. Keys are substrings matched against the command text; values are integer call limits. For example, `{"deploy.sh": 2}` allows `deploy.sh` to be called at most twice. Matching is substring-based so shell-expansion tricks like `./scripts/deploy.sh $(evil)` still count against the cap. Runtime fan-out via `xargs` or `find -exec` is not detected; this is a defense-in-depth control `CLAUDE_CODE_SCROLL_SPEED`| Set the mouse wheel scroll multiplier in [fullscreen rendering](</docs/en/fullscreen#adjust-wheel-scroll-speed>). Accepts values from 1 to 20. Set to `3` to match `vim` if your terminal sends one wheel event per notch without amplification `CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS`| Maximum time in milliseconds for [SessionEnd](</docs/en/hooks#sessionend>) hooks to complete (default: `1500`). Applies to session exit, `/clear`, and switching sessions via interactive `/resume`. Per-hook `timeout` values are also capped by this budget `CLAUDE_CODE_SHELL`| Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`) @@ -115,7 +117,7 @@ `CLAUDE_CODE_SKIP_MANTLE_AUTH`| Skip AWS authentication for Bedrock Mantle (for example, when using an LLM gateway) `CLAUDE_CODE_SKIP_VERTEX_AUTH`| Skip Google authentication for Vertex (for example, when using an LLM gateway) `CLAUDE_CODE_SUBAGENT_MODEL`| See [Model configuration](</docs/en/model-config>) -`CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`| Set to `1` to strip Anthropic and cloud provider credentials from subprocess environments (Bash tool, hooks, MCP stdio servers). The parent Claude process keeps these credentials for API calls, but child processes cannot read them, reducing exposure to prompt injection attacks that attempt to exfiltrate secrets via shell expansion. `claude-code-action` sets this automatically when `allowed_non_write_users` is configured +`CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`| Set to `1` to strip Anthropic and cloud provider credentials from subprocess environments (Bash tool, hooks, MCP stdio servers). The parent Claude process keeps these credentials for API calls, but child processes cannot read them, reducing exposure to prompt injection attacks that attempt to exfiltrate secrets via shell expansion. On Linux, this also runs Bash subprocesses in an isolated PID namespace so they cannot read host process environments via `/proc`; as a side effect, `ps`, `pgrep`, and `kill` cannot see or signal host processes. `claude-code-action` sets this automatically when `allowed_non_write_users` is configured `CLAUDE_CODE_SYNC_PLUGIN_INSTALL`| Set to `1` in non-interactive mode (the `-p` flag) to wait for plugin installation to complete before the first query. Without this, plugins install in the background and may not be available on the first turn. Combine with `CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS` to bound the wait `CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS`| Timeout in milliseconds for synchronous plugin installation. When exceeded, Claude Code proceeds without plugins and logs an error. No default: without this variable, synchronous installation waits until complete `CLAUDE_CODE_SYNTAX_HIGHLIGHT`| Set to `false` to disable syntax highlighting in diff output. Useful when colors interfere with your terminal setup
modified Extend Claude Code View current →
--- a/features-overview.md +++ b/features-overview.md @@ -2,7 +2,7 @@ For how the core agentic loop works, see [How Claude Code works](</docs/en/how-claude-code-works>). -**New to Claude Code?** Start with [CLAUDE.md](</docs/en/memory>) for project conventions. Add other extensions as you need them. +**New to Claude Code?** Start with [CLAUDE.md](</docs/en/memory>) for project conventions, then add other extensions as specific triggers come up. ## @@ -45,6 +45,26 @@ ​ +Build your setup over time + +You don’t need to configure everything up front. Each feature has a recognizable trigger, and most teams add them in roughly this order: + +Trigger| Add +---|--- +Claude gets a convention or command wrong twice| Add it to [CLAUDE.md](</docs/en/memory>) +You keep typing the same prompt to start a task| Save it as a user-invocable [skill](</docs/en/skills>) +You paste the same playbook or multi-step procedure into chat for the third time| Capture it as a [skill](</docs/en/skills>) +You keep copying data from a browser tab Claude can’t see| Connect that system as an [MCP server](</docs/en/mcp>) +A side task floods your conversation with output you won’t reference again| Route it through a [subagent](</docs/en/sub-agents>) +You want something to happen every time without asking| Write a [hook](</docs/en/hooks-guide>) +A second repository needs the same setup| Package it as a [plugin](</docs/en/plugins>) + +The same triggers tell you when to update what you already have. A repeated mistake or a recurring review comment is a CLAUDE.md edit, not a one-off correction in chat. A workflow you keep tweaking by hand is a skill that needs another revision. + +### + +​ + Compare similar features Some features can seem similar. Here’s how to tell them apart. @@ -196,7 +216,7 @@ Keep CLAUDE.md under 200 lines. Move reference material to skills, which load on-demand. -Skills are extra capabilities in Claude’s toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code ships with [bundled skills](</docs/en/skills#bundled-skills>) like `/simplify`, `/batch`, and `/debug` that work out of the box. You can also create your own. Claude uses skills when appropriate, or you can invoke one directly.**When:** Depends on the skill’s configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.**What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.**How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`. Skills with `disable-model-invocation: true` are invisible to Claude until you invoke them.**Context cost:** Low until used. User-only skills have zero cost until invoked.**In subagents:** Skills work differently in subagents. Instead of on-demand loading, skills passed to a subagent are fully preloaded into its context at launch. Subagents don’t inherit skills from the main session; you must specify them explicitly. +Skills are extra capabilities in Claude’s toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](</docs/en/commands>) like `/simplify`, `/batch`, and `/debug` that work out of the box. You can also create your own. Claude uses skills when appropriate, or you can invoke one directly.**When:** Depends on the skill’s configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.**What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.**How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`. Skills with `disable-model-invocation: true` are invisible to Claude until you invoke them.**Context cost:** Low until used. User-only skills have zero cost until invoked.**In subagents:** Skills work differently in subagents. Instead of on-demand loading, skills passed to a subagent are fully preloaded into its context at launch. Subagents don’t inherit skills from the main session; you must specify them explicitly. Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures only you trigger them.
modified Fullscreen rendering View current →
--- a/fullscreen.md +++ b/fullscreen.md @@ -65,7 +65,7 @@ `Ctrl+End`| Jump to the latest message and re-enable auto-follow Mouse wheel| Scroll a few lines at a time -On keyboards without dedicated `PgUp`, `PgDn`, `Home`, or `End` keys, like MacBook keyboards, hold `Fn` with the arrow keys: `Fn+↑` sends `PgUp`, `Fn+↓` sends `PgDn`, `Fn+←` sends `Home`, and `Fn+→` sends `End`. That makes `Ctrl+Fn+→` the jump-to-bottom shortcut. If that feels awkward, scroll to the bottom with the mouse wheel to resume following. Scrolling up pauses auto-follow so new output does not pull you back to the bottom. Press `Ctrl+End` or scroll to the bottom to resume following. Mouse wheel scrolling requires your terminal to forward mouse events to Claude Code. Most terminals do this whenever an application requests it. iTerm2 makes it a per-profile setting: if the wheel does nothing but `PgUp` and `PgDn` work, open Settings → Profiles → Terminal and turn on Enable mouse reporting. The same setting is also required for click-to-expand and text selection to work. +On keyboards without dedicated `PgUp`, `PgDn`, `Home`, or `End` keys, like MacBook keyboards, hold `Fn` with the arrow keys: `Fn+↑` sends `PgUp`, `Fn+↓` sends `PgDn`, `Fn+←` sends `Home`, and `Fn+→` sends `End`. That makes `Ctrl+Fn+→` the jump-to-bottom shortcut. If that feels awkward, scroll to the bottom with the mouse wheel to resume following, or rebind `scroll:bottom` to something reachable. Scrolling up pauses auto-follow so new output does not pull you back to the bottom. Press `Ctrl+End` or scroll to the bottom to resume following. These actions are rebindable. See [Scroll actions](</docs/en/keybindings#scroll-actions>) for the full list of action names, including half-page and full-page variants that have no default binding. Mouse wheel scrolling requires your terminal to forward mouse events to Claude Code. Most terminals do this whenever an application requests it. iTerm2 makes it a per-profile setting: if the wheel does nothing but `PgUp` and `PgDn` work, open Settings → Profiles → Terminal and turn on Enable mouse reporting. The same setting is also required for click-to-expand and text selection to work. ###
modified Claude Code on Google Vertex AI View current →
--- a/google-vertex-ai.md +++ b/google-vertex-ai.md @@ -12,13 +12,43 @@ * Google Cloud SDK (`gcloud`) installed and configured * Quota allocated in desired GCP region -If you are deploying Claude Code to multiple users, pin your model versions to prevent breakage when Anthropic releases new models. - -## - -​ - -Region Configuration +To sign in with your own Vertex AI credentials, follow Sign in with Vertex AI below. To deploy Claude Code across a team, use the manual setup steps and pin your model versions before rolling out. + +## + +​ + +Sign in with Vertex AI + +If you have Google Cloud credentials and want to start using Claude Code through Vertex AI, the login wizard walks you through it. You complete the GCP-side prerequisites once per project; the wizard handles the Claude Code side. + +The Vertex AI setup wizard requires Claude Code v2.1.98 or later. Run `claude --version` to check. + +1 + +Enable Claude models in your GCP project + +Enable the Vertex AI API for your project, then request access to the Claude models you want in the [Vertex AI Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>). See IAM configuration for the permissions your account needs. + +2 + +Start Claude Code and choose Vertex AI + +Run `claude`. At the login prompt, select **3rd-party platform** , then **Google Vertex AI**. + +3 + +Follow the wizard prompts + +Choose how you authenticate to Google Cloud: Application Default Credentials from `gcloud`, a service account key file, or credentials already in your environment. The wizard detects your project and region, verifies which Claude models your project can invoke, and lets you pin them. It saves the result to the `env` block of your [user settings file](</docs/en/settings>), so you don’t need to export environment variables yourself. + +After you’ve signed in, run `/setup-vertex` any time to reopen the wizard and change your credentials, project, region, or model pins. + +## + +​ + +Region configuration Claude Code can be used with both Vertex AI [global](<https://cloud.google.com/blog/products/ai-machine-learning/global-endpoint-for-claude-models-generally-available-on-vertex-ai>) and regional endpoints. @@ -28,7 +58,9 @@ ​ -Setup +Set up manually + +To configure Vertex AI through environment variables instead of the wizard, for example in CI or a scripted enterprise rollout, follow the steps below. ### @@ -98,7 +130,7 @@ 5\. Pin model versions -Pin specific model versions for every deployment. If you use model aliases (`sonnet`, `opus`, `haiku`) without pinning, Claude Code may attempt to use a newer model version that isn’t enabled in your Vertex AI project, breaking existing users when Anthropic releases updates. +Pin specific model versions when deploying to multiple users. Without pinning, model aliases such as `sonnet` and `opus` resolve to the latest version, which may not yet be enabled in your Vertex AI project when Anthropic releases an update. Claude Code falls back to the previous version at startup when the latest is unavailable, but pinning lets you control when your users move to a new model. Set these environment variables to specific Vertex AI model IDs: @@ -117,6 +149,14 @@ export ANTHROPIC_MODEL='claude-opus-4-6' export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5@20251001' + +## + +​ + +Startup model checks + +When Claude Code starts with Vertex AI configured, it verifies that the models it intends to use are accessible in your project. This check requires Claude Code v2.1.98 or later. If you have pinned a model version that is older than the current Claude Code default, and your project can invoke the newer version, Claude Code prompts you to update the pin. Accepting writes the new model ID to your [user settings file](</docs/en/settings>) and restarts Claude Code. Declining is remembered until the next default version change. If you have not pinned a model and the current default is unavailable in your project, Claude Code falls back to the previous version for the current session and shows a notice. The fallback is not persisted. Enable the newer model in [Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>) or pin a version to make the choice permanent. ##
modified Hooks reference View current →
--- a/hooks.md +++ b/hooks.md @@ -8,7 +8,7 @@ Hook lifecycle -Hooks fire at specific points during a Claude Code session. When an event fires and a matcher matches, Claude Code passes JSON context about the event to your hook handler. For command hooks, input arrives on stdin. For HTTP hooks, it arrives as the POST request body. Your handler can then inspect the input, take action, and optionally return a decision. Some events fire once per session, while others fire repeatedly inside the agentic loop: +Hooks fire at specific points during a Claude Code session. When an event fires and a matcher matches, Claude Code passes JSON context about the event to your hook handler. For command hooks, input arrives on stdin. For HTTP hooks, it arrives as the POST request body. Your handler can then inspect the input, take action, and optionally return a decision. Events fall into three cadences: once per session (`SessionStart`, `SessionEnd`), once per turn (`UserPromptSubmit`, `Stop`, `StopFailure`), and on every tool call inside the agentic loop (`PreToolUse`, `PostToolUse`): The table below summarizes when each event fires. The Hook events section documents the full input schema and decision control options for each one. @@ -171,7 +171,15 @@ Matcher patterns -The `matcher` field is a regex string that filters when hooks fire. Use `"*"`, `""`, or omit `matcher` entirely to match all occurrences. Each event type matches on a different field: +The `matcher` field filters when hooks fire. How a matcher is evaluated depends on the characters it contains: + +Matcher value| Evaluated as| Example +---|---|--- +`"*"`, `""`, or omitted| Match all| fires on every occurrence of the event +Only letters, digits, `_`, and `|`| Exact string, or `|`-separated list of exact strings| `Bash` matches only the Bash tool; `Edit|Write` matches either tool exactly +Contains any other character| JavaScript regular expression| `^Notebook` matches any tool starting with Notebook; `mcp__memory__.*` matches every tool from the `memory` server + +The `FileChanged` event does not follow these rules when building its watch list. See FileChanged. Each event type matches on a different field: Event| What the matcher filters| Example matcher values ---|---|--- @@ -184,14 +192,14 @@ `SubagentStop`| agent type| same values as `SubagentStart` `ConfigChange`| configuration source| `user_settings`, `project_settings`, `local_settings`, `policy_settings`, `skills` `CwdChanged`| no matcher support| always fires on every directory change -`FileChanged`| filename (basename of the changed file)| `.envrc`, `.env`, any filename you want to watch +`FileChanged`| literal filenames to watch (see FileChanged)| `.envrc|.env` `StopFailure`| error type| `rate_limit`, `authentication_failed`, `billing_error`, `invalid_request`, `server_error`, `max_output_tokens`, `unknown` `InstructionsLoaded`| load reason| `session_start`, `nested_traversal`, `path_glob_match`, `include`, `compact` `Elicitation`| MCP server name| your configured MCP server names `ElicitationResult`| MCP server name| same values as `Elicitation` `UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`| no matcher support| always fires on every occurrence -The matcher is a regex, so `Edit|Write` matches either tool and `Notebook.*` matches any tool starting with Notebook. The matcher runs against a field from the JSON input that Claude Code sends to your hook on stdin. For tool events, that field is `tool_name`. Each hook event section lists the full set of matcher values and the input schema for that event. This example runs a linting script only when Claude writes or edits a file: +The matcher runs against a field from the JSON input that Claude Code sends to your hook on stdin. For tool events, that field is `tool_name`. Each hook event section lists the full set of matcher values and the input schema for that event. This example runs a linting script only when Claude writes or edits a file: { "hooks": { @@ -223,10 +231,10 @@ * `mcp__filesystem__read_file`: Filesystem server’s read file tool * `mcp__github__search_repositories`: GitHub server’s search tool -Use regex patterns to target specific MCP tools or groups of tools: +To match every tool from a server, append `.*` to the server prefix. The `.*` is required: a matcher like `mcp__memory` contains only letters and underscores, so it is compared as an exact string and matches no tool. * `mcp__memory__.*` matches all tools from the `memory` server - * `mcp__.*__write.*` matches any tool containing “write” from any server + * `mcp__.*__write.*` matches any tool whose name starts with `write` from any server This example logs all memory server operations and validates write operations from any MCP server: @@ -505,7 +513,7 @@ Exit code output -The exit code from your hook command tells Claude Code whether the action should proceed, be blocked, or be ignored. **Exit 0** means success. Claude Code parses stdout for JSON output fields. JSON output is only processed on exit 0. For most events, stdout is written to the debug log but not shown in the transcript. The exceptions are `UserPromptSubmit` and `SessionStart`, where stdout is added as context that Claude can see and act on. **Exit 2** means a blocking error. Claude Code ignores stdout and any JSON in it. Instead, stderr text is fed back to Claude as an error message. The effect depends on the event: `PreToolUse` blocks the tool call, `UserPromptSubmit` rejects the prompt, and so on. See exit code 2 behavior for the full list. **Any other exit code** is a non-blocking error for most hook events. The transcript shows a one-line `<hook name> hook error` notice and execution continues. The full stderr is written to the debug log. For example, a hook command script that blocks dangerous Bash commands: +The exit code from your hook command tells Claude Code whether the action should proceed, be blocked, or be ignored. **Exit 0** means success. Claude Code parses stdout for JSON output fields. JSON output is only processed on exit 0. For most events, stdout is written to the debug log but not shown in the transcript. The exceptions are `UserPromptSubmit` and `SessionStart`, where stdout is added as context that Claude can see and act on. **Exit 2** means a blocking error. Claude Code ignores stdout and any JSON in it. Instead, stderr text is fed back to Claude as an error message. The effect depends on the event: `PreToolUse` blocks the tool call, `UserPromptSubmit` rejects the prompt, and so on. See exit code 2 behavior for the full list. **Any other exit code** is a non-blocking error for most hook events. The transcript shows a `<hook name> hook error` notice followed by the first line of stderr, so you can identify the cause without `--debug`. Execution continues and the full stderr is written to the debug log. For example, a hook command script that blocks dangerous Bash commands: #!/bin/bash # Reads JSON input from stdin, checks the command @@ -1800,7 +1808,12 @@ FileChanged -Runs when a watched file changes on disk. The `matcher` field in your hook configuration controls which filenames to watch: it is a pipe-separated list of basenames (filenames without directory paths, for example `".envrc|.env"`). The same `matcher` value is also used to filter which hooks run when a file changes, matching against the basename of the changed file. Useful for reloading environment variables when project configuration files are modified. FileChanged hooks have access to `CLAUDE_ENV_FILE`. Variables written to that file persist into subsequent Bash commands for the session, just as in SessionStart hooks. Only `type: "command"` hooks are supported. +Runs when a watched file changes on disk. Useful for reloading environment variables when project configuration files are modified. The `matcher` for this event serves two roles: + + * **Build the watch list** : the value is split on `|` and each segment is registered as a literal filename in the working directory, so `".envrc|.env"` watches exactly those two files. Regex patterns are not useful here: a value like `^\.env` would watch a file literally named `^\.env`. + * **Filter which hooks run** : when a watched file changes, the same value filters which hook groups run using the standard matcher rules against the changed file’s basename. + +FileChanged hooks have access to `CLAUDE_ENV_FILE`. Variables written to that file persist into subsequent Bash commands for the session, just as in SessionStart hooks. Only `type: "command"` hooks are supported. ####
modified Automate workflows with hooks View current →
--- a/hooks-guide.md +++ b/hooks-guide.md @@ -296,7 +296,7 @@ } } -To react to specific files instead of every directory change, use `FileChanged` with a `matcher` listing the filenames to watch (pipe-separated). The `matcher` both configures which files to watch and filters which hooks run. This example watches `.envrc` and `.env` for changes in the current directory: +To react to specific files instead of every directory change, use `FileChanged` with a `matcher` listing the filenames to watch, separated by `|`. To build the watch list, this value is split into literal filenames rather than evaluated as a regex. See [FileChanged](</docs/en/hooks#filechanged>) for how the same value also filters which hook groups run when a file changes. This example watches `.envrc` and `.env` in the working directory: { "hooks": { @@ -450,7 +450,7 @@ * **Exit 0** : the action proceeds. For `UserPromptSubmit` and `SessionStart` hooks, anything you write to stdout is added to Claude’s context. * **Exit 2** : the action is blocked. Write a reason to stderr, and Claude receives it as feedback so it can adjust. - * **Any other exit code** : the action proceeds. The transcript shows a one-line error notice; the full stderr goes to the [debug log](</docs/en/hooks#debug-hooks>). + * **Any other exit code** : the action proceeds. The transcript shows a `<hook name> hook error` notice followed by the first line of stderr; the full stderr goes to the [debug log](</docs/en/hooks#debug-hooks>). #### @@ -501,7 +501,7 @@ } } -The `"Edit|Write"` matcher is a regex pattern that matches the tool name. The hook only fires when Claude uses the `Edit` or `Write` tool, not when it uses `Bash`, `Read`, or any other tool. Each event type matches on a specific field. Matchers support exact strings and regex patterns: +The `"Edit|Write"` matcher fires only when Claude uses the `Edit` or `Write` tool, not when it uses `Bash`, `Read`, or any other tool. See [Matcher patterns](</docs/en/hooks#matcher-patterns>) for how plain names and regular expressions are evaluated. Each event type matches on a specific field: Event| What the matcher filters| Example matcher values ---|---|--- @@ -517,7 +517,7 @@ `InstructionsLoaded`| load reason| `session_start`, `nested_traversal`, `path_glob_match`, `include`, `compact` `Elicitation`| MCP server name| your configured MCP server names `ElicitationResult`| MCP server name| same values as `Elicitation` -`FileChanged`| filename (basename of the changed file)| `.envrc`, `.env`, any filename you want to watch +`FileChanged`| literal filenames to watch (see [FileChanged](</docs/en/hooks#filechanged>))| `.envrc|.env` `UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, `CwdChanged`| no matcher support| always fires on every occurrence A few more examples showing matchers on different event types: @@ -827,7 +827,7 @@ Debug techniques -The transcript view, toggled with `Ctrl+O`, shows a one-line summary for each hook that fired: success is silent, blocking errors show stderr, and non-blocking errors show only the hook name. For full execution details including which hooks matched, their exit codes, stdout, and stderr, read the debug log. Start Claude Code with `claude --debug-file /tmp/claude.log` to write to a known path, then `tail -f /tmp/claude.log` in another terminal. If you started without that flag, run `/debug` mid-session to enable logging and find the log path. +The transcript view, toggled with `Ctrl+O`, shows a one-line summary for each hook that fired: success is silent, blocking errors show stderr, and non-blocking errors show a `<hook name> hook error` notice followed by the first line of stderr. For full execution details including which hooks matched, their exit codes, stdout, and stderr, read the debug log. Start Claude Code with `claude --debug-file /tmp/claude.log` to write to a known path, then `tail -f /tmp/claude.log` in another terminal. If you started without that flag, run `/debug` mid-session to enable logging and find the log path. ##
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -87,7 +87,7 @@ Shortcut| Description| Notes ---|---|--- -`/` at start| Command or skill| See built-in commands and [skills](</docs/en/skills>) +`/` at start| Command or skill| See commands and [skills](</docs/en/skills>) `!` at start| Bash mode| Run commands directly and add execution output to the session `@`| File path mention| Trigger file path autocomplete @@ -118,9 +118,9 @@ ​ -Built-in commands - -Type `/` in Claude Code to see all available commands, or type `/` followed by any letters to filter. The `/` menu shows both built-in commands and [bundled skills](</docs/en/skills#bundled-skills>) like `/simplify`. Not all commands are visible to every user since some depend on your platform or plan. See the [commands reference](</docs/en/commands>) for the full list of built-in commands. To create your own commands, see [skills](</docs/en/skills>). +Commands + +Type `/` in Claude Code to see all available commands, or type `/` followed by any letters to filter. The `/` menu shows everything you can invoke: built-in commands, bundled and user-authored [skills](</docs/en/skills>), and commands contributed by [plugins](</docs/en/plugins>) and [MCP servers](</docs/en/mcp#use-mcp-prompts-as-commands>). Not all built-in commands are visible to every user since some depend on your platform or plan. See the [commands reference](</docs/en/commands>) for the full list of commands included in Claude Code. ## @@ -170,7 +170,7 @@ `;`| Repeat last f/F/t/T motion `,`| Repeat last f/F/t/T motion in reverse -In vim normal mode, if the cursor is at the beginning or end of input and cannot move further, the arrow keys navigate command history instead. +In vim normal mode, if the cursor is at the beginning or end of input and cannot move further, `j`/`k` and the arrow keys navigate command history instead. ###
modified JetBrains IDEs View current →
--- a/jetbrains.md +++ b/jetbrains.md @@ -103,7 +103,7 @@ General Settings - * **Claude command** : Specify a custom command to run Claude (for example, `claude`, `/usr/local/bin/claude`, or `npx @anthropic/claude`) + * **Claude command** : Specify a custom command to run Claude (for example, `claude`, `/usr/local/bin/claude`, or `npx @anthropic-ai/claude-code`) * **Suppress notification for Claude command not found** : Skip notifications about not finding the Claude command * **Enable using Option+Enter for multi-line prompts** (macOS only): When enabled, Option+Enter inserts new lines in Claude Code prompts. Disable if experiencing issues with the Option key being captured unexpectedly (requires terminal restart) * **Enable automatic updates** : Automatically check for and install plugin updates (applied on restart)
modified Customize keyboard shortcuts View current →
--- a/keybindings.md +++ b/keybindings.md @@ -62,6 +62,7 @@ `ModelPicker`| Model picker effort level `Select`| Generic select/list components `Plugin`| Plugin dialog (browse, discover, manage) +`Scroll`| Conversation scrolling and text selection in fullscreen mode ## @@ -384,6 +385,29 @@ ---|---|--- `voice:pushToTalk`| Space| Hold to dictate a prompt +### + +​ + +Scroll actions + +Actions available in the `Scroll` context when [fullscreen rendering](</docs/en/fullscreen>) is enabled: + +Action| Default| Description +---|---|--- +`scroll:lineUp`| (unbound)| Scroll up one line. Mouse wheel scrolling triggers this action +`scroll:lineDown`| (unbound)| Scroll down one line. Mouse wheel scrolling triggers this action +`scroll:pageUp`| PageUp| Scroll up half the viewport height +`scroll:pageDown`| PageDown| Scroll down half the viewport height +`scroll:top`| Ctrl+Home| Jump to the start of the conversation +`scroll:bottom`| Ctrl+End| Jump to the latest message and re-enable auto-follow +`scroll:halfPageUp`| (unbound)| Scroll up half the viewport height. Same behavior as `scroll:pageUp`, provided for vi-style rebinds +`scroll:halfPageDown`| (unbound)| Scroll down half the viewport height. Same behavior as `scroll:pageDown`, provided for vi-style rebinds +`scroll:fullPageUp`| (unbound)| Scroll up the full viewport height +`scroll:fullPageDown`| (unbound)| Scroll down the full viewport height +`selection:copy`| Ctrl+Shift+C / Cmd+C| Copy the selected text to the clipboard +`selection:clear`| (unbound)| Clear the active text selection + ## ​
modified Connect Claude Code to tools via MCP View current →
--- a/mcp.md +++ b/mcp.md @@ -1,4 +1,4 @@ -Claude Code can connect to hundreds of external tools and data sources through the [Model Context Protocol (MCP)](<https://modelcontextprotocol.io/introduction>), an open source standard for AI-tool integrations. MCP servers give Claude Code access to your tools, databases, and APIs. +Claude Code can connect to hundreds of external tools and data sources through the [Model Context Protocol (MCP)](<https://modelcontextprotocol.io/introduction>), an open source standard for AI-tool integrations. MCP servers give Claude Code access to your tools, databases, and APIs. Connect a server when you find yourself copying data into chat from another tool, like an issue tracker or a monitoring dashboard. Once connected, Claude can read and act on that system directly instead of working from what you paste. ##
modified How Claude remembers your project View current →
--- a/memory.md +++ b/memory.md @@ -35,6 +35,21 @@ CLAUDE.md files CLAUDE.md files are markdown files that give Claude persistent instructions for a project, your personal workflow, or your entire organization. You write these files in plain text; Claude reads them at the start of every session. + +### + +​ + +When to add to CLAUDE.md + +Treat CLAUDE.md as the place you write down what you’d otherwise re-explain. Add to it when: + + * Claude makes the same mistake a second time + * A code review catches something Claude should have known about this codebase + * You type the same correction or clarification into chat that you typed last session + * A new teammate would need the same context to be productive + +Keep it to facts Claude should hold in every session: build commands, conventions, project layout, “always do X” rules. If an entry is a multi-step procedure or only matters for one part of the codebase, move it to a [skill](</docs/en/skills>) or a path-scoped rule instead. The [extension overview](</docs/en/features-overview#build-your-setup-over-time>) covers when to use each mechanism. ### @@ -405,7 +420,7 @@ Instructions seem lost after `/compact` -CLAUDE.md fully survives compaction. After `/compact`, Claude re-reads your CLAUDE.md from disk and re-injects it fresh into the session. If an instruction disappeared after compaction, it was given only in conversation, not written to CLAUDE.md. Add it to CLAUDE.md to make it persist across sessions. See Write effective instructions for guidance on size, structure, and specificity. +Project-root CLAUDE.md survives compaction: after `/compact`, Claude re-reads it from disk and re-injects it into the session. Nested CLAUDE.md files in subdirectories are not re-injected automatically; they reload the next time Claude reads a file in that subdirectory. If an instruction disappeared after compaction, it was either given only in conversation or lives in a nested CLAUDE.md that hasn’t reloaded yet. Add conversation-only instructions to CLAUDE.md to make them persist. See [What survives compaction](</docs/en/context-window#what-survives-compaction>) for the full breakdown. See Write effective instructions for guidance on size, structure, and specificity. ##
modified Model configuration View current →
--- a/model-config.md +++ b/model-config.md @@ -245,9 +245,9 @@ Pin models for third-party deployments -When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), or [Foundry](</docs/en/microsoft-foundry>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases (`sonnet`, `opus`, `haiku`) that resolve to the latest version. When Anthropic releases a new model, users whose accounts don’t have the new version enabled will break silently. - -Set all three model environment variables to specific version IDs as part of your initial setup. Skipping this step means a Claude Code update can break your users without any action on your part. +When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), or [Foundry](</docs/en/microsoft-foundry>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases (`sonnet`, `opus`, `haiku`) that resolve to the latest version. When Anthropic releases a new model that isn’t yet enabled in a user’s account, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. + +Set all three model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. Use the following environment variables with version-specific model IDs for your provider:
modified Monitoring View current →
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -498,7 +498,7 @@ * `error`: Error message * `status_code`: HTTP status code as a string, or `"undefined"` for non-HTTP errors * `duration_ms`: Request duration in milliseconds - * `attempt`: Attempt number (for retried requests) + * `attempt`: Total number of attempts made, including the initial request (`1` means no retries occurred) * `speed`: `"fast"` or `"normal"`, indicating whether fast mode was active #### @@ -564,6 +564,14 @@ * High session volume from specific users All metrics can be segmented by `user.account_uuid`, `user.account_id`, `organization.id`, `session.id`, `model`, and `app.version`. + +### + +​ + +Detect retry exhaustion + +Claude Code retries failed API requests internally and emits a single `claude_code.api_error` event only after it gives up, so the event itself is the terminal signal for that request. Intermediate retry attempts are not logged as separate events. The `attempt` attribute on the event records how many attempts were made in total. A value greater than `CLAUDE_CODE_MAX_RETRIES` (default `10`) indicates the request exhausted all retries on a transient error. A lower value indicates a non-retryable error such as a `400` response. To distinguish a session that recovered from one that stalled, group events by `session.id` and check whether a later `api_request` event exists after the error. ###
modified Output styles View current →
--- a/output-styles.md +++ b/output-styles.md @@ -1,4 +1,4 @@ -Output styles allow you to use Claude Code as any type of agent while keeping its core capabilities, such as running local scripts, reading/writing files, and tracking TODOs. +Output styles change how Claude responds, not what Claude knows. They modify the system prompt to set role, tone, and output format while keeping core capabilities like running scripts, reading and writing files, and tracking TODOs. Use one when you keep re-prompting for the same voice or format every turn, or when you want Claude to act as something other than a software engineer. For instructions about your project, conventions, or codebase, use [CLAUDE.md](</docs/en/memory>) instead. ##
modified Claude Code overview View current →
--- a/overview.md +++ b/overview.md @@ -44,7 +44,9 @@ brew install --cask claude-code -Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes. +Homebrew offers two casks. `claude-code` tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. `claude-code@latest` tracks the latest channel and receives new versions as soon as they ship. + +Homebrew installations do not auto-update. Run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed, to get the latest features and security fixes. winget install Anthropic.ClaudeCode
modified Choose a permission mode View current →
--- a/permission-modes.md +++ b/permission-modes.md @@ -88,7 +88,7 @@ Auto-approve file edits with acceptEdits mode -`acceptEdits` mode lets Claude create and edit files in your working directory without prompting. The status bar shows `⏵⏵ accept edits on` while this mode is active. In addition to file edits, `acceptEdits` mode auto-approves common filesystem Bash commands: `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp`, and `sed`. Like file edits, these are auto-approved only for paths inside your working directory or `additionalDirectories`. Paths outside that scope, writes to protected paths, and all other Bash commands still prompt. Use `acceptEdits` when you want to review changes in your editor or via `git diff` after the fact rather than approving each edit inline. Press `Shift+Tab` once from default mode to enter it, or start with it directly: +`acceptEdits` mode lets Claude create and edit files in your working directory without prompting. The status bar shows `⏵⏵ accept edits on` while this mode is active. In addition to file edits, `acceptEdits` mode auto-approves common filesystem Bash commands: `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp`, and `sed`. These commands are also auto-approved when prefixed with safe environment variables such as `LANG=C` or `NO_COLOR=1`, or process wrappers such as `timeout`, `nice`, or `nohup`. Like file edits, auto-approval applies only to paths inside your working directory or `additionalDirectories`. Paths outside that scope, writes to protected paths, and all other Bash commands still prompt. Use `acceptEdits` when you want to review changes in your editor or via `git diff` after the fact rather than approving each edit inline. Press `Shift+Tab` once from default mode to enter it, or start with it directly: claude --permission-mode acceptEdits
modified Create and distribute a plugin marketplace View current →
--- a/plugin-marketplaces.md +++ b/plugin-marketplaces.md @@ -8,7 +8,7 @@ Creating and distributing a marketplace involves: - 1. **Creating plugins** : build one or more plugins with commands, agents, hooks, MCP servers, or LSP servers. This guide assumes you already have plugins to distribute; see [Create plugins](</docs/en/plugins>) for details on how to create them. + 1. **Creating plugins** : build one or more plugins with skills, agents, hooks, MCP servers, or LSP servers. This guide assumes you already have plugins to distribute; see [Create plugins](</docs/en/plugins>) for details on how to create them. 2. **Creating a marketplace file** : define a `marketplace.json` that lists your plugins and where to find them (see Create the marketplace file). 3. **Host the marketplace** : push to GitHub, GitLab, or another git host (see Host and distribute marketplaces). 4. **Share with users** : users add your marketplace with `/plugin marketplace add` and install individual plugins (see [Discover and install plugins](</docs/en/discover-plugins>)). @@ -101,13 +101,13 @@ Try it out -Select some code in your editor and run your new command. +Select some code in your editor and run your new skill. /quality-review To learn more about what plugins can do, including hooks, agents, MCP servers, and LSP servers, see [Plugins](</docs/en/plugins>). -**How plugins are installed** : When users install a plugin, Claude Code copies the plugin directory to a cache location. This means plugins can’t reference files outside their directory using paths like `../shared-utils`, because those files won’t be copied.If you need to share files across plugins, use symlinks (which are followed during copying). See [Plugin caching and file resolution](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for details. +**How plugins are installed** : When users install a plugin, Claude Code copies the plugin directory to a cache location. This means plugins can’t reference files outside their directory using paths like `../shared-utils`, because those files won’t be copied.If you need to share files across plugins, use symlinks. See [Plugin caching and file resolution](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for details. ## @@ -231,7 +231,8 @@ Field| Type| Description ---|---|--- -`commands`| string|array| Custom paths to command files or directories +`skills`| string|array| Custom paths to skill directories containing `<name>/SKILL.md` +`commands`| string|array| Custom paths to flat `.md` skill files or directories `agents`| string|array| Custom paths to agent files `hooks`| string|object| Custom hooks configuration or path to hooks file `mcpServers`| string|object| MCP server configurations or path to MCP config @@ -490,7 +491,7 @@ Strict mode -The `strict` field controls whether `plugin.json` is the authority for component definitions (commands, agents, hooks, skills, MCP servers, output styles). +The `strict` field controls whether `plugin.json` is the authority for component definitions (skills, agents, hooks, MCP servers, output styles). Value| Behavior ---|--- @@ -499,8 +500,8 @@ **When to use each mode:** - * **`strict: true`** : the plugin has its own `plugin.json` and manages its own components. The marketplace entry can add extra commands or hooks on top. This is the default and works for most plugins. - * **`strict: false`** : the marketplace operator wants full control. The plugin repo provides raw files, and the marketplace entry defines which of those files are exposed as commands, agents, hooks, etc. Useful when the marketplace restructures or curates a plugin’s components differently than the plugin author intended. + * **`strict: true`** : the plugin has its own `plugin.json` and manages its own components. The marketplace entry can add extra skills or hooks on top. This is the default and works for most plugins. + * **`strict: false`** : the marketplace operator wants full control. The plugin repo provides raw files, and the marketplace entry defines which of those files are exposed as skills, agents, hooks, etc. Useful when the marketplace restructures or curates a plugin’s components differently than the plugin author intended. ##
modified Create plugins View current →
--- a/plugins.md +++ b/plugins.md @@ -170,9 +170,9 @@ Directory| Location| Purpose ---|---|--- `.claude-plugin/`| Plugin root| Contains `plugin.json` manifest (optional if components use default locations) -`commands/`| Plugin root| Skills as Markdown files +`skills/`| Plugin root| Skills as `<name>/SKILL.md` directories +`commands/`| Plugin root| Skills as flat Markdown files. Use `skills/` for new plugins `agents/`| Plugin root| Custom agent definitions -`skills/`| Plugin root| Agent Skills with `SKILL.md` files `hooks/`| Plugin root| Event handlers in `hooks.json` `.mcp.json`| Plugin root| MCP server configurations `.lsp.json`| Plugin root| LSP server configurations for code intelligence @@ -296,7 +296,7 @@ If your plugin isn’t working as expected: 1. **Check the structure** : Ensure your directories are at the plugin root, not inside `.claude-plugin/` - 2. **Test components individually** : Check each command, agent, and hook separately + 2. **Test components individually** : Check each skill, agent, and hook separately 3. **Use validation and debugging tools** : See [Debugging and development tools](</docs/en/plugins-reference#debugging-and-development-tools>) for CLI commands and troubleshooting techniques ###
modified Plugins reference View current →
Show diff (123 lines)
--- a/plugins-reference.md +++ b/plugins-reference.md @@ -277,9 +277,9 @@ "repository": "https://github.com/author/plugin", "license": "MIT", "keywords": ["keyword1", "keyword2"], + "skills": "./custom/skills/", "commands": ["./custom/commands/special.md"], "agents": "./custom/agents/", - "skills": "./custom/skills/", "hooks": "./config/hooks.json", "mcpServers": "./mcp-config.json", "outputStyles": "./styles/", @@ -324,9 +324,9 @@ Field| Type| Description| Example ---|---|---|--- -`commands`| string|array| Custom command files/directories (replaces default `commands/`)| `"./custom/cmd.md"` or `["./cmd1.md"]` +`skills`| string|array| Custom skill directories containing `<name>/SKILL.md` (replaces default `skills/`)| `"./custom/skills/"` +`commands`| string|array| Custom flat `.md` skill files or directories (replaces default `commands/`)| `"./custom/cmd.md"` or `["./cmd1.md"]` `agents`| string|array| Custom agent files (replaces default `agents/`)| `"./custom/agents/reviewer.md"` -`skills`| string|array| Custom skill directories (replaces default `skills/`)| `"./custom/skills/"` `hooks`| string|array|object| Hook config paths or inline config| `"./my-extra-hooks.json"` `mcpServers`| string|array|object| MCP config paths or inline config| `"./my-extra-mcp-config.json"` `outputStyles`| string|array| Custom output style files/directories (replaces default `output-styles/`)| `"./styles/"` @@ -385,12 +385,12 @@ Path behavior rules -For `commands`, `agents`, `skills`, and `outputStyles`, custom paths replace the default directory. If the manifest specifies `commands`, the default `commands/` directory is not scanned. Hooks, MCP servers, and LSP servers have different semantics for handling multiple sources. +For `skills`, `commands`, `agents`, and `outputStyles`, custom paths replace the default directory. If the manifest specifies `skills`, the default `skills/` directory is not scanned. Hooks, MCP servers, and LSP servers have different semantics for handling multiple sources. * All paths must be relative to the plugin root and start with `./` * Components from custom paths use the same naming and namespacing rules * Multiple paths can be specified as arrays - * To keep the default directory and add more paths for commands, agents, skills, or output styles, include the default in your array: `"commands": ["./commands/", "./extras/deploy.md"]` + * To keep the default directory and add more paths for skills, commands, agents, or output styles, include the default in your array: `"skills": ["./skills/", "./extras/"]` * When a skill path points to a directory that contains a `SKILL.md` directly, for example `"skills": ["./"]` pointing to the plugin root, the frontmatter `name` field in `SKILL.md` determines the skill’s invocation name. This gives a stable name regardless of the install directory. If `name` is not set in the frontmatter, the directory basename is used as a fallback. **Path examples** : @@ -497,12 +497,11 @@ Working with external dependencies -If your plugin needs to access files outside its directory, you can create symbolic links to external files within your plugin directory. Symlinks are honored during the copy process: - - # Inside your plugin directory +If your plugin needs to access files outside its directory, you can create symbolic links to external files within your plugin directory. Symlinks are preserved in the cache rather than dereferenced, and they resolve to their target at runtime. The following command creates a link from inside your plugin directory to a shared utilities location: + ln -s /path/to/shared-utils ./shared-utils -The symlinked content will be copied into the plugin cache. This provides flexibility while maintaining the security benefits of the caching system. +This provides flexibility while maintaining the security benefits of the caching system. * * * @@ -523,19 +522,19 @@ enterprise-plugin/ ├── .claude-plugin/ # Metadata directory (optional) │ └── plugin.json # plugin manifest - ├── commands/ # Default command location - │ ├── status.md - │ └── logs.md - ├── agents/ # Default agent location - │ ├── security-reviewer.md - │ ├── performance-tester.md - │ └── compliance-checker.md - ├── skills/ # Agent Skills + ├── skills/ # Skills │ ├── code-reviewer/ │ │ └── SKILL.md │ └── pdf-processor/ │ ├── SKILL.md │ └── scripts/ + ├── commands/ # Skills as flat .md files + │ ├── status.md + │ └── logs.md + ├── agents/ # Subagent definitions + │ ├── security-reviewer.md + │ ├── performance-tester.md + │ └── compliance-checker.md ├── output-styles/ # Output style definitions │ └── terse.md ├── hooks/ # Hook configurations @@ -564,9 +563,9 @@ Component| Default Location| Purpose ---|---|--- **Manifest**| `.claude-plugin/plugin.json`| Plugin metadata and configuration (optional) -**Commands**| `commands/`| Skill Markdown files (legacy; use `skills/` for new skills) +**Skills**| `skills/`| Skills with `<name>/SKILL.md` structure +**Commands**| `commands/`| Skills as flat Markdown files. Use `skills/` for new plugins **Agents**| `agents/`| Subagent Markdown files -**Skills**| `skills/`| Skills with `<name>/SKILL.md` structure **Output styles**| `output-styles/`| Output style definitions **Hooks**| `hooks/hooks.json`| Hook configuration **MCP servers**| `.mcp.json`| MCP server definitions @@ -721,7 +720,7 @@ * Which plugins are being loaded * Any errors in plugin manifests - * Command, agent, and hook registration + * Skill, agent, and hook registration * MCP server initialization ### @@ -733,7 +732,7 @@ Issue| Cause| Solution ---|---|--- Plugin not loading| Invalid `plugin.json`| Run `claude plugin validate` or `/plugin validate` to check `plugin.json`, skill/agent/command frontmatter, and `hooks/hooks.json` for syntax and schema errors -Commands not appearing| Wrong directory structure| Ensure `commands/` at root, not in `.claude-plugin/` +Skills not appearing| Wrong directory structure| Ensure `skills/` or `commands/` is at the plugin root, not inside `.claude-plugin/` Hooks not firing| Script not executable| Run `chmod +x script.sh` MCP server fails| Missing `${CLAUDE_PLUGIN_ROOT}`| Use variable for all plugin paths Path errors| Absolute paths used| All paths must be relative and start with `./` @@ -801,7 +800,7 @@ Directory structure mistakes -**Symptoms** : Plugin loads but components (commands, agents, hooks) are missing. **Correct structure** : Components must be at the plugin root, not inside `.claude-plugin/`. Only `plugin.json` belongs in `.claude-plugin/`. +**Symptoms** : Plugin loads but components (skills, agents, hooks) are missing. **Correct structure** : Components must be at the plugin root, not inside `.claude-plugin/`. Only `plugin.json` belongs in `.claude-plugin/`. my-plugin/ ├── .claude-plugin/
modified Agent SDK reference - Python View current →
--- a/python.md +++ b/python.md @@ -1707,7 +1707,7 @@ `TaskStartedMessage` -Emitted when a background task starts. A background task is anything tracked outside the main turn: a backgrounded Bash command, a subagent spawned via the Agent tool, or a remote agent. The `task_type` field tells you which. This naming is unrelated to the `Task`-to-`Agent` tool rename. +Emitted when a background task starts. A background task is anything tracked outside the main turn: a backgrounded Bash command, a Monitor watch, a subagent spawned via the Agent tool, or a remote agent. The `task_type` field tells you which. This naming is unrelated to the `Task`-to-`Agent` tool rename. @dataclass class TaskStartedMessage(SystemMessage): @@ -1725,7 +1725,7 @@ `uuid`| `str`| Unique message identifier `session_id`| `str`| Session identifier `tool_use_id`| `str | None`| Associated tool use ID -`task_type`| `str | None`| Which kind of background task: `"local_bash"`, `"local_agent"`, `"remote_agent"` +`task_type`| `str | None`| Which kind of background task: `"local_bash"` for background Bash and Monitor watches, `"local_agent"`, or `"remote_agent"` ### @@ -1774,7 +1774,7 @@ `TaskNotificationMessage` -Emitted when a task completes, fails, or is stopped. +Emitted when a background task completes, fails, or is stopped. Background tasks include `run_in_background` Bash commands, Monitor watches, and background subagents. @dataclass class TaskNotificationMessage(SystemMessage): @@ -2538,6 +2538,29 @@ ​ +Monitor + +**Tool name:** `Monitor` Runs a background script and delivers each stdout line to Claude as an event so it can react without polling. Monitor follows the same permission rules as Bash. See the [Monitor tool reference](</docs/en/tools-reference#monitor-tool>) for behavior and provider availability. **Input:** + + { + "command": str, # Shell script; each stdout line is an event, exit ends the watch + "description": str, # Short description shown in notifications + "timeout_ms": int | None, # Kill after this deadline (default 300000, max 3600000) + "persistent": bool | None, # Run for the lifetime of the session; stop with TaskStop + } + +**Output:** + + { + "taskId": str, # ID of the background monitor task + "timeoutMs": int, # Timeout deadline in milliseconds (0 when persistent) + "persistent": bool | None, # True when running until TaskStop or session end + } + +### + +​ + Edit **Tool name:** `Edit` **Input:**
modified Quickstart View current →
--- a/quickstart.md +++ b/quickstart.md @@ -47,7 +47,9 @@ brew install --cask claude-code -Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes. +Homebrew offers two casks. `claude-code` tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. `claude-code@latest` tracks the latest channel and receives new versions as soon as they ship. + +Homebrew installations do not auto-update. Run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed, to get the latest features and security fixes. winget install Anthropic.ClaudeCode
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -30,13 +30,15 @@ Start a Remote Control session -You can start a dedicated Remote Control server, start an interactive session with Remote Control enabled, or connect a session that’s already running. +You can start a Remote Control session from the CLI or the VS Code extension. The CLI offers three invocation modes; VS Code uses the `/remote-control` command. * Server mode * Interactive session * From an existing session + + * VS Code Navigate to your project directory and run: @@ -48,10 +50,12 @@ ---|--- `--name "My Project"`| Set a custom session title visible in the session list at claude.ai/code. `--remote-control-session-name-prefix <prefix>`| Prefix for auto-generated session names when no explicit name is set. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. Set `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` for the same effect. -`--spawn <mode>`| How concurrent sessions are created. Press `w` at runtime to toggle. +`--spawn <mode>`| How the server creates sessions. • `same-dir` (default): all sessions share the current working directory, so they can conflict if editing the same files. • `worktree`: each on-demand session gets its own [git worktree](</docs/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees>). Requires a git repository. -`--capacity <N>`| Maximum number of concurrent sessions. Default is 32. +• `session`: single-session mode. Serves exactly one session and rejects additional connections. Set at startup only. +Press `w` at runtime to toggle between `same-dir` and `worktree`. +`--capacity <N>`| Maximum number of concurrent sessions. Default is 32. Cannot be used with `--spawn=session`. `--verbose`| Show detailed connection and session logs. `--sandbox` / `--no-sandbox`| Enable or disable [sandboxing](</docs/en/sandboxing>) for filesystem and network isolation. Off by default. @@ -75,6 +79,12 @@ This starts a Remote Control session that carries over your current conversation history and displays a session URL and QR code you can use to connect from another device. The `--verbose`, `--sandbox`, and `--no-sandbox` flags are not available with this command. +In the [Claude Code VS Code extension](</docs/en/vs-code>), type `/remote-control` or `/rc` in the prompt box, or open the command menu with `/` and select it. Requires Claude Code v2.1.79 or later. + + /remote-control + +A banner appears above the prompt box showing connection status. Once connected, click **Open in browser** in the banner to go directly to the session, or find it in the session list at [claude.ai/code](<https://claude.ai/code>). The session URL is also posted in the conversation.To disconnect, click the close icon on the banner or run `/remote-control` again.Unlike the CLI, the VS Code command does not accept a name argument or display a QR code. The session title is derived from your conversation history or first prompt. + ### ​ @@ -83,7 +93,7 @@ Once a Remote Control session is active, you have a few ways to connect from another device: - * **Open the session URL** in any browser to go directly to the session on [claude.ai/code](<https://claude.ai/code>). Both `claude remote-control` and `/remote-control` display this URL in the terminal. + * **Open the session URL** in any browser to go directly to the session on [claude.ai/code](<https://claude.ai/code>). * **Scan the QR code** shown alongside the session URL to open it directly in the Claude app. With `claude remote-control`, press spacebar to toggle the QR code display. * **Open[claude.ai/code](<https://claude.ai/code>) or the Claude app** and find the session by name in the session list. Remote Control sessions show a computer icon with a green status dot when online. @@ -102,7 +112,7 @@ Enable Remote Control for all sessions -By default, Remote Control only activates when you explicitly run `claude remote-control`, `claude --remote-control`, or `/remote-control`. To enable it automatically for every interactive session, run `/config` inside Claude Code and set **Enable Remote Control for all sessions** to `true`. Set it back to `false` to disable. With this setting on, each interactive Claude Code process registers one remote session. If you run multiple instances, each one gets its own environment and session. To run multiple concurrent sessions from a single process, use server mode with `--spawn` instead. +By default, Remote Control only activates when you explicitly run `claude remote-control`, `claude --remote-control`, or `/remote-control`. To enable it automatically for every interactive session, run `/config` inside Claude Code and set **Enable Remote Control for all sessions** to `true`. Set it back to `false` to disable. With this setting on, each interactive Claude Code process registers one remote session. If you run multiple instances, each one gets its own environment and session. To run multiple concurrent sessions from a single process, use server mode instead. ## @@ -126,8 +136,8 @@ Limitations - * **One remote session per interactive process** : outside of server mode, each Claude Code instance supports one remote session at a time. Use server mode with `--spawn` to run multiple concurrent sessions from a single process. - * **Terminal must stay open** : Remote Control runs as a local process. If you close the terminal or stop the `claude` process, the session ends. Run `claude remote-control` again to start a new one. + * **One remote session per interactive process** : outside of server mode, each Claude Code instance supports one remote session at a time. Use server mode to run multiple concurrent sessions from a single process. + * **Local process must keep running** : Remote Control runs as a local process. If you close the terminal, quit VS Code, or otherwise stop the `claude` process, the session ends. * **Extended network outage** : if your machine is awake but unable to reach the network for more than roughly 10 minutes, the session times out and the process exits. Run `claude remote-control` again to start a new session. * **Ultraplan disconnects Remote Control** : starting an [ultraplan](</docs/en/ultraplan>) session disconnects any active Remote Control session because both features occupy the claude.ai/code interface and only one can be connected at a time.
modified Run prompts on a schedule View current →
--- a/scheduled-tasks.md +++ b/scheduled-tasks.md @@ -30,7 +30,7 @@ Schedule a recurring prompt with /loop -The `/loop` [bundled skill](</docs/en/skills#bundled-skills>) is the quickest way to schedule a recurring prompt. Pass an optional interval and a prompt, and Claude sets up a cron job that fires in the background while the session stays open. +The `/loop` [bundled skill](</docs/en/commands>) is the quickest way to schedule a recurring prompt. Pass an optional interval and a prompt, and Claude sets up a cron job that fires in the background while the session stays open. /loop 5m check if the deployment finished and tell me what happened
modified Claude Code settings View current →
--- a/settings.md +++ b/settings.md @@ -100,7 +100,7 @@ * **Managed settings** : For organizations that need centralized control, Claude Code supports multiple delivery mechanisms for managed settings. All use the same JSON format and cannot be overridden by user or project settings: * **Server-managed settings** : delivered from Anthropic’s servers via the Claude.ai admin console. See [server-managed settings](</docs/en/server-managed-settings>). * **MDM/OS-level policies** : delivered through native device management on macOS and Windows: - * macOS: `com.anthropic.claudecode` managed preferences domain (deployed via configuration profiles in Jamf, Kandji, or other MDM tools) + * macOS: `com.anthropic.claudecode` managed preferences domain (deployed via configuration profiles in Jamf, Iru (Kandji), or other MDM tools) * Windows: `HKLM\SOFTWARE\Policies\ClaudeCode` registry key with a `Settings` value (REG_SZ or REG_EXPAND_SZ) containing JSON (deployed via Group Policy or Intune) * Windows (user-level): `HKCU\SOFTWARE\Policies\ClaudeCode` (lowest policy priority, only used when no admin-level source exists) * **File-based** : `managed-settings.json` and `managed-mcp.json` deployed to system directories: @@ -111,7 +111,7 @@ The legacy Windows path `C:\ProgramData\ClaudeCode\managed-settings.json` is no longer supported as of v2.1.75. Administrators who deployed settings to that location must migrate files to `C:\Program Files\ClaudeCode\managed-settings.json`. File-based managed settings also support a drop-in directory at `managed-settings.d/` in the same system directory alongside `managed-settings.json`. This lets separate teams deploy independent policy fragments without coordinating edits to a single file. Following the systemd convention, `managed-settings.json` is merged first as the base, then all `*.json` files in the drop-in directory are sorted alphabetically and merged on top. Later files override earlier ones for scalar values; arrays are concatenated and de-duplicated; objects are deep-merged. Hidden files starting with `.` are ignored. Use numeric prefixes to control merge order, for example `10-telemetry.json` and `20-security.json`. -See [managed settings](</docs/en/permissions#managed-only-settings>) and [Managed MCP configuration](</docs/en/mcp#managed-mcp-configuration>) for details. +See [managed settings](</docs/en/permissions#managed-only-settings>) and [Managed MCP configuration](</docs/en/mcp#managed-mcp-configuration>) for details. This [repository](<https://github.com/anthropics/claude-code/tree/main/examples/mdm>) includes starter deployment templates for Jamf, Iru (Kandji), Intune, and Group Policy. Use these as starting points and adjust them to fit your needs. Managed deployments can also restrict **plugin marketplace additions** using `strictKnownMarketplaces`. For more information, see [Managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>). @@ -856,7 +856,7 @@ * Browse available plugins from marketplaces * Install/uninstall plugins * Enable/disable plugins - * View plugin details (commands, agents, hooks provided) + * View plugin details (skills, agents, hooks provided) * Add/remove marketplaces Learn more about the plugin system in the [plugins documentation](</docs/en/plugins>).
modified Advanced setup View current →
--- a/setup.md +++ b/setup.md @@ -61,7 +61,9 @@ brew install --cask claude-code -Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes. +Homebrew offers two casks. `claude-code` tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. `claude-code@latest` tracks the latest channel and receives new versions as soon as they ship. + +Homebrew installations do not auto-update. Run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed, to get the latest features and security fixes. winget install Anthropic.ClaudeCode @@ -145,7 +147,7 @@ Claude Code checks for updates on startup and periodically while running. Updates download and install in the background, then take effect the next time you start Claude Code. -Homebrew and WinGet installations do not auto-update. Use `brew upgrade claude-code` or `winget upgrade Anthropic.ClaudeCode` to update manually.**Known issue:** Claude Code may notify you of updates before the new version is available in these package managers. If an upgrade fails, wait and try again later.Homebrew keeps old versions on disk after upgrades. Run `brew cleanup claude-code` periodically to reclaim disk space. +Homebrew and WinGet installations do not auto-update. For Homebrew, run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed. For WinGet, run `winget upgrade Anthropic.ClaudeCode`.**Known issue:** Claude Code may notify you of updates before the new version is available in these package managers. If an upgrade fails, wait and try again later.Homebrew keeps old versions on disk after upgrades. Run `brew cleanup` periodically to reclaim disk space. ### @@ -164,7 +166,7 @@ "autoUpdatesChannel": "stable" } -For enterprise deployments, you can enforce a consistent release channel across your organization using [managed settings](</docs/en/permissions#managed-settings>). +For enterprise deployments, you can enforce a consistent release channel across your organization using [managed settings](</docs/en/permissions#managed-settings>). Homebrew installations choose a channel by cask name instead of this setting: `claude-code` tracks stable and `claude-code@latest` tracks latest. ### @@ -399,9 +401,13 @@ Homebrew installation -Remove the Homebrew cask: +Remove the Homebrew cask you installed. If you installed the stable cask: brew uninstall --cask claude-code + +If you installed the latest cask: + + brew uninstall --cask claude-code@latest ###
modified Extend Claude with skills View current →
--- a/skills.md +++ b/skills.md @@ -1,6 +1,6 @@ -Skills extend what Claude can do. Create a `SKILL.md` file with instructions, and Claude adds it to its toolkit. Claude uses skills when relevant, or you can invoke one directly with `/skill-name`. - -For built-in commands like `/help` and `/compact`, see the [built-in commands reference](</docs/en/commands>).**Custom commands have been merged into skills.** A file at `.claude/commands/deploy.md` and a skill at `.claude/skills/deploy/SKILL.md` both create `/deploy` and work the same way. Your existing `.claude/commands/` files keep working. Skills add optional features: a directory for supporting files, frontmatter to control whether you or Claude invokes them, and the ability for Claude to load them automatically when relevant. +Skills extend what Claude can do. Create a `SKILL.md` file with instructions, and Claude adds it to its toolkit. Claude uses skills when relevant, or you can invoke one directly with `/skill-name`. Create a skill when you keep pasting the same playbook, checklist, or multi-step procedure into chat, or when a section of CLAUDE.md has grown into a procedure rather than a fact. Unlike CLAUDE.md content, a skill’s body loads only when it’s used, so long reference material costs almost nothing until you need it. + +For built-in commands like `/help` and `/compact`, and bundled skills like `/debug` and `/simplify`, see the [commands reference](</docs/en/commands>).**Custom commands have been merged into skills.** A file at `.claude/commands/deploy.md` and a skill at `.claude/skills/deploy/SKILL.md` both create `/deploy` and work the same way. Your existing `.claude/commands/` files keep working. Skills add optional features: a directory for supporting files, frontmatter to control whether you or Claude invokes them, and the ability for Claude to load them automatically when relevant. Claude Code skills follow the [Agent Skills](<https://agentskills.io>) open standard, which works across multiple AI tools. Claude Code extends the standard with additional features like invocation control, subagent execution, and dynamic context injection. @@ -10,15 +10,7 @@ Bundled skills -Bundled skills ship with Claude Code and are available in every session. Unlike [built-in commands](</docs/en/commands>), which execute fixed logic directly, bundled skills are prompt-based: they give Claude a detailed playbook and let it orchestrate the work using its tools. This means bundled skills can spawn parallel agents, read files, and adapt to your codebase. You invoke bundled skills the same way as any other skill: type `/` followed by the skill name. In the table below, `<arg>` indicates a required argument and `[arg]` indicates an optional one. - -Skill| Purpose ----|--- -`/batch <instruction>`| Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one background agent per unit in an isolated [git worktree](</docs/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees>). Each agent implements its unit, runs tests, and opens a pull request. Requires a git repository. Example: `/batch migrate src/ from Solid to React` -`/claude-api`| Load Claude API reference material for your project’s language (Python, TypeScript, Java, Go, Ruby, C#, PHP, or cURL). Covers tool use, streaming, batches, structured outputs, Managed Agents, and common pitfalls. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk` -`/debug [description]`| Enable debug logging for the current session and troubleshoot issues by reading the session debug log. Debug logging is off by default unless you started with `claude --debug`, so running `/debug` mid-session starts capturing logs from that point forward. Optionally describe the issue to focus the analysis -`/loop [interval] <prompt>`| Run a prompt repeatedly on an interval while the session stays open. Useful for polling a deployment, babysitting a PR, or periodically re-running another skill. Example: `/loop 5m check if the deploy finished`. See [Run prompts on a schedule](</docs/en/scheduled-tasks>) -`/simplify [focus]`| Review your recently changed files for code reuse, quality, and efficiency issues, then fix them. Spawns three review agents in parallel, aggregates their findings, and applies fixes. Pass text to focus on specific concerns: `/simplify focus on memory efficiency` +Claude Code includes a set of bundled skills that are available in every session, including `/simplify`, `/batch`, `/debug`, `/loop`, and `/claude-api`. Unlike built-in commands, which execute fixed logic directly, bundled skills are prompt-based: they give Claude a detailed playbook and let it orchestrate the work using its tools. You invoke them the same way as any other skill, by typing `/` followed by the skill name. Bundled skills are listed alongside built-in commands in the [commands reference](</docs/en/commands>), marked **Skill** in the Purpose column. ## @@ -293,7 +285,7 @@ Skill content lifecycle -When you or Claude invoke a skill, the rendered `SKILL.md` content enters the conversation as a single message and stays there for the rest of the session. Claude Code does not re-read the skill file on later turns, so write guidance that should apply throughout a task as standing instructions rather than one-time steps. [Auto-compaction](</docs/en/how-claude-code-works#when-context-fills-up>) preserves invoked skills. When the conversation is summarized to free context, Claude Code re-attaches the most recent invocation of each skill after the summary (truncated if the skill is very large). If you invoke the same skill more than once, only the latest copy is carried forward through compaction. If a skill seems to stop influencing behavior after the first response, the skill content is still present. The model is choosing other tools or approaches. Strengthen the skill’s `description` and instructions so the model keeps preferring it, or use [hooks](</docs/en/hooks>) to enforce behavior deterministically. +When you or Claude invoke a skill, the rendered `SKILL.md` content enters the conversation as a single message and stays there for the rest of the session. Claude Code does not re-read the skill file on later turns, so write guidance that should apply throughout a task as standing instructions rather than one-time steps. [Auto-compaction](</docs/en/how-claude-code-works#when-context-fills-up>) carries invoked skills forward within a token budget. When the conversation is summarized to free context, Claude Code re-attaches the most recent invocation of each skill after the summary, keeping the first 5,000 tokens of each. Re-attached skills share a combined budget of 25,000 tokens. Claude Code fills this budget starting from the most recently invoked skill, so older skills can be dropped entirely after compaction if you have invoked many in one session. If a skill seems to stop influencing behavior after the first response, the content is usually still present and the model is choosing other tools or approaches. Strengthen the skill’s `description` and instructions so the model keeps preferring it, or use [hooks](</docs/en/hooks>) to enforce behavior deterministically. If the skill is large or you invoked several others after it, re-invoke it after compaction to restore the full content. ### @@ -719,5 +711,5 @@ * **[Plugins](</docs/en/plugins>)** : package and distribute skills with other extensions * **[Hooks](</docs/en/hooks>)** : automate workflows around tool events * **[Memory](</docs/en/memory>)** : manage CLAUDE.md files for persistent context - * **[Built-in commands](</docs/en/commands>)** : reference for built-in `/` commands + * **[Commands](</docs/en/commands>)** : reference for built-in commands and bundled skills * **[Permissions](</docs/en/permissions>)** : control tool and skill access
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -1,4 +1,4 @@ -Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent’s description, it delegates to that subagent, which works independently and returns results. To see the context savings in practice, the [context window visualization](</docs/en/context-window>) walks through a session where a subagent handles research in its own separate window. +Subagents are specialized AI assistants that handle specific types of tasks. Use one when a side task would flood your main conversation with search results, logs, or file contents you won’t reference again: the subagent does that work in its own context and returns only the summary. Define a custom subagent when you keep spawning the same kind of worker with the same instructions. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent’s description, it delegates to that subagent, which works independently and returns results. To see the context savings in practice, the [context window visualization](</docs/en/context-window>) walks through a session where a subagent handles research in its own separate window. If you need multiple agents working in parallel and communicating with each other, see [agent teams](</docs/en/agent-teams>) instead. Subagents work within a single session; agent teams coordinate across separate sessions. @@ -81,7 +81,7 @@ Choose a location -Select **Create new agent** , then choose **Personal**. This saves the subagent to `~/.claude/agents/` so it’s available in all your projects. +Switch to the **Library** tab, select **Create new agent** , then choose **Personal**. This saves the subagent to `~/.claude/agents/` so it’s available in all your projects. 3 @@ -143,7 +143,7 @@ Use the /agents command -The `/agents` command provides an interactive interface for managing subagents. Run `/agents` to: +The `/agents` command opens a tabbed interface for managing subagents. The **Running** tab shows live subagents and lets you open or stop them. The **Library** tab lets you: * View all available subagents (built-in, user, project, and plugin) * Create new subagents with guided setup or Claude generation
modified Enterprise deployment overview View current →
--- a/third-party-integrations.md +++ b/third-party-integrations.md @@ -167,7 +167,7 @@ Pin model versions for cloud providers -If you deploy through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), or [Foundry](</docs/en/microsoft-foundry>), pin specific model versions using `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Without pinning, Claude Code aliases resolve to the latest version, which can break users when Anthropic releases a new model that isn’t yet enabled in your account. See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for details. +If you deploy through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), or [Foundry](</docs/en/microsoft-foundry>), pin specific model versions using `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Without pinning, model aliases resolve to the latest version, which may not yet be enabled in your account when Anthropic releases an update. Pinning lets you control when your users move to a new model. See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for what each provider does when the latest version is unavailable. ###
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -17,6 +17,7 @@ `Grep`| Searches for patterns in file contents| No `ListMcpResourcesTool`| Lists resources exposed by connected [MCP servers](</docs/en/mcp>)| No `LSP`| Code intelligence via language servers: jump to definitions, find references, report type errors and warnings. See LSP tool behavior| No +`Monitor`| Runs a command in the background and feeds each output line back to Claude, so it can react to log entries, file changes, or polled status mid-conversation. See Monitor tool| Yes `NotebookEdit`| Modifies Jupyter notebook cells| Yes `PowerShell`| Executes PowerShell commands on Windows. Opt-in preview. See PowerShell tool| Yes `Read`| Reads the contents of files| No @@ -68,6 +69,23 @@ * Trace call hierarchies The tool is inactive until you install a [code intelligence plugin](</docs/en/discover-plugins#code-intelligence>) for your language. The plugin bundles the language server configuration, and you install the server binary separately. + +## + +​ + +Monitor tool + +The Monitor tool requires Claude Code v2.1.98 or later. + +The Monitor tool lets Claude watch something in the background and react when it changes, without pausing the conversation. Ask Claude to: + + * Tail a log file and flag errors as they appear + * Poll a PR or CI job and report when its status changes + * Watch a directory for file changes + * Track output from any long-running script you point it at + +Claude writes a small script for the watch, runs it in the background, and receives each output line as it arrives. You keep working in the same session and Claude interjects when an event lands. Stop a monitor by asking Claude to cancel it or by ending the session. Monitor uses the same [permission rules as Bash](</docs/en/permissions#tool-specific-permission-rules>), so `allow` and `deny` patterns you have set for Bash apply here too. It is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. ##
modified Troubleshooting View current →
--- a/troubleshooting.md +++ b/troubleshooting.md @@ -134,7 +134,7 @@ npm uninstall -g @anthropic-ai/claude-code -Remove a Homebrew install on macOS: +Remove a Homebrew install on macOS (use `claude-code@latest` if you installed that cask): brew uninstall --cask claude-code
modified Agent SDK reference - TypeScript View current →
--- a/typescript.md +++ b/typescript.md @@ -1485,6 +1485,7 @@ | GrepInput | ListMcpResourcesInput | McpInput + | MonitorInput | NotebookEditInput | ReadMcpResourceInput | SubscribeMcpResourceInput @@ -1556,6 +1557,23 @@ }; Executes bash commands in a persistent shell session with optional timeout and background execution. + +### + +​ + +Monitor + +**Tool name:** `Monitor` + + type MonitorInput = { + command: string; + description: string; + timeout_ms?: number; + persistent?: boolean; + }; + +Runs a background script and delivers each stdout line to Claude as an event so it can react without polling. Set `persistent: true` for session-length watches such as log tails. Monitor follows the same permission rules as Bash. See the [Monitor tool reference](</docs/en/tools-reference#monitor-tool>) for behavior and provider availability. ### @@ -1850,6 +1868,7 @@ | GlobOutput | GrepOutput | ListMcpResourcesOutput + | MonitorOutput | NotebookEditOutput | ReadMcpResourceOutput | TaskStopOutput @@ -1950,6 +1969,22 @@ }; Returns command output with stdout/stderr split. Background commands include a `backgroundTaskId`. + +### + +​ + +Monitor + +**Tool name:** `Monitor` + + type MonitorOutput = { + taskId: string; + timeoutMs: number; + persistent?: boolean; + }; + +Returns the background task ID for the running monitor. Use this ID with `TaskStop` to cancel the watch early. ### @@ -2713,7 +2748,7 @@ `SDKTaskNotificationMessage` -Notification when a background task completes, fails, or is stopped. +Notification when a background task completes, fails, or is stopped. Background tasks include `run_in_background` Bash commands, Monitor watches, and background subagents. type SDKTaskNotificationMessage = { type: "system"; @@ -2852,7 +2887,7 @@ `SDKTaskStartedMessage` -Emitted when a background task begins. +Emitted when a background task begins. The `task_type` field is `"local_bash"` for background Bash commands and Monitor watches, `"local_agent"` for subagents, or `"remote_agent"`. type SDKTaskStartedMessage = { type: "system";
modified Voice dictation View current →
--- a/voice-dictation.md +++ b/voice-dictation.md @@ -119,10 +119,38 @@ Common issues when voice dictation does not activate or record: * **`Voice mode requires a Claude.ai account`** : you are authenticated with an API key or a third-party provider. Run `/login` to sign in with a Claude.ai account. - * **`Microphone access is denied`** : grant microphone permission to your terminal in system settings. On macOS, go to System Settings → Privacy & Security → Microphone. On Windows, go to Settings → Privacy → Microphone. Then run `/voice` again. + * **`Microphone access is denied`** : grant microphone permission to your terminal in system settings. On macOS, go to System Settings → Privacy & Security → Microphone and enable your terminal app, then run `/voice` again. On Windows, go to Settings → Privacy & security → Microphone and turn on microphone access for desktop apps, then run `/voice` again. If your terminal isn’t listed in the macOS settings, see Terminal not listed in macOS Microphone settings. * **`No audio recording tool found` on Linux**: the native audio module could not load and no fallback is installed. Install SoX with the command shown in the error message, for example `sudo apt-get install sox`. * **Nothing happens when holding`Space`**: watch the prompt input while you hold. If spaces keep accumulating, voice dictation is off; run `/voice` to enable it. If only one or two spaces appear and then nothing, voice dictation is on but hold detection is not triggering. Hold detection requires your terminal to send key-repeat events, so it cannot detect a held key if key-repeat is disabled at the OS level. * **Transcription is garbled or in the wrong language** : dictation defaults to English. If you are dictating in another language, set it in `/config` first. See Change the dictation language. + +### + +​ + +Terminal not listed in macOS Microphone settings + +If your terminal app does not appear under System Settings → Privacy & Security → Microphone, there is no toggle you can enable. Reset the permission state for your terminal so the next `/voice` run triggers a fresh macOS permission prompt. + +1 + +Reset the microphone permission for your terminal + +Run `tccutil reset Microphone <bundle-id>`, replacing `<bundle-id>` with your terminal’s identifier: `com.apple.Terminal` for the built-in Terminal, or `com.googlecode.iterm2` for iTerm2. For other terminals, look up the identifier with `osascript -e 'id of app "AppName"'`. + +You can run `tccutil reset Microphone` without a bundle ID, but it revokes microphone access from every app on your Mac, including apps like Zoom or Slack. Each app will need to re-request access on next use, so don’t run it during an active call. + +2 + +Quit and relaunch your terminal + +macOS won’t re-prompt a process that is already running. Quit the terminal app with Cmd+Q, not just close its windows, then open it again. + +3 + +Trigger a fresh prompt + +Start Claude Code and run `/voice`. macOS prompts for microphone access; allow it. ## @@ -133,4 +161,4 @@ * [Customize keyboard shortcuts](</docs/en/keybindings>): rebind `voice:pushToTalk` and other CLI keyboard actions * [Configure settings](</docs/en/settings>): full reference for `voiceEnabled`, `language`, and other settings keys * [Interactive mode](</docs/en/interactive-mode>): keyboard shortcuts, input modes, and session controls - * [Built-in commands](</docs/en/commands>): reference for `/voice`, `/config`, and all other commands + * [Commands](</docs/en/commands>): reference for `/voice`, `/config`, and all other commands
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -46,10 +46,16 @@ * **Command Palette** : `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), type “Claude Code”, and select an option like “Open in New Tab” * **Status Bar** : click **✱ Claude Code** in the bottom-right corner of the window. This works even when no file is open. -When you first open the panel, a **Learn Claude Code** checklist appears. Work through each item by clicking **Show me** , or dismiss it with the X. To reopen it later, uncheck **Hide Onboarding** in VS Code settings under Extensions → Claude Code.You can drag the Claude panel to reposition it anywhere in VS Code. See Customize your workflow for details. +You can drag the Claude panel to reposition it anywhere in VS Code. See Customize your workflow for details. 2 +Sign in + +The first time you open the panel, a sign-in screen appears. Click **Sign in** and complete authorization in your browser.If you see **Not logged in · Please run /login** later, the extension reopens the sign-in screen automatically. If it doesn’t appear, reload the window from the Command Palette with **Developer: Reload Window**.If you have `ANTHROPIC_API_KEY` set in your shell but still see the sign-in prompt, VS Code may not have inherited your shell environment. Launch VS Code from a terminal with `code .` so it inherits your environment variables, or sign in with your Claude account instead.After you sign in, a **Learn Claude Code** checklist appears. Work through each item by clicking **Show me** , or dismiss it with the X. To reopen it later, uncheck **Hide Onboarding** in VS Code settings under Extensions → Claude Code. + +3 + Send a prompt Ask Claude to help with your code or files, whether that’s explaining how something works, debugging an issue, or making changes. @@ -58,7 +64,7 @@ Here’s an example of asking about a particular line in a file: -3 +4 Review changes @@ -243,7 +249,7 @@ Open in Terminal| -| Open Claude in terminal mode Open in New Tab| `Cmd+Shift+Esc` (Mac) / `Ctrl+Shift+Esc` (Windows/Linux)| Open a new conversation as an editor tab Open in New Window| -| Open a new conversation in a separate window -New Conversation| `Cmd+N` (Mac) / `Ctrl+N` (Windows/Linux)| Start a new conversation (requires Claude to be focused) +New Conversation| `Cmd+N` (Mac) / `Ctrl+N` (Windows/Linux)| Start a new conversation. Requires Claude to be focused and `enableNewConversationShortcut` set to `true` Insert @-Mention Reference| `Option+K` (Mac) / `Alt+K` (Windows/Linux)| Insert a reference to the current file and selection (requires editor to be focused) Show Logs| -| View extension debug logs Logout| -| Sign out of your Anthropic account @@ -290,15 +296,15 @@ Setting| Default| Description ---|---|--- -`selectedModel`| `default`| Model for new conversations. Change per-session with `/model`. `useTerminal`| `false`| Launch Claude in terminal mode instead of graphical panel `initialPermissionMode`| `default`| Controls approval prompts for new conversations: `default`, `plan`, `acceptEdits`, or `bypassPermissions`. See [permission modes](</docs/en/permission-modes>). `preferredLocation`| `panel`| Where Claude opens: `sidebar` (right) or `panel` (new tab) `autosave`| `true`| Auto-save files before Claude reads or writes them `useCtrlEnterToSend`| `false`| Use Ctrl/Cmd+Enter instead of Enter to send prompts -`enableNewConversationShortcut`| `true`| Enable Cmd/Ctrl+N to start a new conversation +`enableNewConversationShortcut`| `false`| Enable Cmd/Ctrl+N to start a new conversation `hideOnboarding`| `false`| Hide the onboarding checklist (graduation cap icon) `respectGitIgnore`| `true`| Exclude .gitignore patterns from file searches +`usePythonEnvironment`| `true`| Activate the workspace’s Python environment when running Claude. Requires the Python extension. `environmentVariables`| `[]`| Set environment variables for the Claude process. Use Claude Code settings instead for shared config. `disableLoginPrompt`| `false`| Skip authentication prompts (for third-party provider setups) `allowDangerouslySkipPermissions`| `false`| Adds [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) and Bypass permissions to the mode selector. Auto mode has [plan, admin, model, and provider requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), so it may remain unavailable even with this toggle on. Use Bypass permissions only in sandboxes with no internet access.