Changes on
32 changes detected
--- a/advisor.md
+++ b/advisor.md
@@ -74,6 +74,7 @@
---|---|---
Haiku 4.5| Fable, Opus, Sonnet| Haiku can call the advisor but cannot act as one
Sonnet 4.6| Fable, Opus, Sonnet|
+Sonnet 5| Fable, Opus, Sonnet 5| A Sonnet 4.6 advisor is rejected
Opus 4.6 or later| Fable, Opus at or above the main model’s version| An Opus 4.7 main with an Opus 4.6 advisor is rejected
Fable 5 (v2.1.170+)| Fable| An Opus or Sonnet advisor is rejected
@@ -141,7 +142,7 @@
* **Claude Code v2.1.98 or later** : run `claude update` to upgrade.
* **Anthropic API only** : the advisor is a server-executed tool. It is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. Through an [LLM gateway](</docs/en/llm-gateway>) configured with `ANTHROPIC_BASE_URL`, availability depends on whether the gateway forwards the request intact to the Anthropic API.
- * **Supported main model** : Opus 4.6 or later, Sonnet 4.6, or Haiku 4.5. Fable 5 also qualifies on Claude Code v2.1.170 or later.
+ * **Supported main model** : Opus 4.6 or later, Sonnet 4.6 or later, or Haiku 4.5. Fable 5 also qualifies on Claude Code v2.1.170 or later.
##
--- a/agent-loop.md
+++ b/agent-loop.md
@@ -207,7 +207,7 @@
Model
-If you don’t set `model`, the SDK uses Claude Code’s default, which depends on your authentication method and subscription. Set it explicitly (for example, `model="claude-sonnet-4-6"`) to pin a specific model or to use a smaller model for faster, cheaper agents. See [models](<https://platform.claude.com/docs/en/about-claude/models>) for available IDs.
+If you don’t set `model`, the SDK uses Claude Code’s default, which depends on your authentication method and subscription. Set it explicitly (for example, `model="claude-sonnet-5"`) to pin a specific model or to use a smaller model for faster, cheaper agents. See [models](<https://platform.claude.com/docs/en/about-claude/models>) for available IDs.
##
--- a/agent-teams.md
+++ b/agent-teams.md
@@ -246,7 +246,7 @@
Permissions
-Teammates start with the lead’s permission settings. If the lead runs with `--dangerously-skip-permissions`, all teammates do too. After spawning, you can change individual teammate modes, but you can’t set per-teammate modes at spawn time.
+Teammates start with the lead’s permission settings. If the lead runs with `--dangerously-skip-permissions`, all teammates do too. After spawning, you can change individual teammate modes, but you can’t set per-teammate modes at spawn time. When one agent sends another a message over `SendMessage`, the receiving agent is told it came from another Claude session, not from you. A teammate cannot approve a permission prompt or supply consent on your behalf, and a teammate that was denied an action cannot relay it to another teammate to bypass the check. In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), the classifier treats an approval claim relayed from another agent as untrusted input rather than confirmation from you. Teammate permission prompts bubble up to the lead session, so approve them there yourself.
###
--- a/agent-view.md
+++ b/agent-view.md
@@ -229,7 +229,7 @@
---|---
`<agent-name> <prompt>`| If the first word matches a custom [subagent](</docs/en/sub-agents>) name, that subagent runs as the session’s main agent with the configuration from its frontmatter
`@<agent-name>`| Mention a custom subagent anywhere in the prompt to run it as the main agent
-`@<repo>`| Mention a repository under the directory you opened agent view from to run the session there
+`@<repo>`| Mention a repository to run the session there. See Dispatch to a specific directory for which repositories are listed
`/<command>`| Suggest [skills](</docs/en/skills>) and [commands](</docs/en/commands>) to dispatch as the prompt
`! <command>`| Run a shell command as a background job instead of starting a Claude session. The job appears as a row you can attach to, watch, and detach from
`#<number>` or a pull request URL| If a session is already working on that PR, select it instead of dispatching
@@ -243,10 +243,10 @@
Dispatch to a specific directory
-A new session runs in the directory you opened agent view from. To target a different directory:
+A new session runs in the directory you opened agent view from. To target a different directory, use any of these:
* Open `claude agents` in that directory.
- * Open `claude agents` in a parent directory that holds several repositories and mention one with `@<repo>` in the prompt to run the session there.
+ * Open `claude agents` in a parent directory and mention a child repository with `@<repo>` in the prompt. Typing `@` lists git repositories one level below the launch directory, plus any directory that already has a session in the list. A directory whose name contains a space isn’t listed.
* From the shell, `cd` into the directory and run `claude --bg "<prompt>"`.
When agent view is grouped by directory, the highlighted row’s directory becomes the dispatch target, so you can scroll to a group and dispatch into it without retyping the path.
--- a/amazon-bedrock.md
+++ b/amazon-bedrock.md
@@ -283,7 +283,7 @@
1M token context window
-Claude Opus 4.6 and later, and Sonnet 4.6, support the [1M token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) on Amazon Bedrock. Claude Code automatically enables the extended context window when you select a 1M model variant. The setup wizard offers a 1M context option when it pins models. To enable it for a manually pinned model instead, append `[1m]` to the model ID. See [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) for details.
+Claude Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support the [1M token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) on Amazon Bedrock. Sonnet 5 is served through the Mantle endpoint and always runs with the 1M window, with no `[1m]` variant to select. For the other models, Claude Code automatically enables the extended context window when you select a 1M model variant. The setup wizard offers a 1M context option when it pins models. To enable it for a manually pinned model instead, append `[1m]` to the model ID. See [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) for details.
##
@@ -340,7 +340,7 @@
Select a Mantle model
-Mantle uses model IDs prefixed with `anthropic.` and without a version suffix, for example `anthropic.claude-haiku-4-5`. The models available to your account depend on what your organization has been granted; additional model IDs are listed in your onboarding materials from AWS. Contact your AWS account team to request access to allowlisted models. Set the model with the `--model` flag or with `/model` inside Claude Code:
+Mantle uses model IDs prefixed with `anthropic.` and without a version suffix, for example `anthropic.claude-sonnet-5` or `anthropic.claude-haiku-4-5`. The models available to your account depend on what your organization has been granted; additional model IDs are listed in your onboarding materials from AWS. Contact your AWS account team to request access to allowlisted models. Set the model with the `--model` flag or with `/model` inside Claude Code:
claude --model anthropic.claude-haiku-4-5
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,46 @@
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.197
+
+June 30, 2026
+
+ * Introducing Claude Sonnet 5: now the default model in Claude Code, with a native 1M-token context window and promotional pricing of 2/2/2/10 per Mtok through August 31. Update to version 2.1.197 for access. <https://www.anthropic.com/news/claude-sonnet-5>
+
+
+
+2.1.196
+
+June 29, 2026
+
+ * Added support for organization default models — admins set it in the org console; it shows as “Org default” (or “Role default”) in `/model` when you haven’t picked one yourself
+ * Added readable default names for sessions at start, making them easier to identify and message
+ * Added clickable file attachments in chat — Cmd/Ctrl-click reveals the file in Finder/Explorer
+ * Security: `claude mcp list`/`get` no longer spawn `.mcp.json` servers that a repo self-approved via a committed `.claude/settings.json`; untrusted workspaces show `⏸ Pending approval`
+ * Fixed waking a background job permanently deleting its conversation and re-running the original prompt when the transcript probe misread a real transcript; the file is now set aside, never deleted
+ * Fixed the rate-limit warning flickering off and rate-limit telemetry being over-counted when multiple parallel requests were in flight at the moment a usage limit was hit
+ * Fixed duplicate recap lines after a background session’s turn: a schema-rejected StructuredOutput attempt no longer renders alongside its retry
+ * Fixed PowerShell `git diff`/`git grep`, `egrep`/`fgrep`, and quoted search patterns containing `|` being reported as failures when they exit 1, matching Bash behavior
+ * Fixed multiple `claude agents` side panel issues: keyboard focus getting stuck when opening an agent, background jobs losing their subagent types on every open, and sessions showing incorrect status while actively running
+ * Fixed `claude agents --dangerously-skip-permissions` silently falling back to auto mode instead of showing the bypass disclaimer and applying bypass mode to spawned agents
+ * Fixed mid-turn crash recovery for Remote sessions — sessions interrupted by a server restart now auto-resume on the next worker
+ * Fixed sessions moved with `/cd` reappearing in the old directory’s resume list after a non-graceful exit when the old path contained special characters
+ * Fixed `claude plugin validate` skipping local plugins whose source is ”.” and stopping after the first error class
+ * Fixed Esc Esc at an idle prompt not opening the rewind menu (regression); use Ctrl+C or Ctrl+X Ctrl+K to stop background agents
+ * Fixed MCP OAuth requesting the authorization server’s full `scopes_supported` catalog when no scope is specified, causing `invalid_scope` failures on GitLab self-hosted and other enterprise IdPs
+ * Fixed `/context` showing 0 tokens for all tool groups on Bedrock
+ * Fixed `/deep-research` misreporting verifier failures as “all claims refuted” instead of `unverified`
+ * Fixed plugin dependency version pins not being honored when the marketplace was added as a local folder path backed by a git repo
+ * Fixed `claude agents` session status: completed rows no longer flip between “Done” and “Needs your input”, stalled agents are now labeled “Needs attention”, and results that mention a PR show a clickable link
+ * Fixed voice dictation swallowing spaces and spuriously starting a recording during very fast typing when voice mode is enabled
+ * Improved background session reliability: long-running commands and workflows now survive the session’s process being stopped, restarted, or updated — including on Windows, where background shells are handed off instead of being killed
+ * Improved background agents: workers killed by a daemon restart are now automatically resumed from where they left off the next time the agents view opens
+ * Improved `/code-review` workflow: merged five cleanup finders into one, cutting token usage by roughly 25%
+ * Reduced per-frame rendering work in the terminal UI by skipping no-op subtree walks during streaming
+ * The streaming idle watchdog is now on by default for all providers — it aborts and retries when a response stream produces no events for 5 minutes. Set `CLAUDE_ENABLE_STREAM_WATCHDOG=0` to disable.
+ * Remote Control is now disabled when `ANTHROPIC_BASE_URL` points at a non-Anthropic host, matching the existing behavior under `CLAUDE_CODE_USE_BEDROCK`/`_VERTEX`/`_FOUNDRY`
+ * Changed opening the agents view from a foreground session to require a single `←` press instead of two, matching the behavior in background sessions
--- a/claude-apps-gateway.md
+++ b/claude-apps-gateway.md
@@ -1,4 +1,4 @@
-If a third-party cloud isn’t a requirement, [Claude for Enterprise](</docs/en/authentication#claude-for-teams-or-enterprise>) is usually the better fit: richer admin capabilities, such as SCIM provisioning, and nothing to host. Claude for Enterprise subscriptions are available through AWS Marketplace, where purchases can count toward an AWS spend commitment. The gateway is designed for organizations that must route inference through their own cloud provider, for example to meet [data residency](</docs/en/claude-apps-gateway-deploy#compliance-posture>) requirements.
+The Claude apps gateway is designed for organizations that must — or prefer to — route inference through their own cloud provider, for example to meet [data residency](</docs/en/claude-apps-gateway-deploy#compliance-posture>) requirements. If you don’t have this requirement, and want access to other features such as SCIM provisioning or Claude Code on web & mobile, Claude Enterprise may be a better fit. See the [feature availability](</docs/en/feature-availability>) page for a full comparison of all deployment methods.
Claude apps gateway is a self-hosted service that sits between your developers’ Claude Code clients and your model provider. Developers sign in with your corporate identity provider (IdP) instead of holding API keys or cloud credentials. The gateway holds the upstream credential, enforces model access and [managed settings](</docs/en/permissions#managed-settings>) by IdP group, and relays usage telemetry to your own observability stack. It is included in the `claude` binary, so the same executable that runs Claude Code on a laptop runs the gateway server with `claude gateway --config gateway.yaml`. This page covers:
@@ -290,7 +290,7 @@
Server-side web search| Not available| The CLI can’t see which upstream provider the gateway routes to, so it can’t verify web search support and disables WebSearch on gateway sessions
Standard prompt caching| Available| `cache_control` breakpoints are forwarded to every upstream
1-hour cache TTL| Not available| The CLI omits the extended-cache-ttl beta on gateway sessions, because not every upstream the gateway can route to supports the 1-hour TTL, so prompt caching through the gateway uses the 5-minute TTL; see the beta-header note above
-Auto mode| Available with opt-in| Follows the [third-party provider rules](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>): set `CLAUDE_CODE_ENABLE_AUTO_MODE=1`, deliverable through the managed policy `env` block, and only the Opus models eligible on third-party providers can use it
+Auto mode| Available with opt-in| Follows the [third-party provider rules](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>): set `CLAUDE_CODE_ENABLE_AUTO_MODE=1`, deliverable through the managed policy `env` block, and only the models eligible on third-party providers can use it
First-party-only optimizations such as global cache scope and token-efficient tools| Not available| The CLI doesn’t enable them on gateway sessions; see the beta-header note above
OTLP/gRPC| Not supported| OTLP over HTTP only
SAML, LDAP, and other non-OIDC auth| Not supported| OIDC only. Front with an OIDC bridge if needed
--- a/claude-platform-on-aws.md
+++ b/claude-platform-on-aws.md
@@ -70,7 +70,7 @@
export ANTHROPIC_DEFAULT_FABLE_MODEL=claude-fable-5
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-7
- export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-4-6
+ export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-4-5
For the full list of model IDs and aliases, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For other model-related variables, see [Model configuration](</docs/en/model-config>). [Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`. The API bills 1-hour cache writes at a higher rate. See [prompt caching pricing](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing>) for the rates.
--- a/cli-reference.md
+++ b/cli-reference.md
@@ -90,7 +90,7 @@
`--max-budget-usd`| Maximum dollar amount to spend on API calls before stopping (print mode only)| `claude -p --max-budget-usd 5.00 "query"`
`--max-turns`| Limit the number of agentic turns (print mode only). Exits with an error when the limit is reached. No limit by default| `claude -p --max-turns 3 "query"`
`--mcp-config`| Load MCP servers from JSON files or strings (space-separated)| `claude --mcp-config ./mcp.json`
-`--model`| Sets the model for the current session with an alias for the latest model (`sonnet`, `opus`, `haiku`, or `fable`) or a model’s full name. Overrides the [`model`](</docs/en/settings#available-settings>) setting and [`ANTHROPIC_MODEL`](</docs/en/model-config#environment-variables>)| `claude --model claude-sonnet-4-6`
+`--model`| Sets the model for the current session with an alias for the latest model (`sonnet`, `opus`, `haiku`, or `fable`) or a model’s full name. Overrides the [`model`](</docs/en/settings#available-settings>) setting and [`ANTHROPIC_MODEL`](</docs/en/model-config#environment-variables>)| `claude --model claude-sonnet-5`
`--name`, `-n`| Set a display name for the session, shown in `/resume` and the terminal title. You can resume a named session with `claude --resume <name>`.
[`/rename`](</docs/en/commands>) changes the name mid-session and also shows it on the prompt bar| `claude -n "my-feature-work"`
--- a/context-window.md
+++ b/context-window.md
@@ -45,7 +45,7 @@
* **Clear between tasks** : run `/clear` when switching to unrelated work. Old conversation crowds out the files you need next and costs tokens on every message.
* **Delegate large reads** : send research to a [subagent](</docs/en/sub-agents>) so the file contents stay in its context window, not yours.
-If you need a larger window rather than a smaller conversation, Fable 5, Opus 4.6 and later, and Sonnet 4.6 support a 1 million token context window. See [Extended context](</docs/en/model-config#extended-context>) for availability by plan and how to select a `[1m]` model variant. Compaction works the same way at the larger limit.
+If you need a larger window rather than a smaller conversation, Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a 1 million token context window. See [Extended context](</docs/en/model-config#extended-context>) for availability by plan and how to select a `[1m]` model variant. Sonnet 5 runs at 1M with no `[1m]` variant to select; see [Sonnet 5 context window](</docs/en/model-config#sonnet-5-context-window>) for its auto-compaction thresholds and the LLM gateway exception. Compaction works the same way at the larger limit.
##
--- a/desktop.md
+++ b/desktop.md
@@ -8,7 +8,11 @@
For x64 processors
-For Windows ARM64, download the [ARM64 installer](<https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code&utm_medium=docs>). The desktop app is not available on Linux; use the [CLI](</docs/en/quickstart>) instead. After installing, launch Claude, sign in, and click the **Code** tab. The first time you open it on Windows, you need [Git for Windows](<https://git-scm.com/downloads/win>) installed; restart the app after installing it. For a walkthrough of your first session, see the [Get started guide](</docs/en/desktop-quickstart>). In the Code tab, each conversation is a **session** : it has its own chat history, project folder, and code changes, independent of any other session. The sidebar lists your sessions and lets you run several in parallel. Within a session you can:
+## Get Claude for Linux (beta)
+
+apt or .deb for Ubuntu and Debian
+
+For Windows ARM64, download the [ARM64 installer](<https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code&utm_medium=docs>). On Linux, install with apt; see [Claude Desktop on Linux](</docs/en/desktop-linux>). After installing, launch Claude, sign in, and click the **Code** tab. The first time you open it on Windows, you need [Git for Windows](<https://git-scm.com/downloads/win>) installed; restart the app after installing it. For a walkthrough of your first session, see the [Get started guide](</docs/en/desktop-quickstart>). In the Code tab, each conversation is a **session** : it has its own chat history, project folder, and code changes, independent of any other session. The sidebar lists your sessions and lets you run several in parallel. Within a session you can:
* Review and comment on diffs, then watch the resulting PR through CI
* Preview your running app in an embedded browser while Claude verifies its own changes
@@ -78,7 +82,7 @@
**Auto**| `auto`| Claude executes all actions with background safety checks that verify alignment with your request. Reduces permission prompts while maintaining oversight. Enable in your Settings → Claude Code. See availability requirements below.
**Bypass permissions**| `bypassPermissions`| Claude runs without permission prompts, except those forced by explicit [ask rules](</docs/en/permissions#manage-permissions>); equivalent to `--dangerously-skip-permissions` in the CLI. Enable in your Settings → Claude Code under “Allow bypass permissions mode”. Only use this in sandboxed containers or VMs. Enterprise admins can disable this option.
-The `dontAsk` permission mode is available only in the [CLI](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>). Auto mode is a research preview available to all users on the Anthropic API and requires Claude Opus 4.6 or later, or Sonnet 4.6. In Enterprise deployments that route Desktop to Google Cloud Vertex AI, auto mode is off until you [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>), and only Claude Opus 4.7 and Opus 4.8 are supported there.
+The `dontAsk` permission mode is available only in the [CLI](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>). Auto mode is a research preview available to all users on the Anthropic API and requires Claude Opus 4.6 or later, or Sonnet 4.6 or later. In Enterprise deployments that route Desktop to Google Cloud Vertex AI, auto mode is off until you [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>), and only Claude Sonnet 5, Opus 4.7, and Opus 4.8 are supported there.
Start complex tasks in Plan mode so Claude maps out an approach before making changes. Once you approve the plan, switch to Auto accept edits or Ask permissions to execute it. See [explore first, then plan, then code](</docs/en/best-practices#explore-first-then-plan-then-code>) for more on this workflow.
@@ -564,7 +568,7 @@
Local sessions
-The desktop app does not always inherit your full shell environment. On macOS, when you launch the app from the Dock or Finder, it reads your shell profile, such as `~/.zshrc` or `~/.bashrc`, to extract `PATH` and a fixed set of Claude Code variables, but other variables you export there are not picked up. On Windows, the app inherits user and system environment variables but does not read PowerShell profiles. To set environment variables for local sessions and dev servers on any platform, open the environment dropdown in the prompt box, hover over **Local** , and click the gear icon to open the local environment editor. Variables you save here are stored encrypted on your machine and apply to every local session and preview server you start. You can also add variables to the `env` key in your `~/.claude/settings.json` file, though these reach Claude sessions only and not dev servers. See [environment variables](</docs/en/env-vars>) for the full list of supported variables. [Extended thinking](</docs/en/model-config#extended-thinking>) is enabled by default, which improves performance on complex reasoning tasks but uses additional tokens. To disable thinking, set `MAX_THINKING_TOKENS` to `0` in the local environment editor; this has no effect on Fable 5, which always uses extended thinking. On [third-party providers](</docs/en/third-party-integrations>), `0` omits the `thinking` parameter instead, and adaptive-reasoning models may still think. On models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>), any other `MAX_THINKING_TOKENS` value is ignored because adaptive reasoning controls thinking depth instead. On Opus 4.6 and Sonnet 4.6, set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` to `1` to use a fixed thinking budget; Opus 4.7 and later always use adaptive reasoning and have no fixed-budget mode.
+The desktop app does not always inherit your full shell environment. On macOS, when you launch the app from the Dock or Finder, it reads your shell profile, such as `~/.zshrc` or `~/.bashrc`, to extract `PATH` and a fixed set of Claude Code variables, but other variables you export there are not picked up. On Windows, the app inherits user and system environment variables but does not read PowerShell profiles. To set environment variables for local sessions and dev servers on any platform, open the environment dropdown in the prompt box, hover over **Local** , and click the gear icon to open the local environment editor. Variables you save here are stored encrypted on your machine and apply to every local session and preview server you start. You can also add variables to the `env` key in your `~/.claude/settings.json` file, though these reach Claude sessions only and not dev servers. See [environment variables](</docs/en/env-vars>) for the full list of supported variables. [Extended thinking](</docs/en/model-config#extended-thinking>) is enabled by default, which improves performance on complex reasoning tasks but uses additional tokens. To disable thinking, set `MAX_THINKING_TOKENS` to `0` in the local environment editor; this has no effect on Fable 5, which always uses extended thinking. On [third-party providers](</docs/en/third-party-integrations>), `0` omits the `thinking` parameter instead, and adaptive-reasoning models may still think. On models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>), any other `MAX_THINKING_TOKENS` value is ignored because adaptive reasoning controls thinking depth instead. On Opus 4.6 and Sonnet 4.6, set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` to `1` to use a fixed thinking budget; Fable 5, Sonnet 5, and Opus 4.7 and later always use adaptive reasoning and have no fixed-budget mode.
###
@@ -792,7 +796,7 @@
The following features are only available in the CLI or VS Code extension, except where noted:
* **Third-party providers** : Desktop connects to Anthropic’s API by default. Enterprise deployments can configure Vertex AI and gateway providers via [managed settings](<https://support.claude.com/en/articles/12622667-enterprise-configuration>). For Bedrock or Foundry in the CLI, see the [quickstart](</docs/en/quickstart>). As an exception to the section above, the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/overview>) runs the Code tab on Bedrock, Vertex AI, Foundry, or a self-hosted LLM gateway.
- * **Linux** : the desktop app is available on macOS and Windows only. On Linux, use the [CLI](</docs/en/quickstart>).
+ * **Linux (beta)** : Computer Use isn’t yet available in the Linux desktop app. See [Claude Desktop on Linux](</docs/en/desktop-linux>).
* **Inline code suggestions** : Desktop does not provide autocomplete-style suggestions. It works through conversational prompts and explicit code changes.
* **Agent teams** : parallel Claude Code sessions that message each other are available in the [CLI](</docs/en/agent-teams>), not in Desktop. For multi-agent work inside one session, use [dynamic workflows](</docs/en/workflows>), which run in Desktop.
* **Terminal-dialog commands** : built-in commands that open an interactive panel in the terminal, such as `/permissions`, `/config`, `/agents`, and `/doctor`, are not available in the Code tab and reply with `isn't available in this environment`. Edit [settings files](</docs/en/settings>) directly to manage permission rules and configuration, or run the command from the standalone CLI.
@@ -840,7 +844,7 @@
If the app opens but shows a blank or unresponsive screen:
1. Restart the app.
- 2. Check for pending updates. The app auto-updates on launch.
+ 2. Check for pending updates. On macOS and Windows the app auto-updates on launch; on Linux, update through apt as described in [Claude Desktop on Linux](</docs/en/desktop-linux>).
3. On Windows, check Event Viewer for crash logs under **Windows Logs → Application**.
###
Show diff (106 lines)
--- a/desktop-linux.md
+++ b/desktop-linux.md
@@ -0,0 +1,103 @@
+Linux support for the Claude desktop app is in beta. The Chat, Cowork, and Code tabs are all available.
+
+The desktop app on Linux gives you the same Chat, Cowork, and Claude Code experience as macOS and Windows: parallel sessions, visual diff review, an integrated terminal and editor, and live app preview. See [Use Claude Code Desktop](</docs/en/desktop>) for the full feature reference.
+
+##
+
+
+
+Requirements
+
+ * Ubuntu 22.04 or later, or Debian 12 or later
+ * x86_64 or arm64
+
+Other Debian-based distributions that meet these requirements may work but aren’t officially tested.
+
+##
+
+
+
+Install
+
+Install from Anthropic’s apt repository so that updates arrive through your system’s regular package updates.
+
+1
+
+Add Anthropic's apt repository
+
+Download Anthropic’s signing key:
+
+ sudo curl -fsSLo /usr/share/keyrings/claude-desktop-archive-keyring.asc https://downloads.claude.ai/claude-desktop/key.asc
+
+Register the repository:
+
+ echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/claude-desktop-archive-keyring.asc] https://downloads.claude.ai/claude-desktop/apt/stable stable main" | sudo tee /etc/apt/sources.list.d/claude-desktop.list
+
+2
+
+Install the package
+
+ sudo apt update && sudo apt install claude-desktop
+
+3
+
+Launch and sign in
+
+Launch **Claude** from your application launcher, or run `claude-desktop` from a terminal, and sign in with your Anthropic account.
+
+Verify the signing key
+
+You can confirm the downloaded signing key belongs to Anthropic:
+
+ gpg --show-keys /usr/share/keyrings/claude-desktop-archive-keyring.asc
+
+The fingerprint should be `31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE`.
+
+###
+
+
+
+Install from a downloaded file
+
+If you can’t use the apt repository, download the `.deb` package for your architecture (x64 or arm64) from [claude.com/download](<https://claude.com/download>), then either open it with your software installer or run from your download directory:
+
+ sudo apt install ./claude-desktop_*.deb
+
+A `.deb` installed this way doesn’t receive updates. To get updates through apt, add the repository as shown above, or uncomment the `deb` line in the placeholder entry the package writes to `/etc/apt/sources.list.d/claude-desktop.list`.
+
+##
+
+
+
+Update
+
+The desktop app doesn’t update itself on Linux. Updates arrive with your system’s regular package updates:
+
+ sudo apt update && sudo apt upgrade
+
+Your distribution’s graphical software updater will also pick up new versions.
+
+##
+
+
+
+Uninstall
+
+ sudo apt remove claude-desktop
+
+This removes the signing key along with the app, so if you added the repository entry during install, remove it too:
+
+ sudo rm /etc/apt/sources.list.d/claude-desktop.list
+
+##
+
+
+
+What’s not in the Linux beta yet
+
+ * **Computer Use** : [app and screen control](</docs/en/desktop#let-claude-use-your-computer>) isn’t available on Linux.
+ * **Dictation** : voice input isn’t available in the Linux desktop app. Use [voice dictation](</docs/en/voice-dictation>) in the CLI instead.
+ * **Quick Entry global hotkey** : works on X11. On native Wayland it requires your desktop environment’s GlobalShortcuts portal.
+ * **Fedora and RHEL** : only Debian-based distributions are supported today. Support for additional distributions is coming in the future.
+
+For anything not yet available in the desktop app, the [CLI](</docs/en/quickstart>) runs the same Claude Code engine and supports a wider range of Linux distributions; see the [system requirements](</docs/en/setup#system-requirements>).
--- a/desktop-quickstart.md
+++ b/desktop-quickstart.md
@@ -8,7 +8,11 @@
For x64 processors
-For Windows ARM64, download the [ARM64 installer](<https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code&utm_medium=docs>). The desktop app is not available on Linux; use the [CLI](</docs/en/quickstart>) instead.
+## Get Claude for Linux (beta)
+
+apt or .deb for Ubuntu and Debian
+
+For Windows ARM64, download the [ARM64 installer](<https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code&utm_medium=docs>). On Linux, install with apt; see [Claude Desktop on Linux](</docs/en/desktop-linux>).
Claude Code requires a [Pro, Max, Team, or Enterprise subscription](<https://claude.com/pricing?utm_source=claude_code&utm_medium=docs&utm_content=desktop_quickstart_pricing>).
@@ -30,7 +34,7 @@
Install and sign in
-Download the installer for your platform from the links above and run it. Launch Claude from your Applications folder on macOS or the Start menu on Windows, then sign in with your Anthropic account.
+On macOS and Windows, download the installer from the links above and run it. On Linux, follow the install steps in [Claude Desktop on Linux](</docs/en/desktop-linux>). Launch Claude from your Applications folder on macOS, the Start menu on Windows, or your application launcher on Linux, then sign in with your Anthropic account.
2
--- a/env-vars.md
+++ b/env-vars.md
@@ -136,7 +136,7 @@
`CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS`| Set to `1` to disable all built-in [subagent](</docs/en/sub-agents>) types such as Explore and Plan. Only applies in non-interactive mode (the `-p` flag). Useful for SDK users who want a blank slate
`CLAUDE_AGENT_SDK_MCP_NO_PREFIX`| Set to `1` to skip the `mcp__<server>__` prefix on tool names from SDK-created MCP servers. Tools use their original names. SDK usage only
`CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`| Stall timeout in milliseconds for background subagents. Default `600000` (10 minutes). The timer resets on each streaming progress event; if no progress arrives within the window, the subagent is aborted and the task is marked failed, surfacing any partial result to the parent
-`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`| Set the percentage (1-100) of the auto-compaction window at which auto-compaction triggers. Use lower values like `50` to compact earlier. This variable only causes earlier compaction when Claude Code compacts proactively: when `CLAUDE_CODE_AUTO_COMPACT_WINDOW` is set, in [cloud sessions](</docs/en/claude-code-on-the-web>), and on Sonnet 4.6 and Opus 4.6 without [extended context](</docs/en/model-config#extended-context>), which compact at the 200K boundary by default. In other cases, such as a local session on Opus 4.8 or any model with extended context, auto-compaction triggers when the conversation reaches the model’s context limit. The override can only lower the threshold, so values above the default have no effect. Applies to both main conversations and subagents
+`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`| Set the percentage (1-100) of the auto-compaction window at which auto-compaction triggers. Use lower values like `50` to compact earlier. This variable only causes earlier compaction when Claude Code compacts proactively: when `CLAUDE_CODE_AUTO_COMPACT_WINDOW` is set, in [cloud sessions](</docs/en/claude-code-on-the-web>), and on Sonnet 4.6 and Opus 4.6 without [extended context](</docs/en/model-config#extended-context>), which compact at the 200K boundary by default. On Sonnet 5, proactive compaction applies at the model’s [default threshold](</docs/en/model-config#sonnet-5-context-window>). In other cases, such as a local session on Opus 4.8, auto-compaction triggers when the conversation reaches the model’s context limit. The override can only lower the threshold, so values above the default have no effect. Applies to both main conversations and subagents
`CLAUDE_AUTO_BACKGROUND_TASKS`| Set to `1` to force-enable automatic backgrounding of long-running agent tasks. When enabled, subagents are moved to the background after running for approximately two minutes
`CLAUDE_AX_SCREEN_READER`| Set to `1` to render screen-reader friendly output: flat text without decorative borders or animations. Set to `0` to force screen-reader mode off even when [`axScreenReader`](</docs/en/settings#available-settings>) is `true`. The [`--ax-screen-reader`](</docs/en/cli-reference#cli-flags>) flag takes precedence. Requires Claude Code v2.1.181 or later
`CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR`| Return to the original working directory after each Bash or PowerShell command in the main session
@@ -148,7 +148,7 @@
`CLAUDE_CODE_API_KEY_HELPER_TTL_MS`| Interval in milliseconds at which credentials should be refreshed (when using [`apiKeyHelper`](</docs/en/settings#available-settings>))
`CLAUDE_CODE_ARTIFACT_AUTO_OPEN`| Set to `0` to stop Claude Code from opening the browser automatically when a new [artifact](</docs/en/artifacts>) is published. Republishing an existing artifact does not open the browser regardless of this setting
`CLAUDE_CODE_ATTRIBUTION_HEADER`| Set to `0` to omit the attribution block (client version and prompt fingerprint) from the start of the system prompt. Disabling it improves prompt-cache hit rates when routing through an [LLM gateway](</docs/en/llm-gateway>). Anthropic API caching is unaffected
-`CLAUDE_CODE_AUTO_COMPACT_WINDOW`| Set the context capacity in tokens used for auto-compaction calculations. Defaults to the model’s context window: 200K for standard models or 1M for [extended context](</docs/en/model-config#extended-context>) models. Use a lower value like `500000` on a 1M model to treat the window as 500K for compaction purposes. The value is capped at the model’s actual context window. `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` is applied as a percentage of this value. Setting this variable decouples the compaction threshold from the status line’s `used_percentage`, which always uses the model’s full context window
+`CLAUDE_CODE_AUTO_COMPACT_WINDOW`| Set the context capacity in tokens used for auto-compaction calculations. Defaults to the model’s context window, 200K for standard models or 1M for [extended context](</docs/en/model-config#extended-context>) models, except on Sonnet 5, which has its own [default threshold](</docs/en/model-config#sonnet-5-context-window>). Use a lower value like `500000` on a 1M model to treat the window as 500K for compaction purposes. The value is capped at the model’s actual context window. `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` is applied as a percentage of this value. Setting this variable decouples the compaction threshold from the status line’s `used_percentage`, which always uses the model’s full context window
`CLAUDE_CODE_AUTO_CONNECT_IDE`| Override automatic [IDE connection](</docs/en/vs-code>). By default, Claude Code connects automatically when launched inside a supported IDE’s integrated terminal. Set to `false` to prevent this. Set to `true` to force a connection attempt when auto-detection fails, such as when tmux obscures the parent terminal. Takes precedence over the [`autoConnectIde`](</docs/en/settings#global-config-settings>) global config setting
`CLAUDE_CODE_CERT_STORE`| Comma-separated list of CA certificate sources for TLS connections. `bundled` is the Mozilla CA set shipped with Claude Code. `system` is the operating system trust store, read only on runtimes with `tls.getCACertificates`: the native binary, or Node 22.15 or later for npm installs. See [CA certificate store](</docs/en/network-config#ca-certificate-store>). Default is `bundled,system`
`CLAUDE_CODE_CHILD_SESSION`| Set to `1` in subprocesses Claude Code spawns via the Bash, PowerShell, and Monitor tools, [hook](</docs/en/hooks>) commands, and [status line](</docs/en/statusline>) commands. Not set for stdio [MCP server](</docs/en/mcp>) subprocesses, which are long-lived and outlive the session that spawned them. Unlike `CLAUDECODE`, this is only set by Claude Code itself when it launches a subprocess and not by IDE extensions, so it reliably distinguishes a nested session from a top-level `claude` launched in an IDE-integrated terminal. A nested interactive `claude` TUI started this way is automatically excluded from `--resume`, `--continue`, up-arrow history, and the `claude agents` list. Non-interactive `claude -p` sessions still persist. Set `CLAUDE_CODE_FORCE_SESSION_PERSISTENCE=1` to override this exclusion. Requires Claude Code v2.1.172 or later
@@ -158,8 +158,8 @@
`CLAUDE_CODE_CONNECT_TIMEOUT_MS`| Removed in v2.1.186 and now a no-op. Previously set a separate timeout for the connect, TLS, and response-header phase of a streaming API request. Use `API_TIMEOUT_MS` for the per-request timeout
`CLAUDE_CODE_DEBUG_LOGS_DIR`| Override the debug log file path. Despite the name, this is a file path, not a directory. Requires debug mode to be enabled separately via `--debug`, `/debug`, or the `DEBUG` environment variable: setting this variable alone does not enable logging. The [`--debug-file`](</docs/en/cli-reference#cli-flags>) flag does both at once. Defaults to `~/.claude/debug/<session-id>.txt`
`CLAUDE_CODE_DEBUG_LOG_LEVEL`| Minimum log level written to the debug log file. Values: `verbose`, `debug` (default), `info`, `warn`, `error`. Set to `verbose` to include high-volume diagnostics like full status line command output, or raise to `error` to reduce noise
-`CLAUDE_CODE_DISABLE_1M_CONTEXT`| Set to `1` to disable [1M context window](</docs/en/model-config#extended-context>) support. When set, 1M model variants are unavailable in the model picker. Useful for enterprise environments with compliance requirements
-`CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING`| Set to `1` to disable [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) on Opus 4.6 and Sonnet 4.6 and fall back to the fixed thinking budget controlled by `MAX_THINKING_TOKENS`. From v2.1.111, has no effect on Fable 5, or on Opus 4.7 and later, which always use adaptive reasoning
+`CLAUDE_CODE_DISABLE_1M_CONTEXT`| Set to `1` to disable [1M context window](</docs/en/model-config#extended-context>) support. When set, 1M model variants are unavailable in the model picker, and [Sonnet 5](</docs/en/model-config#sonnet-5-context-window>) sessions are treated as having a 200K window. Useful for enterprise environments with compliance requirements
+`CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING`| Set to `1` to disable [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) on Opus 4.6 and Sonnet 4.6 and fall back to the fixed thinking budget controlled by `MAX_THINKING_TOKENS`. From v2.1.111, has no effect on Fable 5, Sonnet 5, or Opus 4.7 and later, which always use adaptive reasoning
`CLAUDE_CODE_DISABLE_ADVISOR_TOOL`| Set to `1` to disable the [advisor tool](</docs/en/advisor>). The `/advisor` command and `--advisor` flag become unavailable and any configured `advisorModel` is ignored. Requires Claude Code v2.1.98 or later
`CLAUDE_CODE_DISABLE_AGENT_VIEW`| Set to `1` to turn off [background agents and agent view](</docs/en/agent-view>): `claude agents`, `--bg`, `/background`, and the on-demand supervisor. Equivalent to the [`disableAgentView`](</docs/en/settings#available-settings>) setting
`CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN`| Set to `1` to disable [fullscreen rendering](</docs/en/fullscreen>) and use the classic main-screen renderer. The conversation stays in your terminal’s native scrollback so `Cmd+f` and tmux copy mode work as usual. Takes precedence over `CLAUDE_CODE_NO_FLICKER` and the [`tui`](</docs/en/settings#available-settings>) setting. You can also switch with `/tui default`. Does not apply to background sessions opened from [agent view](</docs/en/agent-view>), which always use fullscreen rendering
@@ -256,7 +256,7 @@
`CLAUDE_CODE_SCROLL_SPEED`| Set the mouse wheel scroll multiplier in [fullscreen rendering](</docs/en/fullscreen#mouse-wheel-scrolling>). Accepts values from 1 to 20, and fractional values below 1 such as `0.5` to slow accelerated trackpad and wheel scrolling in terminals that already amplify wheel events. Set to `3` to match `vim` if your terminal sends one wheel event per notch without amplification. Ignored in the JetBrains IDE terminal, where Claude Code uses its own scroll handling
`CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS`| Override the time budget in milliseconds for [SessionEnd](</docs/en/hooks#sessionend>) hooks. Applies to session exit, `/clear`, and switching sessions via interactive `/resume`. By default the budget is 1.5 seconds, automatically raised to the highest per-hook `timeout` configured in settings files, up to 60 seconds. Timeouts on plugin-provided hooks do not raise the budget
`CLAUDE_CODE_SESSION_ID`| Set automatically to the current session ID in Bash and PowerShell tool subprocesses, [hook command](</docs/en/hooks>) subprocesses, and stdio [MCP server](</docs/en/mcp>) subprocesses. For Bash, PowerShell, and hooks this matches the `session_id` field in the hook JSON input and is updated on `/clear`. An MCP server subprocess retains the ID it was spawned with. On `--resume <session-id>` it receives the resumed ID, matching hooks and Bash. On `--continue` or `--resume` without an explicit ID it may receive the initial startup ID instead. Use to correlate scripts and external tools with the Claude Code session that launched them
-`CLAUDE_CODE_SHELL`| Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`)
+`CLAUDE_CODE_SHELL`| Set the shell Claude Code uses to run Bash tool commands. Accepts a path to a `bash` or `zsh` binary, for example `/opt/homebrew/bin/bash`. Other shells such as `fish` are not supported. If the value is not a working `bash` or `zsh` path, Claude Code ignores it and falls back to auto-detection. Auto-detection uses your `$SHELL` when it points to `bash` or `zsh`, otherwise it picks the first working `zsh` then `bash` found on your `PATH` and standard install locations
`CLAUDE_CODE_SHELL_PREFIX`| Command prefix that wraps shell commands Claude Code spawns: Bash tool calls, [hook](</docs/en/hooks>) commands, [status line](</docs/en/statusline>) commands, and stdio [MCP server](</docs/en/mcp>) startup commands. PowerShell hooks and exec-form hooks run without the prefix. Useful for logging or auditing. Setting a bare executable path such as `/path/to/logger.sh` runs each command as `/path/to/logger.sh '<command>'`. The wrapper receives the command line as a single shell-quoted argument in `$1`, so the wrapper must re-evaluate `$1` with a shell, for example `exec bash -c "$1"`. Treating `$1` as a bare executable path breaks stdio MCP servers that pass arguments such as `npx -y <package>`. For Bash tool calls, `$1` contains the full shell invocation Claude Code assembles, including environment setup, not only the command Claude ran
`CLAUDE_CODE_SIMPLE`| Set to `1` to run with a minimal system prompt and only the Bash, file read, and file edit tools. MCP tools from `--mcp-config` are still available. Disables auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md. OAuth tokens and keychain credentials are not read, so Anthropic authentication must come from `ANTHROPIC_API_KEY` or an `apiKeyHelper` in `--settings`. Equivalent to passing [`--bare`](</docs/en/headless#start-faster-with-bare-mode>)
`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`| Set to `1` to use a shorter system prompt and abbreviated tool descriptions on any model. Set to `0`, `false`, `no`, or `off` to opt out even on models where the experiment or server configuration would otherwise enable it. The full tool set, hooks, MCP servers, and CLAUDE.md discovery remain enabled
--- a/errors.md
+++ b/errors.md
@@ -699,15 +699,15 @@
thinking.type.enabled is not supported for this model
-Your Claude Code version is older than the minimum for Opus 4.7 or Opus 4.8. The CLI sent a thinking configuration the model no longer accepts.
+Your Claude Code version is older than the minimum for Sonnet 5, Opus 4.8, or Opus 4.7. The CLI sent a thinking configuration the model no longer accepts.
API Error: 400 ... "thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior.
**What to do:**
- * Run `claude update` and restart Claude Code. Opus 4.7 needs v2.1.111 or later. Opus 4.8 needs v2.1.154 or later
- * If you cannot upgrade, run `/model` and select Opus 4.6 or Sonnet instead
- * If you hit this in the [Agent SDK](</docs/en/agent-sdk/overview>), upgrade the SDK package instead. Opus 4.8 needs TypeScript SDK v0.3.154 or later and Python SDK v0.2.88 or later
+ * Run `claude update` and restart Claude Code. Opus 4.7 needs v2.1.111 or later. Opus 4.8 needs v2.1.154 or later. Sonnet 5 needs v2.1.197 or later
+ * If you can’t upgrade, run `/model` and select Opus 4.6 or Sonnet 4.6 instead
+ * If you hit this in the [Agent SDK](</docs/en/agent-sdk/overview>), upgrade the SDK package instead. Opus 4.8 needs TypeScript SDK v0.3.154 or later and Python SDK v0.2.88 or later. Sonnet 5 needs TypeScript SDK v0.3.197 or later
###
--- a/github-actions.md
+++ b/github-actions.md
@@ -122,7 +122,7 @@
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
custom_instructions: "Follow our coding standards"
max_turns: "10"
- model: "claude-sonnet-4-6"
+ model: "claude-sonnet-5"
**GA version (v1.0):**
@@ -133,7 +133,7 @@
claude_args: |
--append-system-prompt "Follow our coding standards"
--max-turns 10
- --model claude-sonnet-4-6
+ --model claude-sonnet-5
The action now automatically detects whether to run in interactive mode (responds to `@claude` mentions) or automation mode (runs immediately with a prompt) based on your configuration.
@@ -714,12 +714,12 @@
The `claude_args` parameter accepts any Claude Code CLI arguments:
- claude_args: "--max-turns 5 --model claude-sonnet-4-6 --mcp-config /path/to/config.json"
+ claude_args: "--max-turns 5 --model claude-sonnet-5 --mcp-config /path/to/config.json"
Common arguments:
* `--max-turns`: Maximum conversation turns (default: 10)
- * `--model`: Model to use (for example, `claude-sonnet-4-6`)
+ * `--model`: Model to use (for example, `claude-sonnet-5`)
* `--mcp-config`: Path to MCP configuration
* `--allowedTools`: Comma-separated list of allowed tools. The `--allowed-tools` alias also works.
* `--debug`: Enable debug output
--- a/glossary.md
+++ b/glossary.md
@@ -172,7 +172,7 @@
Effort level
-A setting that controls how much of the adaptive-reasoning thinking budget Claude uses on each turn. Higher effort means more thinking tokens and deeper reasoning; lower effort is faster and cheaper. Effort is supported on Fable 5, on Opus 4.6 and later, and on Sonnet 4.6. Learn more: [Adjust effort level](</docs/en/model-config#adjust-effort-level>)
+A setting that controls how much of the adaptive-reasoning thinking budget Claude uses on each turn. Higher effort means more thinking tokens and deeper reasoning; lower effort is faster and cheaper. Effort is supported on Fable 5, on Opus 4.6 and later, and on Sonnet 4.6 and later. Learn more: [Adjust effort level](</docs/en/model-config#adjust-effort-level>)
###
--- a/google-vertex-ai.md
+++ b/google-vertex-ai.md
@@ -155,7 +155,7 @@
Set these environment variables to specific Vertex AI model IDs. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Vertex resolves to Opus 4.6. Set it to the Opus 4.8 ID to use the latest model:
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'
- export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'
+ export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-5'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5@20251001'
For current and legacy model IDs, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for the full list of environment variables. Claude Code uses these default models when no pinning variables are set:
@@ -198,7 +198,7 @@
1M token context window
-Claude Opus 4.6 and later, and Sonnet 4.6, support the [1M token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) on Vertex AI. Claude Code automatically enables the extended context window when you select a 1M model variant. The setup wizard offers a 1M context option when it pins models. To enable it for a manually pinned model instead, append `[1m]` to the model ID. See [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) for details.
+Claude Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support the [1M token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) on Vertex AI. Sonnet 5 always runs with the 1M window, with no `[1m]` variant to select. For the other models, Claude Code automatically enables the extended context window when you select a 1M model variant. The setup wizard offers a 1M context option when it pins models. To enable it for a manually pinned model instead, append `[1m]` to the model ID. See [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) for details.
##
--- a/hooks.md
+++ b/hooks.md
@@ -867,7 +867,7 @@
"cwd": "/Users/...",
"hook_event_name": "SessionStart",
"source": "startup",
- "model": "claude-sonnet-4-6"
+ "model": "claude-sonnet-5"
}
####
@@ -1275,7 +1275,11 @@
PreToolUse
-Runs after Claude creates tool parameters and before processing the tool call. Matches on tool name: `Bash`, `Edit`, `Write`, `Read`, `Glob`, `Grep`, `Agent`, `WebFetch`, `WebSearch`, `AskUserQuestion`, `ExitPlanMode`, and any MCP tool names. Use PreToolUse decision control to allow, deny, ask, or defer the tool call.
+Runs after Claude creates tool parameters and before processing the tool call. Matches on tool name: `Bash`, `Edit`, `Write`, `Read`, `Glob`, `Grep`, `Agent`, `WebFetch`, `WebSearch`, `AskUserQuestion`, `ExitPlanMode`, and any MCP tool names.
+
+PreToolUse runs only when Claude calls a tool. Files you [reference with `@` in your prompt](</docs/en/common-workflows#reference-files-and-directories>) are added without any tool call: Claude Code inserts their contents while building the prompt, so no PreToolUse hook fires for them, including hooks matching `Read`. To block specific paths from `@` references, use a [`Read` deny rule](</docs/en/permissions#read-and-edit>) instead.
+
+Use PreToolUse decision control to allow, deny, ask, or defer the tool call.
####
@@ -3093,6 +3097,14 @@
}
}
+To reference the project root from a PowerShell shell-form command, read it as an environment variable with `$env:CLAUDE_PROJECT_DIR`. PowerShell treats the bare `${CLAUDE_PROJECT_DIR}` form as a local variable, not an environment lookup, and Claude Code substitutes that placeholder in shell form only for plugin hooks. For a hook defined in `settings.json`, either use the `$env:` form or switch to exec form, where `${CLAUDE_PROJECT_DIR}` is substituted in each `args` element regardless of where the hook is defined. The example below shows a `settings.json` hook that runs a project script with the `$env:` form:
+
+ {
+ "type": "command",
+ "shell": "powershell",
+ "command": "& \"$env:CLAUDE_PROJECT_DIR\\.claude\\hooks\\check.ps1\""
+ }
+
##
--- a/microsoft-foundry.md
+++ b/microsoft-foundry.md
@@ -81,7 +81,7 @@
Set the model variables to match the deployment names you created in step 1. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Foundry resolves to Opus 4.6. Set it to the Opus 4.8 ID to use the latest model:
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'
- export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'
+ export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-5'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5'
Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On Foundry, Claude Code defaults this to the primary model because not every account has a Haiku deployment. To use Haiku for background tasks, set `ANTHROPIC_DEFAULT_HAIKU_MODEL` to a Haiku deployment that is available in your account, as shown above. For current and legacy model IDs, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for the full list of environment variables. [Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To request a 1-hour cache TTL instead of the 5-minute default, set the following variable; cache writes with a 1-hour TTL are billed at a higher rate:
Show diff (109 lines)
--- a/model-config.md
+++ b/model-config.md
@@ -31,13 +31,13 @@
**`sonnet`**| Uses the latest Sonnet model for daily coding tasks
**`opus`**| Uses the latest Opus model for complex reasoning tasks
**`haiku`**| Uses the fast and efficient Haiku model for simple tasks
-**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions
+**`sonnet[1m]`**| Uses Sonnet with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions. No effect when `sonnet` already resolves to Sonnet 5 with its native 1M window; behind an [LLM gateway](</docs/en/llm-gateway>), selects the 1M window for Sonnet 5
**`opus[1m]`**| Uses Opus with a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions
**`opusplan`**| Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution
-On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 4.6. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`.
-
-Opus 4.8 requires Claude Code v2.1.154 or later. Run `claude update` to upgrade.
+On the Anthropic API, `opus` resolves to Opus 4.8 and `sonnet` resolves to Sonnet 5. On [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), `opus` resolves to Opus 4.7 and `sonnet` resolves to Sonnet 4.6. On Bedrock, Vertex, and Foundry, `opus` resolves to Opus 4.6 and `sonnet` resolves to Sonnet 4.5; newer models are available on those providers by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-4-8`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`.
+
+Sonnet 5 requires Claude Code v2.1.197 or later. Opus 4.8 requires v2.1.154 or later. Run `claude update` to upgrade.
###
@@ -220,7 +220,7 @@
* **Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API** : defaults to Opus 4.8
* **Claude Platform on AWS** : defaults to Opus 4.7
- * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 4.6
+ * **Pro, Team Standard, and Enterprise subscription seats** : defaults to Sonnet 5
* **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5
Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. When managed settings enforce the allowlist for the Default model and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. Fable 5 is not the default model on any account type. Sessions use Fable 5 only after you choose it, with `/model fable`, a `model` setting, or the `best` alias where Fable 5 is available. Choosing it with `/model` saves it as the selected model in your user settings, so later sessions start on Fable 5 until you change models.
@@ -251,7 +251,7 @@
To persist a chain across sessions, set `fallbackModel` in [settings](</docs/en/settings>) as an array:
{
- "fallbackModel": ["claude-sonnet-4-6", "claude-haiku-4-5"]
+ "fallbackModel": ["claude-sonnet-5", "claude-haiku-4-5"]
}
The `--fallback-model` flag takes precedence over the `fallbackModel` setting. Each element accepts a model name or alias, and `"default"` expands to the default model. Two cases cause an element to be skipped:
@@ -320,10 +320,10 @@
Model| Levels
---|---
Fable 5| `low`, `medium`, `high`, `xhigh`, `max`
-Opus 4.8 and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max`
+Sonnet 5, Opus 4.8, and Opus 4.7| `low`, `medium`, `high`, `xhigh`, `max`
Opus 4.6 and Sonnet 4.6| `low`, `medium`, `high`, `max`
-If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Fable 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`.
+If you set a level the active model does not support, Claude Code falls back to the highest supported level at or below the one you set. For example, `xhigh` runs as `high` on Opus 4.6. The default effort is `high` on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6, and `xhigh` on Opus 4.7. When you first run Fable 5, Opus 4.8, or Opus 4.7, Claude Code applies that model’s default effort even if you previously set a different level for another model: `high` on Fable 5 and Opus 4.8, and `xhigh` on Opus 4.7. Run `/effort` again to choose a different level after switching. `low`, `medium`, `high`, and `xhigh` persist across sessions. `max` provides the deepest reasoning with no constraint on token spending and applies to the current session only, except when set through the `CLAUDE_CODE_EFFORT_LEVEL` environment variable. The `/effort` menu also offers `ultracode`. Ultracode is a Claude Code setting rather than a model effort level: it sends `xhigh` to the model and additionally has Claude orchestrate [dynamic workflows](</docs/en/workflows>) for substantive tasks. It applies to the current session only. Set it through `/effort`, or pass `"ultracode": true` via `--settings` or an Agent SDK control request. It is not part of the `effortLevel` setting, the `--effort` flag, or `CLAUDE_CODE_EFFORT_LEVEL`.
####
@@ -337,7 +337,7 @@
---|---
`low`| Reserve for short, scoped, latency-sensitive tasks that are not intelligence-sensitive
`medium`| Reduces token usage for cost-sensitive work that can trade off some intelligence
-`high`| Balances token usage and intelligence. Default on Fable 5, Opus 4.8, Opus 4.6, and Sonnet 4.6
+`high`| Balances token usage and intelligence. Default on Fable 5, Sonnet 5, Opus 4.8, Opus 4.6, and Sonnet 4.6
`xhigh`| Deeper reasoning at higher token spend. Default on Opus 4.7
`max`| Can improve performance on demanding tasks but may show diminishing returns and is prone to overthinking. Test before adopting broadly
`ultracode`| A Claude Code setting that plans a [dynamic workflow](</docs/en/workflows>) for each substantive task with `xhigh` per-message reasoning. Session-only
@@ -375,7 +375,7 @@
Adaptive reasoning and fixed thinking budgets
-Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Opus 4.7 and later always use adaptive reasoning, as does Fable 5. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>).
+Adaptive reasoning makes thinking optional on each step, so Claude can respond faster to routine prompts and reserve deeper thinking for steps that benefit from it. If you want Claude to think more or less often than the current level produces, you can say so directly in your prompt or in `CLAUDE.md`; the model responds to that guidance within its effort setting. Fable 5, Sonnet 5, and Opus 4.7 and later always use adaptive reasoning. The fixed thinking budget mode and `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` do not apply to them. On Opus 4.6 and Sonnet 4.6, you can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` to revert to the previous fixed thinking budget controlled by `MAX_THINKING_TOKENS`. See [environment variables](</docs/en/env-vars>).
###
@@ -399,9 +399,9 @@
Extended context
-Fable 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. On the Anthropic API, Fable 5, Opus 4.8, and Opus 4.7 always run with the 1M window. Sonnet with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max.
-
-Plan| Opus with 1M context| Sonnet with 1M context
+Fable 5, Sonnet 5, Opus 4.6 and later, and Sonnet 4.6 support a [1 million token context window](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) for long sessions with large codebases. Availability varies by model and plan. On the Anthropic API, Fable 5, Sonnet 5, Opus 4.8, and Opus 4.7 always run with the 1M window. On Max, Team, and Enterprise plans, Opus is automatically upgraded to 1M context with no additional configuration. This applies to both Team Standard and Team Premium seats. Sonnet 4.6 with 1M context is not part of the automatic upgrade and requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) on every subscription plan, including Max.
+
+Plan| Opus with 1M context| Sonnet 4.6 with 1M context
---|---|---
Max, Team, and Enterprise| Included with subscription| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)
Pro| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)| Requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)
@@ -415,6 +415,17 @@
# Or append [1m] to a full model name
/model claude-opus-4-8[1m]
+
+####
+
+
+
+Sonnet 5 context window
+
+On the Anthropic API, Sonnet 5 always runs with the 1M context window. There is no 200K variant, no `[1m]` suffix to select, and no usage credits required on any plan. Sessions auto-compact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/env-vars>) to choose a different threshold. Two configurations budget the window at 200K instead and auto-compact at that boundary:
+
+ * **LLM gateway** : when `ANTHROPIC_BASE_URL` points at a [gateway](</docs/en/llm-gateway>), Claude Code can’t verify 1M support. To use the full window, select Sonnet 5 (1M context) in the model picker, which maps to `sonnet[1m]`.
+ * **`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`** : treats Sonnet 5 sessions as having a 200K window, for deployments that need to cap context.
##
@@ -485,7 +496,7 @@
* Claude Code strips the suffix before sending the model ID to your provider.
* Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>).
- * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix.
+ * The suffix is read per variable, not per model. On Bedrock, Vertex, and Foundry, a model ID without `[1m]` in one variable uses 200K context even if another variable sets the same model with the suffix. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix.
An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/settings#settings-files>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>). Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, list the same provider-form ID the picker shows, or map it through `modelOverrides`. Any `[1m]` suffix is stripped from both the allowlist entry and the requested model before matching.
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -468,7 +468,7 @@
* All standard attributes
* `type`: (`"added"`, `"removed"`)
- * `model`: Model identifier for the model that made the change (for example, “claude-sonnet-4-6”). Requires Claude Code v2.1.172 or later
+ * `model`: Model identifier for the model that made the change (for example, “claude-sonnet-5”)
####
@@ -499,7 +499,7 @@
Incremented after each API request. **Attributes** :
* All standard attributes
- * `model`: Model identifier (for example, “claude-sonnet-4-6”)
+ * `model`: Model identifier (for example, “claude-sonnet-5”)
* `query_source`: Category of the subsystem that issued the request. One of `"main"`, `"subagent"`, or `"auxiliary"`
* `speed`: `"fast"` when the request used fast mode. Absent otherwise
* `effort`: [Effort level](</docs/en/model-config#adjust-effort-level>) applied to the request: `"low"`, `"medium"`, `"high"`, `"xhigh"`, or `"max"`. Absent when the model doesn’t support effort.
@@ -520,7 +520,7 @@
* All standard attributes
* `type`: (`"input"`, `"output"`, `"cacheRead"`, `"cacheCreation"`)
- * `model`: Model identifier (for example, “claude-sonnet-4-6”)
+ * `model`: Model identifier (for example, “claude-sonnet-5”)
* `query_source`: Category of the subsystem that issued the request. One of `"main"`, `"subagent"`, or `"auxiliary"`
* `speed`: `"fast"` when the request used fast mode. Absent otherwise
* `effort`: [Effort level](</docs/en/model-config#adjust-effort-level>) applied to the request. See Cost counter for details.
@@ -653,7 +653,7 @@
* `event.name`: `"api_request"`
* `event.timestamp`: ISO 8601 timestamp
* `event.sequence`: monotonically increasing counter for ordering events within a session
- * `model`: Model used (for example, “claude-sonnet-4-6”)
+ * `model`: Model used (for example, “claude-sonnet-5”)
* `cost_usd`: Estimated cost in USD
* `duration_ms`: Request duration in milliseconds
* `input_tokens`: Number of input tokens
@@ -678,7 +678,7 @@
* `event.name`: `"api_error"`
* `event.timestamp`: ISO 8601 timestamp
* `event.sequence`: monotonically increasing counter for ordering events within a session
- * `model`: Model used (for example, “claude-sonnet-4-6”)
+ * `model`: Model used (for example, “claude-sonnet-5”)
* `error`: Error message
* `status_code`: HTTP status code as a number. Absent for non-HTTP errors such as connection failures.
* `duration_ms`: Request duration in milliseconds
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -150,7 +150,7 @@
* **Plan** : All plans.
* **Owner** : on Team and Enterprise, an Owner must enable it in [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>) before users can turn it on. Administrators can also lock it off by setting `permissions.disableAutoMode` to `"disable"` in [managed settings](</docs/en/permissions#managed-settings>).
- * **Model** : on the Anthropic API, Claude Opus 4.6 or later, or Sonnet 4.6. On Amazon Bedrock, Google Cloud Vertex AI, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, only Claude Opus 4.7 and Opus 4.8. Older models, including Sonnet 4.5, Opus 4.5, Haiku, and claude-3 models, are not supported on any provider.
+ * **Model** : on the Anthropic API, Claude Opus 4.6 or later, or Sonnet 4.6 or later. On Amazon Bedrock, Google Cloud Vertex AI, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, only Claude Sonnet 5, Opus 4.7, and Opus 4.8. Older models, including Sonnet 4.5, Opus 4.5, Haiku, and claude-3 models, are not supported on any provider.
* **Provider** : available by default on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, Microsoft Foundry, and signed-in Claude apps gateway sessions, auto mode is off until you set `CLAUDE_CODE_ENABLE_AUTO_MODE`.
If Claude Code reports auto mode as unavailable, one of these requirements is unmet; this is not a transient outage. A separate message that names a model and says auto mode “cannot determine the safety” of an action is a transient classifier outage; see the [error reference](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>). If you set `defaultMode: "auto"` in [settings](</docs/en/settings#available-settings>) and the session starts in `default` mode with no error, the setting is likely in `.claude/settings.json` or `.claude/settings.local.json`. Claude Code v2.1.142 and later ignore `auto` from those files so a repository cannot grant itself auto mode. Move it to `~/.claude/settings.json`.
@@ -161,7 +161,7 @@
Enable auto mode on Bedrock, Vertex AI, or Foundry
-On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud Vertex AI](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, auto mode does not appear in the `Shift+Tab` cycle until `CLAUDE_CODE_ENABLE_AUTO_MODE` is set to `1`. The variable works in Claude Code v2.1.158 and later. Only Claude Opus 4.7 and Opus 4.8 are supported on these providers. To enable it for one developer, add the variable to the `env` block in `~/.claude/settings.json`:
+On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud Vertex AI](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, auto mode does not appear in the `Shift+Tab` cycle until `CLAUDE_CODE_ENABLE_AUTO_MODE` is set to `1`. The variable works in Claude Code v2.1.158 and later. Only Claude Sonnet 5, Opus 4.7, and Opus 4.8 are supported on these providers. To enable it for one developer, add the variable to the `env` block in `~/.claude/settings.json`:
{
"env": {
--- a/python.md
+++ b/python.md
@@ -766,9 +766,8 @@
return PermissionResultAllow(updated_input=input_data)
async def main():
- options = ClaudeAgentOptions(
- can_use_tool=custom_permission_handler, allowed_tools=["Read", "Write", "Edit"]
- )
+ # Don't also list the gated tools in allowed_tools: allow rules approve calls before can_use_tool runs
+ options = ClaudeAgentOptions(can_use_tool=custom_permission_handler)
async with ClaudeSDKClient(options=options) as client:
await client.query("Update the system config file")
@@ -936,7 +935,7 @@
`max_buffer_size`| `int | None`| `None`| Maximum bytes when buffering CLI stdout
`debug_stderr`| `Any`| `sys.stderr`| _Deprecated_ \- File-like object for debug output. Use `stderr` callback instead
`stderr`| `Callable[[str], None] | None`| `None`| Callback function for stderr output from CLI
-`can_use_tool`| `CanUseTool` ` | None`| `None`| Tool permission callback function. See Permission types for details
+`can_use_tool`| `CanUseTool` ` | None`| `None`| Tool permission callback, invoked only when the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) falls through to a prompt. Not invoked for calls auto-approved by `allowed_tools`, allow rules, or `permission_mode`. See `CanUseTool` for details
`hooks`| `dict[HookEvent, list[HookMatcher]] | None`| `None`| Hook configurations for intercepting events
`user`| `str | None`| `None`| User identifier
`include_partial_messages`| `bool`| `False`| Include partial message streaming events. When enabled, `StreamEvent` messages are yielded
@@ -1231,7 +1230,7 @@
* `input_data`: The tool’s input parameters
* `context`: A `ToolPermissionContext` with additional information
-Returns a `PermissionResult` (either `PermissionResultAllow` or `PermissionResultDeny`).
+Returns a `PermissionResult` (either `PermissionResultAllow` or `PermissionResultDeny`). The callback is the SDK replacement for the interactive permission prompt: it’s invoked only when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Tool calls already approved by an `allowed_tools` entry, a settings allow rule, or the permission mode, such as `acceptEdits` or `bypassPermissions`, never invoke it. To gate every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead.
###
@@ -1425,7 +1424,7 @@
Use with the `betas` field in `ClaudeAgentOptions` to enable beta features.
-The `context-1m-2025-08-07` beta is retired as of April 30, 2026. Passing this header with Claude Sonnet 4.5 or Sonnet 4 has no effect, and requests that exceed the standard 200k-token context window return an error. To use a 1M-token context window, migrate to [Claude Sonnet 4.6, Claude Opus 4.6, Claude Opus 4.7, or Claude Opus 4.8](<https://platform.claude.com/docs/en/about-claude/models/overview>), which include 1M context at standard pricing with no beta header required.
+The `context-1m-2025-08-07` beta is retired as of April 30, 2026. Passing this header with Claude Sonnet 4.5 or Sonnet 4 has no effect, and requests that exceed the standard 200k-token context window return an error. To use a 1M-token context window, migrate to [Claude Sonnet 5, Claude Sonnet 4.6, Claude Opus 4.6, Claude Opus 4.7, or Claude Opus 4.8](<https://platform.claude.com/docs/en/about-claude/models/overview>), which include 1M context at standard pricing with no beta header required.
###
--- a/server-managed-settings.md
+++ b/server-managed-settings.md
@@ -246,17 +246,20 @@
Security considerations
-Server-managed settings provide centralized policy enforcement, but they operate as a client-side control. On unmanaged devices, users with admin or sudo access can modify the Claude Code binary, filesystem, or network configuration.
+Server-managed settings provide centralized policy enforcement, but they operate as a client-side control, not a security boundary. On unmanaged devices, a user doesn’t need admin or sudo access to bypass them.
Scenario| Behavior
---|---
User edits the cached settings file| Tampered file applies at startup, but correct settings restore on the next server fetch
User deletes the cached settings file| First-launch behavior occurs: settings fetch asynchronously with a brief unenforced window
+User runs a modified Claude Code binary| A user who can run a modified client can bypass any client-side control
+User runs an older Claude Code version| Versions that predate server-managed settings don’t fetch or apply them
API is unavailable| Cached settings apply if available, otherwise managed settings are not enforced until the next successful fetch. With `forceRemoteSettingsRefresh: true`, the CLI exits instead of continuing, except for `claude auth` subcommands
User authenticates with a different organization| Settings are not delivered for accounts outside the managed organization
User configures a third-party model provider| Server-managed settings are bypassed. This includes setting `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_MANTLE`, `CLAUDE_CODE_USE_VERTEX`, `CLAUDE_CODE_USE_FOUNDRY`, `CLAUDE_CODE_USE_ANTHROPIC_AWS`, or a non-default `ANTHROPIC_BASE_URL`
-
-To detect runtime configuration changes, use [`ConfigChange` hooks](</docs/en/hooks#configchange>) to log modifications or block unauthorized changes before they take effect. For stronger enforcement guarantees, use [endpoint-managed settings](</docs/en/settings#settings-files>) on devices enrolled in an MDM solution.
+Network traffic is intercepted or redirected| Disabled TLS validation or intercepted traffic can alter the settings the client receives
+
+To detect runtime configuration changes, use [`ConfigChange` hooks](</docs/en/hooks#configchange>) to log modifications or block unauthorized changes before they take effect. To restrict which organizations your users can access with credentials the client supplies, see [Enforce network-level access control with Tenant Restrictions](<https://support.claude.com/en/articles/13198485-enforce-network-level-access-control-with-tenant-restrictions>) in the Claude Help Center. For stronger enforcement guarantees, use [endpoint-managed settings](</docs/en/settings#settings-files>) on devices enrolled in an MDM solution.
##
--- a/settings.md
+++ b/settings.md
@@ -248,9 +248,9 @@
`enableAllProjectMcpServers`| Automatically approve all MCP servers defined in project `.mcp.json` files. As of v2.1.196, `claude mcp list` and `claude mcp get` honor this key in an untrusted folder only from [settings files that aren’t checked into the repository](</docs/en/mcp#managing-your-servers>)| `true`
`enableArtifact`| Enable or disable the [Artifact](</docs/en/artifacts>) tool for this user. When unset, the default follows the feature’s [availability](</docs/en/artifacts#availability>) for your account. The **Artifacts** row in `/config` writes this key. A managed `disableArtifact` and your organization’s [admin setting](</docs/en/artifacts#manage-artifacts-for-your-organization>) take precedence, and the key is ignored in project and local settings (`.claude/settings.json`, `.claude/settings.local.json`), which a repository could otherwise commit. Requires Claude Code v2.1.196 or later| `true`
`enabledMcpjsonServers`| List of specific MCP servers from `.mcp.json` files to approve. As of v2.1.196, `claude mcp list` and `claude mcp get` honor this key in an untrusted folder only from [settings files that aren’t checked into the repository](</docs/en/mcp#managing-your-servers>)| `["memory", "github"]`
-`enforceAvailableModels`| Extend the `availableModels` allowlist to the Default model. When `true` in managed settings and `availableModels` is a non-empty array, the Default option falls back to the first allowlisted entry that is available. Has no effect when `availableModels` is unset or empty. See [Enforce the allowlist for the Default model](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>). Requires Claude Code v2.1.175 or later| `true`
+`enforceAvailableModels`| Extend the `availableModels` allowlist to the Default model. When `true` in managed settings and `availableModels` is a non-empty array, the Default option falls back to the first allowlisted entry that is available, but only when the default model for the user’s account type is not in the allowlist; an allowlisted default is kept as-is. Has no effect when `availableModels` is unset or empty. See [Enforce the allowlist for the Default model](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>). Requires Claude Code v2.1.175 or later| `true`
`env`| Environment variables applied to every session and to subprocesses Claude Code spawns from it. As of v2.1.143, `NO_COLOR` and `FORCE_COLOR` set here are passed to subprocesses but do not change Claude Code’s own interface colors. Set those in your shell before launching `claude` to change interface colors. As of v2.1.195, identity variables that Claude Code’s hosting environments set, for example `CLAUDE_CODE_REMOTE` and `CLAUDE_CODE_ACCOUNT_UUID`, are ignored when set here| `{"FOO": "bar"}`
-`fallbackModel`| Fallback model(s) to try in order when the primary model is overloaded or unavailable. Claude Code switches to the next available model in the chain for the rest of the turn and shows a notice. `"default"` expands to the default model. Chains are capped at three models; extra entries are ignored. Unlike most array settings, this key does not merge across settings files: the highest-precedence file that defines it supplies the entire chain. The [`--fallback-model`](</docs/en/cli-reference#cli-flags>) flag overrides this for one session. See [Fallback model chains](</docs/en/model-config#fallback-model-chains>)| `["claude-sonnet-4-6", "claude-haiku-4-5"]`
+`fallbackModel`| Fallback model(s) to try in order when the primary model is overloaded or unavailable. Claude Code switches to the next available model in the chain for the rest of the turn and shows a notice. `"default"` expands to the default model. Chains are capped at three models; extra entries are ignored. Unlike most array settings, this key does not merge across settings files: the highest-precedence file that defines it supplies the entire chain. The [`--fallback-model`](</docs/en/cli-reference#cli-flags>) flag overrides this for one session. See [Fallback model chains](</docs/en/model-config#fallback-model-chains>)| `["claude-sonnet-5", "claude-haiku-4-5"]`
`fastModePerSessionOptIn`| When `true`, fast mode does not persist across sessions. Each session starts with fast mode off, requiring users to enable it with `/fast`. The user’s fast mode preference is still saved. See [Require per-session opt-in](</docs/en/fast-mode#require-per-session-opt-in>)| `true`
`feedbackSurveyRate`| Probability (0–1) that the [session quality survey](</docs/en/data-usage#session-quality-surveys>) appears when eligible. Set to `0` to suppress entirely, or set [`CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY`](</docs/en/env-vars>) in `env`. Useful when using Bedrock, Vertex, or Foundry where the default sample rate does not apply| `0.05`
`fileCheckpointingEnabled`| **Default** : `true`. Snapshot files before each edit so [`/rewind`](</docs/en/checkpointing>) can restore them. Appears in `/config` as **Rewind code (checkpoints)**. To disable via environment variable, set [`CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING`](</docs/en/env-vars>) in `env`| `false`
@@ -267,7 +267,7 @@
`inputNeededNotifEnabled`| **Default** : `false`. When [Remote Control](</docs/en/remote-control>) is connected, send a push notification to your phone when a permission prompt or question is waiting for your input. Appears in `/config` as **Push when actions required**. See [Mobile push notifications](</docs/en/remote-control#mobile-push-notifications>). Requires Claude Code v2.1.119 or later| `true`
`language`| Configure Claude’s preferred response language (e.g., `"japanese"`, `"spanish"`, `"french"`). Claude will respond in this language by default. Also sets the language for [voice dictation](</docs/en/voice-dictation#change-the-dictation-language>) and auto-generated session titles. As of v2.1.176, when not set, session titles match the language of your conversation| `"japanese"`
`minimumVersion`| Floor that prevents background auto-updates and `claude update` from installing a version below this one. Switching from the `"latest"` channel to `"stable"` via `/config` prompts you to stay on the current version or allow the downgrade. Choosing to stay sets this value. Also useful in [managed settings](</docs/en/permissions#managed-settings>) to pin an organization-wide minimum. For a hard floor that blocks startup entirely, see `requiredMinimumVersion`| `"2.1.100"`
-`model`| Override the default model to use for Claude Code. `--model` and [`ANTHROPIC_MODEL`](</docs/en/model-config#environment-variables>) override this for one session| `"claude-sonnet-4-6"`
+`model`| Override the default model to use for Claude Code. `--model` and [`ANTHROPIC_MODEL`](</docs/en/model-config#environment-variables>) override this for one session| `"claude-sonnet-5"`
`modelOverrides`| Map Anthropic model IDs to provider-specific model IDs such as Bedrock inference profile ARNs. Each model picker entry uses its mapped value when calling the provider API. See [Override model IDs per version](</docs/en/model-config#override-model-ids-per-version>)| `{"claude-opus-4-6": "arn:aws:bedrock:..."}`
`otelHeadersHelper`| Script to generate dynamic OpenTelemetry headers. Runs at startup and periodically. Set the refresh interval with [`CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS`](</docs/en/env-vars>). See [Dynamic headers](</docs/en/monitoring-usage#dynamic-headers>)| `/bin/generate_otel_headers.sh`
`outputStyle`| Configure an output style to adjust the system prompt. See [output styles documentation](</docs/en/output-styles>)| `"Explanatory"`
@@ -478,7 +478,7 @@
**Default commit attribution:**
- Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
+ Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The model name in the trailer reflects the active model for the session. **Default pull request attribution:**
--- a/setup.md
+++ b/setup.md
@@ -33,7 +33,7 @@
Install Claude Code
-Prefer a graphical interface? The [Desktop app](</docs/en/desktop-quickstart>) lets you use Claude Code without the terminal. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>) or [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>).New to the terminal? See the [terminal guide](</docs/en/terminal-guide>) for step-by-step instructions.
+Prefer a graphical interface? The [Desktop app](</docs/en/desktop-quickstart>) lets you use Claude Code without the terminal. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>), [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>), or [Linux](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>).New to the terminal? See the [terminal guide](</docs/en/terminal-guide>) for step-by-step instructions.
To install Claude Code, use one of the following methods:
--- a/skills.md
+++ b/skills.md
@@ -105,7 +105,7 @@
* Its description says which directory it applies to.
* Claude picks the variant that matches the files it is working on.
-Typing `/deploy` runs the project-root skill. Type the qualified name `/apps/web:deploy` to run the nested variant explicitly.
+Typing `/deploy` runs the project-root skill. Type the qualified name `/apps/web:deploy` to run the nested variant explicitly. A `<skill-name>` entry in the enterprise, personal, or project locations can be a symlink to a directory elsewhere on disk. Claude Code follows the symlink and reads `SKILL.md` from the target directory, and if the same target is reachable from more than one location, Claude Code loads the skill once. Plugin skills handle symlinks differently; see [Share files within a marketplace with symlinks](</docs/en/plugins-reference#share-files-within-a-marketplace-with-symlinks>).
Add a `.claude-plugin/plugin.json` to a skill folder and it loads as a [plugin](</docs/en/plugins-reference#skills-directory-plugins>) named `<name>@skills-dir`, so it can bundle agents, hooks, and MCP servers. In a project’s `.claude/skills/`, this requires accepting the workspace trust dialog first.
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -273,7 +273,7 @@
The `model` field controls which [AI model](</docs/en/model-config>) the subagent uses:
* **Model alias** : use one of the available aliases: `sonnet`, `opus`, `haiku`, or `fable`
- * **Full model ID** : use a full model ID such as `claude-opus-4-8` or `claude-sonnet-4-6`. Accepts the same values as the `--model` flag
+ * **Full model ID** : use a full model ID such as `claude-opus-4-8` or `claude-sonnet-5`. Accepts the same values as the `--model` flag
* **inherit** : use the same model as the main conversation
* **Omitted** : defaults to `inherit` and uses the same model as the main conversation
--- a/troubleshoot-install.md
+++ b/troubleshoot-install.md
@@ -20,6 +20,7 @@
`irm is not recognized` or `&& is not valid`| Use the right command for your shell
`Cask 'claude-code' is unavailable: No Cask with this name exists`| Update Homebrew
`'bash' is not recognized as the name of a cmdlet`| Use the Windows installer command
+`A parameter cannot be found that matches parameter name 'fsSL'`| Use the Windows installer command
`Claude Code on Windows requires either Git for Windows (for bash) or PowerShell`| Install a shell
`Claude Code does not support 32-bit Windows`| Open Windows PowerShell, not the x86 entry
`The process cannot access the file ... because it is being used by another process`| Clear the downloads folder and retry
@@ -38,7 +39,7 @@
If your issue isn’t listed, work through the diagnostic checks below to narrow down the cause.
-If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>) or [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup.
+If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>), [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>), or [Linux](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup.
##
@@ -373,7 +374,7 @@
Wrong install command on Windows
-If you see `'irm' is not recognized`, `The token '&&' is not valid`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system.
+If you see `'irm' is not recognized`, `The token '&&' is not valid`, `A parameter cannot be found that matches parameter name 'fsSL'`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system.
* **`irm` not recognized**: you’re in CMD, not PowerShell. You have two options: Open PowerShell by searching for “PowerShell” in the Start menu, then run the original install command:
@@ -384,6 +385,10 @@
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
* **`&&` not valid**: you’re in PowerShell but ran the CMD installer command. Use the PowerShell installer:
+
+ irm https://claude.ai/install.ps1 | iex
+
+ * **`A parameter cannot be found that matches parameter name 'fsSL'`** : you ran the macOS/Linux `curl -fsSL ... | bash` installer in Windows PowerShell, where `curl` is an alias for `Invoke-WebRequest` and rejects the `-fsSL` flags. Use the PowerShell installer instead:
irm https://claude.ai/install.ps1 | iex
--- a/typescript.md
+++ b/typescript.md
@@ -491,7 +491,7 @@
`allowDangerouslySkipPermissions`| `boolean`| `false`| Enable bypassing permissions. Required when using `permissionMode: 'bypassPermissions'`
`allowedTools`| `string[]`| `[]`| Tools to auto-approve without prompting. This does not restrict Claude to only these tools; unlisted tools fall through to `permissionMode` and `canUseTool`. Use `disallowedTools` to block tools. See [Permissions](</docs/en/agent-sdk/permissions#allow-and-deny-rules>)
`betas`| `SdkBeta``[]`| `[]`| Enable beta features
-`canUseTool`| `CanUseTool`| `undefined`| Custom permission function for tool usage
+`canUseTool`| `CanUseTool`| `undefined`| Custom permission function, invoked only when the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) falls through to a prompt. Not invoked for calls auto-approved by `allowedTools`, allow rules, or `permissionMode`. See `CanUseTool` for details
`continue`| `boolean`| `false`| Continue the most recent conversation
`cwd`| `string`| `process.cwd()`| Current working directory
`debug`| `boolean`| `false`| Enable debug mode for the Claude Code process
@@ -890,7 +890,7 @@
`CanUseTool`
-Custom permission function type for controlling tool usage.
+Custom permission function type for controlling tool usage. The function is the SDK replacement for the interactive permission prompt: it’s invoked only when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Tool calls already approved by an `allowedTools` entry, a settings allow rule, or the permission mode, such as `acceptEdits` or `bypassPermissions`, never invoke it. To gate every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead.
type CanUseTool = (
toolName: string,
@@ -3106,7 +3106,7 @@
type SdkBeta = "context-1m-2025-08-07";
-The `context-1m-2025-08-07` beta is retired as of April 30, 2026. Passing this value with Claude Sonnet 4.5 or Sonnet 4 has no effect, and requests that exceed the standard 200k-token context window return an error. To use a 1M-token context window, migrate to [Claude Sonnet 4.6, Claude Opus 4.6, Claude Opus 4.7, or Claude Opus 4.8](<https://platform.claude.com/docs/en/about-claude/models/overview>), which include 1M context at standard pricing with no beta header required.
+The `context-1m-2025-08-07` beta is retired as of April 30, 2026. Passing this value with Claude Sonnet 4.5 or Sonnet 4 has no effect, and requests that exceed the standard 200k-token context window return an error. To use a 1M-token context window, migrate to [Claude Sonnet 5, Claude Sonnet 4.6, Claude Opus 4.6, Claude Opus 4.7, or Claude Opus 4.8](<https://platform.claude.com/docs/en/about-claude/models/overview>), which include 1M context at standard pricing with no beta header required.
###
--- a/user-input.md
+++ b/user-input.md
@@ -20,10 +20,12 @@
The callback fires in two cases:
- 1. **Tool needs approval** : Claude wants to use a tool that isn’t auto-approved by [permission rules](</docs/en/agent-sdk/permissions>) or modes. Check `tool_name` for the tool (e.g., `"Bash"`, `"Write"`).
+ 1. **Tool needs approval** : Claude wants to use a tool that isn’t auto-approved by a [permission rule](</docs/en/agent-sdk/permissions>) or permission mode. Check `tool_name` for the tool (e.g., `"Bash"`, `"Write"`).
2. **Claude asks a question** : Claude calls the `AskUserQuestion` tool. Check if `tool_name == "AskUserQuestion"` to handle it differently. If you specify a `tools` array, include `AskUserQuestion` for this to work. See Handle clarifying questions for details.
-To automatically allow or deny tools without prompting users, use [hooks](</docs/en/agent-sdk/hooks>) instead. Hooks execute before `canUseTool` and can allow, deny, or modify requests based on your own logic. You can also use the [`PermissionRequest` hook](</docs/en/agent-sdk/hooks#available-hooks>) to send external notifications (Slack, email, push) when Claude is waiting for approval.
+**The callback never fires for auto-approved tools.** Any approval earlier in the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>), an allow rule or a mode like `acceptEdits` or `bypassPermissions`, resolves the call before `canUseTool` is consulted. If you list a tool bare in `allowed_tools`, a `canUseTool` check for that tool never runs unless an ask rule or `plan` mode routes the call back to a prompt. For logic that must apply to every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which executes before the rest of the flow and can allow, deny, or modify requests.
+
+You can also use the [`PermissionRequest` hook](</docs/en/agent-sdk/hooks#available-hooks>) to send external notifications (Slack, email, push) when Claude is waiting for approval.
##
@@ -31,7 +33,7 @@
Handle tool approval requests
-Once you’ve passed a `canUseTool` callback in your query options, it fires when Claude wants to use a tool that isn’t auto-approved. Your callback receives three arguments:
+Once you’ve passed a `canUseTool` callback in your query options, it fires when Claude wants to use a tool that nothing earlier in the permission flow has approved. Your callback receives three arguments:
Argument| Description
---|---