modified Week 15 · April 6–10, 2026 View current →
--- a/2026-w15.md +++ b/2026-w15.md @@ -58,11 +58,11 @@ Focus view: press `Ctrl+O` in flicker-free mode to collapse the view to your last prompt, a one-line tool summary with diffstats, and Claude’s final response -Guided [Bedrock](</docs/en/amazon-bedrock>) and [Vertex AI](</docs/en/google-vertex-ai>) setup wizards on the login screen: pick “3rd-party platform” for step-by-step auth, region, credential check, and model pinning +Guided [Amazon Bedrock](</docs/en/amazon-bedrock>) and [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) setup wizards on the login screen: pick “3rd-party platform” for step-by-step auth, region, credential check, and model pinning `/agents` gets a tabbed layout: a Running tab shows live subagents with a `● N running` count, plus Run agent and View running instance actions in the Library tab -Default effort level is now `high` for API-key, Bedrock, Vertex, Foundry, Team, and Enterprise users (control with `/effort`) +Default effort level is now `high` for API-key, Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, Team, and Enterprise users (control with `/effort`) `/cost` shows a per-model and cache-hit breakdown for subscription users
modified Week 16 · April 13–17, 2026 View current →
--- a/2026-w16.md +++ b/2026-w16.md @@ -80,7 +80,7 @@ `PreCompact` hooks can block compaction by exiting with code 2 or returning `“decision”:“block”` -`ENABLE_PROMPT_CACHING_1H` opts API key, Bedrock, Vertex, and Foundry users into 1-hour prompt cache TTL +`ENABLE_PROMPT_CACHING_1H` opts API key, Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry users into 1-hour prompt cache TTL `sandbox.network.deniedDomains` setting carves specific domains out of a broader `allowedDomains` wildcard
modified Week 18 · April 27 – May 1, 2026 View current →
--- a/2026-w18.md +++ b/2026-w18.md @@ -70,11 +70,11 @@ MCP servers that hit a transient error during startup now auto-retry up to 3 times instead of staying disconnected -`ANTHROPIC_BEDROCK_SERVICE_TIER` selects a Bedrock service tier: `default`, `flex`, or `priority` +`ANTHROPIC_BEDROCK_SERVICE_TIER` selects an Amazon Bedrock service tier: `default`, `flex`, or `priority` `/terminal-setup` enables iTerm2’s clipboard access setting so `/copy` works, including from tmux -Vertex AI now supports X.509 certificate-based Workload Identity Federation (mTLS ADC) +Google Cloud’s Agent Platform now supports X.509 certificate-based Workload Identity Federation (mTLS ADC) Significant memory leak fixes: image-heavy sessions, `/usage` on large transcript histories, and long-running tools without progress events
modified Week 21 · May 18–22, 2026 View current →
--- a/2026-w21.md +++ b/2026-w21.md @@ -24,7 +24,7 @@ `claude agents —json` lists live sessions as JSON for scripting, such as status bars and session pickers -The PowerShell tool is now enabled by default on Windows for Bedrock, Vertex, and Foundry users; opt out with `CLAUDE_CODE_USE_POWERSHELL_TOOL=0` +The PowerShell tool is now enabled by default on Windows for Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry users; opt out with `CLAUDE_CODE_USE_POWERSHELL_TOOL=0` `claude plugin disable` now refuses when another enabled plugin depends on the target, and `claude plugin enable` force-enables transitive dependencies
modified Week 22 · May 25–29, 2026 View current →
--- a/2026-w22.md +++ b/2026-w22.md @@ -72,9 +72,9 @@ Vim mode: `/` in NORMAL mode opens reverse history search, matching Bash and Zsh vi-mode -Streaming tool execution is now always enabled, including with telemetry disabled and on Bedrock, Vertex, and Foundry +Streaming tool execution is now always enabled, including with telemetry disabled and on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry -`←←` to open the agents view now works on Bedrock, Vertex, Foundry, and with telemetry disabled +`←←` to open the agents view now works on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and with telemetry disabled Claude in Chrome: pick which connected browser to use via `/chrome` → “Select browser…”, or in-chat when a browser action runs with multiple connected
modified Week 23 · June 1–5, 2026 View current →
--- a/2026-w23.md +++ b/2026-w23.md @@ -1,8 +1,8 @@ Releases [v2.1.158 → v2.1.165](</docs/en/changelog#2-1-158>)4 features · June 1–5 -Auto mode on Bedrock, Vertex, and Foundryv2.1.158 +Auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundryv2.1.158 -Auto mode is now available on Bedrock, Vertex, and Foundry for Opus 4.7 and Opus 4.8, replacing permission prompts with background safety checks on third-party providers. Opt in by setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`. +Auto mode is now available on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry for Opus 4.7 and Opus 4.8, replacing permission prompts with background safety checks on third-party providers. Opt in by setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`. Opt in on a third-party provider, then cycle to auto mode with Shift+Tab: @@ -10,7 +10,7 @@ export CLAUDE_CODE_ENABLE_AUTO_MODE=1 -[Enable auto mode on third-party providers](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>) +[Enable auto mode on third-party providers](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-or-foundry>) Safer automatic editsv2.1.160
modified Week 25 · June 15–19, 2026 View current →
--- a/2026-w25.md +++ b/2026-w25.md @@ -60,7 +60,7 @@ Skills in nested `.claude/skills` directories load when working on files there; on a name clash the nested skill appears as `<dir>:<name>` so both stay available -Fixed prompt caching not reading on a custom `ANTHROPIC_BASE_URL` and on Foundry +Fixed prompt caching not reading on a custom `ANTHROPIC_BASE_URL` and on Microsoft Foundry Fixed Write and Edit producing zero-byte or truncated files on network drives and cloud-synced folders
modified Set up Claude Code for your organization View current →
--- a/admin-setup.md +++ b/admin-setup.md @@ -4,7 +4,7 @@ Decision| What you’re choosing| Reference ---|---|--- -Choose your API provider| Where Claude Code authenticates and how it’s billed| [Authentication](</docs/en/authentication>), [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>) +Choose your API provider| Where Claude Code authenticates and how it’s billed| [Authentication](</docs/en/authentication>), [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>) Decide how settings reach devices| How managed policy reaches developer machines| [Server-managed settings](</docs/en/server-managed-settings>), [Settings files](</docs/en/settings#settings-files>) Decide what to enforce| Which tools, commands, and integrations are allowed| [Permissions](</docs/en/permissions>), [Sandboxing](</docs/en/sandboxing>) Set up usage visibility| How you track spend and adoption| [Analytics](</docs/en/analytics>), [Monitoring](</docs/en/monitoring-usage>), [Costs](</docs/en/costs>) @@ -23,10 +23,10 @@ Claude for Teams / Enterprise| You want Claude Code and claude.ai under one per-seat subscription with no infrastructure to run. This is the default recommendation. Claude Console| You’re API-first or want pay-as-you-go billing Amazon Bedrock| You want to inherit existing AWS compliance controls and billing -Google Vertex AI| You want to inherit existing GCP compliance controls and billing +Google Cloud’s Agent Platform| You want to inherit existing GCP compliance controls and billing Microsoft Foundry| You want to inherit existing Azure compliance controls and billing -Some Claude Code features require a claude.ai account. [Claude Code on the web](</docs/en/claude-code-on-the-web>), [Routines](</docs/en/routines>), [Code Review](</docs/en/code-review>), [Remote Control](</docs/en/remote-control>), and the [Chrome extension](</docs/en/chrome>) aren’t available through Console API keys or cloud-provider credentials alone. If you deploy through Bedrock, Vertex, or Foundry, plan whether developers also need Claude for Teams or Enterprise seats. Each feature page lists its plan requirements. For the full provider comparison covering authentication, regions, and feature parity, see the [enterprise deployment overview](</docs/en/third-party-integrations>). Each provider’s auth setup is in [Authentication](</docs/en/authentication>). Proxy and firewall requirements in [Network configuration](</docs/en/network-config>) apply regardless of provider. If you want a single endpoint in front of multiple providers or centralized request logging, see [LLM gateway](</docs/en/llm-gateway>). +Some Claude Code features require a claude.ai account. [Claude Code on the web](</docs/en/claude-code-on-the-web>), [Routines](</docs/en/routines>), [Code Review](</docs/en/code-review>), [Remote Control](</docs/en/remote-control>), and the [Chrome extension](</docs/en/chrome>) aren’t available through Console API keys or cloud-provider credentials alone. If you deploy through Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, plan whether developers also need Claude for Teams or Enterprise seats. Each feature page lists its plan requirements. For the full provider comparison covering authentication, regions, and feature parity, see the [enterprise deployment overview](</docs/en/third-party-integrations>). Each provider’s auth setup is in [Authentication](</docs/en/authentication>). Proxy and firewall requirements in [Network configuration](</docs/en/network-config>) apply regardless of provider. If you want a single endpoint in front of multiple providers or centralized request logging, see [LLM gateway](</docs/en/llm-gateway>). ## @@ -46,7 +46,7 @@ Windows: `C:\Program Files\ClaudeCode\managed-settings.json`| Medium| All Windows user registry| `HKCU\SOFTWARE\Policies\ClaudeCode`| Lowest| Windows only -A configured [`policyHelper`](</docs/en/settings#compute-managed-settings-with-a-policy-helper>) preempts all four sources: its output becomes the only managed configuration for the run. See [Settings precedence](</docs/en/settings#settings-precedence>). Server-managed settings reach devices at authentication time and refresh hourly during active sessions, with no endpoint infrastructure. Delivery through the claude.ai admin console requires a Claude for Teams or Enterprise plan. Deployments on Bedrock, Vertex AI, or Foundry can get the same remote delivery by running a [Claude apps gateway](</docs/en/claude-apps-gateway>), or use one of the file-based or OS-level mechanisms instead. If your organization mixes providers, configure [server-managed settings](</docs/en/server-managed-settings>) for claude.ai users plus a [file-based or plist/registry fallback](</docs/en/settings#settings-files>) so other users still receive managed policy. The plist and HKLM registry locations work with any provider and resist tampering because they require admin privileges to write. The Windows user registry at HKCU is writable without elevation, so treat it as a convenience default rather than an enforcement channel. By default, WSL reads only the Linux file path at `/etc/claude-code`. To extend your Windows registry and `C:\Program Files\ClaudeCode` policy to WSL on the same machine, set [`wslInheritsWindowsSettings: true`](</docs/en/settings#available-settings>) in either of those admin-only Windows sources. Whichever mechanism you choose, managed values take precedence over user and project settings. Array settings such as `permissions.allow` and `permissions.deny` merge entries from all sources, so developers can extend managed lists but not remove from them. For [two exceptions](</docs/en/settings#settings-precedence>), `fallbackModel` and `availableModels`, the managed value replaces lower layers rather than merging. See [Server-managed settings](</docs/en/server-managed-settings>) and [Settings files and precedence](</docs/en/settings#settings-files>). +A configured [`policyHelper`](</docs/en/settings#compute-managed-settings-with-a-policy-helper>) preempts all four sources: its output becomes the only managed configuration for the run. See [Settings precedence](</docs/en/settings#settings-precedence>). Server-managed settings reach devices at authentication time and refresh hourly during active sessions, with no endpoint infrastructure. Delivery through the claude.ai admin console requires a Claude for Teams or Enterprise plan. Deployments on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry can get the same remote delivery by running a [Claude apps gateway](</docs/en/claude-apps-gateway>), or use one of the file-based or OS-level mechanisms instead. If your organization mixes providers, configure [server-managed settings](</docs/en/server-managed-settings>) for claude.ai users plus a [file-based or plist/registry fallback](</docs/en/settings#settings-files>) so other users still receive managed policy. The plist and HKLM registry locations work with any provider and resist tampering because they require admin privileges to write. The Windows user registry at HKCU is writable without elevation, so treat it as a convenience default rather than an enforcement channel. By default, WSL reads only the Linux file path at `/etc/claude-code`. To extend your Windows registry and `C:\Program Files\ClaudeCode` policy to WSL on the same machine, set [`wslInheritsWindowsSettings: true`](</docs/en/settings#available-settings>) in either of those admin-only Windows sources. Whichever mechanism you choose, managed values take precedence over user and project settings. Array settings such as `permissions.allow` and `permissions.deny` merge entries from all sources, so developers can extend managed lists but not remove from them. For [two exceptions](</docs/en/settings#settings-precedence>), `fallbackModel` and `availableModels`, the managed value replaces lower layers rather than merging. See [Server-managed settings](</docs/en/server-managed-settings>) and [Settings files and precedence](</docs/en/settings#settings-files>). ## @@ -136,5 +136,5 @@ * [Server-managed settings](</docs/en/server-managed-settings>): deliver managed policy from the Claude admin console * [Settings reference](</docs/en/settings>): every setting key, file location, and precedence rule * [Monorepos and large repos](</docs/en/large-codebases>): per-directory configuration patterns for organizations deploying into a monorepo - * [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>): provider-specific deployment + * [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>): provider-specific deployment * [Claude Enterprise Administrator Guide](<https://claude.com/resources/tutorials/claude-enterprise-administrator-guide>): SSO, SCIM, seat management, and rollout playbook
modified Escalate hard decisions with the advisor tool View current →
--- a/advisor.md +++ b/advisor.md @@ -1,4 +1,4 @@ -The advisor tool is experimental and requires Claude Code v2.1.98 or later with the Anthropic API. It is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. Behavior, pricing, and availability may change. +The advisor tool is experimental and requires Claude Code v2.1.98 or later with the Anthropic API. It is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. Behavior, pricing, and availability may change. The advisor tool lets Claude consult a second, typically stronger model at key moments during a task, such as before committing to an approach, when stuck on a recurring error, or before declaring a task complete. The advisor receives the full conversation, including every tool call and result, and returns guidance that Claude applies before continuing. The advisor runs server-side on Anthropic’s infrastructure as a [server tool](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool>), available to both subscription and API-billed accounts. You choose which model acts as the advisor, and Claude decides when to call it. This page covers how to enable the advisor, which model pairings are accepted, what Claude shows during a consultation, and how advisor usage is billed. @@ -142,7 +142,7 @@ The advisor tool requires all of the following: * **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. + * **Anthropic API only** : the advisor is a server-executed tool. It is not available on Amazon Bedrock, Google Cloud’s Agent Platform, 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 later, or Haiku 4.5. Fable 5 also qualifies on Claude Code v2.1.170 or later. ##
modified How the agent loop works View current →
Show diff (157 lines)
--- a/agent-loop.md +++ b/agent-loop.md @@ -75,16 +75,26 @@ TypeScript + import asyncio from claude_agent_sdk import query, AssistantMessage, ResultMessage - async for message in query(prompt="Summarize this project"): - if isinstance(message, AssistantMessage): - print(f"Turn completed: {len(message.content)} content blocks") - if isinstance(message, ResultMessage): - if message.subtype == "success": - print(message.result) - else: - print(f"Stopped: {message.subtype}") + async def main(): + try: + async for message in query(prompt="Summarize this project"): + if isinstance(message, AssistantMessage): + print(f"Turn completed: {len(message.content)} content blocks") + if isinstance(message, ResultMessage): + if message.subtype == "success": + print(message.result) + else: + print(f"Stopped: {message.subtype}") + except Exception as error: + # A single-shot query() raises after yielding an error result. If the + # failure was an error result, the error subtype branches above have + # already run; connection or process failures yield no result message. + print(f"Session ended with an error: {error}") + + asyncio.run(main()) ## @@ -229,7 +239,7 @@ ---|---|--- **System prompt**| Every request| Small fixed cost, always present **CLAUDE.md files**| Session start, via [`settingSources`](</docs/en/agent-sdk/claude-code-features>)| Full content in every request (but prompt-cached, so only the first request pays full cost) -**Tool definitions**| Every request; MCP schemas deferred by default| Built-in tool schemas load every request. [Tool search](</docs/en/agent-sdk/mcp#mcp-tool-search>) defers MCP tool schemas by default, falling back to upfront loading on Vertex AI or a non-first-party `ANTHROPIC_BASE_URL`. See [Configure tool search](</docs/en/agent-sdk/tool-search#configure-tool-search>) for the full matrix +**Tool definitions**| Every request; MCP schemas deferred by default| Built-in tool schemas load every request. [Tool search](</docs/en/agent-sdk/mcp#mcp-tool-search>) defers MCP tool schemas by default, falling back to upfront loading on Google Cloud’s Agent Platform or a non-first-party `ANTHROPIC_BASE_URL`. See [Configure tool search](</docs/en/agent-sdk/tool-search#configure-tool-search>) for the full matrix **Conversation history**| Accumulates over turns| Grows with each turn: prompts, responses, tool inputs, tool outputs **Skill descriptions**| Session start, via setting sources| Short summaries; full content loads only when invoked @@ -271,7 +281,7 @@ * **Use subagents for subtasks.** Each subagent starts with a fresh conversation (no prior message history, though it does load its own system prompt and project-level context like CLAUDE.md). It does not see the parent’s turns, and only its final response returns to the parent as a tool result. The main agent’s context grows by that summary, not by the full subtask transcript. See [What subagents inherit](</docs/en/agent-sdk/subagents#what-subagents-inherit>) for details. * **Be selective with tools.** Every tool definition takes context space. Use the `tools` field on [`AgentDefinition`](</docs/en/agent-sdk/subagents#agentdefinition-configuration>) to scope subagents to the minimum set they need. - * **Watch MCP server costs.** [MCP tool search](</docs/en/agent-sdk/mcp#mcp-tool-search>) defers MCP tool schemas by default and loads them on demand. When tool search is off, on Vertex AI, or behind a non-first-party `ANTHROPIC_BASE_URL`, each MCP server adds all its tool schemas to every request, so a few servers with many tools can consume significant context before the agent does any work. + * **Watch MCP server costs.** [MCP tool search](</docs/en/agent-sdk/mcp#mcp-tool-search>) defers MCP tool schemas by default and loads them on demand. When tool search is off, on Google Cloud’s Agent Platform, or behind a non-first-party `ANTHROPIC_BASE_URL`, each MCP server adds all its tool schemas to every request, so a few servers with many tools can consume significant context before the agent does any work. * **Use lower effort for routine tasks.** Set effort to `"low"` for agents that only need to read files or list directories. This reduces token usage and cost. For a detailed breakdown of per-feature context costs, see [Understand context costs](</docs/en/features-overview#understand-context-costs>). @@ -302,7 +312,14 @@ `error_during_execution`| An error interrupted the loop (for example, an API failure or cancelled request)| No `error_max_structured_output_retries`| No valid structured output was produced within the configured retry limit: every attempt failed validation, or a model fallback retracted the completed output with no successful retry| No -The `result` field (the final text output) is only present on the `success` variant, so always check the subtype before reading it. All result subtypes carry `total_cost_usd`, `usage`, `num_turns`, and `session_id` so you can track cost and resume even after errors. In Python, `total_cost_usd` and `usage` are typed as optional and may be `None` on some error paths, so guard before formatting them. See [Tracking costs and usage](</docs/en/agent-sdk/cost-tracking>) for details on interpreting the `usage` fields. The result also includes a `stop_reason` field (`string | null` in TypeScript, `str | None` in Python) indicating why the model stopped generating on its final turn. Common values are `end_turn` (model finished normally), `max_tokens` (hit the output token limit), and `refusal` (the model declined the request). On error result subtypes, `stop_reason` carries the value from the last assistant response before the loop ended. To detect refusals, check `stop_reason === "refusal"` (TypeScript) or `stop_reason == "refusal"` (Python). See [`SDKResultMessage`](</docs/en/agent-sdk/typescript#sdkresultmessage>) (TypeScript) or [`ResultMessage`](</docs/en/agent-sdk/python#resultmessage>) (Python) for the full type. +The `result` field (the final text output) is only present on the `success` variant, so always check the subtype before reading it. All result subtypes carry `total_cost_usd`, `usage`, `num_turns`, and `session_id` so you can track cost and resume even after errors. In Python, `total_cost_usd` and `usage` are typed as optional and may be `None` on some error paths, so guard before formatting them. See [Tracking costs and usage](</docs/en/agent-sdk/cost-tracking>) for details on interpreting the `usage` fields. + +When a query ends on an error result: + + * A single-shot `query()` call yields the final result message, then raises an error that includes the failure text, such as `Reached maximum number of turns`. The raise is intentional — wrap the loop in a try block if your code needs to continue past it. The underlying Claude Code process also exits with a nonzero code. + * A streaming input session stays alive, and you can keep sending messages. + +The result also includes a `stop_reason` field (`string | null` in TypeScript, `str | None` in Python) indicating why the model stopped generating on its final turn. Common values are `end_turn` (model finished normally), `max_tokens` (hit the output token limit), and `refusal` (the model declined the request). On error result subtypes, `stop_reason` carries the value from the last assistant response before the loop ended. To detect refusals, check `stop_reason === "refusal"` (TypeScript) or `stop_reason == "refusal"` (Python). See [`SDKResultMessage`](</docs/en/agent-sdk/typescript#sdkresultmessage>) (TypeScript) or [`ResultMessage`](</docs/en/agent-sdk/python#resultmessage>) (Python) for the full type. ## @@ -329,7 +346,7 @@ Put it all together -This example combines the key concepts from this page into a single agent that fixes failing tests. It configures the agent with allowed tools (auto-approved so the agent runs autonomously), project settings, and safety limits on turns and reasoning effort. As the loop runs, it captures the session ID for potential resumption, handles the final result, and prints the total cost. +This example combines the key concepts from this page into a single agent that fixes failing tests. It configures the agent with allowed tools (auto-approved so the agent runs autonomously), project settings, and safety limits on turns and reasoning effort. As the loop runs, it captures the session ID for potential resumption, handles the final result, and prints the total cost. Because a single-shot `query()` call raises after yielding an error result, the loop is wrapped in a try block so the script exits cleanly when a limit is hit. Python @@ -341,38 +358,44 @@ async def run_agent(): session_id = None - async for message in query( - prompt="Find and fix the bug causing test failures in the auth module", - options=ClaudeAgentOptions( - allowed_tools=[ - "Read", - "Edit", - "Bash", - "Glob", - "Grep", - ], # Listing tools here auto-approves them (no prompting) - setting_sources=[ - "project" - ], # Load CLAUDE.md, skills, hooks from current directory - max_turns=30, # Prevent runaway sessions - effort="high", # Thorough reasoning for complex debugging - ), - ): - # Handle the final result - if isinstance(message, ResultMessage): - session_id = message.session_id # Save for potential resumption - - if message.subtype == "success": - print(f"Done: {message.result}") - elif message.subtype == "error_max_turns": - # Agent ran out of turns. Resume with a higher limit. - print(f"Hit turn limit. Resume session {session_id} to continue.") - elif message.subtype == "error_max_budget_usd": - print("Hit budget limit.") - else: - print(f"Stopped: {message.subtype}") - if message.total_cost_usd is not None: - print(f"Cost: ${message.total_cost_usd:.4f}") + try: + async for message in query( + prompt="Find and fix the bug causing test failures in the auth module", + options=ClaudeAgentOptions( + allowed_tools=[ + "Read", + "Edit", + "Bash", + "Glob", + "Grep", + ], # Listing tools here auto-approves them (no prompting) + setting_sources=[ + "project" + ], # Load CLAUDE.md, skills, hooks from current directory + max_turns=30, # Prevent runaway sessions + effort="high", # Thorough reasoning for complex debugging + ), + ): + # Handle the final result + if isinstance(message, ResultMessage): + session_id = message.session_id # Save for potential resumption + + if message.subtype == "success": + print(f"Done: {message.result}") + elif message.subtype == "error_max_turns": + # Agent ran out of turns. Resume with a higher limit. + print(f"Hit turn limit. Resume session {session_id} to continue.") + elif message.subtype == "error_max_budget_usd": + print("Hit budget limit.") + else: + print(f"Stopped: {message.subtype}") + if message.total_cost_usd is not None: + print(f"Cost: ${message.total_cost_usd:.4f}") + except Exception as error: + # A single-shot query() raises after yielding an error result. If the + # failure was an error result, the error subtype branches above have + # already run; connection or process failures yield no result message. + print(f"Session ended with an error: {error}") asyncio.run(run_agent())
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -109,7 +109,7 @@ `∙`| The process has exited. You can still peek, reply, or attach, and Claude restarts from where it left off `✢`| A [`/loop`](</docs/en/scheduled-tasks>) session sleeping between iterations. The row shows its run count and a countdown -The `#N` label that can appear at the right edge of a row is the pull request the session opened, not part of the state icon. The terminal tab title shows the awaiting-input count while agent view is open: `2 awaiting input · claude agents` when sessions need input, or `claude agents` when none do. As of v2.1.198, while agent view is open, Claude Code also sends a notification through your configured [terminal notification channel](</docs/en/terminal-config#get-a-terminal-bell-or-notification>) when a local background session starts needing your input, finishes, or fails. Sessions that run on a schedule, such as [`/loop`](</docs/en/scheduled-tasks>) sessions, notify only when they need your input. Notifications use the same [`preferredNotifChannel` setting](</docs/en/settings#available-settings>) as the rest of Claude Code and fire the [`Notification` hook](</docs/en/hooks#notification>) with the `agent_needs_input` or `agent_completed` type. Background sessions don’t need any terminal open to keep working. A separate supervisor process runs them, so you can close agent view, close your shell, or start a new interactive session and your dispatched work keeps going. Session state persists on disk through auto-updates and supervisor restarts. Sessions are also preserved when your machine sleeps. Their processes resume on wake and the supervisor reconnects to them instead of treating the time gap as idle. Shutting down still stops running sessions; see Sessions show as failed after shutdown for how to recover them. +The `#N` label that can appear at the right edge of a row is the pull request the session opened, not part of the state icon. The terminal tab title shows the awaiting-input count while agent view is open: `2 awaiting input · claude agents` when sessions need input, or `claude agents` when none do. As of v2.1.198, while agent view is open, Claude Code also sends a notification through your configured [terminal notification channel](</docs/en/terminal-config#get-a-terminal-bell-or-notification>) when a local background session starts needing your input, finishes, or fails. Sessions that run on a schedule, such as [`/loop`](</docs/en/scheduled-tasks>) sessions, notify only when they need your input. Notifications use the same [`preferredNotifChannel` setting](</docs/en/settings#available-settings>) as the rest of Claude Code and fire the [`Notification` hook](</docs/en/hooks#notification>) with the `agent_needs_input` or `agent_completed` type. Background sessions don’t need any terminal open to keep working. A separate supervisor process runs them, so you can close agent view, close your shell, or start a new interactive session and your dispatched work keeps going. Session state persists on disk through auto-updates and supervisor restarts. Sessions are also preserved when your machine sleeps. Their processes resume on wake and the supervisor reconnects to them instead of treating the time gap as idle. Shutting down still stops running sessions; see Sessions show as failed after shutdown for how to recover them. When you open a session that has stopped responding, the supervisor restarts its process and the session continues the interrupted response from where it left off. A session can end up in that state when the machine sleeps while it’s mid-response. Requires Claude Code v2.1.200 or later. ### @@ -117,7 +117,7 @@ Row summaries -The one-line summary in each row is generated by a [Haiku-class model](</docs/en/model-config>) so the row can tell you what the session is doing, what it needs, or what it produced without opening the transcript. While a session is actively working, the summary refreshes at most once every 15 seconds, plus once when each turn ends. When the session is running two or more parallel work items, such as subagents, background shell commands, or monitors, a `done/total` count such as `2/5` appears before the summary text. Each refresh is one short Haiku-class request through your normal provider, billed and handled under the same [data usage terms](</docs/en/data-usage>) as the session itself. On third-party providers such as Bedrock, Vertex AI, Microsoft Foundry, and custom gateways, the request falls back to the session’s main model when no Haiku model is configured. Set [`ANTHROPIC_DEFAULT_HAIKU_MODEL`](</docs/en/model-config#environment-variables>) to choose the model for these summaries on those providers. +The one-line summary in each row is generated by a [Haiku-class model](</docs/en/model-config>) so the row can tell you what the session is doing, what it needs, or what it produced without opening the transcript. While a session is actively working, the summary refreshes at most once every 15 seconds, plus once when each turn ends. When the session is running two or more parallel work items, such as subagents, background shell commands, or monitors, a `done/total` count such as `2/5` appears before the summary text. Each refresh is one short Haiku-class request through your normal provider, billed and handled under the same [data usage terms](</docs/en/data-usage>) as the session itself. On third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and custom gateways, the request falls back to the session’s main model when no Haiku model is configured. Set [`ANTHROPIC_DEFAULT_HAIKU_MODEL`](</docs/en/model-config#environment-variables>) to choose the model for these summaries on those providers. ### @@ -426,7 +426,7 @@ The supervisor process -Background sessions are hosted by a per-user supervisor process, separate from your terminal and from agent view. The supervisor starts automatically the first time you background a session or open agent view, and you don’t manage it directly. The supervisor keeps one pre-warmed worker process ready so a dispatch from agent view or `claude --bg` starts without the delay of a cold launch. When you dispatch, the supervisor assigns the pre-warmed worker to your session, applies that session’s directory, settings, and credentials to it, and then starts a replacement for the next dispatch. If no healthy pre-warmed worker is available, the supervisor launches a fresh process instead. The supervisor and its sessions authenticate with the same stored credentials as your interactive sessions and make no additional network connections beyond the model API. Provider selection variables such as `CLAUDE_CODE_USE_BEDROCK` and `ANTHROPIC_DEFAULT_*_MODEL` aliases are read from the shell that dispatched each session and are applied to its worker. A background session doesn’t inherit gateway endpoint variables such as `ANTHROPIC_BASE_URL`, the equivalent Bedrock, Vertex, and Foundry base URL variables, or a paired `ANTHROPIC_AUTH_TOKEN` from the shell that started the supervisor or from the dispatching shell. The session uses your stored credentials and any `env` values in the project directory’s [settings](</docs/en/settings>) instead. To point background sessions in a project at an [LLM gateway](</docs/en/llm-gateway>), set `ANTHROPIC_BASE_URL` in that project’s `.claude/settings.json` `env` block rather than exporting it in your shell. Each background session is its own Claude Code process, managed by the supervisor rather than tied to your terminal. A session that’s actively working, waiting for your input, or has a terminal attached keeps its process running. A running background shell command, subagent, dynamic workflow, or monitor counts as active work, so a long-running process such as a dev server keeps the session alive. Once a session finishes and sits unattached for about an hour, the supervisor stops its process to free resources. A session you have pinned with `Ctrl+T` is exempt and keeps its process running while idle. The transcript and state stay on disk either way, and the next time you attach, peek, or reply to a stopped session, the supervisor starts a fresh process from where it left off. When every session has finished and no terminal is connected, the supervisor itself exits and starts again the next time you need it. Background work the session itself started at the top level is handed off when its process is stopped, restarted, or updated, including on Windows. The next process started for that session picks the work back up: +Background sessions are hosted by a per-user supervisor process, separate from your terminal and from agent view. The supervisor starts automatically the first time you background a session or open agent view, and you don’t manage it directly. The supervisor keeps one pre-warmed worker process ready so a dispatch from agent view or `claude --bg` starts without the delay of a cold launch. When you dispatch, the supervisor assigns the pre-warmed worker to your session, applies that session’s directory, settings, and credentials to it, and then starts a replacement for the next dispatch. If no healthy pre-warmed worker is available, the supervisor launches a fresh process instead. The supervisor and its sessions authenticate with the same stored credentials as your interactive sessions and make no additional network connections beyond the model API. Provider selection variables such as `CLAUDE_CODE_USE_BEDROCK` and `ANTHROPIC_DEFAULT_*_MODEL` aliases are read from the shell that dispatched each session and are applied to its worker. A background session doesn’t inherit gateway endpoint variables such as `ANTHROPIC_BASE_URL`, the equivalent Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry base URL variables, or a paired `ANTHROPIC_AUTH_TOKEN` from the shell that started the supervisor or from the dispatching shell. The session uses your stored credentials and any `env` values in the project directory’s [settings](</docs/en/settings>) instead. To point background sessions in a project at an [LLM gateway](</docs/en/llm-gateway>), set `ANTHROPIC_BASE_URL` in that project’s `.claude/settings.json` `env` block rather than exporting it in your shell. Each background session is its own Claude Code process, managed by the supervisor rather than tied to your terminal. A session that’s actively working, waiting for your input, or has a terminal attached keeps its process running. A running background shell command, subagent, dynamic workflow, or monitor counts as active work, so a long-running process such as a dev server keeps the session alive. Once a session finishes and sits unattached for about an hour, the supervisor stops its process to free resources. A session you have pinned with `Ctrl+T` is exempt and keeps its process running while idle. The transcript and state stay on disk either way, and the next time you attach, peek, or reply to a stopped session, the supervisor starts a fresh process from where it left off. When every session has finished and no terminal is connected, the supervisor itself exits and starts again the next time you need it. Background work the session itself started at the top level is handed off when its process is stopped, restarted, or updated, including on Windows. The next process started for that session picks the work back up: * A background shell command that finished in the meantime is reported as completed with its output * A dynamic workflow resumes from where it left off @@ -449,7 +449,7 @@ `~/.claude/jobs/<id>/state.json`| Per-session state shown in agent view `~/.claude/jobs/<id>/tmp/`| Per-session scratch directory. Writes here don’t prompt for permission. Removed when the session is deleted -Each background session has the `CLAUDE_JOB_DIR` environment variable set to its `~/.claude/jobs/<id>` directory, so shell commands the session runs can write temporary files to `$CLAUDE_JOB_DIR/tmp` without colliding with parallel sessions. To inspect this state without reading the files directly, run `claude daemon status`. It reports whether the supervisor is reachable, its process ID and version, the socket directory, and how many background sessions are live. `/doctor` includes a summary of the same check. The command also warns when the running supervisor is on a different version than the `claude` you invoked, which happens after an update the supervisor hasn’t restarted into yet. The warning shows both versions and tells you to run `claude daemon stop --any` to pick up the new version. When Claude Code is installed as an OS service, the suggested command is `claude daemon stop` without the flag. Sessions survive that version mismatch intact: an older Claude Code version that updates a session’s `state.json` preserves fields it doesn’t recognize and keeps the session listed. On Windows, `claude daemon status` surfaces the underlying file error when the daemon’s pipe-key file is locked or unreadable instead of reporting a generic connection failure. +Each background session has the `CLAUDE_JOB_DIR` environment variable set to its `~/.claude/jobs/<id>` directory, so shell commands the session runs can write temporary files to `$CLAUDE_JOB_DIR/tmp` without colliding with parallel sessions. To inspect this state without reading the files directly, run `claude daemon status`. It reports whether the supervisor is reachable, its process ID and version, the socket directory, and how many background sessions are live. `/doctor` includes a summary of the same check. The command also warns when the running supervisor is on a different version than the `claude` you invoked, which happens after an update the supervisor hasn’t restarted into yet. The warning shows both versions and tells you to run `claude daemon stop --any` to pick up the new version. When Claude Code is installed as an OS service, the suggested command is `claude daemon stop` without the flag. Sessions survive that version mismatch intact: an older Claude Code version that updates a session’s `state.json` preserves fields it doesn’t recognize and keeps the session listed. The session list in `roster.json` follows the same rule: an older version that rewrites it preserves fields a newer version wrote, so sessions started by the newer version stay reachable and keep accepting input after the supervisor restarts. Before v2.1.200, older versions could drop those fields on rewrite. On Windows, `claude daemon status` surfaces the underlying file error when the daemon’s pipe-key file is locked or unreadable instead of reporting a generic connection failure. ### @@ -603,6 +603,7 @@ Version| Change ---|--- +v2.1.200| An older Claude Code version that rewrites the session list in `roster.json` preserves fields written by a newer version, matching the existing `state.json` guarantee, so sessions started by the newer version keep accepting input after the supervisor restarts. When you open a session that has stopped responding, the supervisor restarts its process and the session continues the interrupted response from where it left off. v2.1.199| A background session whose process exits before it finishes starting on a low-memory host shows `possibly low memory — free some up and retry` in its row status instead of only the bare exit reason. Backgrounding a session with `←` or `/background` carries its `/color` over to the new row. v2.1.198| Agent view sends a notification through `preferredNotifChannel` when a background session needs input, finishes, or fails, and fires the `Notification` hook with the `agent_needs_input` or `agent_completed` type. `←` and `/exit` inside `claude attach <id>` return to agent view instead of exiting to the shell; `Ctrl+Z` returns to the shell. A background session that isolated its work in a worktree commits, pushes its own isolated branch, never `main` or `master`, and opens a draft pull request when it finishes instead of asking first. `/login` runs in agent view and opens the sign-in dialog. The `Background work is running` exit dialog offers `Move to background and exit`. The exit handoff also covers background subagents, which resume from their transcript on the next wake instead of being reported as failed. `claude --bg` combined with `-p` or `--print` is rejected with an error. v2.1.196| A single `←` press backgrounds a foreground session; earlier versions required two presses, with a footer hint and a confirm. `--dangerously-skip-permissions` passed to `claude agents` shows the bypass disclaimer instead of being silently dropped. Interactive sessions you never named carry a default name such as `my-app-3f` in session listings and `claude agents --json`. Background shell commands and dynamic workflows survive the session’s process being stopped, restarted, or updated, including on Windows; set `CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF=1` to turn the handoff off. A transcript misread as empty on restart is renamed with an `.orphaned-` suffix instead of deleted.
modified Claude Code on Amazon Bedrock View current →
Show diff (246 lines)
--- a/amazon-bedrock.md +++ b/amazon-bedrock.md @@ -4,14 +4,14 @@ Prerequisites -Before configuring Claude Code with Bedrock, ensure you have: - - * An AWS account with Bedrock access enabled - * Access to desired Claude models (for example, Claude Sonnet 4.6) in Bedrock +Before configuring Claude Code with Amazon Bedrock, ensure you have: + + * An AWS account with Amazon Bedrock access enabled + * Access to desired Claude models (for example, Claude Sonnet 4.6) in Amazon Bedrock * AWS CLI installed and configured (optional - only needed if you don’t have another mechanism for getting credentials) * Appropriate IAM permissions -To sign in with your own Bedrock credentials, follow Sign in with Bedrock below. To deploy Claude Code across a team, use the manual setup steps and pin your model versions before rolling out. +To sign in with your own Amazon Bedrock credentials, follow Sign in with Amazon Bedrock below. To deploy Claude Code across a team, use the manual setup steps and pin your model versions before rolling out. ## @@ -19,7 +19,7 @@ Sign in with Bedrock -If you have AWS credentials and want to start using Claude Code through Bedrock, the login wizard walks you through it. You complete the AWS-side prerequisites once per account; the wizard handles the Claude Code side. +If you have AWS credentials and want to start using Claude Code through Amazon Bedrock, the login wizard walks you through it. You complete the AWS-side prerequisites once per account; the wizard handles the Claude Code side. 1 @@ -29,7 +29,7 @@ 2 -Start Claude Code and choose Bedrock +Start Claude Code and choose Amazon Bedrock Run `claude`. At the login prompt, select **3rd-party platform** , then **Amazon Bedrock**. @@ -37,7 +37,7 @@ Follow the wizard prompts -Choose how you authenticate to AWS: an AWS profile detected from your `~/.aws` directory, a Bedrock API key, an access key and secret, or credentials already in your environment. The wizard picks up your region, verifies which Claude models your account can invoke, and lets you pin them. It saves the result to the `env` block of your [user settings file](</docs/en/settings>), so you don’t need to export environment variables yourself. +Choose how you authenticate to AWS: an AWS profile detected from your `~/.aws` directory, an Amazon Bedrock API key, an access key and secret, or credentials already in your environment. The wizard picks up your region, verifies which Claude models your account can invoke, and lets you pin them. It saves the result to the `env` block of your [user settings file](</docs/en/settings>), so you don’t need to export environment variables yourself. After you’ve signed in, run `/setup-bedrock` any time to reopen the wizard and change your credentials, region, or model pins. @@ -47,7 +47,7 @@ Set up manually -To configure Bedrock through environment variables instead of the wizard, for example in CI or a scripted enterprise rollout, follow the steps below. +To configure Amazon Bedrock through environment variables instead of the wizard, for example in CI or a scripted enterprise rollout, follow the steps below. ### @@ -90,11 +90,11 @@ aws login -[Learn more](<https://docs.aws.amazon.com/signin/latest/userguide/command-line-sign-in.html>) about `aws login`. **Option E: Bedrock API keys** +[Learn more](<https://docs.aws.amazon.com/signin/latest/userguide/command-line-sign-in.html>) about `aws login`. **Option E: Amazon Bedrock API keys** export AWS_BEARER_TOKEN_BEDROCK=your-bedrock-api-key -Bedrock API keys provide a simpler authentication method without needing full AWS credentials. [Learn more about Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>). +Amazon Bedrock API keys provide a simpler authentication method without needing full AWS credentials. [Learn more about Amazon Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>). #### @@ -105,7 +105,7 @@ Claude Code supports automatic credential refresh for AWS SSO and corporate identity providers. Add these settings to your Claude Code settings file (see [Settings](</docs/en/settings>) for file locations). These two settings have different trigger conditions: * **`awsAuthRefresh`** : runs only when Claude Code detects that your AWS credentials are expired, either locally based on their timestamp or when the API returns a credential error, then retries the request with refreshed credentials. - * **`awsCredentialExport`** : runs at session start and on each credential reload, even when the credentials in your AWS default credential provider chain are still valid. Use this when your Bedrock account requires cross-account credentials that differ from the ones the default provider chain would resolve. + * **`awsCredentialExport`** : runs at session start and on each credential reload, even when the credentials in your AWS default credential provider chain are still valid. Use this when your Amazon Bedrock account requires cross-account credentials that differ from the ones the default provider chain would resolve. ##### Example configuration @@ -137,7 +137,7 @@ 3\. Configure Claude Code -Set the following environment variables to enable Bedrock: +Set the following environment variables to enable Amazon Bedrock: # Enable Bedrock integration export CLAUDE_CODE_USE_BEDROCK=1 @@ -151,7 +151,7 @@ # Optional: Override the Bedrock endpoint URL for custom endpoints or gateways # export ANTHROPIC_BEDROCK_BASE_URL=https://bedrock-runtime.us-east-1.amazonaws.com -When enabling Bedrock for Claude Code, keep the following in mind: +When enabling Amazon Bedrock for Claude Code, keep the following in mind: * As of v2.1.172, you only need to set `AWS_REGION` to override your AWS profile’s region or when your profile has no region. Claude Code resolves the region in this order: * `AWS_REGION` @@ -159,8 +159,8 @@ * the `region` set on your active AWS profile, read from the AWS shared credentials file first and then the shared config file, matching AWS SDK precedence * `us-east-1` The active profile is `AWS_PROFILE` if set, otherwise `default`. Set `AWS_SHARED_CREDENTIALS_FILE` or `AWS_CONFIG_FILE` to point at non-default file paths. Run `/status` to see the resolved region. When the region came from your AWS config files or the default fallback, `/status` also notes the source. On v2.1.171 and earlier, Claude Code does not read the AWS config files, so set `AWS_REGION` explicitly. - * When using Bedrock, the `/logout` command is unavailable since authentication is handled through AWS credentials. - * The WebSearch tool is not available on Bedrock. See [WebSearch tool behavior](</docs/en/tools-reference#websearch-tool-behavior>). + * When using Amazon Bedrock, the `/logout` command is unavailable since authentication is handled through AWS credentials. + * The WebSearch tool is not available on Amazon Bedrock. See [WebSearch tool behavior](</docs/en/tools-reference#websearch-tool-behavior>). * You can use settings files for environment variables like `AWS_PROFILE` that you don’t want to leak to other processes. See [Settings](</docs/en/settings>) for more information. ### @@ -169,9 +169,9 @@ 4\. Pin model versions -Pin specific model versions when deploying to multiple users. Without pinning, model aliases such as `sonnet` and `opus` resolve to Claude Code’s built-in default for Bedrock, which can lag the newest release and may not yet be available in your account. Claude Code falls back to the previous version at startup when the default is unavailable, but pinning lets you control when your users move to a new model. - -Set these environment variables to specific Bedrock model IDs. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Bedrock resolves to Opus 4.6. Set it to the Opus 4.8 ID to use the latest model: +Pin specific model versions when deploying to multiple users. Without pinning, model aliases such as `sonnet` and `opus` resolve to Claude Code’s built-in default for Amazon Bedrock, which can lag the newest release and may not yet be available in your account. Claude Code falls back to the previous version at startup when the default is unavailable, but pinning lets you control when your users move to a new model. + +Set these environment variables to specific Amazon Bedrock model IDs. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Amazon Bedrock resolves to Opus 4.6. Set it to the Opus 4.8 ID to use the latest model: export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-8' export ANTHROPIC_DEFAULT_SONNET_MODEL='us.anthropic.claude-sonnet-4-6' @@ -184,7 +184,7 @@ Primary model| `us.anthropic.claude-sonnet-4-5-20250929-v1:0` Small/fast model| Same as primary model -Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On Bedrock, Claude Code defaults this to the primary model because Haiku may not be enabled in every account or region. To use Haiku for background tasks, set `ANTHROPIC_DEFAULT_HAIKU_MODEL` to a model ID that is available in your account. To customize models further, use one of these methods: +Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On Amazon Bedrock, Claude Code defaults this to the primary model because Haiku may not be enabled in every account or region. To use Haiku for background tasks, set `ANTHROPIC_DEFAULT_HAIKU_MODEL` to a model ID that is available in your account. To customize models further, use one of these methods: # Using inference profile ID export ANTHROPIC_MODEL='us.anthropic.claude-sonnet-4-6' @@ -201,7 +201,7 @@ The 1-hour cache TTL is billed at a higher rate than the 5-minute default. See [cache lifetime](</docs/en/prompt-caching#cache-lifetime>). -Prompt caching may not be available in all Bedrock regions. If cache token counts stay at zero, check [supported models, regions, and limits](<https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html#prompt-caching-models>) in the Bedrock documentation. +Prompt caching may not be available in all Amazon Bedrock regions. If cache token counts stay at zero, check [supported models, regions, and limits](<https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html#prompt-caching-models>) in the Amazon Bedrock documentation. #### @@ -220,7 +220,7 @@ } } -When a user selects one of these versions in `/model`, Claude Code calls Bedrock with the mapped ARN. Versions without an override fall back to the built-in Bedrock model ID or any matching inference profile discovered at startup. See [Override model IDs per version](</docs/en/model-config#override-model-ids-per-version>) for details on how overrides interact with `availableModels` and other model settings. +When a user selects one of these versions in `/model`, Claude Code calls Amazon Bedrock with the mapped ARN. The same mapping applies when you pass the Anthropic model ID directly through `--model` or `ANTHROPIC_MODEL`. Versions without an override fall back to the built-in Amazon Bedrock model ID or any matching inference profile discovered at startup. Before v2.1.200, `--model` and `ANTHROPIC_MODEL` values reached Amazon Bedrock as-is without going through the override map. See [Override model IDs per version](</docs/en/model-config#override-model-ids-per-version>) for details on how overrides interact with `availableModels` and other model settings. ## @@ -228,7 +228,7 @@ Startup model checks -When Claude Code starts with Bedrock configured, it verifies that the models it intends to use are accessible in your account. This check requires Claude Code v2.1.94 or later. If you have pinned a model version that is older than the current Claude Code default, and your account can invoke the newer version, Claude Code prompts you to update the pin. Accepting writes the new model ID to your [user settings file](</docs/en/settings>) and restarts Claude Code. Declining is remembered until the next default version change. Pins that point to an application inference profile ARN are skipped, since those are managed by your administrator. If you have not pinned a model and the current default is unavailable in your account, Claude Code falls back to the previous version for the current session and shows a notice. The fallback is not persisted. Enable the newer model in your Bedrock account or pin a version to make the choice permanent. +When Claude Code starts with Amazon Bedrock configured, it verifies that the models it intends to use are accessible in your account. This check requires Claude Code v2.1.94 or later. If you have pinned a model version that is older than the current Claude Code default, and your account can invoke the newer version, Claude Code prompts you to update the pin. Accepting writes the new model ID to your [user settings file](</docs/en/settings>) and restarts Claude Code. Declining is remembered until the next default version change. Pins that point to an application inference profile ARN are skipped, since those are managed by your administrator. If you have not pinned a model and the current default is unavailable in your account, Claude Code falls back to the previous version for the current session and shows a notice. The fallback is not persisted. Enable the newer model in your Amazon Bedrock account or pin a version to make the choice permanent. ## @@ -273,7 +273,7 @@ ] } -For more restrictive permissions, you can limit the Resource to specific inference profile ARNs. `bedrock:GetInferenceProfile` lets Claude Code resolve an application inference profile ARN to its backing foundation model, which is used to select the correct request shape for that model. If the token is missing this permission, Claude Code recovers automatically by retrying once with the alternate shape, so requests still succeed but each new model adds an extra round-trip. Granting the permission avoids the retry. This applies most often to `AWS_BEARER_TOKEN_BEDROCK` deployments, where the token’s policy is typically narrower than a full IAM role. For details, see [Bedrock IAM documentation](<https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html>). +For more restrictive permissions, you can limit the Resource to specific inference profile ARNs. `bedrock:GetInferenceProfile` lets Claude Code resolve an application inference profile ARN to its backing foundation model, which is used to select the correct request shape for that model. If the token is missing this permission, Claude Code recovers automatically by retrying once with the alternate shape, so requests still succeed but each new model adds an extra round-trip. Granting the permission avoids the retry. This applies most often to `AWS_BEARER_TOKEN_BEDROCK` deployments, where the token’s policy is typically narrower than a full IAM role. For details, see [Amazon Bedrock IAM documentation](<https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html>). Create a dedicated AWS account for Claude Code to simplify cost tracking and access control. @@ -317,7 +317,7 @@ Use the Mantle endpoint -Mantle is an Amazon Bedrock endpoint that serves Claude models through the native Anthropic API shape rather than the Bedrock Invoke API. It uses the same AWS credentials, IAM permissions, and `awsAuthRefresh` configuration described earlier on this page. +Mantle is an Amazon Bedrock endpoint that serves Claude models through the native Anthropic API shape rather than the Amazon Bedrock Invoke API. It uses the same AWS credentials, IAM permissions, and `awsAuthRefresh` configuration described earlier on this page. Mantle requires Claude Code v2.1.94 or later. Run `claude --version` to check. @@ -332,7 +332,7 @@ export CLAUDE_CODE_USE_MANTLE=1 export AWS_REGION=us-east-1 -Claude Code constructs the endpoint URL from the AWS region. As of v2.1.172, the region is resolved with the same precedence as Bedrock above; earlier versions use `AWS_REGION` only. To override the URL for a custom endpoint or gateway, set `ANTHROPIC_BEDROCK_MANTLE_BASE_URL`. Run `/status` inside Claude Code to confirm. The provider line shows `Amazon Bedrock (Mantle)` when Mantle is active. +Claude Code constructs the endpoint URL from the AWS region. As of v2.1.172, the region is resolved with the same precedence as Amazon Bedrock above; earlier versions use `AWS_REGION` only. To override the URL for a custom endpoint or gateway, set `ANTHROPIC_BEDROCK_MANTLE_BASE_URL`. Run `/status` inside Claude Code to confirm. The provider line shows `Amazon Bedrock (Mantle)` when Mantle is active. ### @@ -350,7 +350,7 @@ Run Mantle alongside the Invoke API -The models available to you on Mantle may not include every model you use today. Setting both `CLAUDE_CODE_USE_BEDROCK` and `CLAUDE_CODE_USE_MANTLE` lets Claude Code call both endpoints from the same session. Model IDs that match the Mantle format are routed to Mantle, and all other model IDs go to the Bedrock Invoke API. +The models available to you on Mantle may not include every model you use today. Setting both `CLAUDE_CODE_USE_BEDROCK` and `CLAUDE_CODE_USE_MANTLE` lets Claude Code call both endpoints from the same session. Model IDs that match the Mantle format are routed to Mantle, and all other model IDs go to the Amazon Bedrock Invoke API. export CLAUDE_CODE_USE_BEDROCK=1 export CLAUDE_CODE_USE_MANTLE=1 @@ -388,7 +388,7 @@ `CLAUDE_CODE_USE_MANTLE`| Enable the Mantle endpoint. Set to `1` or `true`. `ANTHROPIC_BEDROCK_MANTLE_BASE_URL`| Override the default Mantle endpoint URL `CLAUDE_CODE_SKIP_MANTLE_AUTH`| Skip client-side authentication for proxy setups -`ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION`| Override AWS region for the Haiku-class model (shared with Bedrock) +`ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION`| Override AWS region for the Haiku-class model (shared with Amazon Bedrock) ## @@ -420,7 +420,7 @@ * Specify the model as an [inference profile](<https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html>) ID -Claude Code uses the Bedrock [Invoke API](<https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html>) and does not support the Converse API. +Claude Code uses the Amazon Bedrock [Invoke API](<https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html>) and does not support the Converse API. ### @@ -428,7 +428,7 @@ Zero token counts in /context -The `/context` command counts tokens for each tool group by sending the tool schemas to the Bedrock count-tokens API. On Claude Code versions before v2.1.196, Bedrock rejected that request because the schemas carried fields its count-tokens API doesn’t accept, so every tool group showed 0 tokens. Other rows in the breakdown, such as messages and memory files, aren’t affected. Update to v2.1.196 or later. +The `/context` command counts tokens for each tool group by sending the tool schemas to the Amazon Bedrock count-tokens API. On Claude Code versions before v2.1.196, Amazon Bedrock rejected that request because the schemas carried fields its count-tokens API doesn’t accept, so every tool group showed 0 tokens. Other rows in the breakdown, such as messages and memory files, aren’t affected. Update to v2.1.196 or later. ### @@ -436,7 +436,7 @@ Mantle endpoint errors -If `/status` does not show `Amazon Bedrock (Mantle)` after you set `CLAUDE_CODE_USE_MANTLE`, the variable is not reaching the process. Confirm it is exported in the shell where you launched `claude`, or set it in the `env` block of your [settings file](</docs/en/settings>). A `403` from the Mantle endpoint with valid credentials means your AWS account has not been granted access to the model you requested. Contact your AWS account team to request access. A `400` that names the model ID means that model is not served on Mantle. Mantle has its own model lineup separate from the standard Bedrock catalog, so inference profile IDs such as `us.anthropic.claude-sonnet-4-6` will not work. Use a Mantle-format ID, or enable both endpoints so Claude Code routes each request to the endpoint where the model is available. +If `/status` does not show `Amazon Bedrock (Mantle)` after you set `CLAUDE_CODE_USE_MANTLE`, the variable is not reaching the process. Confirm it is exported in the shell where you launched `claude`, or set it in the `env` block of your [settings file](</docs/en/settings>). A `403` from the Mantle endpoint with valid credentials means your AWS account has not been granted access to the model you requested. Contact your AWS account team to request access. A `400` that names the model ID means that model is not served on Mantle. Mantle has its own model lineup separate from the standard Amazon Bedrock catalog, so inference profile IDs such as `us.anthropic.claude-sonnet-4-6` will not work. Use a Mantle-format ID, or enable both endpoints so Claude Code routes each request to the endpoint where the model is available. ## @@ -444,9 +444,9 @@ Additional resources - * [Bedrock documentation](<https://docs.aws.amazon.com/bedrock/>) - * [Bedrock pricing](<https://aws.amazon.com/bedrock/pricing/>) - * [Bedrock inference profiles](<https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html>) - * [Bedrock token burndown and quotas](<https://docs.aws.amazon.com/bedrock/latest/userguide/quotas-token-burndown.html>) + * [Amazon Bedrock documentation](<https://docs.aws.amazon.com/bedrock/>) + * [Amazon Bedrock pricing](<https://aws.amazon.com/bedrock/pricing/>) + * [Amazon Bedrock inference profiles](<https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html>) + * [Amazon Bedrock token burndown and quotas](<https://docs.aws.amazon.com/bedrock/latest/userguide/quotas-token-burndown.html>) * [Claude Code on Amazon Bedrock: Quick Setup Guide](<https://community.aws/content/2tXkZKrZzlrlu0KfH8gST5Dkppq/claude-code-on-amazon-bedrock-quick-setup-guide>) - * [Claude Code Monitoring Implementation (Bedrock)](<https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md>) + * [Claude Code Monitoring Implementation (Amazon Bedrock)](<https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md>)
modified Share session output as artifacts View current →
--- a/artifacts.md +++ b/artifacts.md @@ -170,7 +170,7 @@ ---|--- Plan| Pro, Max, Team, or Enterprise. On Pro and Max plans, artifacts are private to you, and no admin management applies. On Team plans, artifacts are on by default. On Enterprise plans, an Owner enables them in claude.ai admin settings. Authentication| Signed in to claude.ai with `/login`. Sessions using an API key, [gateway token](</docs/en/llm-gateway>), or cloud-provider credential cannot publish. -Model provider| Anthropic API. Not available on [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud Vertex AI](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>). +Model provider| Anthropic API. Not available on [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>). Organization policy| Customer-managed encryption keys (CMEK), HIPAA, and [Zero Data Retention](</docs/en/zero-data-retention>) are not enabled for the organization. Surface| Claude Code CLI, or the Claude desktop app version 1.13576.0 or later. Off by default in [Agent SDK](</docs/en/agent-sdk/overview>), GitHub Action, and MCP-server contexts, and when [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>) is set.
modified Authentication View current →
--- a/authentication.md +++ b/authentication.md @@ -1,4 +1,4 @@ -Claude Code supports multiple authentication methods depending on your setup. Individual users can log in with a Claude.ai account, while teams can use Claude for Teams or Enterprise, the Claude Console, or a cloud provider like Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. +Claude Code supports multiple authentication methods depending on your setup. Individual users can log in with a Claude.ai account, while teams can use Claude for Teams or Enterprise, the Claude Console, or a cloud provider like Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. ## @@ -11,7 +11,7 @@ * **Claude Pro or Max subscription** : log in with your Claude.ai account. Subscribe at [claude.com/pricing](<https://claude.com/pricing?utm_source=claude_code&utm_medium=docs&utm_content=authentication_pro_max>). * **Claude for Teams or Enterprise** : log in with the Claude.ai account your team admin invited you to. * **Claude Console** : log in with your Console credentials. Your admin must have invited you first. - * **Cloud providers** : if your organization uses [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>), set the required environment variables before running `claude`. No browser login is needed. + * **Cloud providers** : if your organization uses [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>), set the required environment variables before running `claude`. No browser login is needed. * **Cloud gateway** : if your organization runs a self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>), sign in with corporate SSO through `/login`. The gateway-issued token is the session’s only credential. To log out and re-authenticate, type `/logout` at the Claude Code prompt. If you’re having trouble logging in, see [authentication troubleshooting](</docs/en/troubleshoot-install#login-and-authentication>). @@ -28,7 +28,7 @@ * Claude Console * [Claude apps gateway](</docs/en/claude-apps-gateway>), a self-hosted gateway that signs developers in with your IdP and routes inference to the cloud provider you configure * [Amazon Bedrock](</docs/en/amazon-bedrock>) - * [Google Vertex AI](</docs/en/google-vertex-ai>) + * [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) * [Microsoft Foundry](</docs/en/microsoft-foundry>) ### @@ -109,13 +109,13 @@ Cloud provider authentication -For teams using Amazon Bedrock, Google Vertex AI, or Microsoft Foundry: +For teams using Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry: 1 Follow provider setup -Follow the [Bedrock docs](</docs/en/amazon-bedrock>), [Vertex docs](</docs/en/google-vertex-ai>), or [Microsoft Foundry docs](</docs/en/microsoft-foundry>). +Follow the [Amazon Bedrock docs](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform docs](</docs/en/google-vertex-ai>), or [Microsoft Foundry docs](</docs/en/microsoft-foundry>). 2 @@ -165,7 +165,7 @@ 5. `CLAUDE_CODE_OAUTH_TOKEN` environment variable. A long-lived OAuth token generated by `claude setup-token`. Use this for CI pipelines and scripts where browser login isn’t available. 6. Subscription OAuth credentials from `/login`. This is the default for Claude Pro, Max, Team, and Enterprise users. -A signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) session sits outside this list: it is a provider selection like Bedrock or Vertex, and it outranks them. When a gateway session exists, the CLI authenticates with the gateway token even if `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX`, or `CLAUDE_CODE_USE_FOUNDRY` is set, and the bearer token, API key, and `apiKeyHelper` entries above are not used. If you have an active Claude subscription but also have `ANTHROPIC_API_KEY` set in your environment, the API key takes precedence once approved. This can cause authentication failures if the key belongs to a disabled or expired organization. Run `unset ANTHROPIC_API_KEY` to fall back to your subscription, and check `/status` to confirm which method is active. [Claude Code on the Web](</docs/en/claude-code-on-the-web>) always uses your subscription credentials. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` in the sandbox environment do not override them. +A signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) session sits outside this list: it is a provider selection like Amazon Bedrock or Google Cloud’s Agent Platform, and it outranks them. When a gateway session exists, the CLI authenticates with the gateway token even if `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX`, or `CLAUDE_CODE_USE_FOUNDRY` is set, and the bearer token, API key, and `apiKeyHelper` entries above are not used. If you have an active Claude subscription but also have `ANTHROPIC_API_KEY` set in your environment, the API key takes precedence once approved. This can cause authentication failures if the key belongs to a disabled or expired organization. Run `unset ANTHROPIC_API_KEY` to fall back to your subscription, and check `/status` to confirm which method is active. [Claude Code on the Web](</docs/en/claude-code-on-the-web>) always uses your subscription credentials. `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` in the sandbox environment do not override them. ###
modified Configure auto mode View current →
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,6 +1,6 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. +Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. By default, the classifier trusts only the working directory and the current repo’s configured remotes. Actions like pushing to your company’s source-control org or writing to a team cloud bucket are blocked until you add them to `autoMode.environment`. For how to enable auto mode and what it blocks by default, see [Permission modes](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: @@ -42,7 +42,7 @@ * **Organization** * **Primary use of Claude Code** : defaults to software development * **Cloud provider(s)** - * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise + * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise, or something earlier in the session already showed it is public, such as a `gh repo view` result in the transcript. The transcript-evidence check requires Claude Code v2.1.200 or later * **Internal sharing / snippet hosting** : public paste and gist services are treated as outside the trust boundary until you name one * **Org-specific CLIs** * **Secrets management**
modified Claude Code changelog View current →
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,36 @@ 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.201 + +July 3, 2026 + + * Claude Sonnet 5 sessions no longer use the mid-conversation system role for harness reminders + +​ + +2.1.200 + +July 3, 2026 + + * Changed `AskUserQuestion` dialogs to no longer auto-continue by default; opt into an idle timeout via `/config` + * Changed the “default” permission mode to “Manual” across the CLI, `--help`, VS Code, and JetBrains; `--permission-mode manual` and `"defaultMode": "manual"` are accepted alongside `default` + * Fixed a crash at startup when `disabledMcpServers` or `enabledMcpServers` in `.claude.json` is set to a non-array value + * Fixed background sessions silently stopping mid-turn after sleep/wake or when reopening a stalled session + * Fixed background sessions re-running a turn cancelled with Esc after a stall respawn + * Fixed background agents never starting again after a crash left a stale `daemon.lock` whose PID the OS reused + * Fixed background-agent daemon handover so a reinstalled older build can no longer take over the daemon; build recency is now judged by the version’s embedded build timestamp + * Fixed background-agent roster issues: transient corruption permanently disabling orphan cleanup, older binaries not preserving fields written by newer versions, and socket auth tokens being stripped during daemon restarts + * Fixed subagents cut off by a rate limit before producing any text output returning an empty result instead of failing cleanly + * Fixed control bytes from background-agent output reaching the terminal in the agent view + * Fixed `claude agents --plugin-dir <dir>` not showing the plugin’s agents and skills in the agent view when the flag is placed after `agents` + * Fixed project-scoped plugins not loading correctly from git worktrees of the same repository + * Fixed `/mcp` server list not tracking focus for screen readers and magnifiers + * Fixed voice dictation showing a misleading “Voice connection failed” message when a recording captures no audio + * Fixed rendering flicker under tmux 3.4+ by enabling synchronized terminal output + * Improved screen-reader output: decorative glyphs are now hidden, transcript symbols read as short labels, and nested tables read as `Header: value.` lines + * Improved the install script to explain when installation is killed by the system running out of memory ​
modified Push events into a running session with channels View current →
--- a/channels.md +++ b/channels.md @@ -1,4 +1,4 @@ -Channels are in research preview and require Claude Code v2.1.80 or later. They require Anthropic authentication through claude.ai or a Console API key, and are not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. Team and Enterprise organizations must explicitly enable them. +Channels are in research preview and require Claude Code v2.1.80 or later. They require Anthropic authentication through claude.ai or a Console API key, and are not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. Team and Enterprise organizations must explicitly enable them. A channel is an MCP server that pushes events into your running Claude Code session, so Claude can react to things that happen while you’re not at the terminal. Channels can be two-way: Claude reads the event and replies back through the same channel, like a chat bridge. Events only arrive while the session is open, so for an always-on setup you run Claude in a background process or persistent terminal. Unlike integrations that spawn a fresh cloud session or wait to be polled, the event arrives in the session you already have open: see how channels compare. You install a channel as a plugin and configure it with your own credentials. Telegram, Discord, and iMessage are included in the research preview. When Claude replies through a channel, you see the inbound message in your terminal but not the reply text. The terminal shows the tool call and a confirmation (like “sent”), and the actual reply appears on the other platform. If you manage a Team, Enterprise, or Console organization, see Enable channels for your organization. To build your own channel, see the [Channels reference](</docs/en/channels-reference>).
modified Use Claude Code with Chrome View current →
--- a/chrome.md +++ b/chrome.md @@ -31,7 +31,7 @@ * [Claude Code](</docs/en/quickstart#step-1-install-claude-code>) version 2.0.73 or higher * A direct Anthropic plan (Pro, Max, Team, or Enterprise) -Chrome integration is not available through third-party providers like Amazon Bedrock, Google Cloud Vertex AI, or Microsoft Foundry. If you access Claude exclusively through a third-party provider, you need a separate claude.ai account to use this feature. +Chrome integration is not available through third-party providers like Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. If you access Claude exclusively through a third-party provider, you need a separate claude.ai account to use this feature. ##
modified Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry View current →
--- a/claude-apps-gateway.md +++ b/claude-apps-gateway.md @@ -21,7 +21,7 @@ * **Access control** : your IdP groups map to model allowlists and [managed settings](</docs/en/permissions#managed-settings>) policies. The gateway enforces model access server-side, rejecting requests for non-granted models, and selects each group’s managed settings policy, which the CLI applies at the [managed settings tier](</docs/en/settings#settings-precedence>). Different teams get different models, tools, and permissions, and a developer can’t override what their policy locks. * **Settings delivery** : the gateway delivers managed settings to signed-in clients itself, taking the place of [server-managed settings](</docs/en/server-managed-settings>) from the claude.ai admin console. * **Telemetry** : each configured destination, such as Datadog, Splunk, or ClickHouse, receives [OpenTelemetry Protocol (OTLP) metrics](</docs/en/monitoring-usage>) with token counts, model, user identity, and latency by default, with logs and traces as per-destination opt-ins. - * **Upstream routing** : clients speak the Anthropic Messages API to the gateway, and the gateway translates for each upstream, whether Bedrock, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Google Cloud’s Agent Platform, Foundry, or the Anthropic API, with failover between them. You can change regions, providers, or failover order without developers noticing or reconfiguring. + * **Upstream routing** : clients speak the Anthropic Messages API to the gateway, and the gateway translates for each upstream, whether Amazon Bedrock, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Google Cloud’s Agent Platform, Microsoft Foundry, or the Anthropic API, with failover between them. You can change regions, providers, or failover order without developers noticing or reconfiguring. The gateway’s own data plane sends nothing to Anthropic infrastructure unless the Anthropic API is a configured upstream. You control where telemetry, audit logs, managed settings, and your developers’ IdP identity go, and the gateway sends none of them to Anthropic. For the remaining traffic the CLI process can send and how to close it, see [Compliance posture](</docs/en/claude-apps-gateway-deploy#compliance-posture>). @@ -41,7 +41,7 @@ Quickstart -This quickstart walks the minimal path: register an OAuth client in your IdP, write a `gateway.yaml`, run the gateway alongside Postgres with Docker Compose, and verify sign-in end to end. It uses an Amazon Bedrock upstream; Claude Platform on AWS, Google Cloud’s Agent Platform, Foundry, and the Anthropic API are equally supported by swapping the `upstreams` block as shown in the [configuration reference](</docs/en/claude-apps-gateway-config#upstreams>). At the end you have a gateway a developer can `/login` to. +This quickstart walks the minimal path: register an OAuth client in your IdP, write a `gateway.yaml`, run the gateway alongside Postgres with Docker Compose, and verify sign-in end to end. It uses an Amazon Bedrock upstream; Claude Platform on AWS, Google Cloud’s Agent Platform, Microsoft Foundry, and the Anthropic API are equally supported by swapping the `upstreams` block as shown in the [configuration reference](</docs/en/claude-apps-gateway-config#upstreams>). At the end you have a gateway a developer can `/login` to. **Deploy on your private network.** Claude Code only connects to a gateway whose address is private. This is a security guard, because a trusted gateway can push settings that run commands on developer machines. Put the gateway behind an internal load balancer or VPN and give it a hostname that resolves to private IPs only. @@ -124,9 +124,9 @@ # expose only specific models. auto_include_builtin_models: true -This config is enough for a working sign-in loop with the default Bedrock model catalog. Once it’s running, add per-group RBAC and managed settings via [`managed.policies`](</docs/en/claude-apps-gateway-config#managed>), telemetry fan-out via [`telemetry`](</docs/en/claude-apps-gateway-config#telemetry>), and multi-upstream failover, provisioned-throughput ARNs, or non-US regions via [`models`](</docs/en/claude-apps-gateway-config#models>). - -The Bedrock upstream needs an AWS principal with `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream` on both the `inference-profile/us.anthropic.*` ARNs and the underlying `foundation-model/anthropic.*` ARNs, and model access enabled in the Bedrock console for the Claude models you want. Supply the credential with IRSA on EKS, an ECS task role, or an EC2 instance profile rather than static keys. The [`upstreams` reference](</docs/en/claude-apps-gateway-config#upstreams>) has the full IAM details, the cross-cloud credential matrix, and the `auth` blocks for the other providers. +This config is enough for a working sign-in loop with the default Amazon Bedrock model catalog. Once it’s running, add per-group RBAC and managed settings via [`managed.policies`](</docs/en/claude-apps-gateway-config#managed>), telemetry fan-out via [`telemetry`](</docs/en/claude-apps-gateway-config#telemetry>), and multi-upstream failover, provisioned-throughput ARNs, or non-US regions via [`models`](</docs/en/claude-apps-gateway-config#models>). + +The Amazon Bedrock upstream needs an AWS principal with `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream` on both the `inference-profile/us.anthropic.*` ARNs and the underlying `foundation-model/anthropic.*` ARNs, and model access enabled in the Amazon Bedrock console for the Claude models you want. Supply the credential with IRSA on EKS, an ECS task role, or an EC2 instance profile rather than static keys. The [`upstreams` reference](</docs/en/claude-apps-gateway-config#upstreams>) has the full IAM details, the cross-cloud credential matrix, and the `auth` blocks for the other providers. 4 @@ -162,7 +162,7 @@ volumes: ["pgdata:/var/lib/postgresql/data"] volumes: { pgdata: } -The gateway is a single Linux binary that reads the config, runs OIDC discovery against your IdP, applies its Postgres schema migrations, builds upstream clients, and starts listening. Boot is fail-closed for the config, the Postgres connection with a 5-second timeout, OIDC discovery, and upstream client construction. If any of those is unreachable or misconfigured, the gateway exits with an error rather than serving traffic in a degraded state.A successful boot doesn’t validate the inference path, because Bedrock and Agent Platform instance credentials resolve on the first request, not at boot.Watch stderr for the boot sequence. Log lines use the format `[gateway] <timestamp> <level> <message>`, audit events are single-line JSON with an `evt` field, and a startup banner, omitted below, prints between the migration and listening lines. You should see, in order: +The gateway is a single Linux binary that reads the config, runs OIDC discovery against your IdP, applies its Postgres schema migrations, builds upstream clients, and starts listening. Boot is fail-closed for the config, the Postgres connection with a 5-second timeout, OIDC discovery, and upstream client construction. If any of those is unreachable or misconfigured, the gateway exits with an error rather than serving traffic in a degraded state.A successful boot doesn’t validate the inference path, because Amazon Bedrock and Google Cloud’s Agent Platform instance credentials resolve on the first request, not at boot.Watch stderr for the boot sequence. Log lines use the format `[gateway] <timestamp> <level> <message>`, audit events are single-line JSON with an `evt` field, and a startup banner, omitted below, prints between the migration and listening lines. You should see, in order: {"ts":"2026-06-10T17:03:21.114Z","evt":"config.load","path":"/etc/claude/gateway.yaml","sha256":"…"} [gateway] 2026-06-10T17:03:21.408Z info migration 1 applied @@ -278,11 +278,11 @@ Availability and limitations -The table covers which Claude Code features work when developers connect through the gateway, and what the gateway server itself supports. Where something isn’t supported, the Notes column gives the alternative. The gateway delivers the [`anthropic-beta`](<https://platform.claude.com/docs/en/api/beta-headers>) values the CLI sends to every upstream, so operators don’t maintain a beta allowlist. For Bedrock, which ignores the header, the gateway moves the values into the request body’s `anthropic_beta` field; the other upstreams receive the header as sent. The CLI’s gateway-session beta set omits first-party-only betas and the extended-cache-ttl beta, which is why those rows below show as not available. +The table covers which Claude Code features work when developers connect through the gateway, and what the gateway server itself supports. Where something isn’t supported, the Notes column gives the alternative. The gateway delivers the [`anthropic-beta`](<https://platform.claude.com/docs/en/api/beta-headers>) values the CLI sends to every upstream, so operators don’t maintain a beta allowlist. For Amazon Bedrock, which ignores the header, the gateway moves the values into the request body’s `anthropic_beta` field; the other upstreams receive the header as sent. The CLI’s gateway-session beta set omits first-party-only betas and the extended-cache-ttl beta, which is why those rows below show as not available. Feature| Status| Notes ---|---|--- -Inference forwarding (Bedrock, Claude Platform on AWS, Agent Platform, Foundry, Anthropic)| Available| With per-upstream model translation and failover. The Bedrock upstream uses the `bedrock-runtime` endpoint and the AWS default credential chain; the Bedrock [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is not a supported upstream. The [Claude Platform on AWS upstream](</docs/en/claude-apps-gateway-config#claude-platform-on-aws>) requires Claude Code v2.1.198 or later on the gateway server. +Inference forwarding (Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, Microsoft Foundry, Anthropic)| Available| With per-upstream model translation and failover. The Amazon Bedrock upstream uses the `bedrock-runtime` endpoint and the AWS default credential chain; the Amazon Bedrock [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is not a supported upstream. The [Claude Platform on AWS upstream](</docs/en/claude-apps-gateway-config#claude-platform-on-aws>) requires Claude Code v2.1.198 or later on the gateway server. Model access and managed settings by IdP group| Available| Model access is enforced server-side; managed settings are delivered per IdP group and applied by the CLI at the [managed settings tier](</docs/en/settings#settings-precedence>) Telemetry fan-out (OTLP/HTTP)| Available| Identity-stamped per export; both protobuf and JSON encodings OIDC identity providers| Available| Any OIDC-compliant IdP; the gateway runs standard OIDC discovery and the authorization-code flow. See [Identity provider setup](</docs/en/claude-apps-gateway-deploy#identity-provider-setup>) for per-IdP configuration @@ -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 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-agent-platform-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
modified Claude apps gateway configuration View current →
Show diff (106 lines)
--- a/claude-apps-gateway-config.md +++ b/claude-apps-gateway-config.md @@ -12,7 +12,7 @@ * `oidc`: your identity provider (IdP), including issuer, client, claim mapping, and who may sign in * `session`: the bearer tokens the gateway mints, with secret and lifetime * `store`: PostgreSQL, for device grants and rate-limit counters - * `upstreams`: where inference goes, whether Anthropic, Bedrock, Claude Platform on AWS, Agent Platform, or Foundry + * `upstreams`: where inference goes, whether Anthropic, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry **Optional sections:** @@ -123,7 +123,7 @@ `upstreams` -`upstreams` is an ordered list. The gateway forwards inference to the first upstream that resolves the requested model. On `5xx`, `429`, `401`, `403`, `404`, or timeout it fails over to the next; other `4xx` doesn’t, because those errors are attributable to the request rather than the upstream. A `401` or `403` means the gateway’s own credential failed against that upstream, and a `404` means that upstream doesn’t serve the requested model, so a later upstream in the list still can. Failover on `404` requires gateway v2.1.198 or later. Earlier releases returned the first `404` to the client even when a later upstream in the list served the model. Multiple upstreams of the same provider must set a distinct `name:`. Bedrock, Claude Platform on AWS, Agent Platform, and Foundry clients are built once at startup, and their SDKs refresh credentials internally, so rotating cloud credentials doesn’t require a restart. Static Anthropic API keys and bearers are read at startup; see Anthropic API. +`upstreams` is an ordered list. The gateway forwards inference to the first upstream that resolves the requested model. On `5xx`, `429`, `401`, `403`, `404`, or timeout it fails over to the next; other `4xx` doesn’t, because those errors are attributable to the request rather than the upstream. A `401` or `403` means the gateway’s own credential failed against that upstream, and a `404` means that upstream doesn’t serve the requested model, so a later upstream in the list still can. Failover on `404` requires gateway v2.1.198 or later. Earlier releases returned the first `404` to the client even when a later upstream in the list served the model. Multiple upstreams of the same provider must set a distinct `name:`. Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry clients are built once at startup, and their SDKs refresh credentials internally, so rotating cloud credentials doesn’t require a restart. Static Anthropic API keys and bearers are read at startup; see Anthropic API. #### @@ -163,7 +163,7 @@ Amazon Bedrock -For the client-side Bedrock deployment that the gateway replaces or fronts, see [Claude Code on Amazon Bedrock](</docs/en/amazon-bedrock>). The gateway-side upstream: +For the client-side Amazon Bedrock deployment that the gateway replaces or fronts, see [Claude Code on Amazon Bedrock](</docs/en/amazon-bedrock>). The gateway-side upstream: upstreams: - provider: bedrock @@ -185,7 +185,7 @@ Setup| How ---|--- IAM permissions| Grant the gateway’s principal `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream` on both the inference-profile ARNs and the underlying foundation-model ARNs. For the built-in catalog in US regions: `arn:aws:bedrock:<region>:<account>:inference-profile/us.anthropic.*` and `arn:aws:bedrock:*::foundation-model/anthropic.*`. -Model access| In the Bedrock console, per region, request and enable model access for the Claude models you want. Cross-region inference profiles (`us.anthropic.*`) require model access in each region the profile spans. +Model access| In the Amazon Bedrock console, per region, request and enable model access for the Claude models you want. Cross-region inference profiles (`us.anthropic.*`) require model access in each region the profile spans. EKS (IRSA)| Create an IAM role with the policy above and a trust policy for your cluster’s OIDC provider scoped to the gateway’s service account. Annotate the service account with `eks.amazonaws.com/role-arn: arn:aws:iam::<acct>:role/claude-gateway`. `auth: {}` picks it up. ECS / EC2| Attach the IAM role to the task definition or instance profile. `auth: {}` picks it up. Anywhere else| Pass credentials via the `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` env vars, or set them explicitly in `auth:` with `${VAR}` expansion @@ -244,11 +244,11 @@ # Override the aiplatform endpoint for Private Service Connect: # base_url: https://us-east5-aiplatform.p.googleapis.com -An empty `auth` block uses Application Default Credentials: `GOOGLE_APPLICATION_CREDENTIALS`, GCE metadata, or GKE Workload Identity. Service-account JSON key files are supported but discouraged; use Workload Identity or attach a service account to the GCE or Cloud Run instance. Set `region: global` to use [Agent Platform’s global endpoint](<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations>) instead of a regional one. Google then routes each request to an available region, so you don’t track per-region model availability. Setting a specific region pins every request to it. +An empty `auth` block uses Application Default Credentials: `GOOGLE_APPLICATION_CREDENTIALS`, GCE metadata, or GKE Workload Identity. Service-account JSON key files are supported but discouraged; use Workload Identity or attach a service account to the GCE or Cloud Run instance. Set `region: global` to use the [global endpoint for Google Cloud’s Agent Platform](<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations>) instead of a regional one. Google then routes each request to an available region, so you don’t track per-region model availability. Setting a specific region pins every request to it. Setup| How ---|--- -IAM permissions| Grant the gateway’s service account `roles/aiplatform.user` on the project, or a custom role with `aiplatform.endpoints.predict`. Enable the Agent Platform API (`aiplatform.googleapis.com`). +IAM permissions| Grant the gateway’s service account `roles/aiplatform.user` on the project, or a custom role with `aiplatform.endpoints.predict`. Enable Google Cloud’s Agent Platform API (`aiplatform.googleapis.com`). Model access| In Model Garden, enable the Claude models for your project. They publish to specific regions; check the model card for supported regions. GKE (Workload Identity)| Bind a GCP service account to the gateway’s Kubernetes service account and annotate the KSA with `iam.gke.io/gcp-service-account: claude-gateway@<proj>.iam.gserviceaccount.com`. `auth: {}` picks it up. Cloud Run / GCE| Set the service’s service account to one with `roles/aiplatform.user`. `auth: {}` picks it up. @@ -260,7 +260,7 @@ Microsoft Foundry -For the client-side Foundry deployment, see [Claude Code on Microsoft Foundry](</docs/en/microsoft-foundry>). The gateway-side upstream: +For the client-side Microsoft Foundry deployment, see [Claude Code on Microsoft Foundry](</docs/en/microsoft-foundry>). The gateway-side upstream: upstreams: - provider: foundry @@ -270,12 +270,12 @@ # auth: # api_key: ${FOUNDRY_API_KEY} -`use_azure_ad: true` resolves through `DefaultAzureCredential`: Managed Identity on AKS, ACI, or App Service; the Azure CLI; or environment credentials. API keys work but are project-wide and don’t rotate automatically. Foundry’s endpoint is derived from `resource:`; set the optional `base_url` to override it for sovereign clouds such as Azure Government. +`use_azure_ad: true` resolves through `DefaultAzureCredential`: Managed Identity on AKS, ACI, or App Service; the Azure CLI; or environment credentials. API keys work but are project-wide and don’t rotate automatically. Microsoft Foundry’s endpoint is derived from `resource:`; set the optional `base_url` to override it for sovereign clouds such as Azure Government. Setup| How ---|--- -RBAC| Grant the gateway’s identity `Azure AI User` or `Cognitive Services User` on the Foundry resource -Deployments| Foundry uses admin-chosen deployment names, not canonical model IDs. Add a `models:` block mapping each canonical ID to your deployment name. +RBAC| Grant the gateway’s identity `Azure AI User` or `Cognitive Services User` on the Microsoft Foundry resource +Deployments| Microsoft Foundry uses admin-chosen deployment names, not canonical model IDs. Add a `models:` block mapping each canonical ID to your deployment name. AKS (workload identity)| Federate a User-Assigned Managed Identity with the cluster’s OIDC issuer and bind it to the gateway’s service account. `use_azure_ad: true` picks it up via `WorkloadIdentityCredential`. ACI / App Service| Enable system-assigned or user-assigned managed identity on the resource. `use_azure_ad: true` picks it up. Anywhere else| `auth: { api_key: "${FOUNDRY_API_KEY}" }`. Quote `${…}` inside `{ }`. @@ -286,7 +286,7 @@ Multiple upstreams -The same provider can appear more than once with a distinct `name:`. This covers different regions, different accounts via different credential chains, provisioned throughput versus on-demand, and cross-provider fallback. The gateway tries upstreams in order. `5xx`, `429`, `401`, `403`, `404`, timeouts, and missing-endpoint (`501`) fail over; other `4xx` doesn’t. `429` is per-upstream capacity, so provisioned-throughput (PT) exhaustion fails over to on-demand. `404` is per-upstream model availability, so an upstream that hasn’t enabled a model doesn’t block a later upstream that serves it. An upstream that can’t resolve the requested model is skipped without a network round-trip. This example routes a provisioned-throughput Bedrock allotment first, overflows to on-demand and a second account, and falls back to the Anthropic API last: +The same provider can appear more than once with a distinct `name:`. This covers different regions, different accounts via different credential chains, provisioned throughput versus on-demand, and cross-provider fallback. The gateway tries upstreams in order. `5xx`, `429`, `401`, `403`, `404`, timeouts, and missing-endpoint (`501`) fail over; other `4xx` doesn’t. `429` is per-upstream capacity, so provisioned-throughput (PT) exhaustion fails over to on-demand. `404` is per-upstream model availability, so an upstream that hasn’t enabled a model doesn’t block a later upstream that serves it. An upstream that can’t resolve the requested model is skipped without a network round-trip. This example routes a provisioned-throughput Amazon Bedrock allotment first, overflows to on-demand and a second account, and falls back to the Anthropic API last: upstreams: # Primary: provisioned throughput in your home region. @@ -327,8 +327,8 @@ Lever| How ---|--- -Different regions| One Bedrock upstream per region, each with its own `region:`. With `auto_include_builtin_models: true` the cross-region inference profiles route automatically; for region-pinned deployments use a `models:` block. -Different accounts| One Bedrock upstream per account, each with its own credentials in `auth:`. The default chain (`auth: {}`) uses the pod’s identity; for a second account, set explicit credentials or a bearer token. +Different regions| One Amazon Bedrock upstream per region, each with its own `region:`. With `auto_include_builtin_models: true` the cross-region inference profiles route automatically; for region-pinned deployments use a `models:` block. +Different accounts| One Amazon Bedrock upstream per account, each with its own credentials in `auth:`. The default chain (`auth: {}`) uses the pod’s identity; for a second account, set explicit credentials or a bearer token. Provisioned throughput| Map the model to the provisioned-throughput ARN in `models:` for that upstream’s name. Other upstreams keep the on-demand ID, so PT capacity is exhausted before failing over. VPC / FIPS endpoints| Set `base_url:` on the upstream to your VPC endpoint or FIPS endpoint URL Model-scoped routing| Omit an upstream from a model’s `upstream_model:` map and that upstream is skipped for that model. For example, route Opus to provisioned throughput and Sonnet and Haiku to on-demand. @@ -392,7 +392,7 @@ `models` -The `models` block is an optional admin-curated model list, served at `/v1/models` and used to translate model IDs per upstream. It is required for non-US Bedrock regions, Bedrock provisioned-throughput ARNs, and Foundry deployment names. +The `models` block is an optional admin-curated model list, served at `/v1/models` and used to translate model IDs per upstream. It is required for non-US Amazon Bedrock regions, Amazon Bedrock provisioned-throughput ARNs, and Microsoft Foundry deployment names. auto_include_builtin_models: true # false: expose only the list below models:
modified Claude apps gateway deployment and operations View current →
--- a/claude-apps-gateway-deploy.md +++ b/claude-apps-gateway-deploy.md @@ -76,7 +76,7 @@ * Terminate TLS at the Ingress and set `listen.public_url` to the Ingress hostname * Point the readiness probe at `GET /readyz` and the liveness probe at `GET /healthz` -**Workload identity** Prefer the platform’s workload identity over static keys: IRSA on EKS for Bedrock and for Claude Platform on AWS, Workload Identity on GKE for Agent Platform, and workload identity on AKS for Foundry. Set `auth: {}` in the upstream block, or `use_azure_ad: true` for Foundry, and the gateway picks up the pod’s identity through that provider’s default credential chain. For a cross-cloud pairing, such as a Bedrock upstream on GKE, set explicit credentials in the upstream’s `auth` block instead. The [`upstreams` reference](</docs/en/claude-apps-gateway-config#upstreams>) has per-platform setup details. +**Workload identity** Prefer the platform’s workload identity over static keys: IRSA on EKS for Amazon Bedrock and for Claude Platform on AWS, Workload Identity on GKE for Google Cloud’s Agent Platform, and workload identity on AKS for Microsoft Foundry. Set `auth: {}` in the upstream block, or `use_azure_ad: true` for Microsoft Foundry, and the gateway picks up the pod’s identity through that provider’s default credential chain. For a cross-cloud pairing, such as an Amazon Bedrock upstream on GKE, set explicit credentials in the upstream’s `auth` block instead. The [`upstreams` reference](</docs/en/claude-apps-gateway-config#upstreams>) has per-platform setup details. ### @@ -275,7 +275,7 @@ Boot exits with a Postgres permission error| App role lacks `CREATE TABLE`| Pre-create the schema with an admin role and grant DML to the app role, or grant DDL temporarily for boots that apply new migrations `/oauth/callback` shows “Sign-in could not be completed”| Email domain rejected, id_token validation failed, or `email_verified` is explicitly `false`, which the gateway always rejects with no override| Check `allowed_email_domains` and that the IdP returns a verified `email` claim. For `email_verified: false`, fix the IdP-side verification. If your IdP emits email under a different claim name, set `oidc.email_claim`. Log: `token exchange failed: id_token missing email claim`| The IdP isn’t including `email` in the id_token by default. This rejection fires only when `allowed_email_domains` is set; without it, a missing email mints a session with no email| Configure the IdP to emit `email` in the id_token. Okta: add `email` to a custom authorization server’s ID-token claims. Entra: add `email` as an optional claim on the app registration. PingFederate: enable an OpenID Connect Policy that emits `email`. If the IdP serves `email` from the userinfo endpoint but won’t include it in the id_token, such as the Okta org authorization server, set `oidc.userinfo_fallback: true`. -Every Bedrock request returns 502; log shows `Could not load credentials from any providers`| On EC2, IMDSv2’s default hop limit of 1 blocks the instance-metadata request from inside the container. Boot and `/readyz` pass anyway because the AWS SDK resolves instance credentials on the first request, not at client construction| Raise the hop limit with `aws ec2 modify-instance-metadata-options --instance-id <id> --http-put-response-hop-limit 2`, or set it in the launch template. The change applies to every container on the instance. Prefer ECS task roles where available, which read credentials from the ECS container-credentials endpoint and avoid the change entirely, or apply the change on a dedicated gateway instance to limit the exposure. +Every Amazon Bedrock request returns 502; log shows `Could not load credentials from any providers`| On EC2, IMDSv2’s default hop limit of 1 blocks the instance-metadata request from inside the container. Boot and `/readyz` pass anyway because the AWS SDK resolves instance credentials on the first request, not at client construction| Raise the hop limit with `aws ec2 modify-instance-metadata-options --instance-id <id> --http-put-response-hop-limit 2`, or set it in the launch template. The change applies to every container on the instance. Prefer ECS task roles where available, which read credentials from the ECS container-credentials endpoint and avoid the change entirely, or apply the change on a dedicated gateway instance to limit the exposure. IdP error: unknown or unsupported scope| The IdP rejects scopes it doesn’t recognize| Set `oidc.scopes` to exactly the list your IdP accepts; it must include `openid`. The default is `openid profile email offline_access`. Sessions don’t silently renew after setting `oidc.scopes`| `offline_access` was dropped from the override| Add `offline_access` back if your IdP supports it. Without a refresh token, developers re-run the browser login every `session.ttl_hours`. Browser shows “This request came from another site and was blocked”| Cross-site form POST, blocked as CSRF protection. Expected for embedded or proxied pages| Open the verification link directly
modified Deploy Claude apps gateway on Google Cloud View current →
--- a/claude-apps-gateway-on-gcp.md +++ b/claude-apps-gateway-on-gcp.md @@ -72,7 +72,7 @@ Create the service account and grant IAM -The gateway runs as a dedicated service account with permission to call Agent Platform. It reaches Cloud SQL over the VPC with a password user, so no Cloud SQL IAM role is required: +The gateway runs as a dedicated service account with permission to call Google Cloud’s Agent Platform. It reaches Cloud SQL over the VPC with a password user, so no Cloud SQL IAM role is required: gcloud iam service-accounts create claude-gateway --display-name="Claude apps gateway" SA="claude-gateway@${PROJECT_ID}.iam.gserviceaccount.com" @@ -133,7 +133,7 @@ Write gateway.yaml -The `upstreams` block points at Agent Platform with `auth: {}`, so the gateway authenticates via Application Default Credentials from the runtime service account. See the [configuration reference](</docs/en/claude-apps-gateway-config>) for every field.Two `listen` fields depend on what fronts the gateway: +The `upstreams` block points at Google Cloud’s Agent Platform with `auth: {}`, so the gateway authenticates via Application Default Credentials from the runtime service account. See the [configuration reference](</docs/en/claude-apps-gateway-config>) for every field.Two `listen` fields depend on what fronts the gateway: * `public_url`: required behind Cloud Run or a GKE Ingress. The gateway builds the IdP `redirect_uri` and its discovery document only from this value, never from `X-Forwarded-*` headers. * `trusted_proxies`: the front end’s source ranges. The gateway honors `X-Forwarded-For` only when the TCP peer is in this list, then walks the chain past trusted hops, so per-IP sign-in rate limits and audit events record developer IPs instead of the load balancer’s. @@ -218,7 +218,7 @@ --set-secrets=/etc/claude/gateway.yaml=gateway-config:latest,GATEWAY_JWT_SECRET=gateway-jwt-secret:latest,OIDC_CLIENT_SECRET=gateway-oidc-client-secret:latest,GATEWAY_POSTGRES_URL=gateway-postgres-url:latest \ --no-invoker-iam-check -Direct VPC egress, via `--network`, `--subnet`, and `--vpc-egress=private-ranges-only`, lets the service reach the Cloud SQL private IP directly. Public egress to the Agent Platform endpoints and `accounts.google.com` goes directly to the internet rather than through the VPC, so no Cloud NAT is needed.The invoker IAM check must be open or disabled. The gateway runs its own OIDC and its clients carry no GCP token, so Cloud Run’s invoker check has to admit unauthenticated requests. The gateway’s OIDC sign-in authenticates the request once it reaches the container, with `allowed_email_domains` gating which domains may sign in.Two flags admit unauthenticated requests: +Direct VPC egress, via `--network`, `--subnet`, and `--vpc-egress=private-ranges-only`, lets the service reach the Cloud SQL private IP directly. Public egress to Google Cloud’s Agent Platform endpoints and `accounts.google.com` goes directly to the internet rather than through the VPC, so no Cloud NAT is needed.The invoker IAM check must be open or disabled. The gateway runs its own OIDC and its clients carry no GCP token, so Cloud Run’s invoker check has to admit unauthenticated requests. The gateway’s OIDC sign-in authenticates the request once it reaches the container, with `allowed_email_domains` gating which domains may sign in.Two flags admit unauthenticated requests: * `--no-invoker-iam-check`: disables the check with no `allUsers` binding to manage, and works under Domain Restricted Sharing * `--allow-unauthenticated`: grants `allUsers` the `run.invoker` role; use it if your organization doesn’t allow `--no-invoker-iam-check` @@ -292,7 +292,7 @@ `--no-invoker-iam-check` rejected with `invoker_iam_disabled is not currently available`| Blocked by `constraints/run.managed.requireInvokerIam`| Use `--allow-unauthenticated`. If Domain Restricted Sharing via `constraints/iam.allowedPolicyMemberDomains` blocks that too, use the GKE track, which exposes the gateway at the network layer with no `allUsers` binding. `Container manifest type … must support amd64/linux` at deploy| Image was built on a non-amd64 host, or buildx emitted an OCI image index| Build with `--platform=linux/amd64 --provenance=false` Gateway boot exits with a Postgres connection-timeout error on Cloud Run| Service isn’t attached to the VPC, or Cloud SQL has no private IP on that VPC; the store stops waiting after 5 seconds| Deploy with `--network` and `--subnet` for Direct VPC egress, and create the Cloud SQL instance with `--no-assign-ip` and `--network` pointing at the same VPC -Agent Platform requests return `403 PERMISSION_DENIED`| Runtime isn’t using the `claude-gateway` service account, or the model isn’t enabled in Model Garden for the project| Set `--service-account` on Cloud Run or bind Workload Identity on GKE, and enable each Claude model in Model Garden for the target region +Google Cloud’s Agent Platform requests return `403 PERMISSION_DENIED`| Runtime isn’t using the `claude-gateway` service account, or the model isn’t enabled in Model Garden for the project| Set `--service-account` on Cloud Run or bind Workload Identity on GKE, and enable each Claude model in Model Garden for the target region Streaming responses cut off after a fixed duration| Front-end request timeout: the load balancer backend service behind GKE Ingress defaults to 30 seconds and Cloud Run to 300 seconds| Attach a BackendConfig with a raised `timeoutSec` on GKE, or deploy with `--timeout=3600` on Cloud Run ##
modified Claude apps gateway spend limits View current →
--- a/claude-apps-gateway-spend-limits.md +++ b/claude-apps-gateway-spend-limits.md @@ -45,7 +45,7 @@ How enforcement works -On each `/v1/messages` request, the gateway resolves the developer’s caps and period-to-date spend in one Postgres query. If they’re over any cap, the request returns `429` with `error.type: billing_error` and the header `x-should-retry: false`. The message is `spend limit reached`, followed by your [`admin.blocked_message`](</docs/en/claude-apps-gateway-config#admin>) if set. `/v1/messages/count_tokens` is exempt. Token counting is free, so it runs regardless of cap state. After each response, a usage meter reads token counts off the response as it streams to the client, prices them at USD list price, and increments Postgres counters for all three period buckets. The meter is a single reader on the stream, so the client’s bytes are untouched and a metering failure doesn’t break the response. Spend limits estimate spend from token counts at USD list price; they’re a circuit breaker, not an invoice. For authoritative billing, reconcile against your provider’s own usage reporting, such as the Anthropic Usage & Cost Admin API, invocation logs on Bedrock, or Cloud Monitoring on Google Cloud. Pricing uses the same table the Claude Code CLI uses for its own cost display, with the same model-ID canonicalization across Anthropic, Bedrock (`us.anthropic.…-v1:0`), Agent Platform (`claude-…@date`), and Foundry ID forms. A model ID the table can’t place, such as a Foundry deployment name or an inference-profile ARN, is priced at the unknown-model default tier of $5/$25 per million input/output tokens rather than zero, so an unrecognized ID can’t bypass a cap by going unmetered. The gateway warns at boot and once per ID at runtime when a model prices through the fallback. Client aborts are billed too. The upstream reports output tokens only in the stream’s terminal frame, so an aborted stream doesn’t carry them. The meter keeps a conservative floor estimate from the streamed content size, about four characters per token, and bills it when and only when the terminal usage frame is missing. A complete stream always bills the upstream-reported count. Without this, a capped developer could stream output and abort each request immediately before the end, spending without ever being counted. +On each `/v1/messages` request, the gateway resolves the developer’s caps and period-to-date spend in one Postgres query. If they’re over any cap, the request returns `429` with `error.type: billing_error` and the header `x-should-retry: false`. The message is `spend limit reached`, followed by your [`admin.blocked_message`](</docs/en/claude-apps-gateway-config#admin>) if set. `/v1/messages/count_tokens` is exempt. Token counting is free, so it runs regardless of cap state. After each response, a usage meter reads token counts off the response as it streams to the client, prices them at USD list price, and increments Postgres counters for all three period buckets. The meter is a single reader on the stream, so the client’s bytes are untouched and a metering failure doesn’t break the response. Spend limits estimate spend from token counts at USD list price; they’re a circuit breaker, not an invoice. For authoritative billing, reconcile against your provider’s own usage reporting, such as the Anthropic Usage & Cost Admin API, invocation logs on Amazon Bedrock, or Cloud Monitoring on Google Cloud. Pricing uses the same table the Claude Code CLI uses for its own cost display, with the same model-ID canonicalization across Anthropic, Amazon Bedrock (`us.anthropic.…-v1:0`), Google Cloud’s Agent Platform (`claude-…@date`), and Microsoft Foundry ID forms. A model ID the table can’t place, such as a Microsoft Foundry deployment name or an inference-profile ARN, is priced at the unknown-model default tier of $5/$25 per million input/output tokens rather than zero, so an unrecognized ID can’t bypass a cap by going unmetered. The gateway warns at boot and once per ID at runtime when a model prices through the fallback. Client aborts are billed too. The upstream reports output tokens only in the stream’s terminal frame, so an aborted stream doesn’t carry them. The meter keeps a conservative floor estimate from the streamed content size, about four characters per token, and bills it when and only when the terminal usage frame is missing. A complete stream always bills the upstream-reported count. Without this, a capped developer could stream output and abort each request immediately before the end, spending without ever being counted. ###
modified Use Claude Code on the web View current →
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -10,7 +10,7 @@ * The cloud environment: what config carries over, what tools are installed, and how to configure environments * Setup scripts and dependency management * Network access: levels, proxies, and the default allowlist - * Move tasks between web and terminal with `--remote` and `--teleport` + * Move tasks between web and terminal with `--cloud` and `--teleport` * Work with sessions: reviewing, sharing, archiving, deleting * Auto-fix pull requests: respond automatically to CI failures and review comments * Security and isolation: how sessions are isolated @@ -164,7 +164,7 @@ Add an environment| Select the current environment to open the selector, then select **Add environment**. The dialog includes name, network access level, environment variables, and setup script. Edit an environment| Select the cloud icon showing the current environment’s name to open the selector, hover over an environment, and click the settings icon that appears on the right. Archive an environment| Open the environment for editing and select **Archive**. Archived environments are hidden from the selector but existing sessions keep running. -Set the default for `--remote`| Run `/remote-env` in your terminal. If you have a single environment, this command shows your current configuration. `/remote-env` only selects the default; add, edit, and archive environments from the web interface. +Set the default environment for CLI cloud sessions| Run `/remote-env` in your terminal. If you have a single environment, this command shows your current configuration. `/remote-env` only selects the default; add, edit, and archive environments from the web interface. Environment variables use `.env` format with one `KEY=value` pair per line. Don’t wrap values in quotes, since quotes are stored as part of the value. This example defines three variables: @@ -592,7 +592,7 @@ These workflows require the [Claude Code CLI](</docs/en/quickstart>) signed in to the same claude.ai account. You can start new cloud sessions from your terminal, or pull cloud sessions into your terminal to continue locally. Cloud sessions persist even if you close your laptop, and you can monitor them from anywhere including the Claude mobile app. -From the CLI, session handoff is one-way: you can pull cloud sessions into your terminal with `--teleport`, but you can’t push an existing terminal session to the web. The `--remote` flag creates a new cloud session for your current repository. The [Desktop app](</docs/en/desktop#continue-in-another-surface>) provides a Continue in menu that can send a local session to the web. +From the CLI, session handoff is one-way: you can pull cloud sessions into your terminal with `--teleport`, but you can’t push an existing terminal session to the web. The `--cloud` flag creates a new cloud session for your current repository. The [Desktop app](</docs/en/desktop#continue-in-another-surface>) provides a Continue in menu that can send a local session to the web. ### @@ -600,13 +600,13 @@ From terminal to web -Start a cloud session from the command line with the `--remote` flag: - - claude --remote "Fix the authentication bug in src/auth/login.ts" - -This creates a new cloud session on claude.ai. The session clones your current directory’s GitHub remote at your current branch, so push first if you have local commits, since the VM clones from GitHub rather than your machine. `--remote` works with a single repository at a time. The task runs in the cloud while you continue working locally. As of v2.1.195, the CLI shows a live checklist of setup steps, such as cloning the repository and running your setup script, while the cloud container starts. Messages you type while the container is provisioning are queued and sent once the session is ready. - -`--remote` creates cloud sessions. `--remote-control` is unrelated: it exposes a local CLI session for monitoring from the web. See [Remote Control](</docs/en/remote-control>). +Start a cloud session from the command line with the `--cloud` flag: + + claude --cloud "Fix the authentication bug in src/auth/login.ts" + +This creates a new cloud session on claude.ai. The session clones your current directory’s GitHub remote at your current branch, so push first if you have local commits, since the VM clones from GitHub rather than your machine. `--cloud` works with a single repository at a time. The task runs in the cloud while you continue working locally. The older `--remote` spelling still works as a deprecated alias for `--cloud`. As of v2.1.195, the CLI shows a live checklist of setup steps, such as cloning the repository and running your setup script, while the cloud container starts. Messages you type while the container is provisioning are queued and sent once the session is ready. + +`--cloud` creates cloud sessions. `--remote-control` is unrelated: it exposes a local CLI session for monitoring from the web. See [Remote Control](</docs/en/remote-control>). Use `/tasks` in the Claude Code CLI to check progress, or open the session on claude.ai or the Claude mobile app to interact directly. From there you can steer Claude, provide feedback, or answer questions just like any other conversation. @@ -622,13 +622,13 @@ In plan mode, Claude reads files, runs commands to explore, and proposes a plan without editing source code. Once you’re satisfied, save the plan to the repo, commit, and push so the cloud VM can clone it. Then start a cloud session for autonomous execution: - claude --remote "Execute the migration plan in docs/migration-plan.md" - -This pattern gives you control over the strategy while letting Claude execute autonomously in the cloud. **Plan in the cloud with ultraplan** : to draft and review the plan itself in a web session, use [ultraplan](</docs/en/ultraplan>). Claude generates the plan on Claude Code on the web while you keep working, then you comment on sections in your browser and choose to execute remotely or send the plan back to your terminal. **Run tasks in parallel** : each `--remote` command creates its own cloud session that runs independently. You can start multiple tasks and they’ll all run simultaneously in separate sessions: - - claude --remote "Fix the flaky test in auth.spec.ts" - claude --remote "Update the API documentation" - claude --remote "Refactor the logger to use structured output" + claude --cloud "Execute the migration plan in docs/migration-plan.md" + +This pattern gives you control over the strategy while letting Claude execute autonomously in the cloud. **Plan in the cloud with ultraplan** : to draft and review the plan itself in a web session, use [ultraplan](</docs/en/ultraplan>). Claude generates the plan on Claude Code on the web while you keep working, then you comment on sections in your browser and choose to execute remotely or send the plan back to your terminal. **Run tasks in parallel** : each `--cloud` command creates its own cloud session that runs independently. You can start multiple tasks and they’ll all run simultaneously in separate sessions: + + claude --cloud "Fix the flaky test in auth.spec.ts" + claude --cloud "Update the API documentation" + claude --cloud "Refactor the logger to use structured output" Monitor all sessions with `/tasks` in the Claude Code CLI. When a session completes, you can create a PR from the web interface or teleport the session to your terminal to continue working. @@ -638,9 +638,9 @@ Send local repositories without GitHub -When you run `claude --remote` from a repository that isn’t connected to GitHub, Claude Code bundles your local repository and uploads it directly to the cloud session. The bundle includes your full repository history across all branches, plus any uncommitted changes to tracked files. This fallback activates automatically when GitHub access isn’t available. To force it even when GitHub is connected, set `CCR_FORCE_BUNDLE=1`: - - CCR_FORCE_BUNDLE=1 claude --remote "Run the test suite and fix any failures" +When you run `claude --cloud` from a repository that isn’t connected to GitHub, Claude Code bundles your local repository and uploads it directly to the cloud session. The bundle includes your full repository history across all branches, plus any uncommitted changes to tracked files. This fallback activates automatically when GitHub access isn’t available. To force it even when GitHub is connected, set `CCR_FORCE_BUNDLE=1`: + + CCR_FORCE_BUNDLE=1 claude --cloud "Run the test suite and fix any failures" Bundled repositories must meet these limits: @@ -685,7 +685,7 @@ `--teleport` is unavailable -Teleport requires claude.ai subscription authentication. If you’re authenticated via API key, Bedrock, Vertex AI, or Microsoft Foundry, run `/login` to sign in with your claude.ai account instead. If you’re already signed in via claude.ai and `--teleport` is still unavailable, your organization may have disabled cloud sessions. +Teleport requires claude.ai subscription authentication. If you’re authenticated via API key, Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, run `/login` to sign in with your claude.ai account instead. If you’re already signed in via claude.ai and `--teleport` is still unavailable, your organization may have disabled cloud sessions. ##
modified Claude Code on Claude Platform on AWS View current →
--- a/claude-platform-on-aws.md +++ b/claude-platform-on-aws.md @@ -58,7 +58,7 @@ export ANTHROPIC_AWS_WORKSPACE_ID=wrkspc_01ABCDEFGHIJKLMN export AWS_REGION=us-east-1 -`ANTHROPIC_AWS_WORKSPACE_ID` is required and is sent on every request as the `anthropic-workspace-id` header. The base URL is computed from `AWS_REGION` as `https://aws-external-anthropic.{region}.api.aws`. To override the URL directly, set `ANTHROPIC_AWS_BASE_URL`. Claude Platform on AWS is opt-in even when AWS credentials are present in your environment. Bedrock and Foundry take precedence in provider routing, so unset `CLAUDE_CODE_USE_BEDROCK` and `CLAUDE_CODE_USE_FOUNDRY` if they’re set. +`ANTHROPIC_AWS_WORKSPACE_ID` is required and is sent on every request as the `anthropic-workspace-id` header. The base URL is computed from `AWS_REGION` as `https://aws-external-anthropic.{region}.api.aws`. To override the URL directly, set `ANTHROPIC_AWS_BASE_URL`. Claude Platform on AWS is opt-in even when AWS credentials are present in your environment. Amazon Bedrock and Microsoft Foundry take precedence in provider routing, so unset `CLAUDE_CODE_USE_BEDROCK` and `CLAUDE_CODE_USE_FOUNDRY` if they’re set. ###
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -16,7 +16,7 @@ `claude -c -p "query"`| Continue via SDK| `claude -c -p "Check for type errors"` `claude -r "<session>" "query"`| Resume session by ID or name| `claude -r "auth-refactor" "Finish this PR"` `claude update`| Update to latest version| `claude update` -`claude gateway`| Start the self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) server, for administrators deploying SSO and policy in front of Claude Code on Bedrock, Vertex AI, or Foundry. Requires `--config` pointing at a [`gateway.yaml`](</docs/en/claude-apps-gateway-config>). Available in Claude Code v2.1.195 and later.| `claude gateway --config gateway.yaml` +`claude gateway`| Start the self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) server, for administrators deploying SSO and policy in front of Claude Code on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. Requires `--config` pointing at a [`gateway.yaml`](</docs/en/claude-apps-gateway-config>). Available in Claude Code v2.1.195 and later.| `claude gateway --config gateway.yaml` `claude install [version]`| Install or reinstall the native binary. Accepts a version like `2.1.118`, or `stable` or `latest`. See [Install a specific version](</docs/en/setup#install-a-specific-version>)| `claude install stable` `claude auth login`| Sign in to your Anthropic account. Use `--email` to pre-fill your email address, `--sso` to force SSO authentication, and `--console` to sign in with Anthropic Console for API usage billing instead of a Claude subscription| `claude auth login --console` `claude auth logout`| Log out from your Anthropic account| `claude auth logout` @@ -65,6 +65,7 @@ `--bg`, `--background`| Start the session as a [background agent](</docs/en/agent-view>) and return immediately. Prints the session ID and management commands. Combine with `--exec` to run a shell command as a background job instead of a Claude session, or with `--agent` to run a specific subagent. Cannot be combined with `-p`/`--print`; see the [error reference](</docs/en/errors#command-line-errors>)| `claude --bg "investigate the flaky test"` `--channels`| (Research preview) MCP servers whose [channel](</docs/en/channels>) notifications Claude should listen for in this session. Space-separated list of `plugin:<name>@<marketplace>` entries. Requires Claude.ai authentication| `claude --channels plugin:my-notifier@my-marketplace` `--chrome`| Enable [Chrome browser integration](</docs/en/chrome>) for web automation and testing| `claude --chrome` +`--cloud`| Create a new [web session](</docs/en/claude-code-on-the-web>) on claude.ai with the provided task description| `claude --cloud "Fix the login bug"` `--continue`, `-c`| Load the most recent conversation in the current directory. Includes sessions that added this directory with `/add-dir`| `claude --continue` `--dangerously-load-development-channels`| Enable [channels](</docs/en/channels-reference#test-during-the-research-preview>) that are not on the approved allowlist, for local development. Accepts `plugin:<name>@<marketplace>` and `server:<name>` entries. Prompts for confirmation| `claude --dangerously-load-development-channels server:webhook` `--dangerously-skip-permissions`| Skip permission prompts. Equivalent to `--permission-mode bypassPermissions`. See [permission modes](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) for what this does and does not skip| `claude --dangerously-skip-permissions` @@ -97,13 +98,13 @@ `--no-chrome`| Disable [Chrome browser integration](</docs/en/chrome>) for this session| `claude --no-chrome` `--no-session-persistence`| Disable session persistence so sessions are not saved to disk and cannot be resumed. Print mode only. The [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](</docs/en/env-vars>) environment variable does the same in any mode| `claude -p --no-session-persistence "query"` `--output-format`| Specify output format for print mode (options: `text`, `json`, `stream-json`)| `claude -p "query" --output-format json` -`--permission-mode`| Begin in a specified [permission mode](</docs/en/permission-modes>). Accepts `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, or `bypassPermissions`. Overrides `defaultMode` from settings files| `claude --permission-mode plan` +`--permission-mode`| Begin in a specified [permission mode](</docs/en/permission-modes>). Accepts `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions`, or `manual` as an alias for `default`. The `manual` alias selects the mode the UI labels Manual and requires Claude Code v2.1.200 or later; `claude --help` lists it in place of `default`, and both values work. Overrides `defaultMode` from settings files| `claude --permission-mode plan` `--permission-prompt-tool`| Specify an MCP tool to handle permission prompts in non-interactive mode. As of v2.1.199, the prompt tool can’t approve an MCP tool marked as [requiring user interaction](</docs/en/mcp#require-approval-for-a-specific-tool>): an `allow` result for one is converted to a deny| `claude -p --permission-prompt-tool mcp_auth_tool "query"` `--plugin-dir`| Load a plugin from a directory or `.zip` archive for this session only. Each flag takes one path. Repeat the flag for multiple plugins: `--plugin-dir A --plugin-dir B.zip`| `claude --plugin-dir ./my-plugin` `--plugin-url`| Fetch a plugin `.zip` archive from a URL for this session only. Repeat the flag for multiple plugins, or pass space-separated URLs in a single quoted value| `claude --plugin-url https://example.com/plugin.zip` `--print`, `-p`| Print response without interactive mode (see [Agent SDK documentation](</docs/en/agent-sdk/overview>) for programmatic usage details)| `claude -p "query"` `--prompt-suggestions`| Emit a `prompt_suggestion` message after each turn with a predicted next user prompt. Requires `--print`, `--output-format stream-json`, and `--verbose`. See [Prompt suggestions](</docs/en/interactive-mode#prompt-suggestions>)| `claude -p --prompt-suggestions --output-format stream-json --verbose "query"` -`--remote`| Create a new [web session](</docs/en/claude-code-on-the-web>) on claude.ai with the provided task description| `claude --remote "Fix the login bug"` +`--remote`| Deprecated alias for `--cloud`| `claude --remote "Fix the login bug"` `--remote-control`, `--rc`| Start an interactive session with [Remote Control](</docs/en/remote-control#start-a-remote-control-session>) enabled so you can also control it from claude.ai or the Claude app. Optionally pass a name for the session| `claude --remote-control "My Project"` `--remote-control-session-name-prefix <prefix>`| Prefix for auto-generated [Remote Control](</docs/en/remote-control>) session names when no explicit name is set. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. Set `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` for the same effect| `claude remote-control --remote-control-session-name-prefix dev-box` `--replay-user-messages`| Re-emit user messages from stdin back on stdout for acknowledgment. Requires `--input-format stream-json` and `--output-format stream-json`| `claude -p --input-format stream-json --output-format stream-json --verbose --replay-user-messages`
modified Code Review View current →
--- a/code-review.md +++ b/code-review.md @@ -255,7 +255,7 @@ * **After every push** : runs on each push, multiplying cost by the number of pushes * **Manual** : no reviews until someone comments `@claude review` on a PR -In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. To run a single review without subscribing to future pushes, comment `@claude review once` instead. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Vertex AI for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. +In any mode, commenting `@claude review` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. To run a single review without subscribing to future pushes, comment `@claude review once` instead. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings. ##
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -84,7 +84,7 @@ `/powerup`| Discover Claude Code features through quick interactive lessons with animated demos `/pr-comments [PR]`| Removed in v2.1.91. Ask Claude directly to view pull request comments instead. On earlier versions, fetches and displays comments from a GitHub pull request; automatically detects the PR for the current branch, or pass a PR URL or number. Requires the `gh` CLI `/privacy-settings`| View and update your privacy settings. Only available for Pro and Max plan subscribers -`/radio`| Open Claude FM lo-fi radio in your browser. Prints the stream URL when no browser is available. Not available on Bedrock, Vertex, or Foundry +`/radio`| Open Claude FM lo-fi radio in your browser. Prints the stream URL when no browser is available. Not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry `/recap`| Generate a one-line summary of the current session on demand. See [Session recap](</docs/en/interactive-mode#session-recap>) for the automatic recap that appears after you’ve been away `/release-notes`| View the changelog in an interactive version picker. Select a specific version to see its release notes, or choose to show all versions `/reload-plugins [--force]`| Reload all active [plugins](</docs/en/plugins>) to apply pending changes without restarting. Reports counts for each reloaded component and flags any load errors. When the reload would change which MCP tools are loaded and invalidate the prompt cache, the command warns and skips unless you pass `--force` @@ -101,8 +101,8 @@ `/schedule [description]`| Create, update, list, or run [routines](</docs/en/routines>), which execute on Anthropic-managed cloud infrastructure. Claude walks you through the setup conversationally. Alias: `/routines` `/scroll-speed`| Adjust mouse wheel [scroll speed](</docs/en/fullscreen#mouse-wheel-scrolling>) interactively, with a ruler you can scroll while the dialog is open to preview the change. Available in [fullscreen rendering](</docs/en/fullscreen>) only and not in the JetBrains IDE terminal `/security-review`| Analyze pending changes on the current branch for security vulnerabilities. Reviews the git diff and identifies risks like injection, auth issues, and data exposure -`/setup-bedrock`| Configure [Amazon Bedrock](</docs/en/amazon-bedrock>) authentication, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_BEDROCK=1` is set. First-time Bedrock users can also access this wizard from the login screen -`/setup-vertex`| Configure [Google Vertex AI](</docs/en/google-vertex-ai>) authentication, project, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_VERTEX=1` is set. First-time Vertex AI users can also access this wizard from the login screen +`/setup-bedrock`| Configure [Amazon Bedrock](</docs/en/amazon-bedrock>) authentication, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_BEDROCK=1` is set. First-time Amazon Bedrock users can also access this wizard from the login screen +`/setup-vertex`| Configure [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) authentication, project, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_VERTEX=1` is set. First-time Google Cloud’s Agent Platform users can also access this wizard from the login screen `/simplify [target]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the changed code for cleanup opportunities and apply the fixes. Four review [agents](</docs/en/sub-agents>) run in parallel, covering reuse of existing helpers, simplification, efficiency, and whether the change is at the right level of abstraction. From v2.1.154, the review doesn’t look for correctness bugs. Use `/code-review` to find bugs. On earlier versions, `/simplify` is equivalent to `/code-review --fix`. Pass a path or PR reference to review a specific target `/skills`| List available [skills](</docs/en/skills>). As of v2.1.121, type to filter the list by name. Press `t` to sort by token count. Press `Space` to [cycle a skill’s visibility to Claude and the `/` menu](</docs/en/skills#override-skill-visibility-from-settings>), then `Enter` to save `/stats`| Alias for `/usage`. Opens on the Stats tab
modified Common workflows View current →
--- a/common-workflows.md +++ b/common-workflows.md @@ -235,7 +235,7 @@ enhance the PR description with more context about the security improvements -When you create a PR using `gh pr create`, the session is automatically linked to that PR. To return to it later, run `claude --from-pr <number>` or paste the PR URL into the [`/resume` picker](</docs/en/sessions#use-the-session-picker>) search. +When you create a PR using `gh pr create`, the session is automatically linked to that PR. To return to it later, run `claude --from-pr 123`, replacing 123 with the PR number, or paste the PR URL into the [`/resume` picker](</docs/en/sessions#use-the-session-picker>) search. Review Claude’s generated PR before submitting and ask Claude to highlight potential risks or considerations.
modified Communications kit View current →
--- a/communications-kit.md +++ b/communications-kit.md @@ -303,8 +303,9 @@ Sometimes you want Claude to ask before every edit. Sometimes you just want it to ship. You shouldn't have to pick one forever. - *Shift+Tab* cycles through how much leash Claude gets: *default* asks before - risky stuff, *acceptEdits* lets file edits and common filesystem commands + *Shift+Tab* cycles through how much Claude can do without asking: *Manual* (the + `default` setting value) asks before each action, *acceptEdits* lets file + edits and common filesystem commands flow through while still checking before other shell commands, and *plan* proposes changes for your approval before anything is touched. Plan mode is the trust-builder, so start there for anything touching multiple files.
modified Let Claude use your computer from the CLI View current →
--- a/computer-use.md +++ b/computer-use.md @@ -246,7 +246,7 @@ * You’re on macOS. Computer use in the CLI is not available on Linux or Windows. On Windows, use [computer use in Desktop](</docs/en/desktop#let-claude-use-your-computer>) instead. * You’re running Claude Code v2.1.85 or later. Run `claude --version` to check. * You’re on a Pro or Max plan. Run `/status` to confirm your subscription. - * You’re authenticated through claude.ai. Computer use is not available with third-party providers like Amazon Bedrock, Google Cloud Vertex AI, or Microsoft Foundry. If you access Claude exclusively through a third-party provider, you need a separate claude.ai account to use this feature. + * You’re authenticated through claude.ai. Computer use is not available with third-party providers like Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. If you access Claude exclusively through a third-party provider, you need a separate claude.ai account to use this feature. * You’re in an interactive session. Computer use is not available in non-interactive mode with the `-p` flag. ##
modified Track cost and usage View current →
Show diff (128 lines)
--- a/cost-tracking.md +++ b/cost-tracking.md @@ -53,10 +53,18 @@ import { query } from "@anthropic-ai/claude-agent-sdk"; - for await (const message of query({ prompt: "Summarize this project" })) { - if (message.type === "result") { - console.log(`Total cost: $${message.total_cost_usd}`); - } + try { + for await (const message of query({ prompt: "Summarize this project" })) { + if (message.type === "result") { + console.log(`Total cost: $${message.total_cost_usd}`); + } + } + } catch (error) { + // A single-shot query() throws after yielding an error result. If the + // failure was an error result, it still carried total_cost_usd and the + // branch above has already run; connection or process failures yield + // no result message. + console.error(`Session ended with an error: ${error}`); } ## @@ -85,17 +93,23 @@ let totalInputTokens = 0; let totalOutputTokens = 0; - for await (const message of query({ prompt: "Summarize this project" })) { - if (message.type === "assistant") { - const msgId = message.message.id; - - // Parallel tool calls share the same ID, only count once - if (!seenIds.has(msgId)) { - seenIds.add(msgId); - totalInputTokens += message.message.usage.input_tokens; - totalOutputTokens += message.message.usage.output_tokens; - } - } + try { + for await (const message of query({ prompt: "Summarize this project" })) { + if (message.type === "assistant") { + const msgId = message.message.id; + + // Parallel tool calls share the same ID, only count once + if (!seenIds.has(msgId)) { + seenIds.add(msgId); + totalInputTokens += message.message.usage.input_tokens; + totalOutputTokens += message.message.usage.output_tokens; + } + } + } + } catch (error) { + // A single-shot query() throws after yielding an error result, so the + // totals below still reflect the steps that ran before the failure. + console.error(`Session ended with an error: ${error}`); } console.log(`Steps: ${seenIds.size}`); @@ -112,16 +126,23 @@ import { query } from "@anthropic-ai/claude-agent-sdk"; - for await (const message of query({ prompt: "Summarize this project" })) { - if (message.type !== "result") continue; - - for (const [modelName, usage] of Object.entries(message.modelUsage)) { - console.log(`${modelName}: $${usage.costUSD.toFixed(4)}`); - console.log(` Input tokens: ${usage.inputTokens}`); - console.log(` Output tokens: ${usage.outputTokens}`); - console.log(` Cache read: ${usage.cacheReadInputTokens}`); - console.log(` Cache creation: ${usage.cacheCreationInputTokens}`); - } + try { + for await (const message of query({ prompt: "Summarize this project" })) { + if (message.type !== "result") continue; + + for (const [modelName, usage] of Object.entries(message.modelUsage)) { + console.log(`${modelName}: $${usage.costUSD.toFixed(4)}`); + console.log(` Input tokens: ${usage.inputTokens}`); + console.log(` Output tokens: ${usage.outputTokens}`); + console.log(` Cache read: ${usage.cacheReadInputTokens}`); + console.log(` Cache creation: ${usage.cacheCreationInputTokens}`); + } + } + } catch (error) { + // A single-shot query() throws after yielding an error result. If the + // failure was an error result, the per-model breakdown above has already + // printed; connection or process failures yield no result message. + console.error(`Session ended with an error: ${error}`); } ## @@ -147,11 +168,19 @@ ]; for (const prompt of prompts) { - for await (const message of query({ prompt })) { - if (message.type === "result") { - totalSpend += message.total_cost_usd; - console.log(`This call: $${message.total_cost_usd}`); - } + try { + for await (const message of query({ prompt })) { + if (message.type === "result") { + totalSpend += message.total_cost_usd; + console.log(`This call: $${message.total_cost_usd}`); + } + } + } catch (error) { + // A single-shot query() throws after yielding an error result. If the + // failure was an error result, this call's cost was already counted; + // connection or process failures yield no result message. Continue + // with the next prompt. + console.error(`Call failed: ${error}`); } } @@ -204,7 +233,7 @@ Extend the prompt cache TTL to one hour -Cache entries written by the SDK use a 5-minute TTL by default when you authenticate with an API key or run on Amazon Bedrock, Google Cloud Vertex AI, or Microsoft Foundry. If your workload runs many short sessions against the same system prompt and context with gaps longer than 5 minutes between them, the cache expires between sessions and each new session pays full input price. To request a 1-hour TTL on cache writes, set the [`ENABLE_PROMPT_CACHING_1H`](</docs/en/env-vars>) environment variable. You can export it in your shell or container environment, or pass it through `options.env`. The following example enables 1-hour TTL for an agent running on Bedrock: +Cache entries written by the SDK use a 5-minute TTL by default when you authenticate with an API key or run on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. If your workload runs many short sessions against the same system prompt and context with gaps longer than 5 minutes between them, the cache expires between sessions and each new session pays full input price. To request a 1-hour TTL on cache writes, set the [`ENABLE_PROMPT_CACHING_1H`](</docs/en/env-vars>) environment variable. You can export it in your shell or container environment, or pass it through `options.env`. The following example enables 1-hour TTL for an agent running on Amazon Bedrock: Python
modified Manage costs effectively View current →
--- a/costs.md +++ b/costs.md @@ -33,7 +33,7 @@ When you first authenticate Claude Code with your Claude Console account, a workspace called “Claude Code” is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace; it is exclusively for Claude Code authentication and usage.For organizations with custom rate limits, Claude Code traffic in this workspace counts toward your organization’s overall API rate limits. You can set a [workspace rate limit](<https://platform.claude.com/docs/en/api/rate-limits#setting-lower-limits-for-workspaces>) on this workspace’s Limits page in the Claude Console to cap Claude Code’s share and protect other production workloads. -On Bedrock, Vertex, and Foundry, Claude Code doesn’t send metrics from your cloud. A self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) provides per-user usage attribution, OTLP metrics with token counts, and [per-user spend limits](</docs/en/claude-apps-gateway-spend-limits>) on these providers. Organizations that route Claude Code through a different [LLM gateway](</docs/en/llm-gateway>) can track spend at the gateway instead, since it sees every request. +On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code doesn’t send metrics from your cloud. A self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) provides per-user usage attribution, OTLP metrics with token counts, and [per-user spend limits](</docs/en/claude-apps-gateway-spend-limits>) on these providers. Organizations that route Claude Code through a different [LLM gateway](</docs/en/llm-gateway>) can track spend at the gateway instead, since it sees every request. ###
modified Data usage View current →
--- a/data-usage.md +++ b/data-usage.md @@ -18,7 +18,7 @@ Development Partner Program -If you explicitly opt in to methods to provide us with materials to train on, such as via the [Development Partner Program](<https://support.claude.com/en/articles/11174108-about-the-development-partner-program>), we may use those materials provided to train our models. An organization admin can expressly opt-in to the Development Partner Program for their organization. Note that this program is available only for Anthropic first-party API, and not for Bedrock or Vertex users. +If you explicitly opt in to methods to provide us with materials to train on, such as via the [Development Partner Program](<https://support.claude.com/en/articles/11174108-about-the-development-partner-program>), we may use those materials provided to train our models. An organization admin can expressly opt-in to the Development Partner Program for their organization. Note that this program is available only for Anthropic first-party API, and not for Amazon Bedrock or Google Cloud’s Agent Platform users. ### @@ -36,7 +36,7 @@ When you see the “How is Claude doing this session?” prompt in Claude Code, responding to this survey, including selecting “Dismiss”, records only your rating. We do not collect or store any conversation transcripts, inputs, outputs, or other session data as part of the rating prompt itself. Unlike thumbs up/down feedback or `/feedback` reports, this session quality survey is a simple product satisfaction metric. After the rating prompt, you may see a separate follow-up asking “Can Anthropic look at your session transcript to help us improve Claude Code?”. This is an optional second step distinct from the rating: - * **Yes** : uploads your conversation transcript, any subagent transcripts, and the raw session log file from disk to Anthropic. Known API key and token patterns are redacted before upload. Source code, file contents, and other conversation content are uploaded as-is. Shared transcripts are retained for up to 6 months. On Bedrock, Vertex AI, Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, Yes writes the same payload to a local archive under `~/.claude/feedback-bundles/` instead of uploading; nothing leaves your machine until you forward that file. + * **Yes** : uploads your conversation transcript, any subagent transcripts, and the raw session log file from disk to Anthropic. Known API key and token patterns are redacted before upload. Source code, file contents, and other conversation content are uploaded as-is. Shared transcripts are retained for up to 6 months. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, Yes writes the same payload to a local archive under `~/.claude/feedback-bundles/` instead of uploading; nothing leaves your machine until you forward that file. * **No** : declines without sending anything * **Don’t ask again** : declines and stops this follow-up from appearing in future sessions @@ -82,7 +82,7 @@ ---|--- Anthropic API| Infrastructure-level disk encryption (AES-256). Enable [Zero Data Retention](</docs/en/zero-data-retention>) for no server-side persistence. Amazon Bedrock| AES-256 with AWS-managed keys. Customer-managed keys available via AWS KMS. -Google Cloud Vertex AI| Google-managed encryption keys. CMEK available. +Google Cloud’s Agent Platform| Google-managed encryption keys. CMEK available. Microsoft Foundry| Requests route to Anthropic infrastructure with AES-256 disk encryption. Claude Code is built on Anthropic’s APIs. For details on API security controls, including API logging procedures, see the compliance artifacts in the [Anthropic Trust Center](<https://trust.anthropic.com>). @@ -108,7 +108,7 @@ Telemetry services -Claude Code connects from users’ machines to Anthropic to log operational metrics such as latency, reliability, and usage patterns. This logging does not include any code or file paths. Data is encrypted in transit and at rest. To opt out of telemetry, set the `DISABLE_TELEMETRY` environment variable. Claude Code connects from users’ machines to Sentry for operational error logging. The data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Sentry security documentation](<https://sentry.io/security/>). To opt out of error logging, set the `DISABLE_ERROR_REPORTING` environment variable. When you run the `/feedback` command, a copy of your conversation history including code is sent to Anthropic. Before submitting, you choose how much history to include: the current session only, which is the default, or also other sessions from the same project over the last 24 hours or 7 days. The data is encrypted in transit via TLS and stored in Google Cloud Storage, which encrypts stored data at rest by default. Optionally, a GitHub issue is created in the public repository. To opt out, set the `DISABLE_FEEDBACK_COMMAND` environment variable to `1`. When you use a third-party provider such as Bedrock or Vertex, or have no Anthropic credentials configured, `/feedback` writes the report to a local archive under `~/.claude/feedback-bundles/` instead of sending it to Anthropic. Known API key and token patterns are redacted before the archive is written. Nothing leaves your machine until you send that file to your Anthropic account representative or attach it to a support request. +Claude Code connects from users’ machines to Anthropic to log operational metrics such as latency, reliability, and usage patterns. This logging does not include any code or file paths. Data is encrypted in transit and at rest. To opt out of telemetry, set the `DISABLE_TELEMETRY` environment variable. Claude Code connects from users’ machines to Sentry for operational error logging. The data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Sentry security documentation](<https://sentry.io/security/>). To opt out of error logging, set the `DISABLE_ERROR_REPORTING` environment variable. When you run the `/feedback` command, a copy of your conversation history including code is sent to Anthropic. Before submitting, you choose how much history to include: the current session only, which is the default, or also other sessions from the same project over the last 24 hours or 7 days. The data is encrypted in transit via TLS and stored in Google Cloud Storage, which encrypts stored data at rest by default. Optionally, a GitHub issue is created in the public repository. To opt out, set the `DISABLE_FEEDBACK_COMMAND` environment variable to `1`. When you use a third-party provider such as Amazon Bedrock or Google Cloud’s Agent Platform, or have no Anthropic credentials configured, `/feedback` writes the report to a local archive under `~/.claude/feedback-bundles/` instead of sending it to Anthropic. Known API key and token patterns are redacted before the archive is written. Nothing leaves your machine until you send that file to your Anthropic account representative or attach it to a support request. ## @@ -116,9 +116,9 @@ Default behaviors by API provider -By default, error reporting, telemetry, and bug reporting are disabled when using Bedrock, Vertex, Foundry, or Claude Platform on AWS. Session quality surveys and the WebFetch domain safety check are exceptions and run regardless of provider. On a signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) session, usage analytics, error reporting, and survey ratings to Anthropic are disabled by the gateway credential itself, with no setting to re-enable them. You can opt out of all non-essential traffic, including surveys, at once by setting `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`. This variable does not affect the WebFetch check, which has its own opt-out. Here are the full default behaviors: +By default, error reporting, telemetry, and bug reporting are disabled when using Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS. Session quality surveys and the WebFetch domain safety check are exceptions and run regardless of provider. On a signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) session, usage analytics, error reporting, and survey ratings to Anthropic are disabled by the gateway credential itself, with no setting to re-enable them. You can opt out of all non-essential traffic, including surveys, at once by setting `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`. This variable does not affect the WebFetch check, which has its own opt-out. Here are the full default behaviors: -Service| Claude API| Vertex API| Bedrock API| Foundry API| Claude Platform on AWS +Service| Claude API| Google Cloud’s Agent Platform API| Amazon Bedrock API| Microsoft Foundry API| Claude Platform on AWS ---|---|---|---|---|--- **Anthropic (Metrics)**| Default on. `DISABLE_TELEMETRY=1` to disable.| Default off. @@ -151,7 +151,7 @@ `skipWebFetchPreflight: true` in [settings](</docs/en/settings>) to disable.| Default on. `skipWebFetchPreflight: true` in [settings](</docs/en/settings>) to disable. -All environment variables can be checked into `settings.json` (see [settings reference](</docs/en/settings>)). As of v2.1.126, when a host platform sets `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`, metrics default to on for Vertex, Bedrock, and Foundry, and follow the standard `DISABLE_TELEMETRY` opt-out. Sentry error reporting and `/feedback` reports remain off by default on those providers. +All environment variables can be checked into `settings.json` (see [settings reference](</docs/en/settings>)). As of v2.1.126, when a host platform sets `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`, metrics default to on for Google Cloud’s Agent Platform, Amazon Bedrock, and Microsoft Foundry, and follow the standard `DISABLE_TELEMETRY` opt-out. Sentry error reporting and `/feedback` reports remain off by default on those providers. ###
modified Debug your configuration View current →
--- a/debug-your-config.md +++ b/debug-your-config.md @@ -59,7 +59,7 @@ Test against a clean configuration -Start with [`claude --safe-mode`](</docs/en/cli-reference#cli-flags>), which launches a session with all customizations disabled, including `CLAUDE.md`, skills, plugins, hooks, MCP servers, and custom commands and agents. Authentication, model selection, built-in tools, and permissions work normally. If the problem disappears in safe mode, one of those surfaces is the cause; use the targeted checks above to find which. Managed settings deployed by your organization still partially apply, so policy-configured hooks and status line run even in safe mode. If the problem persists in safe mode, or your settings themselves are suspect, compare against a session that loads nothing from your usual setup. Point [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>) at an empty directory to bypass everything under `~/.claude`, and launch from a directory that has no `.claude` folder, `.mcp.json`, or `CLAUDE.md` so project configuration is also skipped. +Start with [`claude --safe-mode`](</docs/en/cli-reference#cli-flags>), which launches a session with all customizations disabled, including `CLAUDE.md`, skills, plugins, hooks, MCP servers, and custom commands and agents. Authentication, model selection, built-in tools, and permissions work normally. If the problem disappears in safe mode, one of those surfaces is the cause; use the targeted checks above to find which. Safe mode still applies managed hooks and settings policy from your organization. Managed plugins, skills, CLAUDE.md, and MCP servers are turned off. If the problem persists in safe mode, or your settings themselves are suspect, compare against a session that loads nothing from your usual setup. Point [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>) at an empty directory to bypass everything under `~/.claude`, and launch from a directory that has no `.claude` folder, `.mcp.json`, or `CLAUDE.md` so project configuration is also skipped. cd /tmp && CLAUDE_CONFIG_DIR=/tmp/claude-clean claude
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -82,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 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. +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’s Agent Platform, auto mode is off until you [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-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. @@ -722,7 +722,7 @@ Coming from the CLI? -If you already use the Claude Code CLI, Desktop runs the same underlying engine with a graphical interface. You can run both simultaneously on the same machine, even on the same project. Each maintains separate session history, but they share configuration and project memory via CLAUDE.md files. To move a CLI session into Desktop, run `/desktop` in the terminal. Claude saves your session and opens it in the desktop app, then exits the CLI. This command is available on macOS and Windows when you are signed in with a Claude subscription. It is not available with API key authentication or on Bedrock, Vertex, or Foundry. +If you already use the Claude Code CLI, Desktop runs the same underlying engine with a graphical interface. You can run both simultaneously on the same machine, even on the same project. Each maintains separate session history, but they share configuration and project memory via CLAUDE.md files. To move a CLI session into Desktop, run `/desktop` in the terminal. Claude saves your session and opens it in the desktop app, then exits the CLI. This command is available on macOS and Windows when you are signed in with a Claude subscription. It is not available with API key authentication or on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. When to use Desktop vs CLI: use Desktop when you want to manage parallel sessions in one window, arrange panes side by side, or review changes visually. Use the CLI when you need scripting, automation, or prefer a terminal workflow. @@ -775,7 +775,7 @@ ---|---|--- Permission modes| All modes including `dontAsk`| Ask permissions, Auto accept edits, Plan mode, Auto, and Bypass permissions via Settings `--dangerously-skip-permissions`| CLI flag| Bypass permissions mode. Enable in Settings → Claude Code → “Allow bypass permissions mode” -[Third-party providers](</docs/en/third-party-integrations>)| Bedrock, Vertex AI, Foundry| Anthropic’s API by default. Enterprise deployments can configure Vertex AI and gateway providers. See the [enterprise configuration guide](<https://support.claude.com/en/articles/12622667-enterprise-configuration>). To run the Code tab on Bedrock, Vertex AI, Foundry, or a self-hosted LLM gateway, see the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/overview>). +[Third-party providers](</docs/en/third-party-integrations>)| Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry| Anthropic’s API by default. Enterprise deployments can configure Google Cloud’s Agent Platform and gateway providers. See the [enterprise configuration guide](<https://support.claude.com/en/articles/12622667-enterprise-configuration>). To run the Code tab on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway, see the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/overview>). [MCP servers](</docs/en/mcp>)| Configure in settings files| Connectors UI for local and SSH sessions, or settings files [Plugins](</docs/en/plugins>)| `/plugin` command| Plugin manager UI @mention files| Text-based| With autocomplete; local and SSH sessions only @@ -795,7 +795,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. + * **Third-party providers** : Desktop connects to Anthropic’s API by default. Enterprise deployments can configure Google Cloud’s Agent Platform and gateway providers via [managed settings](<https://support.claude.com/en/articles/12622667-enterprise-configuration>). For Amazon Bedrock or Microsoft 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 Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway. * **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.
modified Development containers View current →
--- a/devcontainer.md +++ b/devcontainer.md @@ -48,9 +48,9 @@ What you see at the authentication prompt depends on your provider: * **Anthropic** : sign in through a browser with your Claude or Anthropic Console account - * **[Amazon Bedrock, Google Vertex AI, or Microsoft Foundry](</docs/en/third-party-integrations>)** : Claude Code uses your cloud provider credentials, with no browser prompt + * **[Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry](</docs/en/third-party-integrations>)** : Claude Code uses your cloud provider credentials, with no browser prompt -For cloud providers, pass credentials into the container as environment variables through `containerEnv`, a Codespaces secret, or your cloud’s workload identity rather than mounting credential files from the host. See [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>) for the credential chain Claude Code reads. See [Choose your API provider](</docs/en/admin-setup#choose-your-api-provider>) to decide which path fits your organization. +For cloud providers, pass credentials into the container as environment variables through `containerEnv`, a Codespaces secret, or your cloud’s workload identity rather than mounting credential files from the host. See [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>) for the credential chain Claude Code reads. See [Choose your API provider](</docs/en/admin-setup#choose-your-api-provider>) to decide which path fits your organization. If the browser sign-in completes but the callback never reaches the container, copy the code shown in the browser and paste it at the `Paste code here if prompted` prompt in the terminal. This can happen when the editor’s port forwarding doesn’t route the localhost callback.
modified Environment variables View current →
Show diff (195 lines)
--- a/env-vars.md +++ b/env-vars.md @@ -90,10 +90,10 @@ `ANTHROPIC_AWS_API_KEY`| Workspace API key for [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), generated in the AWS Console. Sent as `x-api-key` and takes precedence over AWS SigV4 `ANTHROPIC_AWS_BASE_URL`| Override the [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) endpoint URL. Use for custom regions or when routing through an [LLM gateway](</docs/en/llm-gateway>). Defaults to `https://aws-external-anthropic.{AWS_REGION}.api.aws` `ANTHROPIC_AWS_WORKSPACE_ID`| Required for [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). Sent on every request as the `anthropic-workspace-id` header -`ANTHROPIC_BASE_URL`| Override the API endpoint to route requests through a proxy or gateway. When set to a non-first-party host, [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) is disabled by default. Set `ENABLE_TOOL_SEARCH=true` if your proxy forwards `tool_reference` blocks. As of v2.1.196, [Remote Control](</docs/en/remote-control#requirements>) is disabled when this points at a host other than `api.anthropic.com`, matching its behavior on Bedrock, Vertex AI, and Foundry -`ANTHROPIC_BEDROCK_BASE_URL`| Override the Bedrock endpoint URL. Use for custom Bedrock endpoints or when routing through an [LLM gateway](</docs/en/llm-gateway>). See [Amazon Bedrock](</docs/en/amazon-bedrock>) -`ANTHROPIC_BEDROCK_MANTLE_BASE_URL`| Override the Bedrock Mantle endpoint URL. See [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) -`ANTHROPIC_BEDROCK_SERVICE_TIER`| Bedrock [service tier](<https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html>) (`default`, `flex`, or `priority`). Sent as the `X-Amzn-Bedrock-Service-Tier` header. See [Amazon Bedrock](</docs/en/amazon-bedrock#service-tiers>) +`ANTHROPIC_BASE_URL`| Override the API endpoint to route requests through a proxy or gateway. When set to a non-first-party host, [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) is disabled by default. Set `ENABLE_TOOL_SEARCH=true` if your proxy forwards `tool_reference` blocks. As of v2.1.196, [Remote Control](</docs/en/remote-control#requirements>) is disabled when this points at a host other than `api.anthropic.com`, matching its behavior on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry +`ANTHROPIC_BEDROCK_BASE_URL`| Override the Amazon Bedrock endpoint URL. Use for custom Amazon Bedrock endpoints or when routing through an [LLM gateway](</docs/en/llm-gateway>). See [Amazon Bedrock](</docs/en/amazon-bedrock>) +`ANTHROPIC_BEDROCK_MANTLE_BASE_URL`| Override the Amazon Bedrock Mantle endpoint URL. See [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) +`ANTHROPIC_BEDROCK_SERVICE_TIER`| Amazon Bedrock [service tier](<https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html>) (`default`, `flex`, or `priority`). Sent as the `X-Amzn-Bedrock-Service-Tier` header. See [Amazon Bedrock](</docs/en/amazon-bedrock#service-tiers>) `ANTHROPIC_BETAS`| Comma-separated list of additional `anthropic-beta` header values to include in API requests. Claude Code already sends the beta headers it needs; use this to opt into an [Anthropic API beta](<https://platform.claude.com/docs/en/api/beta-headers>) before Claude Code adds native support. Unlike the [`--betas` flag](</docs/en/cli-reference#cli-flags>), which requires API key authentication, this variable works with all auth methods including Claude.ai subscription `ANTHROPIC_CUSTOM_HEADERS`| Custom headers to add to requests (`Name: Value` format, newline-separated for multiple headers) `ANTHROPIC_CUSTOM_MODEL_OPTION`| Model ID to add as a custom entry in the `/model` picker. Use this to make a non-standard or gateway-specific model selectable without replacing built-in aliases. See [Model configuration](</docs/en/model-config#add-a-custom-model-option>) @@ -117,24 +117,24 @@ `ANTHROPIC_DEFAULT_SONNET_MODEL_NAME`| See [Model configuration](</docs/en/model-config#customize-pinned-model-display-and-capabilities>) `ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`| See [Model configuration](</docs/en/model-config#customize-pinned-model-display-and-capabilities>) `ANTHROPIC_FOUNDRY_API_KEY`| API key for Microsoft Foundry authentication (see [Microsoft Foundry](</docs/en/microsoft-foundry>)) -`ANTHROPIC_FOUNDRY_BASE_URL`| Full base URL for the Foundry resource (for example, `https://my-resource.services.ai.azure.com/anthropic`). Alternative to `ANTHROPIC_FOUNDRY_RESOURCE` (see [Microsoft Foundry](</docs/en/microsoft-foundry>)) -`ANTHROPIC_FOUNDRY_RESOURCE`| Foundry resource name (for example, `my-resource`). Required if `ANTHROPIC_FOUNDRY_BASE_URL` is not set (see [Microsoft Foundry](</docs/en/microsoft-foundry>)) +`ANTHROPIC_FOUNDRY_BASE_URL`| Full base URL for the Microsoft Foundry resource (for example, `https://my-resource.services.ai.azure.com/anthropic`). Alternative to `ANTHROPIC_FOUNDRY_RESOURCE` (see [Microsoft Foundry](</docs/en/microsoft-foundry>)) +`ANTHROPIC_FOUNDRY_RESOURCE`| Microsoft Foundry resource name (for example, `my-resource`). Required if `ANTHROPIC_FOUNDRY_BASE_URL` is not set (see [Microsoft Foundry](</docs/en/microsoft-foundry>)) `ANTHROPIC_MODEL`| Name of the model setting to use (see [Model Configuration](</docs/en/model-config#environment-variables>)) `ANTHROPIC_SMALL_FAST_MODEL`| [DEPRECATED] Name of [Haiku-class model for background tasks](</docs/en/costs>) -`ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION`| Override AWS region for the Haiku-class model when using Bedrock or Bedrock Mantle. On Bedrock, this only takes effect when `ANTHROPIC_DEFAULT_HAIKU_MODEL` or the deprecated `ANTHROPIC_SMALL_FAST_MODEL` is also set, since Bedrock otherwise uses the primary model for background tasks -`ANTHROPIC_VERTEX_BASE_URL`| Override the Vertex AI endpoint URL. Use for custom Vertex endpoints or when routing through an [LLM gateway](</docs/en/llm-gateway>). See [Google Vertex AI](</docs/en/google-vertex-ai>) -`ANTHROPIC_VERTEX_PROJECT_ID`| GCP project ID for Vertex AI requests. Overridden by `GCLOUD_PROJECT`, `GOOGLE_CLOUD_PROJECT`, or the project in your `GOOGLE_APPLICATION_CREDENTIALS` credential file. See [Google Vertex AI](</docs/en/google-vertex-ai>) +`ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION`| Override AWS region for the Haiku-class model when using Amazon Bedrock or Amazon Bedrock Mantle. On Amazon Bedrock, this only takes effect when `ANTHROPIC_DEFAULT_HAIKU_MODEL` or the deprecated `ANTHROPIC_SMALL_FAST_MODEL` is also set, since Amazon Bedrock otherwise uses the primary model for background tasks +`ANTHROPIC_VERTEX_BASE_URL`| Override Google Cloud’s Agent Platform endpoint URL. Use for custom Google Cloud’s Agent Platform endpoints or when routing through an [LLM gateway](</docs/en/llm-gateway>). See [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) +`ANTHROPIC_VERTEX_PROJECT_ID`| GCP project ID for Google Cloud’s Agent Platform requests. Overridden by `GCLOUD_PROJECT`, `GOOGLE_CLOUD_PROJECT`, or the project in your `GOOGLE_APPLICATION_CREDENTIALS` credential file. See [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) `ANTHROPIC_WORKSPACE_ID`| Workspace ID for [workload identity federation](<https://platform.claude.com/docs/en/manage-claude/workload-identity-federation>). Set this when your federation rule is scoped to more than one workspace so the token exchange knows which workspace to target -`API_FORCE_IDLE_TIMEOUT`| Override the 5-minute idle timeout that aborts a streaming model response when no bytes arrive. Set to `0` to disable the timeout, for example when a slow [gateway](</docs/en/llm-gateway>) or local model pauses longer than 5 minutes between chunks. Set to `1` to keep the timeout on every provider. When unset, the timeout is inactive on direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) connections, where Claude Code’s own byte-level stream watchdog runs, and active on every other provider, including [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), [Bedrock](</docs/en/amazon-bedrock>), and gateway connections, so a stalled stream aborts instead of hanging. As of v2.1.169 +`API_FORCE_IDLE_TIMEOUT`| Override the 5-minute idle timeout that aborts a streaming model response when no bytes arrive. Set to `0` to disable the timeout, for example when a slow [gateway](</docs/en/llm-gateway>) or local model pauses longer than 5 minutes between chunks. Set to `1` to keep the timeout on every provider. When unset, the timeout is inactive on direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) connections, where Claude Code’s own byte-level stream watchdog runs, and active on every other provider, including [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), [Amazon Bedrock](</docs/en/amazon-bedrock>), and gateway connections, so a stalled stream aborts instead of hanging. As of v2.1.169 `API_TIMEOUT_MS`| Timeout for API requests in milliseconds (default: 600000, or 10 minutes; maximum: 2147483647). Increase this when requests time out on slow networks or when routing through a proxy. Values above the maximum overflow the underlying timer and cause requests to fail immediately -`AWS_BEARER_TOKEN_BEDROCK`| Bedrock API key for authentication (see [Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>)) +`AWS_BEARER_TOKEN_BEDROCK`| Amazon Bedrock API key for authentication (see [Amazon Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>)) `BASH_DEFAULT_TIMEOUT_MS`| Default timeout for long-running bash commands (default: 120000, or 2 minutes) `BASH_MAX_OUTPUT_LENGTH`| Maximum number of characters in bash outputs before the full output is saved to a file and Claude receives the path plus a short preview. See [Bash tool behavior](</docs/en/tools-reference#bash-tool-behavior>) `BASH_MAX_TIMEOUT_MS`| Maximum timeout the model can set for long-running bash commands (default: 600000, or 10 minutes) -`CCR_FORCE_BUNDLE`| Set to `1` to force [`claude --remote`](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) to bundle and upload your local repository even when GitHub access is available +`CCR_FORCE_BUNDLE`| Set to `1` to force [`claude --cloud`](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) to bundle and upload your local repository even when GitHub access is available `CLAUDECODE`| Set to `1` in subprocesses Claude Code spawns (Bash and PowerShell tools, tmux sessions, [hook](</docs/en/hooks>) commands, [status line](</docs/en/statusline>) commands, stdio [MCP server](</docs/en/mcp>) subprocesses). IDE extensions also set this in their integrated terminals. Use to detect when a script is running inside a subprocess spawned by Claude Code. To check whether the current process was spawned directly by a tool call or hook, rather than inside a stdio MCP server that Claude Code started, use `CLAUDE_CODE_CHILD_SESSION` instead -`CLAUDE_AFK_COUNTDOWN_MS`| How many milliseconds before auto-continue the on-screen countdown appears on an unanswered `AskUserQuestion` dialog. Default `20000` (20 seconds). See `CLAUDE_AFK_TIMEOUT_MS`. Requires Claude Code v2.1.198 or later -`CLAUDE_AFK_TIMEOUT_MS`| How many milliseconds of idle time before an unanswered [`AskUserQuestion`](</docs/en/tools-reference>) dialog auto-continues without you. Default `60000` (60 seconds). To keep questions open while you’re away, set a large value like `86400000` (24 hours). Setting `0` doesn’t turn the timeout off; it closes the dialog immediately. Requires Claude Code v2.1.198 or later +`CLAUDE_AFK_COUNTDOWN_MS`| How many milliseconds before auto-continue the on-screen countdown appears on an unanswered [`AskUserQuestion`](</docs/en/tools-reference>) dialog. Default `20000` (20 seconds), capped at the auto-continue timeout. Has no effect unless auto-continue is on; see the [`askUserQuestionTimeout`](</docs/en/settings#available-settings>) setting and `CLAUDE_AFK_TIMEOUT_MS`. Requires Claude Code v2.1.198 or later +`CLAUDE_AFK_TIMEOUT_MS`| How many milliseconds of idle time before an unanswered [`AskUserQuestion`](</docs/en/tools-reference>) dialog auto-continues without you. Auto-continue is off by default; opt in with the [`askUserQuestionTimeout`](</docs/en/settings#available-settings>) setting. This variable is an override for demos and automated tests: when set, it takes precedence over that setting and turns auto-continue on even when the setting is unset or `never`. Setting `0` doesn’t turn the timeout off; it closes the dialog immediately. In v2.1.198 and v2.1.199, auto-continue was on by default with a `60000` (60 seconds) timeout. Requires Claude Code v2.1.198 or later `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 @@ -149,7 +149,7 @@ `CLAUDE_CODE_ALWAYS_ENABLE_EFFORT`| Set to `1` to send the [effort](</docs/en/model-config#adjust-effort-level>) parameter with every request, even when Claude Code does not recognize the model ID as effort-capable. Use this when routing through an [LLM gateway](</docs/en/llm-gateway>) or third-party provider that serves models under custom identifiers. Models that reject the effort parameter at the API, including Claude 3 models, Sonnet 4.0 and 4.5, Opus 4.0 and 4.1, and Haiku 4.5, are still excluded so requests do not fail `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_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>). Caching on a direct connection to the Anthropic API is unaffected either way `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_BRIDGE_SESSION_ID`| Set automatically in Bash tool and [hook command](</docs/en/hooks>) subprocesses while the session has an active [Remote Control](</docs/en/remote-control>) connection, and removed when the connection ends. The value is the session’s ID in `session_` form, the same identifier that appears in the session’s `claude.ai/code` URL, so a script can link back to the session that ran it. Requires Claude Code v2.1.199 or later. In [cloud sessions](</docs/en/claude-code-on-the-web>), read `CLAUDE_CODE_REMOTE_SESSION_ID` instead @@ -181,7 +181,7 @@ `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY`| Set to `1` to disable the “How is Claude doing?” session quality surveys. Surveys are also disabled when `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set, unless `CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL` opts back in. To set a sample rate instead of disabling outright, use the [`feedbackSurveyRate`](</docs/en/settings#available-settings>) setting. See [Session quality surveys](</docs/en/data-usage#session-quality-surveys>) `CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING`| Set to `1` to disable file [checkpointing](</docs/en/checkpointing>). The `/rewind` command will not be able to restore code changes `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS`| Set to `1` to remove built-in commit and PR workflow instructions and the git status snapshot from Claude’s system prompt. Useful when using your own git workflow skills. Takes precedence over the [`includeGitInstructions`](</docs/en/settings#available-settings>) setting when set -`CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP`| Set to `1` to prevent automatic remapping of Opus 4.0 and 4.1 to the current Opus version on the Anthropic API. Use when you intentionally want to pin an older model. The remap does not run on Bedrock, Vertex, or Foundry +`CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP`| Set to `1` to prevent automatic remapping of Opus 4.0 and 4.1 to the current Opus version on the Anthropic API. Use when you intentionally want to pin an older model. The remap does not run on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry `CLAUDE_CODE_DISABLE_MOUSE`| Set to `1` to disable mouse tracking in [fullscreen rendering](</docs/en/fullscreen>). Keyboard scrolling with `PgUp` and `PgDn` still works. Use this to keep your terminal’s native copy-on-select behavior `CLAUDE_CODE_DISABLE_MOUSE_CLICKS`| Set to `1` to disable click, drag, and hover handling in [fullscreen rendering](</docs/en/fullscreen>) while keeping mouse-wheel scrolling. Use this when you want wheel scroll to work inside Claude Code but don’t want clicks to position the cursor, expand tool output, or open links. `CLAUDE_CODE_DISABLE_MOUSE` takes precedence when both are set. Requires Claude Code v2.1.195 or later `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`| Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_FEEDBACK_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` @@ -194,11 +194,11 @@ `CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL`| Set to `1` to disable virtual scrolling in [fullscreen rendering](</docs/en/fullscreen>) and render every message in the transcript. Use this if scrolling in fullscreen mode shows blank regions where messages should appear `CLAUDE_CODE_DISABLE_WORKFLOWS`| Set to `1` to disable [workflows](</docs/en/workflows#turn-workflows-off>). Equivalent to the [`disableWorkflows`](</docs/en/settings#available-settings>) setting `CLAUDE_CODE_EFFORT_LEVEL`| Set the effort level for supported models. Values: `low`, `medium`, `high`, `xhigh`, `max`, or `auto` to use the model default. Available levels depend on the model. Takes precedence over `/effort` and the `effortLevel` setting. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>) -`CLAUDE_CODE_ENABLE_AUTO_MODE`| Set to `1` to make [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) available on Amazon Bedrock, Google Cloud Vertex AI, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. Requires Claude Code v2.1.158 or later. Has no effect on the Anthropic API, where auto mode is available by default. See [Enable auto mode on Bedrock, Vertex AI, or Foundry](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>) +`CLAUDE_CODE_ENABLE_AUTO_MODE`| Set to `1` to make [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. Requires Claude Code v2.1.158 or later. Has no effect on the Anthropic API, where auto mode is available by default. See [Enable auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-or-foundry>) `CLAUDE_CODE_ENABLE_AWAY_SUMMARY`| Override [session recap](</docs/en/interactive-mode#session-recap>) availability. Set to `0` to force recaps off regardless of the `/config` toggle. Set to `1` to force recaps on when [`awaySummaryEnabled`](</docs/en/settings#available-settings>) is `false`. Takes precedence over the setting and `/config` toggle `CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH`| Set to `1` to refresh plugin state at turn boundaries in [non-interactive mode](</docs/en/headless>) after a background install completes. Off by default because the refresh changes the system prompt mid-session, which invalidates [prompt caching](</docs/en/prompt-caching>) for that turn `CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL`| Set to `1` to route the “How is Claude doing?” session quality survey to your own [OpenTelemetry collector](</docs/en/monitoring-usage>) when Anthropic-bound nonessential traffic is blocked. Survey ratings are emitted only as OTEL events to your configured collector. No survey data is sent to Anthropic in this mode. Applies when `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, `DISABLE_TELEMETRY`, or `DO_NOT_TRACK` is set, and has no effect otherwise. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY` and the organization product feedback policy take precedence -`CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING`| Controls whether tool call inputs stream from the API as Claude generates them. With this off, a large tool input such as a long file write arrives only after Claude finishes generating it, which can look like it’s hanging. Enabled by default on the Anthropic API. On Bedrock and Vertex, enabled per model where the deployed container supports it. Set to `0` to opt out. Set to `1` to force on when routing through a proxy via `ANTHROPIC_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, or `ANTHROPIC_BEDROCK_BASE_URL`. Off by default on Foundry and [gateway](</docs/en/llm-gateway>) connections +`CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING`| Controls whether tool call inputs stream from the API as Claude generates them. With this off, a large tool input such as a long file write arrives only after Claude finishes generating it, which can look like it’s hanging. Enabled by default on the Anthropic API. On Amazon Bedrock and Google Cloud’s Agent Platform, enabled per model where the deployed container supports it. Set to `0` to opt out. Set to `1` to force on when routing through a proxy via `ANTHROPIC_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, or `ANTHROPIC_BEDROCK_BASE_URL`. Off by default on Microsoft Foundry and [gateway](</docs/en/llm-gateway>) connections `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY`| Set to `1` to populate the `/model` picker from your gateway’s `/v1/models` endpoint when `ANTHROPIC_BASE_URL` points at an Anthropic-compatible gateway such as LiteLLM, Kong, or an internal proxy. Off by default because gateways backed by a shared API key would otherwise show every user every model the key can access. Discovered models are still filtered by an [`availableModels`](</docs/en/settings#available-settings>) allowlist the session receives; deliver the list through [MDM or a managed settings file](</docs/en/settings#settings-files>), since [server-managed delivery is not available on gateway configurations](</docs/en/server-managed-settings#platform-availability>) `CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE`| Removed in v2.1.142, when the [fast mode](</docs/en/fast-mode>) default moved from Opus 4.6 to Opus 4.7 `CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION`| Set to `false` to disable prompt suggestions (the “Prompt suggestions” toggle in `/config`). These are the grayed-out predictions that appear in your prompt input after Claude responds. See [Prompt suggestions](</docs/en/interactive-mode#prompt-suggestions>) @@ -248,7 +248,7 @@ `CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY`| Set to `1` to stop Claude Code from passing `-ExecutionPolicy Bypass` when spawning PowerShell for tool calls, hooks, and status line commands, and respect the machine’s effective execution policy instead. By default Claude Code bypasses execution policy at process scope so `.ps1` scripts and module imports work on default-Restricted Windows installs. Process-scope bypass never overrides Group Policy `MachinePolicy` or `UserPolicy` regardless of this setting `CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`| Maximum time in milliseconds that [non-interactive mode](</docs/en/headless#background-tasks-at-exit>) with the `-p` flag waits after the final turn for background subagents and workflows whose result is part of the output. Default: `600000`, or 10 minutes. When the cap is exceeded, remaining background tasks are terminated and the process exits. Set to `0` to wait indefinitely. This cap is separate from the five-second grace period that applies to plain background shells `CLAUDE_CODE_PROPAGATE_TRACEPARENT`| Set to `1` to propagate W3C trace context when `ANTHROPIC_BASE_URL` points at a custom proxy. Propagation covers the `traceparent` header on model and HTTP MCP requests and the `TRACEPARENT` environment variable for Bash, PowerShell, and hook subprocesses. By default, propagation is enabled only when connected directly to the Anthropic API. Added in v2.1.152. See [Traces (beta)](</docs/en/monitoring-usage#traces-beta>) -`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`| Set by host platforms that embed Claude Code and manage model provider routing on its behalf. When set, provider-selection, endpoint, and authentication variables such as `CLAUDE_CODE_USE_BEDROCK`, `ANTHROPIC_BASE_URL`, and `ANTHROPIC_API_KEY` in settings files are ignored so user settings cannot override the host’s routing. The automatic telemetry opt-out for Bedrock, Vertex, and Foundry is also skipped, so telemetry follows the standard `DISABLE_TELEMETRY` opt-out. See [Default behaviors by API provider](</docs/en/data-usage#default-behaviors-by-api-provider>) +`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`| Set by host platforms that embed Claude Code and manage model provider routing on its behalf. When set, provider-selection, endpoint, and authentication variables such as `CLAUDE_CODE_USE_BEDROCK`, `ANTHROPIC_BASE_URL`, and `ANTHROPIC_API_KEY` in settings files are ignored so user settings cannot override the host’s routing. The automatic telemetry opt-out for Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry is also skipped, so telemetry follows the standard `DISABLE_TELEMETRY` opt-out. See [Default behaviors by API provider](</docs/en/data-usage#default-behaviors-by-api-provider>) `CLAUDE_CODE_PROXY_RESOLVES_HOSTS`| Set to `1` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution `CLAUDE_CODE_REMOTE`| Set automatically to `true` when Claude Code is running as a [cloud session](</docs/en/claude-code-on-the-web>). Read this from a hook or setup script to detect whether you are in a cloud environment `CLAUDE_CODE_REMOTE_SESSION_ID`| Set automatically in [cloud sessions](</docs/en/claude-code-on-the-web>) to the current session’s ID. Read this to construct a link back to the session transcript. See [Link output back to the session](</docs/en/claude-code-on-the-web#link-output-back-to-the-session>) @@ -265,11 +265,11 @@ `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 `CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH`| Skip client-side authentication for [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), for gateways that sign requests themselves -`CLAUDE_CODE_SKIP_BEDROCK_AUTH`| Skip AWS authentication for Bedrock (for example, when using an LLM gateway) -`CLAUDE_CODE_SKIP_FOUNDRY_AUTH`| Skip Azure authentication for Microsoft Foundry. For a gateway, set the credential in `ANTHROPIC_FOUNDRY_API_KEY` instead; without an API key this variable leaves the Foundry client unable to send requests -`CLAUDE_CODE_SKIP_MANTLE_AUTH`| Skip AWS authentication for Bedrock Mantle (for example, when using an LLM gateway) +`CLAUDE_CODE_SKIP_BEDROCK_AUTH`| Skip AWS authentication for Amazon Bedrock (for example, when using an LLM gateway) +`CLAUDE_CODE_SKIP_FOUNDRY_AUTH`| Skip Azure authentication for Microsoft Foundry. For a gateway, set the credential in `ANTHROPIC_FOUNDRY_API_KEY` instead; without an API key this variable leaves the Microsoft Foundry client unable to send requests +`CLAUDE_CODE_SKIP_MANTLE_AUTH`| Skip AWS authentication for Amazon Bedrock Mantle (for example, when using an LLM gateway) `CLAUDE_CODE_SKIP_PROMPT_HISTORY`| Set to `1` to skip writing prompt history and session transcripts to disk. Sessions started with this variable set do not appear in `--resume`, `--continue`, or up-arrow history. Useful for ephemeral scripted sessions -`CLAUDE_CODE_SKIP_VERTEX_AUTH`| Skip Google authentication for Vertex (for example, when using an LLM gateway) +`CLAUDE_CODE_SKIP_VERTEX_AUTH`| Skip Google authentication for Google Cloud’s Agent Platform (for example, when using an LLM gateway) `CLAUDE_CODE_STOP_HOOK_BLOCK_CAP`| Maximum number of consecutive times a [Stop](</docs/en/hooks#stop>) or [SubagentStop](</docs/en/hooks#subagentstop>) hook may block the turn from ending before Claude Code overrides it and ends the turn anyway (default: 8). Set to `0` to disable the cap. Raise this if your hook legitimately needs more iterations to resolve `CLAUDE_CODE_SUBAGENT_MODEL`| See [Model configuration](</docs/en/model-config>). As of v2.1.196, setting it to `inherit` is the same as leaving it unset; earlier versions treated `inherit` as an override that forced every subagent onto the main conversation’s model `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB`| Set to `1` to strip Anthropic and cloud provider credentials from subprocess environments (Bash tool, hooks, MCP stdio servers). The parent Claude process keeps these credentials for API calls, but child processes cannot read them, reducing exposure to prompt injection attacks that attempt to exfiltrate secrets via shell expansion. On Linux, this also runs Bash subprocesses in an isolated PID namespace so they cannot read host process environments via `/proc`; as a side effect, `ps`, `pgrep`, and `kill` cannot see or signal host processes. `claude-code-action` sets this automatically when `allowed_non_write_users` is configured @@ -284,21 +284,21 @@ `CLAUDE_CODE_TMPDIR`| Override the temp directory used for internal temp files. Claude Code appends `/claude-{uid}/` on Unix or `/claude/` on Windows to this path. Default: `/tmp` on macOS, `os.tmpdir()` on Linux and Windows. As of v2.1.161, on macOS and Linux, [sandboxed](</docs/en/sandboxing>) Bash subprocesses receive a short fallback `$TMPDIR` under the system default when your override is a long path, since some tools fail when temp paths get too long. Unsandboxed Bash commands inherit your shell’s `$TMPDIR` unchanged. Claude Code’s own temp files always use your override `CLAUDE_CODE_TMUX_TRUECOLOR`| Set to `1` to allow 24-bit truecolor output inside tmux. By default, Claude Code clamps to 256 colors when `$TMUX` is set because tmux does not pass through truecolor escape sequences unless configured to. Set this after adding `set -ga terminal-overrides ',*:Tc'` to your `~/.tmux.conf`. See [Terminal configuration](</docs/en/terminal-config>) for other tmux settings `CLAUDE_CODE_USE_ANTHROPIC_AWS`| Use [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) -`CLAUDE_CODE_USE_BEDROCK`| Use [Bedrock](</docs/en/amazon-bedrock>) +`CLAUDE_CODE_USE_BEDROCK`| Use [Amazon Bedrock](</docs/en/amazon-bedrock>) `CLAUDE_CODE_USE_FOUNDRY`| Use [Microsoft Foundry](</docs/en/microsoft-foundry>) -`CLAUDE_CODE_USE_MANTLE`| Use the Bedrock [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) +`CLAUDE_CODE_USE_MANTLE`| Use the Amazon Bedrock [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) `CLAUDE_CODE_USE_NATIVE_FILE_SEARCH`| Set to `1` to discover custom commands, subagents, and output styles using Node.js file APIs instead of ripgrep. Set this if the bundled ripgrep binary is unavailable or blocked in your environment. Does not affect the Grep or file search tools `CLAUDE_CODE_USE_POWERSHELL_TOOL`| Controls the PowerShell tool. On Windows without Git Bash, the tool is enabled automatically; set to `0` to disable it. On Windows with Git Bash installed, the tool is rolling out progressively: set to `1` to opt in or `0` to opt out. On Linux, macOS, and WSL, set to `1` to enable it, which requires `pwsh` on your `PATH`. When enabled on Windows, Claude can run PowerShell commands natively instead of routing through Git Bash. See [PowerShell tool](</docs/en/tools-reference#powershell-tool>) -`CLAUDE_CODE_USE_VERTEX`| Use [Vertex](</docs/en/google-vertex-ai>) +`CLAUDE_CODE_USE_VERTEX`| Use [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) `CLAUDE_CONFIG_DIR`| Override the configuration directory (default: `~/.claude`). All settings, session history, and plugins are stored under this path, as are credentials on Linux and Windows; on macOS, credentials are in the system Keychain. Useful for running multiple accounts side by side: for example, `alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'` `CLAUDE_DISABLE_ADOPT`| Set to `1` to stop in-flight background work instead of carrying it over when you background a session by pressing `←` or with [`/background`](</docs/en/agent-view#from-inside-a-session>). Claude Code asks you to confirm before backgrounding, then stops the tasks that would otherwise carry over. Requires Claude Code v2.1.195 or later `CLAUDE_EFFORT`| Set automatically in Bash tool subprocesses and hook commands to the active [effort level](</docs/en/model-config#adjust-effort-level>) for the turn: `low`, `medium`, `high`, `xhigh`, or `max`. Ultracode is not a distinct level and reports as `xhigh`. Matches the `effort.level` field passed to [hooks](</docs/en/hooks>). Only set when the current model supports the effort parameter -`CLAUDE_ENABLE_BYTE_WATCHDOG`| Set to `1` to force-enable the byte-level streaming idle watchdog, or set to `0` to force-disable it. When unset, the watchdog is enabled by default for direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) connections. The byte watchdog aborts a connection when no bytes arrive on the wire for 180 seconds by default on direct Anthropic API connections, 300 seconds on Claude Platform on AWS and when enabled on Bedrock, or for the value of `CLAUDE_STREAM_IDLE_TIMEOUT_MS` when that is set, which is clamped to a minimum of 5 minutes, independent of the event-level watchdog +`CLAUDE_ENABLE_BYTE_WATCHDOG`| Set to `1` to force-enable the byte-level streaming idle watchdog, or set to `0` to force-disable it. When unset, the watchdog is enabled by default for direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) connections. The byte watchdog aborts a connection when no bytes arrive on the wire for 180 seconds by default on direct Anthropic API connections, 300 seconds on Claude Platform on AWS and when enabled on Amazon Bedrock, or for the value of `CLAUDE_STREAM_IDLE_TIMEOUT_MS` when that is set, which is clamped to a minimum of 5 minutes, independent of the event-level watchdog `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`| Set to `1` to enable the byte-level streaming idle watchdog on Amazon Bedrock `vnd.amazon.eventstream` responses. Off by default. Configure the timeout with `CLAUDE_STREAM_IDLE_TIMEOUT_MS` -`CLAUDE_ENABLE_STREAM_WATCHDOG`| Set to `0` to force-disable the event-level streaming idle watchdog, or set to `1` to force-enable it. When unset, the watchdog is on by default for all providers. Before v2.1.196, the unset default was server-controlled on the direct Anthropic API and off on other providers. As of v2.1.169, providers other than the direct Anthropic API and Claude Platform on AWS also have a default-on 5-minute body idle timeout independent of this variable; see `API_FORCE_IDLE_TIMEOUT`. On Bedrock, you can also enable the independent byte-level watchdog with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`; the two run together when both are set. Configure the timeout with `CLAUDE_STREAM_IDLE_TIMEOUT_MS` +`CLAUDE_ENABLE_STREAM_WATCHDOG`| Set to `0` to force-disable the event-level streaming idle watchdog, or set to `1` to force-enable it. When unset, the watchdog is on by default for all providers. Before v2.1.196, the unset default was server-controlled on the direct Anthropic API and off on other providers. As of v2.1.169, providers other than the direct Anthropic API and Claude Platform on AWS also have a default-on 5-minute body idle timeout independent of this variable; see `API_FORCE_IDLE_TIMEOUT`. On Amazon Bedrock, you can also enable the independent byte-level watchdog with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`; the two run together when both are set. Configure the timeout with `CLAUDE_STREAM_IDLE_TIMEOUT_MS` `CLAUDE_ENV_FILE`| Path to a shell script whose contents Claude Code runs before each Bash command in the same shell process, so exports in the file are visible to the command. Use to persist virtualenv or conda activation across commands. Also populated dynamically by [SessionStart](</docs/en/hooks#persist-environment-variables>), [Setup](</docs/en/hooks#setup>), [CwdChanged](</docs/en/hooks#cwdchanged>), and [FileChanged](</docs/en/hooks#filechanged>) hooks `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX`| Prefix for auto-generated [Remote Control](</docs/en/remote-control>) session names when no explicit name is provided. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. The `--remote-control-session-name-prefix` CLI flag sets the same value for a single invocation -`CLAUDE_STREAM_IDLE_TIMEOUT_MS`| Timeout in milliseconds before the streaming idle watchdog closes a stalled connection. When you set this variable explicitly, the minimum is `300000` (5 minutes); lower values are silently clamped to absorb extended thinking pauses and proxy buffering. When unset, the event-level watchdog defaults to 300 seconds and the byte-level watchdog defaults to 180 seconds on direct Anthropic API connections (300 seconds on Claude Platform on AWS and other providers). The unset 180-second byte-watchdog default is a separate value and is not subject to the 5-minute clamp. The body idle timeout described under `API_FORCE_IDLE_TIMEOUT` applies independently. On Bedrock, also applies when `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` +`CLAUDE_STREAM_IDLE_TIMEOUT_MS`| Timeout in milliseconds before the streaming idle watchdog closes a stalled connection. When you set this variable explicitly, the minimum is `300000` (5 minutes); lower values are silently clamped to absorb extended thinking pauses and proxy buffering. When unset, the event-level watchdog defaults to 300 seconds and the byte-level watchdog defaults to 180 seconds on direct Anthropic API connections (300 seconds on Claude Platform on AWS and other providers). The unset 180-second byte-watchdog default is a separate value and is not subject to the 5-minute clamp. The body idle timeout described under `API_FORCE_IDLE_TIMEOUT` applies independently. On Amazon Bedrock, also applies when `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` `DEBUG`| Set to `1` to enable debug mode, equivalent to launching with [`--debug`](</docs/en/cli-reference#cli-flags>). Debug logs are written to `~/.claude/debug/<session-id>.txt`, or to the path set by `CLAUDE_CODE_DEBUG_LOGS_DIR`. Only the truthy values `1`, `true`, `yes`, and `on` enable debug mode, so namespace patterns like `DEBUG=express:*` set for other tools do not trigger it `DISABLE_AUTOUPDATER`| Set to `1` to disable automatic background updates. Manual `claude update` still works. Use `DISABLE_UPDATES` to block both `DISABLE_AUTO_COMPACT`| Set to `1` to disable automatic compaction when approaching the context limit. The manual `/compact` command remains available. Use when you want explicit control over when compaction occurs @@ -310,7 +310,7 @@ `DISABLE_FEEDBACK_COMMAND`| Set to `1` to disable the `/feedback` command. The older name `DISABLE_BUG_COMMAND` is also accepted `DISABLE_GROWTHBOOK`| Set to `1` to disable GrowthBook feature-flag fetching and use code defaults for every flag. Telemetry event logging stays on unless `DISABLE_TELEMETRY` is also set `DISABLE_INSTALLATION_CHECKS`| Set to `1` to disable installation warnings. Use only when manually managing the installation location, as this can mask issues with standard installations -`DISABLE_INSTALL_GITHUB_APP_COMMAND`| Set to `1` to hide the `/install-github-app` command. Already hidden when using third-party providers (Bedrock, Vertex, or Foundry) +`DISABLE_INSTALL_GITHUB_APP_COMMAND`| Set to `1` to hide the `/install-github-app` command. Already hidden when using third-party providers (Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry) `DISABLE_INTERLEAVED_THINKING`| Set to `1` to prevent sending the interleaved-thinking beta header. Useful when your LLM gateway or provider does not support [interleaved thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking#interleaved-thinking>) `DISABLE_LOGIN_COMMAND`| Set to `1` to hide the `/login` command. Useful when authentication is handled externally via API keys or `apiKeyHelper` `DISABLE_LOGOUT_COMMAND`| Set to `1` to hide the `/logout` command @@ -324,9 +324,9 @@ `DISABLE_UPGRADE_COMMAND`| Set to `1` to hide the `/upgrade` command `DO_NOT_TRACK`| Set to `1` to opt out of telemetry. Equivalent to setting `DISABLE_TELEMETRY`. Claude Code honors this as the cross-tool convention recognized by many developer CLIs `ENABLE_CLAUDEAI_MCP_SERVERS`| Set to `false` to disable [claude.ai MCP servers](</docs/en/mcp#use-mcp-servers-from-claude-ai>) in Claude Code. Enabled by default for logged-in users. To disable per-project or per-org, set [`disableClaudeAiConnectors`](</docs/en/settings#available-settings>) in settings instead -`ENABLE_PROMPT_CACHING_1H`| Set to `1` to request a 1-hour [prompt cache TTL](</docs/en/prompt-caching#cache-lifetime>) instead of the default 5 minutes. Intended for API key, [Bedrock](</docs/en/amazon-bedrock>), [Vertex](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) users. Subscription users within included usage receive 1-hour TTL automatically. 1-hour cache writes are billed at a higher rate +`ENABLE_PROMPT_CACHING_1H`| Set to `1` to request a 1-hour [prompt cache TTL](</docs/en/prompt-caching#cache-lifetime>) instead of the default 5 minutes. Intended for API key, [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) users. Subscription users within included usage receive 1-hour TTL automatically. 1-hour cache writes are billed at a higher rate `ENABLE_PROMPT_CACHING_1H_BEDROCK`| Deprecated. Use `ENABLE_PROMPT_CACHING_1H` instead -`ENABLE_TOOL_SEARCH`| Controls [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>). Unset: all MCP tools deferred by default, but loaded upfront on Vertex AI or when `ANTHROPIC_BASE_URL` points to a non-first-party host. Values: `true` (always defer and send the beta header, requests fail on Vertex AI models earlier than Sonnet 4.5 or Opus 4.5, or on proxies that do not support `tool_reference`), `auto` (threshold mode: load upfront if tools fit within 10% of context), `auto:N` (custom threshold, e.g., `auto:5` for 5%), `false` (load all upfront) +`ENABLE_TOOL_SEARCH`| Controls [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>). Unset: all MCP tools deferred by default, but loaded upfront on Google Cloud’s Agent Platform or when `ANTHROPIC_BASE_URL` points to a non-first-party host. Values: `true` (always defer and send the beta header, requests fail on Google Cloud’s Agent Platform models earlier than Sonnet 4.5 or Opus 4.5, or on proxies that do not support `tool_reference`), `auto` (threshold mode: load upfront if tools fit within 10% of context), `auto:N` (custom threshold, e.g., `auto:5` for 5%), `false` (load all upfront) `FALLBACK_FOR_ALL_PRIMARY_MODELS`| Set to any non-empty value to make all models, not only Opus, stop retrying with a repeated-overload error when no fallback model is configured. As of v2.1.160, a configured [fallback model chain](</docs/en/model-config#fallback-model-chains>) triggers on repeated overload errors for any primary model, so this variable does not affect switching to a fallback model `FORCE_AUTOUPDATE_PLUGINS`| Set to `1` to force plugin auto-updates even when the main auto-updater is disabled via `DISABLE_AUTOUPDATER` `FORCE_PROMPT_CACHING_5M`| Set to `1` to force the 5-minute prompt cache TTL even when 1-hour TTL would otherwise apply. Overrides `ENABLE_PROMPT_CACHING_1H` @@ -358,21 +358,21 @@ `SLASH_COMMAND_TOOL_CHAR_BUDGET`| Override the character budget for skill metadata shown to the [Skill tool](</docs/en/skills#control-who-invokes-a-skill>). The budget scales dynamically at 1% of the context window, with a fallback of 8,000 characters. Legacy name kept for backwards compatibility `TASK_MAX_OUTPUT_LENGTH`| Maximum number of characters in [subagent](</docs/en/sub-agents>) output before truncation (default: 32000, maximum: 160000). When truncated, the full output is saved to disk and the path is included in the truncated response `USE_BUILTIN_RIPGREP`| Set to `0` to use system-installed `rg` instead of `rg` included with Claude Code -`VERTEX_REGION_CLAUDE_3_5_HAIKU`| Override region for Claude 3.5 Haiku when using Vertex AI -`VERTEX_REGION_CLAUDE_3_5_SONNET`| Override region for Claude 3.5 Sonnet when using Vertex AI -`VERTEX_REGION_CLAUDE_3_7_SONNET`| Override region for Claude 3.7 Sonnet when using Vertex AI -`VERTEX_REGION_CLAUDE_4_0_OPUS`| Override region for Claude 4.0 Opus when using Vertex AI -`VERTEX_REGION_CLAUDE_4_0_SONNET`| Override region for Claude 4.0 Sonnet when using Vertex AI -`VERTEX_REGION_CLAUDE_4_1_OPUS`| Override region for Claude 4.1 Opus when using Vertex AI -`VERTEX_REGION_CLAUDE_4_5_OPUS`| Override region for Claude Opus 4.5 when using Vertex AI -`VERTEX_REGION_CLAUDE_4_5_SONNET`| Override region for Claude Sonnet 4.5 when using Vertex AI -`VERTEX_REGION_CLAUDE_4_6_OPUS`| Override region for Claude Opus 4.6 when using Vertex AI -`VERTEX_REGION_CLAUDE_4_6_SONNET`| Override region for Claude Sonnet 4.6 when using Vertex AI -`VERTEX_REGION_CLAUDE_4_7_OPUS`| Override region for Claude Opus 4.7 when using Vertex AI. Added in v2.1.111 -`VERTEX_REGION_CLAUDE_4_8_OPUS`| Override region for Claude Opus 4.8 when using Vertex AI. Added in v2.1.154 -`VERTEX_REGION_CLAUDE_5_SONNET`| Override region for Claude Sonnet 5 when using Vertex AI. Added in v2.1.197 -`VERTEX_REGION_CLAUDE_FABLE_5`| Override region for Claude Fable 5 when using Vertex AI. Added in v2.1.170 -`VERTEX_REGION_CLAUDE_HAIKU_4_5`| Override region for Claude Haiku 4.5 when using Vertex AI +`VERTEX_REGION_CLAUDE_3_5_HAIKU`| Override region for Claude 3.5 Haiku when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_3_5_SONNET`| Override region for Claude 3.5 Sonnet when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_3_7_SONNET`| Override region for Claude 3.7 Sonnet when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_4_0_OPUS`| Override region for Claude 4.0 Opus when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_4_0_SONNET`| Override region for Claude 4.0 Sonnet when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_4_1_OPUS`| Override region for Claude 4.1 Opus when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_4_5_OPUS`| Override region for Claude Opus 4.5 when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_4_5_SONNET`| Override region for Claude Sonnet 4.5 when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_4_6_OPUS`| Override region for Claude Opus 4.6 when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_4_6_SONNET`| Override region for Claude Sonnet 4.6 when using Google Cloud’s Agent Platform +`VERTEX_REGION_CLAUDE_4_7_OPUS`| Override region for Claude Opus 4.7 when using Google Cloud’s Agent Platform. Added in v2.1.111 +`VERTEX_REGION_CLAUDE_4_8_OPUS`| Override region for Claude Opus 4.8 when using Google Cloud’s Agent Platform. Added in v2.1.154 +`VERTEX_REGION_CLAUDE_5_SONNET`| Override region for Claude Sonnet 5 when using Google Cloud’s Agent Platform. Added in v2.1.197 +`VERTEX_REGION_CLAUDE_FABLE_5`| Override region for Claude Fable 5 when using Google Cloud’s Agent Platform. Added in v2.1.170 +`VERTEX_REGION_CLAUDE_HAIKU_4_5`| Override region for Claude Haiku 4.5 when using Google Cloud’s Agent Platform Standard OpenTelemetry exporter variables (`OTEL_METRICS_EXPORTER`, `OTEL_LOGS_EXPORTER`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_METRIC_EXPORT_INTERVAL`, `OTEL_RESOURCE_ATTRIBUTES`, and signal-specific variants) are also supported. See [Monitoring](</docs/en/monitoring-usage>) for configuration details.
modified Error reference View current →
Show diff (230 lines)
--- a/errors.md +++ b/errors.md @@ -43,6 +43,7 @@ `SSL certificate verification failed`| Network `SSL certificate error (...)` during login or startup| Network `403` with `x-deny-reason: host_not_allowed` in a cloud or routine session| Network +`Couldn't reconnect to your Remote Control session`| Network `Prompt is too long`| Request errors `Error during compaction: Conversation too long`| Request errors `Request too large`| Request errors @@ -51,13 +52,16 @@ `PDF too large` / `PDF is password protected`| Request errors `Extra inputs are not permitted`| Request errors `There's an issue with the selected model`| Request errors +`Model ... is not a recognized model id`| Request errors `Claude Opus is not available with the Claude Pro plan`| Request errors `Model ... is restricted by your organization's settings`| Request errors `thinking.type.enabled is not supported for this model`| Request errors `max_tokens must be greater than thinking.budget_tokens`| Request errors `API Error: 400 due to tool use concurrency issues`| Request errors `Claude Code is unable to respond to this request, which appears to violate our Usage Policy`| Request errors +`Installation was killed before it could finish (exit code 137)`| Installation errors `--bg and --print conflict`| Command-line errors +`Ignoring N permissions.allow entries from ... this workspace has not been trusted`| Configuration warnings Responses seem lower quality than usual| Response quality ## @@ -85,7 +89,7 @@ Server errors -These errors come from the inference provider rather than your account or request. On the Anthropic API that means Anthropic infrastructure. On Bedrock, Vertex AI, Foundry, or a custom gateway it means that provider’s infrastructure. +These errors come from the inference provider rather than your account or request. On the Anthropic API that means Anthropic infrastructure. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or a custom gateway it means that provider’s infrastructure. ### @@ -97,7 +101,7 @@ API Error: 500 Internal server error. This is a server-side issue, usually temporary — try again in a moment. If it persists, check https://status.claude.com. -The trailing sentence names where to check service health and varies by provider. Bedrock, Vertex AI, and Foundry configurations name that provider’s service status. A custom `ANTHROPIC_BASE_URL` names the gateway host. This indicates an unexpected failure inside the API. It is not caused by your prompt, settings, or account. **What to do:** +The trailing sentence names where to check service health and varies by provider. Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry configurations name that provider’s service status. A custom `ANTHROPIC_BASE_URL` names the gateway host. This indicates an unexpected failure inside the API. It is not caused by your prompt, settings, or account. **What to do:** * Check [status.claude.com](<https://status.claude.com>), or the provider status page named in the message, for active incidents * Wait a minute, then send your message again. Your original message is still in the conversation, so for a long prompt you can type `try again` instead of pasting the whole thing. @@ -217,7 +221,7 @@ * Match the error detail after the colon to its own section on this page, such as Usage limits or Server errors, and follow that section’s steps * Once the underlying error clears, ask Claude to retry the task or [resume the subagent](</docs/en/sub-agents#resume-subagents>) -When a rate limit, overload, or server error interrupts a foreground subagent that already produced output, Claude receives that partial output marked as incomplete instead of this error. See [API errors in subagents](</docs/en/sub-agents#api-errors-in-subagents>). +When a rate limit, overload, or server error interrupts a foreground subagent that already produced text output, Claude receives that partial output marked as incomplete instead of this error. A subagent whose only output was tool calls gets this error too; in v2.1.199 that shape returned an empty partial result instead. See [API errors in subagents](</docs/en/sub-agents#api-errors-in-subagents>). ## @@ -286,11 +290,11 @@ Request rejected (429) -You have hit the rate limit configured for your API key, Amazon Bedrock project, or Google Vertex AI project. +You have hit the rate limit configured for your API key, Amazon Bedrock project, or Google Cloud project. API Error: Request rejected (429) · this may be a temporary capacity issue. If it persists, check https://status.claude.com. -The trailing sentence names where to check service health and varies by provider. Bedrock, Vertex AI, and Foundry configurations name that provider’s service status instead of the Anthropic status page. A custom `ANTHROPIC_BASE_URL` names the gateway host. **What to do:** +The trailing sentence names where to check service health and varies by provider. Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry configurations name that provider’s service status instead of the Anthropic status page. A custom `ANTHROPIC_BASE_URL` names the gateway host. **What to do:** * Run `/status` and confirm the active credential is the one you expect. A stray `ANTHROPIC_API_KEY` in your environment can route requests through a low-tier key instead of your subscription. * Check your provider console for the active limits and request a higher tier if needed @@ -454,7 +458,7 @@ Remote Control is only available when using Claude via api.anthropic.com. -This appears on Amazon Bedrock, Google Vertex AI, and Microsoft Foundry. As of v2.1.196 it also appears when [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>) points at a host other than `api.anthropic.com`, such as an [LLM gateway](</docs/en/llm-gateway>) or proxy, even when you sign in with claude.ai. **What to do:** +This appears on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. As of v2.1.196 it also appears when [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>) points at a host other than `api.anthropic.com`, such as an [LLM gateway](</docs/en/llm-gateway>) or proxy, even when you sign in with claude.ai. **What to do:** * Unset `ANTHROPIC_BASE_URL` and restart the session, or start Remote Control from a session that talks to the Anthropic API directly * For this and the other Remote Control startup messages, see [Troubleshoot Remote Control](</docs/en/remote-control#troubleshooting>) @@ -514,7 +518,7 @@ AWS authentication failed -This message requires Claude Code v2.1.198 or later and only appears when [`awsAuthRefresh`](</docs/en/amazon-bedrock#advanced-credential-configuration>) is set in your settings file. Your AWS provider returned a 403, or [Amazon Bedrock](</docs/en/amazon-bedrock>) returned a 401. Claude Code can’t tell which cause you hit. Amazon Bedrock reports an expired security token as a 403, but a 403 is also how it reports an authorization denial, such as an `AccessDeniedException` from a missing IAM permission or a model that isn’t enabled for your account. A 401 from Amazon Bedrock also lands here rather than under AWS credentials expired or invalid, because Bedrock doesn’t report an expired token as a 401. A 401 from that endpoint typically comes from something else in the request path, such as a corporate proxy. A credential refresh fixes an expired token and can’t fix the other causes, so the message offers both: +This message requires Claude Code v2.1.198 or later and only appears when [`awsAuthRefresh`](</docs/en/amazon-bedrock#advanced-credential-configuration>) is set in your settings file. Your AWS provider returned a 403, or [Amazon Bedrock](</docs/en/amazon-bedrock>) returned a 401. Claude Code can’t tell which cause you hit. Amazon Bedrock reports an expired security token as a 403, but a 403 is also how it reports an authorization denial, such as an `AccessDeniedException` from a missing IAM permission or a model that isn’t enabled for your account. A 401 from Amazon Bedrock also lands here rather than under AWS credentials expired or invalid, because Amazon Bedrock doesn’t report an expired token as a 401. A 401 from that endpoint typically comes from something else in the request path, such as a corporate proxy. A credential refresh fixes an expired token and can’t fix the other causes, so the message offers both: AWS authentication failed · run /login and select "Claude Platform on AWS · refresh credentials", or run `aws sso login --profile myprofile` in another terminal · if credentials are current, check AWS permissions and model access · API Error: 403 ... @@ -601,13 +605,29 @@ See [Network access](</docs/en/claude-code-on-the-web#network-access>) for access levels and the default allowlist. Local CLI sessions are not affected by this policy. +### + +​ + +Couldn’t reconnect to your Remote Control session + + Couldn't reconnect to your Remote Control session. Retry, or start a fresh session without --resume. + +Resuming with `claude --resume` or `claude --continue` reconnects to the [Remote Control](</docs/en/remote-control>) session recorded in that conversation. This message means the reconnection failed for a reason that may be temporary, such as a network interruption or a server error, so Claude Code can’t confirm whether the remote session still exists. Your local session keeps running without Remote Control. **What to do:** + + * Run `/remote-control` to retry the connection + * Start Claude Code without `--resume` to create a new Remote Control session + * For other Remote Control startup messages, see [Troubleshoot Remote Control](</docs/en/remote-control#troubleshooting>) + +You won’t see this message when the server confirms the previous session no longer exists; Claude Code creates a new one in that case. Before v2.1.200, any reconnection failure created a new Remote Control session, which left extra sessions in the session list at claude.ai/code. + ## ​ Request errors -These errors mean the API received your request but rejected its content. +These errors relate to the content of your request. Most come back from the API after it rejected the request; a few are produced locally by Claude Code before any request is sent. ### @@ -746,7 +766,24 @@ * **Agent SDK** : the error text omits the hint because the model is set programmatically. Set [`model` on `Options`](</docs/en/agent-sdk/typescript#options>) in TypeScript or [`ClaudeAgentOptions(model=...)`](</docs/en/agent-sdk/python#claudeagentoptions>) in Python, and handle the structured `model_not_found` error to surface your own retry or model picker. * Use an alias such as `sonnet` or `opus` instead of a full versioned ID. Aliases resolve to a maintained default so they don’t go stale. See [Model configuration](</docs/en/model-config>). * If the wrong model keeps coming back in the CLI, a stale ID is set somewhere. Check in [priority order](</docs/en/model-config#setting-your-model>): the `--model` flag, the `ANTHROPIC_MODEL` environment variable, then the `model` field in `.claude/settings.local.json`, your project’s `.claude/settings.json`, and `~/.claude/settings.json`. Remove the stale value and Claude Code falls back to your account default. - * For Vertex AI deployments, see [Vertex AI troubleshooting](</docs/en/google-vertex-ai#troubleshooting>). + * For Google Cloud’s Agent Platform deployments, see [Google Cloud’s Agent Platform troubleshooting](</docs/en/google-vertex-ai#troubleshooting>). + +### + +​ + +Model is not a recognized model id + +The model string you passed to a model switch isn’t a model alias, a model ID this Claude Code version knows, or an ID that starts with `claude-`. The usual causes are a typo in the ID, a display name such as `Sonnet 5` where the ID `claude-sonnet-5` is expected, or an alias that only newer Claude Code versions recognize. Claude Code rejects the switch immediately. Before v2.1.200, Claude Code saved the string and failed on the next request with There’s an issue with the selected model. + + Model "claud-sonnet-5" is not a recognized model id. Did you mean 'claude-sonnet-5'? + +The trailing hint names the closest matching alias or model ID. When nothing is close enough, it reads `Run /model to see available models.` instead. Claude Code produces this error locally at the moment the switch is requested, before any API request is made. It applies when a model is set through the [Agent SDK](</docs/en/agent-sdk/typescript>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you. **What to do:** + + * Run `/model` with no argument to open the picker and choose from the models available to your account, then pass the alias or ID shown there + * If you used an alias that a newer Claude Code version supports, run `claude update`. A full ID that starts with `claude-` passes this check even when the model is newer than your Claude Code version, so upgrading isn’t needed for those. + * A model saved before v2.1.200 isn’t repaired by this check. If a stale value keeps coming back, remove it from the locations listed under There’s an issue with the selected model. + * The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code accepts any string and passes it through. ### @@ -806,7 +843,7 @@ API Error: 400 ... max_tokens must be greater than thinking.budget_tokens -Claude Code adjusts these values automatically on the Anthropic API. You typically see this error on Amazon Bedrock or Google Vertex AI when [`MAX_THINKING_TOKENS`](</docs/en/env-vars>) is set higher than the provider’s output limit, or when plan mode raises the thinking budget. **What to do:** +Claude Code adjusts these values automatically on the Anthropic API. You typically see this error on Amazon Bedrock or Google Cloud’s Agent Platform when [`MAX_THINKING_TOKENS`](</docs/en/env-vars>) is set higher than the provider’s output limit, or when plan mode raises the thinking budget. **What to do:** * Lower `MAX_THINKING_TOKENS`, or raise [`CLAUDE_CODE_MAX_OUTPUT_TOKENS`](</docs/en/env-vars>) above the thinking budget * See [Extended thinking](</docs/en/model-config#extended-thinking>) for how the budget interacts with output length @@ -848,6 +885,30 @@ ​ +Installation errors + +These errors come from the [install script](</docs/en/setup#install-claude-code>) before Claude Code has started. For `command not found`, PATH, permission, and TLS problems during setup, see [Troubleshoot installation and login](</docs/en/troubleshoot-install>). + +### + +​ + +Installation was killed before it could finish + +The install script reports when the `claude install` step is terminated by a signal. On Linux, exit code 137 means the process received SIGKILL, and on a low-memory host that’s usually the kernel out-of-memory (OOM) killer. The script prints this explanation and exits with code 137: + + Installation was killed before it could finish (exit code 137). This usually means the system ran out of memory. + Claude Code needs roughly 512MB of free memory to install. Free up memory, then run this script again. + +For any other fatal signal, and for exit code 137 on macOS, the script prints `Installation was killed before it could finish (exit code <N>)` with the actual exit code and omits the out-of-memory explanation. The message comes from the install script macOS and Linux use, which also covers installs inside WSL; the native Windows install scripts never print it. Before v2.1.200, the script exited with only the shell’s bare `Killed` line. **What to do:** + + * Stop other processes to free memory, then rerun the installer + * Add swap space or move to a larger instance. See [Install killed on low-memory Linux servers](</docs/en/troubleshoot-install#install-killed-on-low-memory-linux-servers>) for the swap-file commands. + +## + +​ + Command-line errors These errors come from Claude Code’s own validation of the `claude` command line. Claude Code prints them immediately, before it creates a session or sends any API request. @@ -871,12 +932,36 @@ ​ +Configuration warnings + +Claude Code writes these messages to stderr at startup rather than showing an error in the conversation. They report configuration it read but didn’t apply. + +### + +​ + +Workspace has not been trusted + +Claude Code found `permissions.allow` rules or `permissions.additionalDirectories` entries in the project’s `.claude/settings.json` or `.claude/settings.local.json` and didn’t apply them, because [allow rules from project settings require workspace trust](</docs/en/permissions#project-allow-rules-and-workspace-trust>). The count, the setting name, and the file named in the message vary with your configuration. `deny` and `ask` rules aren’t affected. + + Ignoring 2 permissions.allow entries from .claude/settings.local.json: this workspace has not been trusted. Run Claude Code interactively here once and accept the trust dialog, or set projects["/Users/you/project"].hasTrustDialogAccepted: true in /Users/you/.claude.json. + +**What to do:** + + * Run `claude` in the directory and accept the trust dialog. The dialog appears even when a parent directory is already trusted, lists the rules being held back, and lets you decline and keep working without them. Before v2.1.200, no dialog appeared in that situation, so this step couldn’t be completed there. + * In [non-interactive mode](</docs/en/headless>) with `-p` no dialog is shown. Set the `hasTrustDialogAccepted` entry in `~/.claude.json` using the exact `projects` key the message prints. + * If the message names `.claude/settings.local.json` and you started Claude Code outside a git repository or in your home directory, update to v2.1.200 or later. Versions 2.1.196 through 2.1.199 treated your own `.claude/settings.local.json` as repository-supplied in those workspaces. See [Project allow rules and workspace trust](</docs/en/permissions#project-allow-rules-and-workspace-trust>). + +## + +​ + Responses seem lower quality than usual If Claude’s answers seem less capable than you expect but no error is shown, the cause is usually conversation state rather than the model itself. Claude Code doesn’t silently change model versions. It can switch to a fallback model in three specific cases: * A configured [`--fallback-model`](</docs/en/cli-reference#cli-flags>) takes over after an availability error, for that turn only, with a notice in the transcript - * A Bedrock or Vertex AI startup check finds your default model unavailable + * An Amazon Bedrock or Google Cloud’s Agent Platform startup check finds your default model unavailable * [Automatic model fallback](</docs/en/model-config#automatic-model-fallback>) on Fable 5 moves the session to the default Opus model and shows a notice in the transcript The Model selection check below catches the second and third cases; the first appears as a transcript notice rather than a `/model` change. [Model configuration](</docs/en/model-config>) explains when each fallback applies. Check these first: @@ -902,7 +987,7 @@ If an error is not listed here or the suggested fix does not help: - * Run `/feedback` inside Claude Code to send the transcript and a description to Anthropic. The command also offers to open a prefilled GitHub issue. On Bedrock, Vertex AI, Foundry, and other third-party providers, `/feedback` saves a local archive you can send to your Anthropic account representative instead. + * Run `/feedback` inside Claude Code to send the transcript and a description to Anthropic. The command also offers to open a prefilled GitHub issue. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and other third-party providers, `/feedback` saves a local archive you can send to your Anthropic account representative instead. * Run `/doctor` to check for local configuration problems * Check [status.claude.com](<https://status.claude.com>) for active incidents * Search [existing issues](<https://github.com/anthropics/claude-code/issues>) on GitHub
modified Speed up responses with fast mode View current →
--- a/fast-mode.md +++ b/fast-mode.md @@ -89,7 +89,7 @@ Fast mode requires all of the following: - * **Anthropic API or subscription only** : fast mode is available through the Anthropic Console API and for Claude subscription plans using usage credits. It is not available on Amazon Bedrock, Google Vertex AI, Microsoft Azure Foundry, or Claude Platform on AWS. + * **Anthropic API or subscription only** : fast mode is available through the Anthropic Console API and for Claude subscription plans using usage credits. It is not available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS. * **Usage credits turned on** : your account must have usage credits turned on, which allows billing beyond your plan’s included usage. For individual accounts, turn this on in your [Console billing settings](<https://platform.claude.com/settings/organization/billing>). For Team and Enterprise, an admin must turn on usage credits for the organization. Fast mode usage draws directly from usage credits, even if you have remaining usage on your plan. This means fast mode tokens do not count against your plan’s included usage and are charged at the fast mode rate from the first token.
modified Feature availability View current →
--- a/feature-availability.md +++ b/feature-availability.md @@ -10,9 +10,9 @@ * **Claude subscription** : you sign in with a claude.ai account on the Pro, Max, Team, or Enterprise plan * **Anthropic Console** : you authenticate with an Anthropic API key - * **Amazon Bedrock** : you use Claude models from the Bedrock model catalog and set `CLAUDE_CODE_USE_BEDROCK`. The [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) (`CLAUDE_CODE_USE_MANTLE`) is covered by this column + * **Amazon Bedrock** : you use Claude models from the Amazon Bedrock model catalog and set `CLAUDE_CODE_USE_BEDROCK`. The [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) (`CLAUDE_CODE_USE_MANTLE`) is covered by this column * **Claude Platform on AWS** : you bought Claude through AWS Marketplace but call the Anthropic API, and set `CLAUDE_CODE_USE_ANTHROPIC_AWS` - * **Google Vertex AI** : Google-operated; you set `CLAUDE_CODE_USE_VERTEX` + * **Google Cloud’s Agent Platform** : Google-operated; you set `CLAUDE_CODE_USE_VERTEX` * **Microsoft Foundry** : Anthropic-operated on Azure; you set `CLAUDE_CODE_USE_FOUNDRY` ### @@ -49,7 +49,7 @@ * [Artifacts](</docs/en/artifacts>): Pro, Max, Team, and Enterprise plans * [Voice dictation](</docs/en/voice-dictation>) -Desktop is the partial exception: Enterprise deployments can route Desktop to Vertex AI or a gateway provider via [managed settings](<https://support.claude.com/en/articles/12622667-enterprise-configuration>), and 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. For per-plan availability of these features, see Availability by subscription plan. +Desktop is the partial exception: Enterprise deployments can route Desktop to Google Cloud’s Agent Platform or a gateway provider via [managed settings](<https://support.claude.com/en/articles/12622667-enterprise-configuration>), and the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/overview>) runs the Code tab on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway. For per-plan availability of these features, see Availability by subscription plan. ### @@ -57,7 +57,7 @@ CLI capabilities that vary by provider -These features work in the local CLI but depend on a server-side capability that not every provider exposes. Feature| Claude subscription| Anthropic Console| Amazon Bedrock| Claude Platform on AWS| Google Vertex AI| Microsoft Foundry +These features work in the local CLI but depend on a server-side capability that not every provider exposes. Feature| Claude subscription| Anthropic Console| Amazon Bedrock| Claude Platform on AWS| Google Cloud’s Agent Platform| Microsoft Foundry ---|---|---|---|---|---|--- [Web search](</docs/en/tools-reference#websearch-tool-behavior>)| ✓| ✓| ✗| ✓| See note 1| ✓ [Fast mode](</docs/en/fast-mode>)| ✓| ✓| ✗| ✗| ✗| ✗ @@ -73,14 +73,14 @@ Admin and analytics -Organization-level controls and usage visibility. Feature| Claude subscription| Anthropic Console| Amazon Bedrock| Claude Platform on AWS| Google Vertex AI| Microsoft Foundry +Organization-level controls and usage visibility. Feature| Claude subscription| Anthropic Console| Amazon Bedrock| Claude Platform on AWS| Google Cloud’s Agent Platform| Microsoft Foundry ---|---|---|---|---|---|--- [Analytics dashboard and API](</docs/en/analytics>)| ✓ (Team and Enterprise)| ✓ 5| ✗| ✗| ✗| ✗ [Server-managed settings](</docs/en/server-managed-settings>)| ✓ (Team and Enterprise)| ✓ (Team and Enterprise)| ✗| ✗| ✗| ✗ [Zero Data Retention](</docs/en/zero-data-retention>)| ✓ (qualified Enterprise accounts)| ✓ (qualified accounts)| See note 4| ✓ (qualified accounts)| See note 4| See note 4 -1 On Vertex AI, web search is available for Claude 4 models and later. +1 On Google Cloud’s Agent Platform, web search is available for Claude 4 models and later. 2 Requires `CLAUDE_CODE_ENABLE_AUTO_MODE`. See [Auto mode configuration](</docs/en/auto-mode-config>). -3 Explicit intervals such as `/loop every 2 hours` work on every provider. On Bedrock, Vertex AI, and Foundry, `/loop` cannot pick its own interval or supply the default maintenance prompt, so a prompt with no interval runs every 10 minutes, and `/loop` with no arguments shows the usage message. See [Scheduled tasks](</docs/en/scheduled-tasks>). +3 Explicit intervals such as `/loop every 2 hours` work on every provider. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` cannot pick its own interval or supply the default maintenance prompt, so a prompt with no interval runs every 10 minutes, and `/loop` with no arguments shows the usage message. See [Scheduled tasks](</docs/en/scheduled-tasks>). 4 Subject to your agreement with the cloud provider. 5 Dashboard and API only. [Contribution metrics](</docs/en/analytics#enable-contribution-metrics>) requires a claude.ai Team or Enterprise organization. @@ -92,13 +92,13 @@ Summary by provider -Each tab lists what is unavailable or partially supported on that provider, with alternatives where one exists. Everything not listed works the same as on a Claude subscription. On Bedrock, Vertex AI, Foundry, and Claude Platform on AWS, error reporting and telemetry to Anthropic are off by default. See [default behaviors by API provider](</docs/en/data-usage#default-behaviors-by-api-provider>) for what traffic still reaches Anthropic and how to opt out. +Each tab lists what is unavailable or partially supported on that provider, with alternatives where one exists. Everything not listed works the same as on a Claude subscription. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS, error reporting and telemetry to Anthropic are off by default. See [default behaviors by API provider](</docs/en/data-usage#default-behaviors-by-api-provider>) for what traffic still reaches Anthropic and how to opt out. * Amazon Bedrock * Claude Platform on AWS - * Google Vertex AI + * Google Cloud's Agent Platform * Microsoft Foundry @@ -113,7 +113,7 @@ **Alternatives:** for scheduling, use [`/loop`](</docs/en/scheduled-tasks>) with an explicit interval instead of `/schedule`. For cloud sessions, use [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). For web lookups, use the [WebFetch tool](</docs/en/tools-reference#webfetch-tool-behavior>) with a specific URL. -**Not available:** all features that require a Claude subscription, plus [fast mode](</docs/en/fast-mode>), [Advisor](</docs/en/advisor>), [Channels](</docs/en/channels>), the [analytics dashboard](</docs/en/analytics>), and [server-managed settings](</docs/en/server-managed-settings>).**Available** where Bedrock is not: [web search](</docs/en/tools-reference#websearch-tool-behavior>), [auto mode](</docs/en/auto-mode-config>) without an opt-in flag, and [`/loop` self-pacing](</docs/en/scheduled-tasks>).**Alternatives:** for scheduling, use [`/loop`](</docs/en/scheduled-tasks>) instead of `/schedule`. For cloud sessions, use [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). +**Not available:** all features that require a Claude subscription, plus [fast mode](</docs/en/fast-mode>), [Advisor](</docs/en/advisor>), [Channels](</docs/en/channels>), the [analytics dashboard](</docs/en/analytics>), and [server-managed settings](</docs/en/server-managed-settings>).**Available** where Amazon Bedrock is not: [web search](</docs/en/tools-reference#websearch-tool-behavior>), [auto mode](</docs/en/auto-mode-config>) without an opt-in flag, and [`/loop` self-pacing](</docs/en/scheduled-tasks>).**Alternatives:** for scheduling, use [`/loop`](</docs/en/scheduled-tasks>) instead of `/schedule`. For cloud sessions, use [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>). **Not available:** all features that require a Claude subscription, plus [fast mode](</docs/en/fast-mode>), [Advisor](</docs/en/advisor>), [Channels](</docs/en/channels>), the [analytics dashboard](</docs/en/analytics>), and [server-managed settings](</docs/en/server-managed-settings>).**Partial support:** @@ -142,7 +142,7 @@ Availability by subscription plan -If you authenticate through Bedrock, Vertex AI, Foundry, or an Anthropic Console API key, this section does not apply to you. When you sign in with a claude.ai account, your plan determines which of the features below are available. +If you authenticate through Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or an Anthropic Console API key, this section does not apply to you. When you sign in with a claude.ai account, your plan determines which of the features below are available. Feature| Pro| Max| Team| Enterprise ---|---|---|---|--- @@ -170,7 +170,7 @@ Model availability -For which Claude models and context-window sizes are available per provider and region, see [Model configuration](</docs/en/model-config>) and the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). Vision, PDF input, and extended thinking are model capabilities rather than Claude Code features and work on every provider that offers the model. [Prompt caching](</docs/en/prompt-caching>) works the same way on most providers; on Bedrock, support varies by model. +For which Claude models and context-window sizes are available per provider and region, see [Model configuration](</docs/en/model-config>) and the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). Vision, PDF input, and extended thinking are model capabilities rather than Claude Code features and work on every provider that offers the model. [Prompt caching](</docs/en/prompt-caching>) works the same way on most providers; on Amazon Bedrock, support varies by model. ## @@ -179,5 +179,5 @@ Related resources * [Enterprise deployment overview](</docs/en/third-party-integrations>): compare authentication, billing, and regions across providers - * Provider setup guides: [Amazon Bedrock](</docs/en/amazon-bedrock>), [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), [Google Vertex AI](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>) + * Provider setup guides: [Amazon Bedrock](</docs/en/amazon-bedrock>), [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>) * [Platforms and integrations](</docs/en/platforms>): where Claude Code runs, including the CLI, Desktop, IDE extensions, web, mobile, and CI/CD
modified Rewind file changes with checkpointing View current →
--- a/file-checkpointing.md +++ b/file-checkpointing.md @@ -125,8 +125,8 @@ session_id = None async for message in client.receive_response(): - # Update checkpoint on each user message (keeps the latest) - if isinstance(message, UserMessage) and message.uuid: + # Capture the first user message UUID as the checkpoint + if isinstance(message, UserMessage) and message.uuid and checkpoint_id is None: checkpoint_id = message.uuid # Capture session ID from the result message if isinstance(message, ResultMessage): @@ -150,9 +150,11 @@ await client.rewind_files(checkpoint_id) break -If you capture the session ID and checkpoint ID, you can also rewind from the CLI. This command requires the `claude` executable, which comes from [installing Claude Code](</docs/en/setup>) and is not installed by the SDK package: - - claude -p --resume <session-id> --rewind-files <checkpoint-uuid> +If you capture the session ID and checkpoint ID, you can also rewind from the CLI. This command requires the `claude` executable, which comes from [installing Claude Code](</docs/en/setup>) and is not installed by the SDK package. The SDK enables checkpointing for you, but when you run `claude -p` directly you must set the `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING` environment variable: + + CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true claude -p --resume <session-id> --rewind-files <checkpoint-uuid> + +The `--rewind-files` flag does not appear in `claude --help` output, but the CLI accepts it as shown. ## @@ -168,7 +170,7 @@ Checkpoint before risky operations -This pattern keeps only the most recent checkpoint UUID, updating it before each agent turn. If something goes wrong during processing, you can immediately rewind to the last safe state and break out of the loop. +This pattern keeps only the most recent checkpoint UUID, updating it before each agent turn. If something goes wrong during processing, you can immediately rewind to the last safe state and break out of the loop. Before running this example, replace `your_revert_condition` (Python) or `yourRevertCondition` (TypeScript) with your own check, such as error detection or a validation failure; the placeholder is not defined in the example. Python @@ -456,6 +458,18 @@ ​ +”File rewinding is not enabled” error + +This error occurs when you attempt a non-interactive rewind without checkpointing enabled: running bare `claude -p` with `--rewind-files`, or running an SDK session, including a resumed one, whose options don’t enable checkpointing. The SDK sets the `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING` environment variable internally only when `enable_file_checkpointing` (Python) or `enableFileCheckpointing` (TypeScript) is enabled on the session performing the rewind; the bare CLI never sets it. **Solution** : For the bare CLI, set the environment variable when running the command: + + CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true claude -p --resume <session-id> --rewind-files <checkpoint-uuid> + +For the SDK, set `enable_file_checkpointing=True` (Python) or `enableFileCheckpointing: true` (TypeScript) on the resumed session, as the examples on this page do. + +### + +​ + ”ProcessTransport is not ready for writing” error This error occurs when you call `rewindFiles()` or `rewind_files()` after you’ve finished iterating through the response. The connection to the CLI process closes when the loop completes. **Solution** : Resume the session with an empty prompt, then call rewind on the new query:
modified Fullscreen rendering View current →
--- a/fullscreen.md +++ b/fullscreen.md @@ -138,7 +138,7 @@ set -g mouse on -Without mouse mode, wheel events go to tmux instead of Claude Code. Keyboard scrolling with `PgUp` and `PgDn` works either way. Claude Code prints a one-time hint at startup if it detects tmux with mouse mode off. Fullscreen rendering is incompatible with iTerm2’s tmux integration mode, which is the mode you enter with `tmux -CC`. In integration mode, iTerm2 renders each tmux pane as a native split rather than letting tmux draw to the terminal. The alternate screen buffer and mouse tracking don’t work correctly there: the mouse wheel does nothing, and double-click can corrupt the terminal state. Don’t enable fullscreen rendering in `tmux -CC` sessions. Regular tmux inside iTerm2, without `-CC`, works fine. tmux doesn’t support synchronized output, so you may see more flicker during redraws than when running Claude Code directly in your terminal. If the flicker is noticeable, especially over SSH, run Claude Code in its own terminal tab outside tmux. +Without mouse mode, wheel events go to tmux instead of Claude Code. Keyboard scrolling with `PgUp` and `PgDn` works either way. Claude Code prints a one-time hint at startup if it detects tmux with mouse mode off. Fullscreen rendering is incompatible with iTerm2’s tmux integration mode, which is the mode you enter with `tmux -CC`. In integration mode, iTerm2 renders each tmux pane as a native split rather than letting tmux draw to the terminal. The alternate screen buffer and mouse tracking don’t work correctly there: the mouse wheel does nothing, and double-click can corrupt the terminal state. Don’t enable fullscreen rendering in `tmux -CC` sessions. Regular tmux inside iTerm2, without `-CC`, works fine. Not every tmux version applies synchronized output from applications, so you may see more flicker during redraws under tmux than when running Claude Code directly in your terminal. If the flicker is noticeable, especially over SSH, upgrade to the newest tmux or run Claude Code in its own terminal tab outside tmux. Check your tmux version with `tmux -V`. Claude Code turns on synchronized output automatically when it detects tmux 3.4 or later from the `TERM_PROGRAM_VERSION` variable, and falls back to querying the terminal directly for synchronized output support when the version can’t be determined. Whether redraws actually become atomic depends on your tmux version honoring synchronized output; if you still see flicker under tmux 3.4 or later, upgrade to the newest tmux. This detection requires Claude Code v2.1.200 or later. ##
modified Claude Code GitHub Actions View current →
Show diff (153 lines)
--- a/github-actions.md +++ b/github-actions.md @@ -46,7 +46,7 @@ * You must be a repository admin to install the GitHub app and add secrets * The GitHub app will request read & write permissions for Contents, Issues, and Pull requests - * This quickstart method is only available for direct Claude API users. If you’re using Amazon Bedrock or Google Vertex AI, see the Using with Amazon Bedrock & Google Vertex AI section. + * This quickstart method is only available for direct Claude API users. If you’re using Amazon Bedrock or Google Cloud’s Agent Platform, see the Using with Amazon Bedrock and Google Cloud section. ## @@ -320,7 +320,7 @@ ​ -Using with Amazon Bedrock & Google Vertex AI +Using with Amazon Bedrock and Google Cloud For enterprise environments, you can use Claude Code GitHub Actions with your own cloud infrastructure. This approach gives you control over data residency and billing while maintaining the same functionality. @@ -336,9 +336,9 @@ ​ -For Google Cloud Vertex AI: - - 1. A Google Cloud Project with Vertex AI enabled +For Google Cloud’s Agent Platform: + + 1. A Google Cloud Project with Google Cloud’s Agent Platform enabled 2. Workload Identity Federation configured for GitHub Actions 3. A service account with the required permissions 4. A GitHub App (recommended) or use the default GITHUB_TOKEN @@ -351,14 +351,14 @@ 1. An AWS account with Amazon Bedrock enabled 2. GitHub OIDC Identity Provider configured in AWS - 3. An IAM role with Bedrock permissions + 3. An IAM role with Amazon Bedrock permissions 4. A GitHub App (recommended) or use the default GITHUB_TOKEN 1 Create a custom GitHub App (Recommended for 3P Providers) -For best control and security when using 3P providers like Vertex AI or Bedrock, we recommend creating your own GitHub App: +For best control and security when using 3P providers like Google Cloud’s Agent Platform or Amazon Bedrock, we recommend creating your own GitHub App: 1. Go to <https://github.com/settings/apps/new> 2. Fill in the basic information: @@ -427,7 +427,7 @@ See [AWS documentation](<https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html>) for detailed OIDC setup instructions. -Google Vertex AI +Google Cloud's Agent Platform **Configure Google Cloud to allow GitHub Actions to authenticate securely without storing credentials.** @@ -438,7 +438,7 @@ 1. **Enable APIs** in your Google Cloud project: * IAM Credentials API * Security Token Service (STS) API - * Vertex AI API + * Google Cloud’s Agent Platform API 2. **Create Workload Identity Federation resources** : * Create a Workload Identity Pool * Add a GitHub OIDC provider with: @@ -483,7 +483,7 @@ ​ -For Google Cloud Vertex AI +For Google Cloud’s Agent Platform 1. **For GCP Authentication** : * `GCP_WORKLOAD_IDENTITY_PROVIDER` @@ -508,7 +508,7 @@ Create workflow files -Create GitHub Actions workflow files that integrate with your cloud provider. The examples below show complete configurations for both Amazon Bedrock and Google Vertex AI: +Create GitHub Actions workflow files that integrate with your cloud provider. The examples below show complete configurations for both Amazon Bedrock and Google Cloud’s Agent Platform: Amazon Bedrock workflow @@ -516,13 +516,13 @@ * Amazon Bedrock access enabled with Claude model permissions * GitHub configured as an OIDC identity provider in AWS - * IAM role with Bedrock permissions that trusts GitHub Actions + * IAM role with Amazon Bedrock permissions that trusts GitHub Actions **Required GitHub secrets:** Secret Name| Description ---|--- -`AWS_ROLE_TO_ASSUME`| ARN of the IAM role for Bedrock access +`AWS_ROLE_TO_ASSUME`| ARN of the IAM role for Amazon Bedrock access `APP_ID`| Your GitHub App ID (from app settings) `APP_PRIVATE_KEY`| The private key you generated for your GitHub App @@ -574,22 +574,22 @@ use_bedrock: "true" claude_args: '--model us.anthropic.claude-sonnet-4-6 --max-turns 10' -The model ID format for Bedrock includes a region prefix (for example, `us.anthropic.claude-sonnet-4-6`). - -Google Vertex AI workflow +The model ID format for Amazon Bedrock includes a region prefix (for example, `us.anthropic.claude-sonnet-4-6`). + +Google Cloud's Agent Platform workflow **Prerequisites:** - * Vertex AI API enabled in your GCP project + * Google Cloud’s Agent Platform API enabled in your GCP project * Workload Identity Federation configured for GitHub - * Service account with Vertex AI permissions + * Service account with Google Cloud’s Agent Platform permissions **Required GitHub secrets:** Secret Name| Description ---|--- `GCP_WORKLOAD_IDENTITY_PROVIDER`| Workload identity provider resource name -`GCP_SERVICE_ACCOUNT`| Service account email with Vertex AI access +`GCP_SERVICE_ACCOUNT`| Service account email with Google Cloud’s Agent Platform access `APP_ID`| Your GitHub App ID (from app settings) `APP_PRIVATE_KEY`| The private key you generated for your GitHub App @@ -675,7 +675,7 @@ Authentication errors -Confirm API key is valid and has sufficient permissions. For Bedrock/Vertex, check credentials configuration and ensure secrets are named correctly in workflows. +Confirm API key is valid and has sufficient permissions. For Amazon Bedrock or Google Cloud’s Agent Platform, check credentials configuration and ensure secrets are named correctly in workflows. ## @@ -701,10 +701,10 @@ `github_token`| GitHub token for API access| No `trigger_phrase`| Custom trigger phrase (default: “@claude”)| No `use_bedrock`| Use Amazon Bedrock instead of Claude API| No -`use_vertex`| Use Google Vertex AI instead of Claude API| No +`use_vertex`| Use Google Cloud’s Agent Platform instead of Claude API| No *Prompt is optional - when omitted for issue/PR comments, Claude responds to trigger phrase -**Required for direct Claude API, not for Bedrock/Vertex +**Required for direct Claude API, not for Amazon Bedrock or Google Cloud’s Agent Platform ####
modified Claude Code with GitHub Enterprise Server View current →
--- a/github-enterprise-server.md +++ b/github-enterprise-server.md @@ -12,7 +12,7 @@ Feature| GHES support| Notes ---|---|--- -Claude Code on the web| ✅ Supported| An Owner connects the GHES instance once; developers use `claude --remote` or [claude.ai/code](<https://claude.ai/code>) as usual +Claude Code on the web| ✅ Supported| An Owner connects the GHES instance once; developers use `claude --cloud` or [claude.ai/code](<https://claude.ai/code>) as usual Code Review| ✅ Supported| Same automated PR reviews as github.com Claude Security| ✅ Supported| Available in public beta for Enterprise plans at [claude.ai/security](<https://claude.ai/security>) Teleport sessions| ✅ Supported| Move sessions between web and terminal with `--teleport` @@ -108,7 +108,7 @@ Then start a web session. Claude detects the GHES host from your git remote and routes the session through your organization’s configured instance: - claude --remote "Add retry logic to the payment webhook handler" + claude --cloud "Add retry logic to the payment webhook handler" The session runs on Anthropic infrastructure, clones your repository from GHES, and pushes changes back to a branch. Monitor progress with `/tasks` or at [claude.ai/code](<https://claude.ai/code>). See [Claude Code on the web](</docs/en/claude-code-on-the-web>) for the full cloud session workflow including diff review, auto-fix, and routines. @@ -199,7 +199,7 @@ Web session fails to clone repository -If `claude --remote` fails with a clone error, verify that an Owner has completed setup for your GHES instance and that the GitHub App is installed on the repository you’re working in. Ask the Owner who connected the instance to confirm that the hostname registered in Claude settings matches the hostname in your git remote. +If `claude --cloud` fails with a clone error, verify that an Owner has completed setup for your GHES instance and that the GitHub App is installed on the repository you’re working in. Ask the Owner who connected the instance to confirm that the hostname registered in Claude settings matches the hostname in your git remote. ###
modified Claude Code GitLab CI/CD View current →
Show diff (193 lines)
--- a/gitlab-ci-cd.md +++ b/gitlab-ci-cd.md @@ -12,7 +12,7 @@ * **Automated implementation** : Turn issues into working code with a single command or mention * **Project-aware** : Claude follows your `CLAUDE.md` guidelines and existing code patterns * **Simple setup** : Add one job to `.gitlab-ci.yml` and a masked CI/CD variable - * **Enterprise-ready** : Choose Claude API, Amazon Bedrock, or Google Vertex AI to meet data residency and procurement needs + * **Enterprise-ready** : Choose Claude API, Amazon Bedrock, or Google Cloud’s Agent Platform to meet data residency and procurement needs * **Secure by default** : Runs in your GitLab runners with your branch protection and approvals ## @@ -27,7 +27,7 @@ 2. **Provider abstraction** : Use the provider that fits your environment: * Claude API (SaaS) * Amazon Bedrock (IAM-based access, cross-region options) - * Google Vertex AI (GCP-native, Workload Identity Federation) + * Google Cloud’s Agent Platform (GCP-native, Workload Identity Federation) 3. **Sandboxed execution** : Each interaction runs in a container with strict network and filesystem rules. Claude Code enforces workspace-scoped permissions to constrain writes. Every change flows through an MR so reviewers see the diff and approvals still apply. Pick regional endpoints to reduce latency and meet data-sovereignty requirements while using existing cloud agreements. @@ -98,7 +98,7 @@ After adding the job and your `ANTHROPIC_API_KEY` variable, test by running the job manually from **CI/CD** → **Pipelines** , or trigger it from an MR to let Claude propose updates in a branch and open an MR if needed. -To run on Amazon Bedrock or Google Vertex AI instead of the Claude API, see the Using with Amazon Bedrock & Google Vertex AI section below for authentication and environment setup. +To run on Amazon Bedrock or Google Cloud’s Agent Platform instead of the Claude API, see the Using with Amazon Bedrock and Google Cloud section below for authentication and environment setup. ### @@ -110,8 +110,8 @@ 1. **Configure provider access** : * **Claude API** : Create and store `ANTHROPIC_API_KEY` as a masked CI/CD variable - * **Amazon Bedrock** : **Configure GitLab** → **AWS OIDC** and create an IAM role for Bedrock - * **Google Vertex AI** : **Configure Workload Identity Federation for GitLab** → **GCP** + * **Amazon Bedrock** : **Configure GitLab** → **AWS OIDC** and create an IAM role for Amazon Bedrock + * **Google Cloud’s Agent Platform** : **Configure Workload Identity Federation for GitLab** → **GCP** 2. **Add project credentials for GitLab API operations** : * Use `CI_JOB_TOKEN` by default, or create a Project Access Token with `api` scope * Store as `GITLAB_ACCESS_TOKEN` (masked) if using a PAT @@ -166,13 +166,13 @@ ​ -Using with Amazon Bedrock & Google Vertex AI +Using with Amazon Bedrock and Google Cloud For enterprise environments, you can run Claude Code entirely on your cloud infrastructure with the same developer experience. * Amazon Bedrock - * Google Vertex AI + * Google Cloud's Agent Platform ### @@ -184,10 +184,10 @@ 1. An AWS account with Amazon Bedrock access to the desired Claude models 2. GitLab configured as an OIDC identity provider in AWS IAM - 3. An IAM role with Bedrock permissions and a trust policy restricted to your GitLab project/refs + 3. An IAM role with Amazon Bedrock permissions and a trust policy restricted to your GitLab project/refs 4. GitLab CI/CD variables for role assumption: * `AWS_ROLE_TO_ASSUME` (role ARN) - * `AWS_REGION` (Bedrock region) + * `AWS_REGION` (Amazon Bedrock region) ### @@ -200,7 +200,7 @@ 1. Enable Amazon Bedrock and request access to your target Claude models 2. Create an IAM OIDC provider for GitLab if not already present 3. Create an IAM role trusted by the GitLab OIDC provider, restricted to your project and protected refs - 4. Attach least-privilege permissions for Bedrock invoke APIs + 4. Attach least-privilege permissions for Amazon Bedrock invoke APIs **Required values to store in CI/CD variables:** @@ -221,12 +221,12 @@ Prerequisites -Before setting up Claude Code with Google Vertex AI, you need: +Before setting up Claude Code with Google Cloud’s Agent Platform, you need: 1. A Google Cloud project with: - * Vertex AI API enabled + * Google Cloud’s Agent Platform API enabled * Workload Identity Federation configured to trust GitLab OIDC - 2. A dedicated service account with only the required Vertex AI roles + 2. A dedicated service account with only the required Google Cloud’s Agent Platform roles 3. GitLab CI/CD variables for WIF: * `GCP_WORKLOAD_IDENTITY_PROVIDER` (full resource name) * `GCP_SERVICE_ACCOUNT` (service account email) @@ -239,9 +239,9 @@ Configure Google Cloud to allow GitLab CI jobs to impersonate a service account via Workload Identity Federation.**Required setup:** - 1. Enable IAM Credentials API, STS API, and Vertex AI API + 1. Enable IAM Credentials API, STS API, and Google Cloud’s Agent Platform API 2. Create a Workload Identity Pool and provider for GitLab OIDC - 3. Create a dedicated service account with Vertex AI roles + 3. Create a dedicated service account with Google Cloud’s Agent Platform roles 4. Grant the WIF principal permission to impersonate the service account **Required values to store in CI/CD variables:** @@ -251,12 +251,12 @@ Add variables in Settings → CI/CD → Variables: - # For Google Vertex AI: + # For Google Cloud's Agent Platform: - GCP_WORKLOAD_IDENTITY_PROVIDER - GCP_SERVICE_ACCOUNT - CLOUD_ML_REGION (for example, us-east5) -Use the Google Vertex AI job example above to authenticate without storing keys. +Use the job example above for Google Cloud’s Agent Platform to authenticate without storing keys. ## @@ -307,12 +307,12 @@ * Amazon Bedrock enabled with access to your chosen Claude model(s) * GitLab OIDC configured in AWS with a role that trusts your GitLab project and refs - * IAM role with Bedrock permissions (least privilege recommended) + * IAM role with Amazon Bedrock permissions (least privilege recommended) **Required CI/CD variables:** - * `AWS_ROLE_TO_ASSUME`: ARN of the IAM role for Bedrock access - * `AWS_REGION`: Bedrock region (for example, `us-west-2`) + * `AWS_ROLE_TO_ASSUME`: ARN of the IAM role for Amazon Bedrock access + * `AWS_REGION`: Amazon Bedrock region (for example, `us-west-2`) claude-bedrock: stage: ai @@ -346,25 +346,25 @@ variables: AWS_REGION: "us-west-2" -Model IDs for Bedrock include region-specific prefixes (for example, `us.anthropic.claude-sonnet-4-6`). Pass the desired model via your job configuration or prompt if your workflow supports it. - -### - -​ - -Google Vertex AI job example (Workload Identity Federation) +Model IDs for Amazon Bedrock include region-specific prefixes (for example, `us.anthropic.claude-sonnet-4-6`). Pass the desired model via your job configuration or prompt if your workflow supports it. + +### + +​ + +Agent Platform job example (Workload Identity Federation) **Prerequisites:** - * Vertex AI API enabled in your GCP project + * Google Cloud’s Agent Platform API enabled in your GCP project * Workload Identity Federation configured to trust GitLab OIDC - * A service account with Vertex AI permissions + * A service account with Google Cloud’s Agent Platform permissions **Required CI/CD variables:** * `GCP_WORKLOAD_IDENTITY_PROVIDER`: Full provider resource name * `GCP_SERVICE_ACCOUNT`: Service account email - * `CLOUD_ML_REGION`: Vertex region (for example, `us-east5`) + * `CLOUD_ML_REGION`: Google Cloud’s Agent Platform region (for example, `us-east5`) claude-vertex: stage: ai @@ -504,7 +504,7 @@ Authentication errors * **For Claude API** : Confirm `ANTHROPIC_API_KEY` is valid and unexpired - * **For Bedrock/Vertex** : Verify OIDC/WIF configuration, role impersonation, and secret names; confirm region and model availability + * **For Amazon Bedrock or Google Cloud’s Agent Platform** : Verify OIDC/WIF configuration, role impersonation, and secret names; confirm region and model availability ## @@ -523,8 +523,8 @@ * `prompt` / `prompt_file`: Provide instructions inline (`-p`) or via a file * `max_turns`: Limit the number of back-and-forth iterations * `timeout_minutes`: Limit total execution time - * `ANTHROPIC_API_KEY`: Required for the Claude API (not used for Bedrock/Vertex) - * Provider-specific environment: `AWS_REGION`, project/region vars for Vertex + * `ANTHROPIC_API_KEY`: Required for the Claude API (not used for Amazon Bedrock or Google Cloud’s Agent Platform) + * Provider-specific environment: `AWS_REGION`, project/region vars for Google Cloud’s Agent Platform Exact flags and parameters may vary by version of `@anthropic-ai/claude-code`. Run `claude --help` in your job to see supported options.
modified Glossary View current →
--- a/glossary.md +++ b/glossary.md @@ -272,7 +272,7 @@ Permission mode -The baseline approval behavior for the session. Cycle with `Shift+Tab` in the CLI or use the mode selector in VS Code, Desktop, and claude.ai. Available modes are `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, and `bypassPermissions`. Learn more: [Choose a permission mode](</docs/en/permission-modes>) +The baseline approval behavior for the session. Cycle with `Shift+Tab` in the CLI or use the mode selector in VS Code, Desktop, and claude.ai. Available modes are `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, and `bypassPermissions`. The `default` mode is labeled Manual in the CLI and in the VS Code and JetBrains extensions, and Claude Code accepts `manual` as an alias for the value. Learn more: [Choose a permission mode](</docs/en/permission-modes>) ### @@ -402,7 +402,7 @@ Teleport -A command, `/teleport`, that pulls a cloud Claude Code session into your local terminal. Claude fetches the branch, loads the conversation history, and resumes from the web session’s last state. The reverse direction is `--remote`, which sends a local task to run on the web. Learn more: [From web to terminal](</docs/en/claude-code-on-the-web#from-web-to-terminal>) +A command, `/teleport`, that pulls a cloud Claude Code session into your local terminal. Claude fetches the branch, loads the conversation history, and resumes from the web session’s last state. The reverse direction is `--cloud`, which sends a local task to run on the web. Learn more: [From web to terminal](</docs/en/claude-code-on-the-web#from-web-to-terminal>) ###
modified Claude Code on Google Cloud's Agent Platform View current →
Show diff (206 lines)
--- a/google-vertex-ai.md +++ b/google-vertex-ai.md @@ -4,37 +4,37 @@ Prerequisites -Before configuring Claude Code with Vertex AI, ensure you have: +Before configuring Claude Code with Google Cloud’s Agent Platform, formerly Vertex AI, ensure you have: * A Google Cloud Platform (GCP) account with billing enabled - * A GCP project with Vertex AI API enabled + * A GCP project with Google Cloud’s Agent Platform API enabled * Access to desired Claude models (for example, Claude Sonnet 4.6) * Google Cloud SDK (`gcloud`) installed and configured * Quota allocated in desired GCP region -To sign in with your own Vertex AI credentials, follow Sign in with Vertex AI below. To deploy Claude Code across a team, use the manual setup steps and pin your model versions before rolling out. - -## - -​ - -Sign in with Vertex AI - -If you have Google Cloud credentials and want to start using Claude Code through Vertex AI, the login wizard walks you through it. You complete the GCP-side prerequisites once per project; the wizard handles the Claude Code side. - -The Vertex AI setup wizard requires Claude Code v2.1.98 or later. Run `claude --version` to check. +To sign in with your own Google Cloud’s Agent Platform credentials, follow Sign in with Google Cloud’s Agent Platform below. To deploy Claude Code across a team, use the manual setup steps and pin your model versions before rolling out. + +## + +​ + +Sign in with Agent Platform + +If you have Google Cloud credentials and want to start using Claude Code through Google Cloud’s Agent Platform, the login wizard walks you through it. You complete the GCP-side prerequisites once per project; the wizard handles the Claude Code side. + +The Google Cloud’s Agent Platform setup wizard requires Claude Code v2.1.98 or later. Run `claude --version` to check. 1 Enable Claude models in your GCP project -Enable the Vertex AI API for your project, then request access to the Claude models you want in the [Vertex AI Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>). See IAM configuration for the permissions your account needs. +Enable Google Cloud’s Agent Platform API for your project, then request access to the Claude models you want in the [Google Cloud’s Agent Platform Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>). See IAM configuration for the permissions your account needs. 2 -Start Claude Code and choose Vertex AI - -Run `claude`. At the login prompt, select **3rd-party platform** , then **Google Vertex AI**. +Start Claude Code and choose Google Cloud's Agent Platform + +Run `claude`. At the login prompt, select **3rd-party platform** , then **Google Vertex AI** , the label the login prompt still uses for Google Cloud’s Agent Platform. 3 @@ -50,9 +50,9 @@ Region configuration -Claude Code supports Vertex AI [global](<https://cloud.google.com/blog/products/ai-machine-learning/global-endpoint-for-claude-models-generally-available-on-vertex-ai>), multi-region, and regional endpoints. Set `CLOUD_ML_REGION` to `global`, a multi-region location such as `eu` or `us`, or a specific region such as `us-east5`. Claude Code selects the correct Vertex AI hostname for each form, including the `aiplatform.eu.rep.googleapis.com` and `aiplatform.us.rep.googleapis.com` hosts for multi-region locations. - -Vertex AI may not support the Claude Code default models on every endpoint type. Model availability varies across [specific regions](<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#genai-partner-models>), multi-region locations, and [global endpoints](<https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models#supported_models>). You may need to switch to a supported location or specify a supported model. +Claude Code supports Google Cloud’s Agent Platform [global](<https://cloud.google.com/blog/products/ai-machine-learning/global-endpoint-for-claude-models-generally-available-on-vertex-ai>), multi-region, and regional endpoints. Set `CLOUD_ML_REGION` to `global`, a multi-region location such as `eu` or `us`, or a specific region such as `us-east5`. Claude Code selects the correct Google Cloud’s Agent Platform hostname for each form, including the `aiplatform.eu.rep.googleapis.com` and `aiplatform.us.rep.googleapis.com` hosts for multi-region locations. + +Google Cloud’s Agent Platform may not support the Claude Code default models on every endpoint type. Model availability varies across [specific regions](<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#genai-partner-models>), multi-region locations, and [global endpoints](<https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models#supported_models>). You may need to switch to a supported location or specify a supported model. ## @@ -60,20 +60,20 @@ Set up manually -To configure Vertex AI through environment variables instead of the wizard, for example in CI or a scripted enterprise rollout, follow the steps below. - -### - -​ - -1\. Enable Vertex AI API - -Enable the Vertex AI API in your GCP project: +To configure Google Cloud’s Agent Platform through environment variables instead of the wizard, for example in CI or a scripted enterprise rollout, follow the steps below. + +### + +​ + +1\. Enable Agent Platform API + +Enable Google Cloud’s Agent Platform API in your GCP project: # Set your project ID gcloud config set project YOUR-PROJECT-ID - # Enable Vertex AI API + # Enable Agent Platform API gcloud services enable aiplatform.googleapis.com ### @@ -82,9 +82,9 @@ 2\. Request model access -Request access to Claude models in Vertex AI: - - 1. Navigate to the [Vertex AI Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>) +Request access to Claude models in Google Cloud’s Agent Platform: + + 1. Navigate to the [Google Cloud’s Agent Platform Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>) 2. Search for “Claude” models 3. Request access to desired Claude models (for example, Claude Sonnet 4.6) 4. Wait for approval (may take 24-48 hours) @@ -97,7 +97,7 @@ Claude Code uses standard Google Cloud authentication. For more information, see [Google Cloud authentication documentation](<https://cloud.google.com/docs/authentication>). Claude Code v2.1.121 or later supports [X.509 certificate-based Workload Identity Federation](<https://cloud.google.com/iam/docs/workload-identity-federation-with-x509-certificates>) through the same Application Default Credentials chain. Set `GOOGLE_APPLICATION_CREDENTIALS` to the path of your credential configuration file. -Claude Code uses `ANTHROPIC_VERTEX_PROJECT_ID` as the project ID for Vertex AI requests. The `GCLOUD_PROJECT` and `GOOGLE_CLOUD_PROJECT` environment variables and the credential file referenced by `GOOGLE_APPLICATION_CREDENTIALS` take precedence over it. If none of these are set, the project ID is resolved from your `gcloud` configuration or the attached service account. +Claude Code uses `ANTHROPIC_VERTEX_PROJECT_ID` as the project ID for Google Cloud’s Agent Platform requests. The `GCLOUD_PROJECT` and `GOOGLE_CLOUD_PROJECT` environment variables and the credential file referenced by `GOOGLE_APPLICATION_CREDENTIALS` take precedence over it. If none of these are set, the project ID is resolved from your `gcloud` configuration or the attached service account. #### @@ -124,12 +124,12 @@ Set the following environment variables: - # Enable Vertex AI integration + # Enable Agent Platform integration export CLAUDE_CODE_USE_VERTEX=1 export CLOUD_ML_REGION=global export ANTHROPIC_VERTEX_PROJECT_ID=YOUR-PROJECT-ID - # Optional: Override the Vertex endpoint URL for custom endpoints or gateways + # Optional: Override the Agent Platform endpoint URL for custom endpoints or gateways # export ANTHROPIC_VERTEX_BASE_URL=https://aiplatform.googleapis.com # Optional: Disable prompt caching if needed @@ -142,7 +142,7 @@ export VERTEX_REGION_CLAUDE_HAIKU_4_5=us-east5 export VERTEX_REGION_CLAUDE_4_6_SONNET=europe-west1 -Most model versions have a corresponding `VERTEX_REGION_CLAUDE_*` variable. See the [Environment variables reference](</docs/en/env-vars>) for the full list. Check [Vertex Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>) to determine which models support global endpoints versus regional only. [Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To disable it, set `DISABLE_PROMPT_CACHING=1`. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`; cache writes with a 1-hour TTL are billed at a higher rate. For heightened rate limits, contact Google Cloud support. When using Vertex AI, the `/logout` command is unavailable since authentication is handled through Google Cloud credentials. Claude Code disables [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) by default on Vertex AI, so MCP tool definitions load upfront. Vertex AI supports tool search for Claude Sonnet 4.5 and later and Claude Opus 4.5 and later. Set `ENABLE_TOOL_SEARCH=true` to enable it on those models. Earlier models on Vertex AI do not accept the required beta header, and requests fail if you enable tool search with them. +Most model versions have a corresponding `VERTEX_REGION_CLAUDE_*` variable. See the [Environment variables reference](</docs/en/env-vars>) for the full list. Check [Google Cloud’s Agent Platform Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>) to determine which models support global endpoints versus regional only. [Prompt caching](</docs/en/prompt-caching>) is enabled automatically. To disable it, set `DISABLE_PROMPT_CACHING=1`. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`; cache writes with a 1-hour TTL are billed at a higher rate. For heightened rate limits, contact Google Cloud support. When using Google Cloud’s Agent Platform, the `/logout` command is unavailable since authentication is handled through Google Cloud credentials. Claude Code disables [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>) by default on Google Cloud’s Agent Platform, so MCP tool definitions load upfront. Google Cloud’s Agent Platform supports tool search for Claude Sonnet 4.5 and later and Claude Opus 4.5 and later. Set `ENABLE_TOOL_SEARCH=true` to enable it on those models. Earlier models on Google Cloud’s Agent Platform do not accept the required beta header, and requests fail if you enable tool search with them. ### @@ -150,9 +150,9 @@ 5\. Pin model versions -Pin specific model versions when deploying to multiple users. Without pinning, model aliases such as `sonnet` and `opus` resolve to Claude Code’s built-in default for Vertex AI, which can lag the newest release and may not yet be enabled in your project. Claude Code falls back to the previous version at startup when the default is unavailable, but pinning lets you control when your users move to a new model. - -Set these environment variables to specific Vertex AI model IDs. 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: +Pin specific model versions when deploying to multiple users. Without pinning, model aliases such as `sonnet` and `opus` resolve to Claude Code’s built-in default for Google Cloud’s Agent Platform, which can lag the newest release and may not yet be enabled in your project. Claude Code falls back to the previous version at startup when the default is unavailable, but pinning lets you control when your users move to a new model. + +Set these environment variables to specific Google Cloud’s Agent Platform model IDs. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Google Cloud’s Agent Platform 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-5' @@ -165,7 +165,7 @@ Primary model| `claude-sonnet-4-5@20250929` Small/fast model| Same as primary model -Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On Vertex AI, Claude Code defaults this to the primary model because Haiku may not be enabled in every project or region. To use Haiku for background tasks, set `ANTHROPIC_DEFAULT_HAIKU_MODEL` to a model ID that is available in your project. To customize models further: +Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On Google Cloud’s Agent Platform, Claude Code defaults this to the primary model because Haiku may not be enabled in every project or region. To use Haiku for background tasks, set `ANTHROPIC_DEFAULT_HAIKU_MODEL` to a model ID that is available in your project. To customize models further: export ANTHROPIC_MODEL='claude-opus-4-8' export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5@20251001' @@ -176,7 +176,7 @@ Startup model checks -When Claude Code starts with Vertex AI configured, it verifies that the models it intends to use are accessible in your project. This check requires Claude Code v2.1.98 or later. If you have pinned a model version that is older than the current Claude Code default, and your project can invoke the newer version, Claude Code prompts you to update the pin. Accepting writes the new model ID to your [user settings file](</docs/en/settings>) and restarts Claude Code. Declining is remembered until the next default version change. If you have not pinned a model and the current default is unavailable in your project, Claude Code falls back to the previous version for the current session and shows a notice. The fallback is not persisted. Enable the newer model in [Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>) or pin a version to make the choice permanent. +When Claude Code starts with Google Cloud’s Agent Platform configured, it verifies that the models it intends to use are accessible in your project. This check requires Claude Code v2.1.98 or later. If you have pinned a model version that is older than the current Claude Code default, and your project can invoke the newer version, Claude Code prompts you to update the pin. Accepting writes the new model ID to your [user settings file](</docs/en/settings>) and restarts Claude Code. Declining is remembered until the next default version change. If you have not pinned a model and the current default is unavailable in your project, Claude Code falls back to the previous version for the current session and shows a notice. The fallback is not persisted. Enable the newer model in [Model Garden](<https://console.cloud.google.com/vertex-ai/model-garden>) or pin a version to make the choice permanent. ## @@ -188,7 +188,7 @@ * `aiplatform.endpoints.predict` \- Required for model invocation and token counting -For more restrictive permissions, create a custom role with only the permissions above. For details, see [Vertex IAM documentation](<https://cloud.google.com/vertex-ai/docs/general/access-control>). +For more restrictive permissions, create a custom role with only the permissions above. For details, see [Google Cloud’s Agent Platform IAM documentation](<https://cloud.google.com/vertex-ai/docs/general/access-control>). Create a dedicated GCP project for Claude Code to simplify cost tracking and access control. @@ -198,7 +198,7 @@ 1M token context window -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. +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 Google Cloud’s Agent Platform. 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. ## @@ -235,6 +235,6 @@ Additional resources - * [Vertex AI documentation](<https://cloud.google.com/vertex-ai/docs>) - * [Vertex AI pricing](<https://cloud.google.com/vertex-ai/pricing>) - * [Vertex AI quotas and limits](<https://cloud.google.com/vertex-ai/docs/quotas>) + * [Google Cloud’s Agent Platform documentation](<https://cloud.google.com/vertex-ai/docs>) + * [Google Cloud’s Agent Platform pricing](<https://cloud.google.com/vertex-ai/pricing>) + * [Google Cloud’s Agent Platform quotas and limits](<https://cloud.google.com/vertex-ai/docs/quotas>)
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -40,7 +40,7 @@ Custom agents| `--agents <json>` A plugin| `--plugin-dir <path>`, `--plugin-url <url>` -Bare mode skips OAuth and keychain reads. Anthropic authentication must come from `ANTHROPIC_API_KEY` or an `apiKeyHelper` in the JSON passed to `--settings`. Bedrock, Vertex, and Foundry use their usual provider credentials. +Bare mode skips OAuth and keychain reads. Anthropic authentication must come from `ANTHROPIC_API_KEY` or an `apiKeyHelper` in the JSON passed to `--settings`. Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry use their usual provider credentials. `--bare` is the recommended mode for scripted and SDK calls, and will become the default for `-p` in a future release.
modified Hooks reference View current →
--- a/hooks.md +++ b/hooks.md @@ -572,7 +572,7 @@ `prompt_id`| UUID identifying the user prompt currently being processed. Matches the [`prompt.id` attribute on OpenTelemetry events](</docs/en/monitoring-usage#event-correlation-attributes>), so you can correlate hook output with telemetry for a single prompt. Absent until the first user input. Requires Claude Code v2.1.196 or later `transcript_path`| Path to conversation JSON `cwd`| Current working directory when the hook is invoked -`permission_mode`| Current [permission mode](</docs/en/permissions#permission-modes>): `"default"`, `"plan"`, `"acceptEdits"`, `"auto"`, `"dontAsk"`, or `"bypassPermissions"`. Not all events receive this field: see each event’s JSON example below to check +`permission_mode`| Current [permission mode](</docs/en/permissions#permission-modes>): `"default"`, `"plan"`, `"acceptEdits"`, `"auto"`, `"dontAsk"`, or `"bypassPermissions"`. The mode labeled **Manual** arrives as `"default"`, never as `"manual"`, so scripts that match `"default"` keep working. Not all events receive this field. Check the JSON example in each hook event section `effort`| Object with a `level` field holding the active [effort level](</docs/en/model-config#adjust-effort-level>) for the turn: `"low"`, `"medium"`, `"high"`, `"xhigh"`, or `"max"`. If the requested model effort exceeds what the current model supports, this is the downgraded level the model actually used. Ultracode is not a distinct level and reports as `"xhigh"`. The object matches the [status line](</docs/en/statusline#available-data>) `effort` field. Present for events that fire within a tool-use context, such as `PreToolUse`, `PostToolUse`, `Stop`, and `SubagentStop`, when the current model supports the effort parameter. The level is also available to hook commands and the Bash tool as the `$CLAUDE_EFFORT` environment variable. `hook_event_name`| Name of the event that fired @@ -1576,7 +1576,7 @@ `addRules`| `rules`, `behavior`, `destination`| Adds permission rules. `rules` is an array of `{toolName, ruleContent?}` objects. Omit `ruleContent` to match the whole tool. `behavior` is `"allow"`, `"deny"`, or `"ask"` `replaceRules`| `rules`, `behavior`, `destination`| Replaces all rules of the given `behavior` at the `destination` with the provided `rules` `removeRules`| `rules`, `behavior`, `destination`| Removes matching rules of the given `behavior` -`setMode`| `mode`, `destination`| Changes the permission mode. Valid modes are `default`, `auto`, `acceptEdits`, `dontAsk`, `bypassPermissions`, and `plan` +`setMode`| `mode`, `destination`| Changes the permission mode. Valid modes are `default`, `auto`, `acceptEdits`, `dontAsk`, `bypassPermissions`, `plan`, and `manual` as an alias for `default`. The `manual` alias requires Claude Code v2.1.200 or later `addDirectories`| `directories`, `destination`| Adds working directories. `directories` is an array of path strings `removeDirectories`| `directories`, `destination`| Removes working directories
modified Hosting the Agent SDK View current →
--- a/hosting.md +++ b/hosting.md @@ -156,7 +156,7 @@ Network -The SDK needs outbound HTTPS to `api.anthropic.com`, or to your provider’s regional endpoint when running on Bedrock or Vertex. If your agents use [MCP servers](</docs/en/agent-sdk/mcp>) or external tools, they need outbound access to those endpoints as well. For production, route outbound traffic through an egress proxy that enforces domain allowlists, injects credentials, and logs requests. See [Secure Deployment](</docs/en/agent-sdk/secure-deployment>) for the full pattern. For inbound traffic, expose an HTTP or WebSocket port on the container. Your application handles client requests on that port and calls the SDK internally; the subprocess itself does not listen on the network. +The SDK needs outbound HTTPS to `api.anthropic.com`, or to your provider’s regional endpoint when running on Amazon Bedrock or Google Cloud’s Agent Platform. If your agents use [MCP servers](</docs/en/agent-sdk/mcp>) or external tools, they need outbound access to those endpoints as well. For production, route outbound traffic through an egress proxy that enforces domain allowlists, injects credentials, and logs requests. See [Secure Deployment](</docs/en/agent-sdk/secure-deployment>) for the full pattern. For inbound traffic, expose an HTTP or WebSocket port on the container. Your application handles client requests on that port and calls the SDK internally; the subprocess itself does not listen on the network. ##
modified What's new View current →
--- a/index.md +++ b/index.md @@ -38,7 +38,7 @@ June 1–5, 2026 -**Auto mode on Bedrock, Vertex, and Foundry** : auto mode is now available on third-party providers for Opus 4.7 and Opus 4.8, replacing permission prompts with background safety checks.Also this week: **safer automatic edits** prompt before writing files that can run code in `acceptEdits` mode; **`/plugin list`** prints your installed plugins inline; and **version requirements** let managed deployments require an approved Claude Code version range.[Read the Week 23 digest →](</docs/en/whats-new/2026-w23>) +**Auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry** : auto mode is now available on third-party providers for Opus 4.7 and Opus 4.8, replacing permission prompts with background safety checks.Also this week: **safer automatic edits** prompt before writing files that can run code in `acceptEdits` mode; **`/plugin list`** prints your installed plugins inline; and **version requirements** let managed deployments require an approved Claude Code version range.[Read the Week 23 digest →](</docs/en/whats-new/2026-w23>) ​
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -34,7 +34,7 @@ `Up/Down arrows` or `Ctrl+P`/`Ctrl+N`| Move cursor or navigate command history| When the input spans more than one visual row, whether wrapped or multiline, first moves the cursor within the prompt. Once the cursor is on the first or last visual row, pressing again navigates command history. As of v2.1.169, wrapped single-line input behaves the same as multiline `Esc`| Interrupt Claude| Stop the current response or tool call mid-turn so you can redirect. Claude keeps the work done so far `Esc` \+ `Esc`| Clear input draft, or rewind| When the prompt input contains text, double `Esc` clears it and saves the draft to history so `Up` recalls it. When the input is empty, double `Esc` opens the [rewind menu](</docs/en/checkpointing>) to restore or summarize code and conversation from a previous point -`Shift+Tab` or `Alt+M` (some configurations)| Cycle permission modes| Cycle through `default`, `acceptEdits`, `plan`, and any modes you have enabled, such as `auto` or `bypassPermissions`. See [permission modes](</docs/en/permission-modes>). +`Shift+Tab` or `Alt+M` (some configurations)| Cycle permission modes| Cycle through `default` (labeled Manual in the mode indicator), `acceptEdits`, `plan`, and any modes you have enabled, such as `auto` or `bypassPermissions`. See [permission modes](</docs/en/permission-modes>). `Option+P` (macOS) or `Alt+P` (Windows/Linux)| Switch model| Switch models without clearing your prompt `Option+T` (macOS) or `Alt+T` (Windows/Linux)| Toggle extended thinking| Enable or disable extended thinking mode. Has no effect on Fable 5, which always uses extended thinking. As of v2.1.132 this shortcut works on macOS without configuring Option as Meta `Option+O` (macOS) or `Alt+O` (Windows/Linux)| Toggle fast mode| Enable or disable [fast mode](</docs/en/fast-mode>)
modified Customize keyboard shortcuts View current →
--- a/keybindings.md +++ b/keybindings.md @@ -519,10 +519,16 @@ ] } -This also works for chord bindings. Unbinding every chord that shares a prefix frees that prefix for use as a single-key binding: +This also works for chord bindings. Unbinding every chord that shares a prefix frees that prefix for use as a single-key binding. A chord in any active context keeps its prefix reserved, so you must unbind each chord in the context that defines it. The default `Ctrl+X` family spans two contexts: `ctrl+x ctrl+k` and `ctrl+x ctrl+e` in `Chat`, and `ctrl+x ctrl+b` in `Task`. To reclaim `ctrl+x` itself as a single-key binding, unbind all of them: { "bindings": [ + { + "context": "Task", + "bindings": { + "ctrl+x ctrl+b": null + } + }, { "context": "Chat", "bindings": {
modified Legal and compliance View current →
--- a/legal-and-compliance.md +++ b/legal-and-compliance.md @@ -21,7 +21,7 @@ Commercial agreements -Whether you’re using the Claude API directly (1P) or accessing it through Amazon Bedrock or Google Vertex (3P), your existing commercial agreement will apply to Claude Code usage, unless we’ve mutually agreed otherwise. +Whether you’re using the Claude API directly (1P) or accessing it through Amazon Bedrock or Google Cloud’s Agent Platform (3P), your existing commercial agreement will apply to Claude Code usage, unless we’ve mutually agreed otherwise. ##
modified Other LLM gateways View current →
--- a/llm-gateway.md +++ b/llm-gateway.md @@ -43,7 +43,7 @@ Subscriptions and gateways -While a [gateway credential variable](</docs/en/llm-gateway-connect#set-the-credential-variable>) or `apiKeyHelper` is active, a developer’s claude.ai subscription isn’t used: the credential replaces the subscription login for that session, and the subscription’s usage limits don’t apply. That traffic is billed per token to whoever owns the credential the gateway forwards, such as your organization’s Anthropic Console account, or your Bedrock, Agent Platform, or Foundry account when the gateway routes there. [`ANTHROPIC_BASE_URL`](</docs/en/llm-gateway-connect#set-the-base-url-and-credential>) is the variable that points Claude Code at the gateway. Setting only that variable, without a gateway credential, doesn’t replace the subscription. Requests still route through the gateway, but a saved claude.ai login remains the active credential, so its usage limits and billing apply. Gateways that pass this traffic on to Anthropic must forward the OAuth capability in `anthropic-beta`; see the [request headers reference](</docs/en/llm-gateway-protocol#request-headers>). +While a [gateway credential variable](</docs/en/llm-gateway-connect#set-the-credential-variable>) or `apiKeyHelper` is active, a developer’s claude.ai subscription isn’t used: the credential replaces the subscription login for that session, and the subscription’s usage limits don’t apply. That traffic is billed per token to whoever owns the credential the gateway forwards, such as your organization’s Anthropic Console account, or your Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry account when the gateway routes there. [`ANTHROPIC_BASE_URL`](</docs/en/llm-gateway-connect#set-the-base-url-and-credential>) is the variable that points Claude Code at the gateway. Setting only that variable, without a gateway credential, doesn’t replace the subscription. Requests still route through the gateway, but a saved claude.ai login remains the active credential, so its usage limits and billing apply. Gateways that pass this traffic on to Anthropic must forward the OAuth capability in `anthropic-beta`; see the [request headers reference](</docs/en/llm-gateway-protocol#request-headers>). ##
modified Connect Claude Code to an LLM gateway View current →
--- a/llm-gateway-connect.md +++ b/llm-gateway-connect.md @@ -348,7 +348,7 @@ Route to a cloud provider through a gateway -These configurations point Claude Code at a gateway through a provider-specific base URL variable in place of `ANTHROPIC_BASE_URL`. Bedrock and Agent Platform gateways accept those providers’ native request formats; Foundry and Claude Platform on AWS gateways accept the Anthropic Messages format and differ only in which base URL variable reaches them. Use one only if your gateway team specifically named Bedrock, Agent Platform, Foundry, or the Claude Platform on AWS. If the verification request above returned JSON, you can skip this section. Set the block for the provider your gateway team named. The skip-auth variables tell Claude Code not to sign requests with provider credentials, since the gateway holds those. If the gateway needs its own token, add `ANTHROPIC_AUTH_TOKEN` after the block, except for Foundry, which uses `ANTHROPIC_FOUNDRY_API_KEY` as shown. +These configurations point Claude Code at a gateway through a provider-specific base URL variable in place of `ANTHROPIC_BASE_URL`. Amazon Bedrock and Google Cloud’s Agent Platform gateways accept those providers’ native request formats; Microsoft Foundry and Claude Platform on AWS gateways accept the Anthropic Messages format and differ only in which base URL variable reaches them. Use one only if your gateway team specifically named Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or the Claude Platform on AWS. If the verification request above returned JSON, you can skip this section. Set the block for the provider your gateway team named. The skip-auth variables tell Claude Code not to sign requests with provider credentials, since the gateway holds those. If the gateway needs its own token, add `ANTHROPIC_AUTH_TOKEN` after the block, except for Microsoft Foundry, which uses `ANTHROPIC_FOUNDRY_API_KEY` as shown. #### @@ -396,7 +396,7 @@ Microsoft Foundry -Put the gateway’s credential in `ANTHROPIC_FOUNDRY_API_KEY`; it is sent to the gateway as the `x-api-key` header. `CLAUDE_CODE_SKIP_FOUNDRY_AUTH` doesn’t apply here: without an API key, the Foundry client fails every request before it leaves the machine. +Put the gateway’s credential in `ANTHROPIC_FOUNDRY_API_KEY`; it is sent to the gateway as the `x-api-key` header. `CLAUDE_CODE_SKIP_FOUNDRY_AUTH` doesn’t apply here: without an API key, the Microsoft Foundry client fails every request before it leaves the machine. * Bash or Zsh
modified Gateway protocol reference View current →
--- a/llm-gateway-protocol.md +++ b/llm-gateway-protocol.md @@ -24,13 +24,13 @@ API formats -A gateway must expose at least one of the following API formats to Claude Code clients. Which format Claude Code speaks is determined by the client’s configuration: the variable in the Selected by column of the table below points Claude Code at your gateway in that format. Agent Platform is Google Cloud’s Claude endpoint, formerly Vertex AI; its variable names keep the `VERTEX` spelling. +A gateway must expose at least one of the following API formats to Claude Code clients. Which format Claude Code speaks is determined by the client’s configuration: the variable in the Selected by column of the table below points Claude Code at your gateway in that format. Google Cloud’s Agent Platform is Google Cloud’s Claude endpoint, formerly Vertex AI; its variable names keep the `VERTEX` spelling. Format| Selected by| Endpoints| Forward unchanged ---|---|---|--- Anthropic Messages| `ANTHROPIC_BASE_URL`| `/v1/messages`, `/v1/messages/count_tokens` (optional)| `anthropic-beta` and `anthropic-version` request headers -Bedrock InvokeModel| `ANTHROPIC_BEDROCK_BASE_URL` with `CLAUDE_CODE_USE_BEDROCK=1`| `/model/{model}/invoke`, `/model/{model}/invoke-with-response-stream`| `anthropic_beta` and `anthropic_version` request body fields -Agent Platform rawPredict| `ANTHROPIC_VERTEX_BASE_URL` with `CLAUDE_CODE_USE_VERTEX=1`| `:rawPredict`, `:streamRawPredict`, `count-tokens:rawPredict` (optional)| `anthropic-beta` and `anthropic-version` request headers, and the `anthropic_version` request body field +Amazon Bedrock InvokeModel| `ANTHROPIC_BEDROCK_BASE_URL` with `CLAUDE_CODE_USE_BEDROCK=1`| `/model/{model}/invoke`, `/model/{model}/invoke-with-response-stream`| `anthropic_beta` and `anthropic_version` request body fields +Google Cloud’s Agent Platform rawPredict| `ANTHROPIC_VERTEX_BASE_URL` with `CLAUDE_CODE_USE_VERTEX=1`| `:rawPredict`, `:streamRawPredict`, `count-tokens:rawPredict` (optional)| `anthropic-beta` and `anthropic-version` request headers, and the `anthropic_version` request body field ### @@ -46,7 +46,7 @@ Optional endpoints and startup traffic -Token-counting endpoints are the only optional ones: when they’re absent, Claude Code estimates context usage locally. Inference requests post to `/v1/messages?beta=true`, so match on the path, not the full URL. The Agent Platform method suffixes attach to the publisher model path, as in `/projects/{project}/locations/{location}/publishers/anthropic/models/{model}:streamRawPredict`. A gateway also sees best-effort startup traffic it can reject without breaking anything: a `HEAD /` connectivity probe, and on Bedrock-format gateways a `GET /inference-profiles?type=SYSTEM_DEFINED` request. +Token-counting endpoints are the only optional ones: when they’re absent, Claude Code estimates context usage locally. Inference requests post to `/v1/messages?beta=true`, so match on the path, not the full URL. The Google Cloud’s Agent Platform method suffixes attach to the publisher model path, as in `/projects/{project}/locations/{location}/publishers/anthropic/models/{model}:streamRawPredict`. A gateway also sees best-effort startup traffic it can reject without breaking anything: a `HEAD /` connectivity probe, and on Amazon Bedrock-format gateways a `GET /inference-profiles?type=SYSTEM_DEFINED` request. ### @@ -64,8 +64,8 @@ Which format the client speaks determines what your gateway receives. The common failure mode is a mismatch between the format the client sends to your gateway and the format the upstream provider behind it accepts. - * When the client speaks the Bedrock or Agent Platform format, Claude Code sends only the subset of its full capability set that those providers accept - * When the client speaks the Anthropic Messages format, Claude Code sends the full set, even if your gateway forwards to a Bedrock or Agent Platform upstream + * When the client speaks the Amazon Bedrock or Google Cloud’s Agent Platform format, Claude Code sends only the subset of its full capability set that those providers accept + * When the client speaks the Anthropic Messages format, Claude Code sends the full set, even if your gateway forwards to an Amazon Bedrock or Google Cloud’s Agent Platform upstream Bridging that difference is your gateway’s job. Feature pass-through describes what breaks when it doesn’t. @@ -80,7 +80,7 @@ Header| Description ---|--- `Authorization`, `x-api-key`| The developer’s gateway credential, in one or both headers depending on which [credential variable](</docs/en/llm-gateway-connect#set-the-credential-variable>) they set -`anthropic-version`| API version, currently `2023-06-01`. Bedrock- and Agent Platform-format requests also carry the `anthropic_version` body field, whose value is the provider dialect string, not this header’s value +`anthropic-version`| API version, currently `2023-06-01`. Amazon Bedrock- and Google Cloud’s Agent Platform-format requests also carry the `anthropic_version` body field, whose value is the provider dialect string, not this header’s value `anthropic-beta`| Comma-separated capability values for the request. Forward the header verbatim; don’t allowlist individual values, because the set changes with Claude Code releases. When the developer authenticates with a claude.ai login, which is possible when `ANTHROPIC_BASE_URL` is set without a gateway credential variable, this header also carries an OAuth capability that the upstream requires, and stripping it fails those requests with `401` `x-claude-code-session-id`| A unique identifier for the current Claude Code session. Use it to aggregate all requests from one session without parsing request bodies `x-claude-code-agent-id`| Identifier of the [subagent](</docs/en/sub-agents>) that issued the request, present only on requests from an agent Claude Code spawned inside the session. Use it with the session ID to attribute cost to parallel agents @@ -94,7 +94,7 @@ Forward as open lists -Treat the headers and body fields as open lists, not closed ones. Claude Code gains capabilities over releases, and they arrive as new `anthropic-beta` values, new request body fields, and occasionally new `anthropic-*` or `x-claude-code-*` headers. When forwarding to an Anthropic-format upstream, pass `anthropic-*` request headers and request body fields through unchanged rather than allowlisting the ones you see today. A gateway pinned to an observed list strips the next capability’s header or field and breaks it on the release that introduces it. The exception is a non-Anthropic upstream such as Bedrock or Agent Platform, where bridging the schema difference is the gateway’s job; see feature pass-through. +Treat the headers and body fields as open lists, not closed ones. Claude Code gains capabilities over releases, and they arrive as new `anthropic-beta` values, new request body fields, and occasionally new `anthropic-*` or `x-claude-code-*` headers. When forwarding to an Anthropic-format upstream, pass `anthropic-*` request headers and request body fields through unchanged rather than allowlisting the ones you see today. A gateway pinned to an observed list strips the next capability’s header or field and breaks it on the release that introduces it. The exception is a non-Anthropic upstream such as Amazon Bedrock or Google Cloud’s Agent Platform, where bridging the schema difference is the gateway’s job; see feature pass-through. ## @@ -102,7 +102,13 @@ System prompt attribution block -Claude Code prepends a short attribution block to the system prompt containing the client version and a fingerprint derived from the conversation. The `api.anthropic.com` endpoint strips the block before processing, so it doesn’t affect first-party prompt caching; any other upstream receives it as part of the prompt. Anthropic and the cloud providers’ Claude endpoints read it for attribution, so to omit it set [`CLAUDE_CODE_ATTRIBUTION_HEADER=0`](</docs/en/env-vars>) rather than stripping it in the gateway. From Claude Code v2.1.181, the block is stable for the lifetime of a conversation when requests route through a custom base URL, so a gateway-side prompt cache keyed on the full request body works without disabling it. Before v2.1.181 the block included a per-request token; on those versions, set `CLAUDE_CODE_ATTRIBUTION_HEADER=0` if your gateway implements such a cache. +Claude Code prepends a short attribution block to the system prompt containing the client version and a fingerprint derived from the conversation. The `api.anthropic.com` endpoint strips the block before processing when it arrives unchanged as the first system block, so it doesn’t affect first-party prompt caching. Any other upstream receives it as part of the prompt. The strip is positional, so it only works when the gateway forwards the `system` array unchanged. To keep the block out of the prompt without losing other system content: + + * Forward the `system` array exactly as received, keeping the block first: prepending another system block, reordering the array, or converting it to a single string defeats the strip, and the block then reaches the model and the prompt cache key. + * Keep the block in its own array entry: the endpoint treats a merged block that starts with the attribution header as attribution in its entirety and drops everything merged into it, including the rest of the system prompt. + * If your gateway must reshape system content, set [`CLAUDE_CODE_ATTRIBUTION_HEADER=0`](</docs/en/env-vars>) so Claude Code omits the block. Anthropic and the cloud providers’ Claude endpoints read the block for attribution, so omit it at the client rather than stripping or moving it in the gateway. + +Requests that reach the endpoint unmodified are unaffected. From Claude Code v2.1.181, the block is stable for the lifetime of a conversation when requests route through a custom base URL, so a gateway-side prompt cache keyed on the full request body works without disabling it. Before v2.1.181 the block included a per-request token; on those versions, set `CLAUDE_CODE_ATTRIBUTION_HEADER=0` if your gateway implements such a cache. ## @@ -115,10 +121,10 @@ Feature| Header and body pair| Symptom when broken| Remediation ---|---|---|--- [Adaptive reasoning](</docs/en/model-config#adjust-effort-level>)| No beta header. Claude Code sends `thinking: {"type": "adaptive"}` for Claude 4.6 and later, and treats model names it doesn’t recognize, such as gateway aliases, as current models that receive the field| `400` naming the `thinking` field or the `adaptive` tag when the upstream model build doesn’t accept it| Upgrade the upstream. On Opus 4.6 and Sonnet 4.6, developers can set `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` instead -[Context management](<https://platform.claude.com/docs/en/build-with-claude/context-management>)| Context management beta header pairs with the `context_management` body field| `400` with `Extra inputs are not permitted`. Common when a gateway accepts Anthropic-format requests but forwards them to Bedrock| Forward both, or [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`](</docs/en/env-vars>) +[Context management](<https://platform.claude.com/docs/en/build-with-claude/context-management>)| Context management beta header pairs with the `context_management` body field| `400` with `Extra inputs are not permitted`. Common when a gateway accepts Anthropic-format requests but forwards them to Amazon Bedrock| Forward both, or [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`](</docs/en/env-vars>) [Extended context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window>) and [interleaved thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking#interleaved-thinking>)| Beta headers only, no body field| Silently unavailable when the header is stripped; the upstream never sees the capability request| Forward `anthropic-beta` verbatim Beta [tool fields](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview>)| Tool-related beta headers pair with tool schema fields such as `strict` and `defer_loading`| `400` naming the unrecognized tool schema field when the body passes through without its header| Forward both, or `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` -[Effort](<https://platform.claude.com/docs/en/build-with-claude/effort>) and [structured outputs](<https://platform.claude.com/docs/en/build-with-claude/structured-outputs>)| The `output_config` body field carries effort, structured-output format, and task budget settings; each pairs with its own beta header| `400` naming `output_config`, often `Extra inputs are not permitted`, on Bedrock and Agent Platform upstreams| Forward the field and its headers together +[Effort](<https://platform.claude.com/docs/en/build-with-claude/effort>) and [structured outputs](<https://platform.claude.com/docs/en/build-with-claude/structured-outputs>)| The `output_config` body field carries effort, structured-output format, and task budget settings; each pairs with its own beta header| `400` naming `output_config`, often `Extra inputs are not permitted`, on Amazon Bedrock and Google Cloud’s Agent Platform upstreams| Forward the field and its headers together [Token counting](<https://platform.claude.com/docs/en/build-with-claude/token-counting>)| No beta pairing; uses the `count_tokens` endpoint| Claude Code falls back to estimating context usage locally| Expose the endpoint if you want exact counts The `ANTHROPIC_DEFAULT_*_MODEL_SUPPORTED_CAPABILITIES` [variables](</docs/en/model-config>) declare model capabilities only in the provider configurations: `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX`, `CLAUDE_CODE_USE_FOUNDRY`, and [`CLAUDE_CODE_USE_MANTLE`](</docs/en/amazon-bedrock#use-the-mantle-endpoint>). They have no effect behind an `ANTHROPIC_BASE_URL` gateway.
modified Roll out an LLM gateway for your organization View current →
--- a/llm-gateway-rollout.md +++ b/llm-gateway-rollout.md @@ -163,9 +163,9 @@ `apiKeyHelper`, or a credential in `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_API_KEY`| Authenticates each request to the gateway. The helper runs a command to fetch the key; the variables hold a static key, sent as `Authorization: Bearer` and `x-api-key` respectively| Always; one of the three `ANTHROPIC_CUSTOM_HEADERS`| Adds extra HTTP headers to every API request| Your gateway requires a tenant or routing header on every request `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY`| Queries the gateway’s `/v1/models` at startup and adds the returned names to the `/model` picker| Your gateway serves `/v1/models` and you want developers’ pickers populated from it -`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`| Stops Claude Code sending pre-release capability headers and body fields| Your gateway forwards to a Bedrock or Agent Platform upstream that rejects beta fields; see Gateway requirements +`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`| Stops Claude Code sending pre-release capability headers and body fields| Your gateway forwards to an Amazon Bedrock or Google Cloud’s Agent Platform upstream that rejects beta fields; see Gateway requirements `ANTHROPIC_MODEL` or [`ANTHROPIC_DEFAULT_HAIKU_MODEL`](</docs/en/model-config>)| Set which model name Claude Code requests for the main session and for background traffic| Your gateway routes model names that don’t match Claude Code’s defaults, or you route [background functionality](</docs/en/costs#background-token-usage>) to a different model. Route both the override names and the built-in model IDs Claude Code requests when no override is set, since some background sub-calls request a built-in ID regardless of the override; [model configuration](</docs/en/model-config>) covers which model each part of a session uses -`ANTHROPIC_BEDROCK_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, `ANTHROPIC_FOUNDRY_BASE_URL`, or `ANTHROPIC_AWS_BASE_URL` with the [variables for that provider](</docs/en/llm-gateway-connect#route-to-a-cloud-provider-through-a-gateway>)| Point Claude Code at the gateway through a provider-specific base URL. Bedrock and Agent Platform also switch to those providers’ native request format| Your gateway fronts Bedrock, Agent Platform, Foundry, or the Claude Platform on AWS; see [API formats](</docs/en/llm-gateway-protocol#api-formats>) +`ANTHROPIC_BEDROCK_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, `ANTHROPIC_FOUNDRY_BASE_URL`, or `ANTHROPIC_AWS_BASE_URL` with the [variables for that provider](</docs/en/llm-gateway-connect#route-to-a-cloud-provider-through-a-gateway>)| Point Claude Code at the gateway through a provider-specific base URL. Amazon Bedrock and Google Cloud’s Agent Platform also switch to those providers’ native request format| Your gateway fronts Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or the Claude Platform on AWS; see [API formats](</docs/en/llm-gateway-protocol#api-formats>) ####
modified Connect Claude Code to tools via MCP View current →
--- a/mcp.md +++ b/mcp.md @@ -153,7 +153,7 @@ * settings passed with `--settings` * `.claude/settings.local.json`, as long as git doesn’t track it -A `disabledMcpjsonServers` entry in any settings file still rejects the server. The `/mcp` panel shows the tool count next to each connected server and flags servers that advertise the tools capability but expose no tools. If your request needs tools from a server that is still connecting in the background, Claude waits for that server before continuing. With tool search enabled, which is the default, the wait happens inside the `ToolSearch` call. In configurations without tool search, such as Vertex AI, a custom `ANTHROPIC_BASE_URL`, or `ENABLE_TOOL_SEARCH=false`, Claude uses the `WaitForMcpServers` tool instead. The server name `workspace` is reserved for internal use. If your configuration defines a server with that name, Claude Code skips it at load time and shows a warning asking you to rename it. +A `disabledMcpjsonServers` entry in any settings file still rejects the server. The `/mcp` panel shows the tool count next to each connected server and flags servers that advertise the tools capability but expose no tools. If your request needs tools from a server that is still connecting in the background, Claude waits for that server before continuing. With tool search enabled, which is the default, the wait happens inside the `ToolSearch` call. In configurations without tool search, such as Google Cloud’s Agent Platform, a custom `ANTHROPIC_BASE_URL`, or `ENABLE_TOOL_SEARCH=false`, Claude uses the `WaitForMcpServers` tool instead. The server name `workspace` is reserved for internal use. If your configuration defines a server with that name, Claude Code skips it at load time and shows a warning asking you to rename it. ### @@ -769,7 +769,7 @@ Servers from claude.ai appear in the list with indicators showing they come from claude.ai. -From v2.1.161, connectors you have never signed in to are collapsed behind a `Show unused connectors` row at the end of the claude.ai section, so an organization-provisioned list doesn’t fill the panel. Select the row to expand them. A connector you signed in to before stays visible even when it currently needs re-authentication. Connectors from claude.ai are fetched only when your active [authentication method](</docs/en/authentication#authentication-precedence>) is your claude.ai subscription. They aren’t loaded when `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `apiKeyHelper`, or a third-party provider such as Bedrock or Vertex is active, even if you previously ran `/login`. If `/mcp` doesn’t list a connector you added, run `/status` to confirm which authentication method is active, unset that environment variable or remove the `apiKeyHelper` setting, then run `/login` to select your claude.ai account. A server you’ve added in Claude Code takes precedence over a claude.ai connector that points at the same URL. When this happens, `/mcp` lists the connector as hidden and shows how to remove the duplicate if you’d rather use the connector. Some Anthropic-hosted connectors, such as Microsoft 365, Gmail, and Google Calendar, don’t support local OAuth from Claude Code because the upstream identity provider only accepts the redirect URL that claude.ai registered. From v2.1.162, authenticating one of these hosts in `/mcp` shows a message directing you to connect it at Settings → Connectors on claude.ai instead. Once connected there, the connector appears in Claude Code automatically. +From v2.1.161, connectors you have never signed in to are collapsed behind a `Show unused connectors` row at the end of the claude.ai section, so an organization-provisioned list doesn’t fill the panel. Select the row to expand them. A connector you signed in to before stays visible even when it currently needs re-authentication. Connectors from claude.ai are fetched only when your active [authentication method](</docs/en/authentication#authentication-precedence>) is your claude.ai subscription. They aren’t loaded when `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `apiKeyHelper`, or a third-party provider such as Amazon Bedrock or Google Cloud’s Agent Platform is active, even if you previously ran `/login`. If `/mcp` doesn’t list a connector you added, run `/status` to confirm which authentication method is active, unset that environment variable or remove the `apiKeyHelper` setting, then run `/login` to select your claude.ai account. A server you’ve added in Claude Code takes precedence over a claude.ai connector that points at the same URL. When this happens, `/mcp` lists the connector as hidden and shows how to remove the duplicate if you’d rather use the connector. Some Anthropic-hosted connectors, such as Microsoft 365, Gmail, and Google Calendar, don’t support local OAuth from Claude Code because the upstream identity provider only accepts the redirect URL that claude.ai registered. From v2.1.162, authenticating one of these hosts in `/mcp` shows a message directing you to connect it at Settings → Connectors on claude.ai instead. Once connected there, the connector appears in Claude Code automatically. ### @@ -1009,12 +1009,12 @@ Configure tool search -Tool search is enabled by default: MCP tools are deferred and discovered on demand. Claude Code disables it by default on Vertex AI. It is also disabled when `ANTHROPIC_BASE_URL` points to a non-first-party host, since most proxies don’t forward `tool_reference` blocks. Set `ENABLE_TOOL_SEARCH` explicitly to override either fallback. Tool search requires a model that supports `tool_reference` blocks. Haiku models don’t support it. On Vertex AI, tool search is supported for Claude Sonnet 4.5 and later and Claude Opus 4.5 and later. Control tool search behavior with the `ENABLE_TOOL_SEARCH` environment variable: +Tool search is enabled by default: MCP tools are deferred and discovered on demand. Claude Code disables it by default on Google Cloud’s Agent Platform. It is also disabled when `ANTHROPIC_BASE_URL` points to a non-first-party host, since most proxies don’t forward `tool_reference` blocks. Set `ENABLE_TOOL_SEARCH` explicitly to override either fallback. Tool search requires a model that supports `tool_reference` blocks. Haiku models don’t support it. On Google Cloud’s Agent Platform, tool search is supported for Claude Sonnet 4.5 and later and Claude Opus 4.5 and later. Control tool search behavior with the `ENABLE_TOOL_SEARCH` environment variable: Value| Behavior ---|--- -(unset)| All MCP tools deferred and loaded on demand. Falls back to loading upfront on Vertex AI or when `ANTHROPIC_BASE_URL` is a non-first-party host -`true`| All MCP tools deferred. Claude Code sends the beta header even on Vertex AI and through proxies. Requests fail on Vertex AI models earlier than Sonnet 4.5 or Opus 4.5, or on proxies that don’t support `tool_reference` blocks +(unset)| All MCP tools deferred and loaded on demand. Falls back to loading upfront on Google Cloud’s Agent Platform or when `ANTHROPIC_BASE_URL` is a non-first-party host +`true`| All MCP tools deferred. Claude Code sends the beta header even on Google Cloud’s Agent Platform and through proxies. Requests fail on Google Cloud’s Agent Platform models earlier than Sonnet 4.5 or Opus 4.5, or on proxies that don’t support `tool_reference` blocks `auto`| Threshold mode: tools load upfront if they fit within 10% of the context window, deferred otherwise `auto:N`| Threshold mode with a custom percentage, where `N` is 0-100. For example, `auto:5` for 5% `false`| All MCP tools loaded upfront, no deferral
modified Claude Code on Microsoft Foundry View current →
--- a/microsoft-foundry.md +++ b/microsoft-foundry.md @@ -76,15 +76,15 @@ 4\. Pin model versions -Pin specific model versions for every deployment. Without pinning, model aliases such as `sonnet` and `opus` resolve to Claude Code’s built-in default for Foundry, which can lag the newest release and may not yet be available in your account. Foundry has no startup model check, so requests fail when the default is unavailable. When you create Azure deployments, select a specific model version rather than “auto-update to latest.” +Pin specific model versions for every deployment. Without pinning, model aliases such as `sonnet` and `opus` resolve to Claude Code’s built-in default for Microsoft Foundry, which can lag the newest release and may not yet be available in your account. Microsoft Foundry has no startup model check, so requests fail when the default is unavailable. When you create Azure deployments, select a specific model version rather than “auto-update to latest.” -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: +Set the model variables to match the deployment names you created in step 1. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Microsoft 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-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: +Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On Microsoft 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: export ENABLE_PROMPT_CACHING_1H=1 @@ -98,7 +98,7 @@ claude -Claude Code reads `CLAUDE_CODE_USE_FOUNDRY` and the other Foundry variables from the environment and connects to your Azure resource on the first prompt. Unlike Bedrock and Vertex AI, Foundry has no interactive setup wizard, so the environment variables in steps 3 and 4 are the only configuration path. +Claude Code reads `CLAUDE_CODE_USE_FOUNDRY` and the other Microsoft Foundry variables from the environment and connects to your Azure resource on the first prompt. Unlike Amazon Bedrock and Google Cloud’s Agent Platform, Microsoft Foundry has no interactive setup wizard, so the environment variables in steps 3 and 4 are the only configuration path. ##
modified Model configuration View current →
Show diff (165 lines)
--- a/model-config.md +++ b/model-config.md @@ -9,9 +9,9 @@ * A **model alias** * A **model name** * Anthropic API: a full **[model name](<https://platform.claude.com/docs/en/about-claude/models/overview>)** - * Bedrock: an inference profile ARN - * Foundry: a deployment name - * Vertex: a version name + * Amazon Bedrock: an inference profile ARN + * Microsoft Foundry: a deployment name + * Google Cloud’s Agent Platform: a version name `ANTHROPIC_BASE_URL` changes where requests are sent, not which model answers them. To route Claude through an LLM gateway, see [LLM gateways](</docs/en/llm-gateway>). @@ -35,7 +35,7 @@ **`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 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`. +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 Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft 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. @@ -72,7 +72,14 @@ * `Enter`: switch model and save as your default * `s`: switch model for this session only -Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: +Typing `/model <name>` directly behaves like `Enter`. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved, regardless of the current `model` setting. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. This prevents another session’s `/model` choice from changing the model on resume. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. When a model switch is requested through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method or by an app such as the [Desktop app](</docs/en/desktop>) that runs the Claude Code CLI for you, Claude Code checks that the string is one it recognizes before saving it. This check requires Claude Code v2.1.200 or later. On the Anthropic API, Claude Code recognizes: + + * a model alias + * an entry from the `/model` picker + * any name that starts with `claude-` + * a value you configured yourself as a custom model option or in `modelOverrides` + +Claude Code rejects an unrecognized string with `Model "<name>" is not a recognized model id.` and the session keeps its current model, instead of saving the string and failing on the next request. See [the error reference](</docs/en/errors#model-is-not-a-recognized-model-id>) for recovery steps. The check runs only on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and behind an [LLM gateway](</docs/en/llm-gateway>) or a custom `ANTHROPIC_BASE_URL`, your provider or gateway defines the model names, so Claude Code passes any string through without checking it. The check also doesn’t cover the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting; a mistyped value there produces [There’s an issue with the selected model](</docs/en/errors#there%E2%80%99s-an-issue-with-the-selected-model>) on the first request instead. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. Example usage: # Start with Opus claude --model opus @@ -126,7 +133,7 @@ * Cloud sessions, on [Claude Code on the web](</docs/en/claude-code-on-the-web>) or in the Desktop app, run on Anthropic-managed VMs: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. Server-side rejection at session creation applies to organization model restrictions, not the `availableModels` settings key. * Cowork, the agentic-work tab in the Claude Desktop app, is not a Claude Code surface and does not receive server-managed settings by design. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. - * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Bedrock, Vertex AI, Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. + * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. * Server-managed delivery also requires the session to authenticate with an organization login or a directly configured API key. Fleets that generate keys only through an [`apiKeyHelper`](</docs/en/settings#available-settings>) script should deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; enforcement happens in the session. @@ -194,7 +201,7 @@ Mantle model IDs -When the [Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. This is an exception to the alias matching described in Pin models for third-party deployments. The setting still restricts the picker to listed entries, and a Mantle ID embeds a family name, so it counts as a specific entry and disables that family’s wildcard: alongside any Mantle IDs, list the version prefixes or full IDs you want to keep selectable. See Merge behavior. +When the [Amazon Bedrock Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) is enabled, entries in `availableModels` that start with `anthropic.` are added to the `/model` picker as custom options and routed to the Mantle endpoint. This is an exception to the alias matching described in Pin models for third-party deployments. The setting still restricts the picker to listed entries, and a Mantle ID embeds a family name, so it counts as a specific entry and disables that family’s wildcard: alongside any Mantle IDs, list the version prefixes or full IDs you want to keep selectable. See Merge behavior. ### @@ -209,7 +216,7 @@ * Haiku models are always available and can’t be disabled, so every member keeps at least one usable model. * An access change takes effect on new requests within about a minute; the `/model` picker reflects it the next time a session starts. -Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Bedrock, Vertex AI, Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. +Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions are delivered to sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments. Sessions on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS do not receive them, so use `availableModels` on those providers instead. ## @@ -256,7 +263,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 5 - * **Bedrock, Vertex, and Foundry** : defaults to Sonnet 4.5 + * **Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry** : defaults to Sonnet 4.5 Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. 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. When both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default. 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. @@ -327,9 +334,9 @@ ​ -Enable fallback on Bedrock, Vertex AI, and Foundry - -On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: +Enable fallback on Bedrock, Agent Platform, and Foundry + +On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), and [Microsoft Foundry](</docs/en/microsoft-foundry>), model IDs are provider-specific, so automatic fallback only operates when Claude Code can identify both models involved: * Claude Code must recognize the current model as Fable 5: the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. * The fallback target must resolve to an Opus model: the value of `ANTHROPIC_DEFAULT_OPUS_MODEL` if set, otherwise an Opus 4.8 entry in the provider’s model list. @@ -511,7 +518,7 @@ Pin models for third-party deployments -When deploying Claude Code through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Bedrock and Vertex AI users see a notice and fall back to the previous version for that session, while Foundry users see errors because Foundry has no equivalent startup check. +When deploying Claude Code through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin model versions before rolling out to users. Without pinning, Claude Code uses model aliases such as `fable`, `opus`, `sonnet`, and `haiku` that resolve to a built-in default model ID for each provider. That default can lag the newest Anthropic release, and the model it points to may not yet be enabled in a user’s account. When the default is unavailable, Amazon Bedrock and Google Cloud’s Agent Platform users see a notice and fall back to the previous version for that session, while Microsoft Foundry users see errors because Microsoft Foundry has no equivalent startup check. Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model. @@ -519,9 +526,9 @@ Provider| Example ---|--- -Bedrock| `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-8'` -Vertex AI| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` -Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` +Amazon Bedrock| `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-8'` +Google Cloud’s Agent Platform| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` +Microsoft Foundry| `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'` Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. To enable extended context for a pinned model, append `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`: @@ -531,7 +538,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. Sonnet 5 always runs with the 1M window on these providers and never needs the suffix. + * The suffix is read per variable, not per model. On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft 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. @@ -541,7 +548,7 @@ Customize pinned model display and capabilities -When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Bedrock, Vertex AI, and Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`. +When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`. Environment variable| Description ---|--- @@ -549,7 +556,7 @@ `ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION`| Display description for the pinned Opus model in the `/model` picker. Defaults to `Custom Opus model` when not set `ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`| Comma-separated list of capabilities the pinned Opus model supports -The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_FABLE_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: +The same `_NAME`, `_DESCRIPTION`, and `_SUPPORTED_CAPABILITIES` suffixes are available for `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, `ANTHROPIC_DEFAULT_FABLE_MODEL`, and `ANTHROPIC_CUSTOM_MODEL_OPTION`. Claude Code enables features like effort levels and extended thinking by matching the model ID against known patterns. Provider-specific IDs such as Amazon Bedrock ARNs or custom deployment names often don’t match these patterns, leaving supported features disabled. Set `_SUPPORTED_CAPABILITIES` to tell Claude Code which features the model actually supports: Capability value| Enables ---|--- @@ -560,7 +567,7 @@ `adaptive_thinking`| Adaptive reasoning that dynamically allocates thinking based on task complexity `interleaved_thinking`| Thinking between tool calls -When `_SUPPORTED_CAPABILITIES` is set, listed capabilities are enabled and unlisted capabilities are disabled for the matching pinned model. When the variable is unset, Claude Code falls back to built-in detection based on the model ID. This example pins Opus to a Bedrock custom model ARN, sets a friendly name, and declares its capabilities: +When `_SUPPORTED_CAPABILITIES` is set, listed capabilities are enabled and unlisted capabilities are disabled for the matching pinned model. When the variable is unset, Claude Code falls back to built-in detection based on the model ID. This example pins Opus to an Amazon Bedrock custom model ARN, sets a friendly name, and declares its capabilities: export ANTHROPIC_DEFAULT_OPUS_MODEL='arn:aws:bedrock:us-east-1:123456789012:custom-model/abc' export ANTHROPIC_DEFAULT_OPUS_MODEL_NAME='Opus via Bedrock' @@ -573,7 +580,7 @@ Override model IDs per version -The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Bedrock inference profile ARN, Vertex AI version name, or Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>): +The family-level environment variables above configure one model ID per family alias. If you need to map several versions within the same family to distinct provider IDs, use the `modelOverrides` setting instead. `modelOverrides` maps individual Anthropic model IDs to the provider-specific strings that Claude Code sends to your provider’s API. When a user selects a mapped model in the `/model` picker, Claude Code uses your configured value instead of the built-in default. This lets enterprise administrators route each model version to a specific Amazon Bedrock inference profile ARN, Google Cloud’s Agent Platform version name, or Microsoft Foundry deployment name for governance, cost allocation, or regional routing. Set `modelOverrides` in your [settings file](</docs/en/settings#settings-files>): { "modelOverrides": { @@ -583,7 +590,7 @@ } } -Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Bedrock, overrides take precedence over any inference profiles that Claude Code discovers automatically at startup. Values you supply directly through `ANTHROPIC_MODEL`, `--model`, or the `ANTHROPIC_DEFAULT_*_MODEL` environment variables are passed to the provider as-is and are not transformed by `modelOverrides`. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. +Keys must be Anthropic model IDs as listed in the [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). For dated model IDs, include the date suffix exactly as it appears there. Unknown keys are ignored. Overrides replace the built-in model IDs that back each entry in the `/model` picker. On Amazon Bedrock, `modelOverrides` entries take precedence over any inference profiles that Claude Code discovers automatically at startup. Claude Code passes values that are already provider-native, such as Amazon Bedrock inference profile ARNs or Microsoft Foundry deployment names, to the provider as-is. Overrides also apply when you pass an Anthropic model ID directly through `--model`, the `ANTHROPIC_MODEL` environment variable, or an `ANTHROPIC_DEFAULT_*_MODEL` environment variable. On Amazon Bedrock, Google Cloud’s Agent Platform, and [Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), an Anthropic model ID with no `modelOverrides` entry resolves to the same provider-specific ID as the `/model` picker row for that version, when the provider supports that version. Mantle supports a subset of versions. For an Anthropic model ID outside that subset, Claude Code sends the raw ID to Mantle without mapping it, unless a `modelOverrides` entry covers it. Before v2.1.200, `--model` and the environment-variable values reached the provider as-is without going through the override map. `modelOverrides` works alongside `availableModels`. The allowlist is evaluated against the Anthropic model ID, not the override value, so an entry like `"opus"` in `availableModels` continues to match even when Opus versions are mapped to ARNs. When `enforceAvailableModels` is set in managed settings, the enforced Default resolves through `modelOverrides` from the [highest-precedence managed source](</docs/en/server-managed-settings#settings-precedence>) only. An admin’s mapping, such as a version pinned to an inference profile ARN, is honored in the enforced Default. Overrides from user or project settings do not affect it. When `availableModels` is set in [managed settings](</docs/en/settings#settings-files>), only `modelOverrides` from that managed source apply to an Anthropic model ID passed directly through `--model` or the environment variables above. Claude Code ignores overrides in user or project settings for those IDs, and never resolves an ID the managed list excludes through `modelOverrides` from any settings source. This managed-source restriction requires Claude Code v2.1.200 or later. See Restrict model selection for how blocked IDs are handled. ###
modified Modifying system prompts View current →
--- a/modifying-system-prompts.md +++ b/modifying-system-prompts.md @@ -132,7 +132,9 @@ * **CLI** : run `/config` and select an output style * **Settings** : set `outputStyle` in `.claude/settings.local.json` - * **TypeScript SDK** : set `outputStyle` inside the inline `settings` object passed to `query()`, or point `settings` at a settings file that sets it. `outputStyle` is not a top-level `Options` field + * **TypeScript SDK** : set `outputStyle` inside the inline `settings` object passed to `query()`, or point `settings` at a settings file that sets it. `outputStyle` is not a top-level `Options` field: + + const options = { settings: { outputStyle: "Explanatory" } }; The Python SDK does not have an option to select an output style programmatically. For code-only deployments where you can’t write to `.claude/settings.local.json`, use `append` or a custom prompt string instead. **Note for SDK users:** Output styles are loaded when you include `settingSources: ['user']` or `settingSources: ['project']` (TypeScript) / `setting_sources=["user"]` or `setting_sources=["project"]` (Python) in your options.
modified Monitoring View current →
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -844,7 +844,7 @@ Internal error event -Logged when Claude Code catches an unexpected internal error. Only the error class name and an errno-style code are recorded. The error message and stack trace are never included. This event is not emitted when running against Bedrock, Vertex, or Foundry, or when `DISABLE_ERROR_REPORTING` is set. **Event Name** : `claude_code.internal_error` **Attributes** : +Logged when Claude Code catches an unexpected internal error. Only the error class name and an errno-style code are recorded. The error message and stack trace are never included. This event is not emitted when running against Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or when `DISABLE_ERROR_REPORTING` is set. **Event Name** : `claude_code.internal_error` **Attributes** : * All standard attributes * `event.name`: `"internal_error"` @@ -1102,7 +1102,7 @@ * Identifying high-usage sessions for optimization * Attributing spend to specific skills, plugins, or subagent types via the `skill.name`, `plugin.name`, and `agent.name` attributes -Cost metrics are approximations. For official billing data, refer to your API provider (Claude Console, Amazon Bedrock, or Google Cloud Vertex). +Cost metrics are approximations. For official billing data, refer to your API provider (Claude Console, Amazon Bedrock, or Google Cloud’s Agent Platform). ### @@ -1155,7 +1155,7 @@ Attribute actions to users -The standard attributes on each event include the authenticated user’s identity: `user.email`, `user.account_uuid`, `user.account_id`, and `organization.id` when signed in with a Claude account, plus `user.id` and the per-session `session.id`. `user.id` is an installation-scoped identifier, except on [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where it is the IdP subject from the gateway-issued token. MCP tool calls, Bash commands, and file edits are therefore attributed to the developer who started the session. Claude Code doesn’t act under a separate service account; the identity recorded on each event is the developer’s own Claude account, or the developer’s IdP identity on a [Claude apps gateway](</docs/en/claude-apps-gateway>) session. When Claude Code authenticates with a direct API key, or against Bedrock, Vertex AI, or Microsoft Foundry, there is no Claude account in the session and only `user.id` and `session.id` are populated. In these deployments, attach user identity yourself with `OTEL_RESOURCE_ATTRIBUTES`, set per user through the managed settings file or a launch wrapper. Claude apps gateway sessions need none of this: the CLI stamps the IdP identity automatically, as described in Standard attributes. +The standard attributes on each event include the authenticated user’s identity: `user.email`, `user.account_uuid`, `user.account_id`, and `organization.id` when signed in with a Claude account, plus `user.id` and the per-session `session.id`. `user.id` is an installation-scoped identifier, except on [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, where it is the IdP subject from the gateway-issued token. MCP tool calls, Bash commands, and file edits are therefore attributed to the developer who started the session. Claude Code doesn’t act under a separate service account; the identity recorded on each event is the developer’s own Claude account, or the developer’s IdP identity on a [Claude apps gateway](</docs/en/claude-apps-gateway>) session. When Claude Code authenticates with a direct API key, or against Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, there is no Claude account in the session and only `user.id` and `session.id` are populated. In these deployments, attach user identity yourself with `OTEL_RESOURCE_ATTRIBUTES`, set per user through the managed settings file or a launch wrapper. Claude apps gateway sessions need none of this: the CLI stamps the IdP identity automatically, as described in Standard attributes. export OTEL_RESOURCE_ATTRIBUTES="enduser.id=jdoe@example.com,enduser.directory_id=S-1-5-21-..." @@ -1308,4 +1308,4 @@ Monitor Claude Code on Amazon Bedrock -For detailed Claude Code usage monitoring guidance for Amazon Bedrock, see [Claude Code Monitoring Implementation (Bedrock)](<https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md>). +For detailed Claude Code usage monitoring guidance for Amazon Bedrock, see [Claude Code Monitoring Implementation (Amazon Bedrock)](<https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md>).
modified Enterprise network configuration View current →
--- a/network-config.md +++ b/network-config.md @@ -107,7 +107,7 @@ `*.claudeusercontent.com`| Viewing [artifacts](</docs/en/artifacts>) on claude.ai. The viewer loads each artifact’s content from a sandboxed subdomain of this origin. Required in the viewer’s browser, not by the CLI itself `raw.githubusercontent.com`| Changelog feed for [`/release-notes`](</docs/en/commands>) and the release notes shown after updating; plugin marketplace install counts -If you install Claude Code through npm or manage your own binary distribution, end users may not need access to `downloads.claude.ai` or `storage.googleapis.com`. Claude Code also sends optional operational telemetry by default, which you can disable with environment variables. See [Telemetry services](</docs/en/data-usage#telemetry-services>) for how to disable it before finalizing your allowlist. When using [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or a signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) session, model traffic and authentication go to your provider or gateway instead of `api.anthropic.com`, `claude.ai`, or `platform.claude.com`. The WebFetch tool still calls `api.anthropic.com` for its [domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>) unless you set `skipWebFetchPreflight: true` in [settings](</docs/en/settings>). [Claude Code on the web](</docs/en/claude-code-on-the-web>) and [Code Review](</docs/en/code-review>) connect to your repositories from Anthropic-managed infrastructure. If your GitHub Enterprise Cloud organization restricts access by IP address, enable [IP allow list inheritance for installed GitHub Apps](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps>). The Claude GitHub App registers its IP ranges, so enabling this setting allows access without manual configuration. To [add the ranges to your allow list manually](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#adding-an-allowed-ip-address>) instead, or to configure other firewalls, see the [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>). For self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances behind a firewall, allowlist the same [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>) so Anthropic infrastructure can reach your GHES host to clone repositories and post review comments. +If you install Claude Code through npm or manage your own binary distribution, end users may not need access to `downloads.claude.ai` or `storage.googleapis.com`. Claude Code also sends optional operational telemetry by default, which you can disable with environment variables. See [Telemetry services](</docs/en/data-usage#telemetry-services>) for how to disable it before finalizing your allowlist. When using [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or a signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) session, model traffic and authentication go to your provider or gateway instead of `api.anthropic.com`, `claude.ai`, or `platform.claude.com`. The WebFetch tool still calls `api.anthropic.com` for its [domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>) unless you set `skipWebFetchPreflight: true` in [settings](</docs/en/settings>). [Claude Code on the web](</docs/en/claude-code-on-the-web>) and [Code Review](</docs/en/code-review>) connect to your repositories from Anthropic-managed infrastructure. If your GitHub Enterprise Cloud organization restricts access by IP address, enable [IP allow list inheritance for installed GitHub Apps](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps>). The Claude GitHub App registers its IP ranges, so enabling this setting allows access without manual configuration. To [add the ranges to your allow list manually](<https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#adding-an-allowed-ip-address>) instead, or to configure other firewalls, see the [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>). For self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances behind a firewall, allowlist the same [Anthropic API IP addresses](<https://platform.claude.com/docs/en/api/ip-addresses>) so Anthropic infrastructure can reach your GHES host to clone repositories and post review comments. ##
modified Observability with OpenTelemetry View current →
--- a/observability.md +++ b/observability.md @@ -140,7 +140,7 @@ Attribute actions to your end users -The CLI attaches [identity attributes](</docs/en/monitoring-usage#standard-attributes>) to every event based on the credential it uses to call Anthropic. When you build an application that serves many end users from one deployment, these attributes identify your service’s credential, not the end user on whose behalf the agent acted. To make tool calls and MCP activity attributable to your application’s end users, inject end-user identity as resource attributes on each `query()` call. Percent-encode values before interpolating them, since `OTEL_RESOURCE_ATTRIBUTES` [reserves commas, spaces, and equals signs](</docs/en/monitoring-usage#multi-team-organization-support>). The following example attaches the requesting user and tenant to every span and event from one request: +The CLI attaches [identity attributes](</docs/en/monitoring-usage#standard-attributes>) to every event based on the credential it uses to call Anthropic. When you build an application that serves many end users from one deployment, these attributes identify your service’s credential, not the end user on whose behalf the agent acted. To make tool calls and MCP activity attributable to your application’s end users, inject end-user identity as resource attributes on each `query()` call. Percent-encode values before interpolating them, since `OTEL_RESOURCE_ATTRIBUTES` [reserves commas, spaces, and equals signs](</docs/en/monitoring-usage#multi-team-organization-support>). The following example attaches the requesting user and tenant to every span and event from one request. It assumes a `request` object from your web framework carrying the user and tenant IDs: Python @@ -155,7 +155,7 @@ }, ) -With end-user identity attached, the `tool_decision`, `tool_result`, `mcp_server_connection`, and `permission_mode_changed` events become a per-user audit trail you can forward to a Security Information and Event Management (SIEM) platform. See [Audit security events](</docs/en/monitoring-usage#audit-security-events>) in the Monitoring reference for the full list of security-relevant events and the attributes each one carries. +With end-user identity attached, the `tool_decision`, `tool_result`, `mcp_server_connection`, and `permission_mode_changed` events, which export as log records named with a `claude_code.` prefix, become a per-user audit trail you can forward to a Security Information and Event Management (SIEM) platform. See [Audit security events](</docs/en/monitoring-usage#audit-security-events>) in the Monitoring reference for the full list of security-relevant events and the attributes each one carries. ##
modified Choose a permission mode View current →
Show diff (104 lines)
--- a/permission-modes.md +++ b/permission-modes.md @@ -1,4 +1,4 @@ -When Claude wants to edit a file, run a shell command, or make a network request, it pauses and asks you to approve the action. Permission modes control how often that pause happens. The mode you pick shapes the flow of a session: default mode has you review each action as it comes, while looser modes let Claude work in longer uninterrupted stretches and report back when done. Pick more oversight for sensitive work, or fewer interruptions when you trust the direction. +When Claude wants to edit a file, run a shell command, or make a network request, it pauses and asks you to approve the action. Permission modes control how often that pause happens. The mode you pick shapes the flow of a session: Manual mode has you review each action as it comes, while looser modes let Claude work in longer uninterrupted stretches and report back when done. Pick more oversight for sensitive work, or fewer interruptions when you trust the direction. ## @@ -10,14 +10,14 @@ Mode| What runs without asking| Best for ---|---|--- -`default`| Reads only| Getting started, sensitive work +`default`| Reads only. Labeled **Manual** in the CLI and IDE extensions| Getting started, sensitive work `acceptEdits`| Reads, file edits, and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.)| Iterating on code you’re reviewing `plan`| Reads only| Exploring a codebase before changing it `auto`| Everything, with background safety checks| Long tasks, reducing prompt fatigue `dontAsk`| Only pre-approved tools| Locked-down CI and scripts `bypassPermissions`| Everything| Isolated containers and VMs only -In every mode except `bypassPermissions`, writes to protected paths are never auto-approved, guarding repository state and Claude’s own configuration against accidental corruption. Modes set the baseline. Layer [permission rules](</docs/en/permissions#manage-permissions>) on top to pre-approve or block specific tools. Deny rules and explicit ask rules apply in every mode, including `bypassPermissions`. Allow rules have no effect in that mode because everything else is already approved. +The mode that reviews every action is named **Manual** in the CLI, in `claude --help`, and in the VS Code and JetBrains extensions. Its config value is `default`, which is what hooks and SDK integrations use. The CLI accepts `manual` as an alias wherever you type the value, for example `claude --permission-mode manual` or `"defaultMode": "manual"`. The Manual label and the `manual` alias require Claude Code v2.1.200 or later. In every mode except `bypassPermissions`, writes to protected paths are never auto-approved, guarding repository state and Claude’s own configuration against accidental corruption. Modes set the baseline. Layer [permission rules](</docs/en/permissions#manage-permissions>) on top to pre-approve or block specific tools. Deny rules and explicit ask rules apply in every mode, including `bypassPermissions`. Allow rules have no effect in that mode because everything else is already approved. ## @@ -61,7 +61,7 @@ UI label| Mode ---|--- -Ask before edits| `default` +Manual| `default` Edit automatically| `acceptEdits` Plan mode| `plan` Auto mode| `auto` @@ -88,7 +88,7 @@ Auto-approve file edits with acceptEdits mode -`acceptEdits` mode lets Claude create and edit files in your working directory without prompting. The status bar shows `⏵⏵ accept edits on` while this mode is active. In addition to file edits, `acceptEdits` mode auto-approves common filesystem Bash commands: `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp`, and `sed`. These commands are also auto-approved when prefixed with safe environment variables such as `LANG=C` or `NO_COLOR=1`, or process wrappers such as `timeout`, `nice`, or `nohup`. Like file edits, auto-approval applies only to paths inside your working directory or `additionalDirectories`. Paths outside that scope, writes to protected paths, and all other Bash commands still prompt. When the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) is enabled, `acceptEdits` mode also auto-approves `Set-Content`, `Add-Content`, `Clear-Content`, and `Remove-Item` on in-scope paths, along with their common aliases. The same scope and protected-path rules apply. Use `acceptEdits` when you want to review changes in your editor or via `git diff` after the fact rather than approving each edit inline. Press `Shift+Tab` once from default mode to enter it, or start with it directly: +`acceptEdits` mode lets Claude create and edit files in your working directory without prompting. The status bar shows `⏵⏵ accept edits on` while this mode is active. In addition to file edits, `acceptEdits` mode auto-approves common filesystem Bash commands: `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp`, and `sed`. These commands are also auto-approved when prefixed with safe environment variables such as `LANG=C` or `NO_COLOR=1`, or process wrappers such as `timeout`, `nice`, or `nohup`. Like file edits, auto-approval applies only to paths inside your working directory or `additionalDirectories`. Paths outside that scope, writes to protected paths, and all other Bash commands still prompt. When the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) is enabled, `acceptEdits` mode also auto-approves `Set-Content`, `Add-Content`, `Clear-Content`, and `Remove-Item` on in-scope paths, along with their common aliases. The same scope and protected-path rules apply. Use `acceptEdits` when you want to review changes in your editor or via `git diff` after the fact rather than approving each edit inline. Press `Shift+Tab` once from Manual mode to enter it, or start with it directly: claude --permission-mode acceptEdits @@ -98,7 +98,7 @@ Analyze before you edit with plan mode -Plan mode tells Claude to research and propose changes without making them. Claude reads files, runs shell commands to explore, and writes a plan, but does not edit your source. Permission prompts still apply the same as default mode. Enter plan mode by pressing `Shift+Tab` or prefixing a single prompt with `/plan`. You can also start in plan mode from the CLI: +Plan mode tells Claude to research and propose changes without making them. Claude reads files, runs shell commands to explore, and writes a plan, but does not edit your source. Permission prompts still apply as they do in Manual mode. Enter plan mode by pressing `Shift+Tab` or prefixing a single prompt with `/plan`. You can also start in plan mode from the CLI: claude --permission-mode plan @@ -150,8 +150,8 @@ * **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 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`. + * **Model** : on the Anthropic API, Claude Opus 4.6 or later, or Sonnet 4.6 or later. On Amazon Bedrock, Google Cloud’s Agent Platform, 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’s Agent Platform, 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`. @@ -159,9 +159,9 @@ ​ -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 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`: +Enable auto mode on Bedrock, Agent Platform, or Foundry + +On [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</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": { @@ -177,7 +177,7 @@ What the classifier blocks by default -The classifier trusts your working directory and your repo’s configured remotes. Everything else is treated as external until you [configure trusted infrastructure](</docs/en/auto-mode-config>). **Blocked by default** : +The classifier trusts your working directory and the remotes that were configured for it when the session started. A remote added or repointed during the session with `git remote add` or `git remote set-url` isn’t trusted, and everything else is treated as external until you [configure trusted infrastructure](</docs/en/auto-mode-config>). Before v2.1.200, remotes added mid-session were also trusted. **Blocked by default** : * Downloading and executing code, like `curl | bash` * Sending sensitive data to external endpoints @@ -213,8 +213,17 @@ Claude Code v2.1.198 and later also block these by default: * Deleting files in `/tmp`, `$TMPDIR`, or another shared scratch or cache directory by wildcard, glob, or age filter rather than by a specific named path - * Including sensitive details in content sent, uploaded, published, or written to other people or shared systems, when your own message didn’t authorize those details for that recipient + * Including sensitive details in content sent, uploaded, published, or written to other people or shared systems, when your own message didn’t authorize those details for that recipient. PR and issue bodies, commit messages, and comments count as this kind of outbound content when the repository is outside the trust boundary or public, including your organization’s own public repositories; internal file paths, code names, live API response data such as emails or account identifiers, and infrastructure identifiers count as sensitive details. The PR, issue, and commit-message scoping requires Claude Code v2.1.200 or later * Sending keystrokes to Claude Code’s own tmux pane to drive its own interface, which the classifier treats as Claude changing its own permissions or oversight + +Claude Code v2.1.200 and later also block these by default: + + * Commenting out, deleting, or force-passing a test or assertion that guards security behavior, such as auth, access control, input validation, or sandboxing + * Deleting or tearing down a stateful resource Claude didn’t create in the session, when no more specific deletion rule applies and you didn’t name that resource + * Repointing an API base URL, proxy endpoint, webhook receiver, or registry mirror at a third-party host that doesn’t fit the task, including in example files like `.env.example` + * Changing where pushes go with `git remote set-url` or `git remote add`, unless you named the new remote + * Pushing secrets to a repository known to be public, or pushing other sensitive or confidential material there that isn’t part of that repository’s own work. When a repository’s visibility isn’t established, the classifier doesn’t block on that alone; it judges the content against the other rules instead + * Opening a pull request against a different repository or organization, forking with `gh repo fork`, or pushing to a third-party repository, unless you named that external target **Allowed by default** :
modified Configure permissions View current →
--- a/permissions.md +++ b/permissions.md @@ -40,7 +40,7 @@ Mode| Description ---|--- -`default`| Standard behavior: prompts for permission on first use of each tool +`default`| Standard behavior: prompts for permission on first use of each tool. Labeled Manual in the CLI and the VS Code and JetBrains extensions, and Claude Code accepts `manual` as an alias. The label and alias require Claude Code v2.1.200 or later `acceptEdits`| Automatically accepts file edits and common filesystem commands such as `mkdir`, `touch`, `mv`, and `cp` for paths in the working directory or `additionalDirectories` `plan`| Plan Mode: Claude reads files and runs read-only shell commands to explore but doesn’t edit your source files `auto`| Auto-approves tool calls with background safety checks that verify actions align with your request. Currently a research preview @@ -259,12 +259,21 @@ ---|---|---|--- `//path`| Absolute path from filesystem root| `Read(//Users/alice/secrets/**)`| `/Users/alice/secrets/**` `~/path`| Path from home directory| `Read(~/Documents/*.pdf)`| `/Users/alice/Documents/*.pdf` -`/path`| Path relative to project root| `Edit(/src/**/*.ts)`| `<project root>/src/**/*.ts` +`/path`| Path relative to the settings source| `Edit(/src/**/*.ts)`| `<project root>/src/**/*.ts` in project settings `path` or `./path`| Path relative to current directory| `Read(*.env)`| `<cwd>/*.env` -A pattern like `/Users/alice/file` isn’t an absolute path. It’s relative to the project root. Use `//Users/alice/file` for absolute paths. - -On Windows, paths are normalized to POSIX form before matching. `C:\Users\alice` becomes `/c/Users/alice`, so use `//c/**/.env` to match `.env` files anywhere on that drive. To match across all drives, use `//**/.env`. Examples: +A pattern like `/Users/alice/file` isn’t an absolute path. The single leading slash anchors at the settings source, not the filesystem root. Use `//Users/alice/file` for absolute paths. + +A `/path` pattern anchors at the directory associated with the settings file that defines it, so the same rule matches different locations depending on where you put it: + +Rule defined in| `/path` resolves to +---|--- +Project or local settings, such as `.claude/settings.json`| `<project root>/path` +User settings at `~/.claude/settings.json`| `~/.claude/path` +A file passed with `--settings <file>`| `<directory of file>/path` +CLI flags, `/permissions`, or session rules| `<original cwd>/path` + +A deny rule such as `Read(/secrets/**)` in user settings blocks `~/.claude/secrets/**`, not a `secrets` directory in your project. To write a rule in user settings that applies inside every project, use a `//` absolute path or a `~/` home-relative path instead. On Windows, paths are normalized to POSIX form before matching. `C:\Users\alice` becomes `/c/Users/alice`, so use `//c/**/.env` to match `.env` files anywhere on that drive. To match across all drives, use `//**/.env`. Examples: * `Edit(/docs/**)`: edits in `<project>/docs/`, not `/docs/` or `<project>/.claude/docs/` * `Read(~/.zshrc)`: reads your home directory’s `.zshrc` @@ -474,6 +483,24 @@ ​ +Project allow rules and workspace trust + +`permissions.allow` rules and `permissions.additionalDirectories` entries in a project’s `.claude/settings.json` grant capability, so Claude Code applies them only after you accept the [workspace trust dialog](</docs/en/security#additional-safeguards>) for that workspace. Until then, Claude Code reads the rules but doesn’t apply them. The trust dialog lists the allow rules and additional directories the folder would grant so you can review them before accepting. `deny` and `ask` rules aren’t affected, since they only restrict. Claude Code saves trust per workspace, keyed on the git repository root or, outside a repository, the directory you started Claude Code from. When you start in your home directory, trust is held for the current session only and isn’t written to disk; see the [additional safeguards](</docs/en/security#additional-safeguards>) note. Trusting a parent directory doesn’t apply a nested project’s allow rules. `.claude/settings.local.json` is your own file, so the workspace trust check usually doesn’t apply to it. When a repository could have supplied the file, such as when it is committed to git or `.claude` is a symlink, its allow rules and additional directories go through the trust check like project settings. Allow rules and additional directories in `.claude/settings.local.json` also apply without workspace trust in two cases: + + * The directory you started Claude Code from isn’t inside a git repository. + * The session runs in your own configuration home: your home directory or any directory whose `.claude` subdirectory you’ve set as [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>). + +In both cases the file is one you created rather than one a repository could have supplied, and a repository-committed `.claude/settings.local.json` still requires workspace trust. Versions 2.1.196 through 2.1.199 treated the file as repository-supplied in those workspaces, ignored its allow rules, and printed a [`this workspace has not been trusted`](</docs/en/errors#workspace-has-not-been-trusted>) warning to stderr. The two exceptions above match v2.1.195 and earlier and were restored in v2.1.200. Also as of v2.1.200, a workspace whose allow rules or additional directories still aren’t applied, but that never showed the trust dialog because a parent directory was already trusted, shows the dialog the next time you start Claude Code there interactively. The dialog offers two choices: + + * **Yes, I trust this folder** : saves trust for that workspace and applies the rules in the same session. + * **No, continue without these permissions** : keeps working with those rules ignored. The dialog appears again in the next session. + +In [non-interactive mode](</docs/en/headless>) with `-p`, no dialog appears and the rules stay ignored. + +## + +​ + Example configurations This [repository](<https://github.com/anthropics/claude-code/tree/main/examples/settings>) includes starter settings configurations for common deployment scenarios. Use these as starting points and adjust them to fit your needs.
modified Platforms and integrations View current →
--- a/platforms.md +++ b/platforms.md @@ -17,7 +17,7 @@ [Web](</docs/en/claude-code-on-the-web>)| Long-running tasks that don’t need much steering, or work that should continue when you’re offline| Anthropic-managed cloud, continues after you disconnect Mobile| Starting and monitoring tasks while away from your computer| Cloud sessions from the Claude app for iOS and Android, [Remote Control](</docs/en/remote-control>) for local sessions, [Dispatch](</docs/en/desktop#sessions-from-dispatch>) to Desktop on Pro and Max -The CLI is the most complete surface for terminal-native work: scripting and the Agent SDK are CLI-only. Third-party providers also work in [VS Code](</docs/en/vs-code#use-third-party-providers>). Enterprise [Desktop](</docs/en/desktop>) deployments support Vertex AI and gateway providers; for Bedrock or Foundry, use the CLI or VS Code, or the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/overview>), which runs the Code tab on those providers. Desktop and the IDE extensions trade some CLI-only features for visual review and tighter editor integration. The web runs in Anthropic’s cloud, so tasks keep going after you disconnect. Mobile is a thin client into those same cloud sessions or into a local session via Remote Control, and can send tasks to Desktop with Dispatch. You can mix surfaces on the same project. Configuration, project memory, and MCP servers are shared across the local surfaces. +The CLI is the most complete surface for terminal-native work: scripting and the Agent SDK are CLI-only. Third-party providers also work in [VS Code](</docs/en/vs-code#use-third-party-providers>). Enterprise [Desktop](</docs/en/desktop>) deployments support Google Cloud’s Agent Platform and gateway providers; for Amazon Bedrock or Microsoft Foundry, use the CLI or VS Code, or the [Cowork on 3P research preview](<https://claude.com/docs/cowork/3p/overview>), which runs the Code tab on those providers. Desktop and the IDE extensions trade some CLI-only features for visual review and tighter editor integration. The web runs in Anthropic’s cloud, so tasks keep going after you disconnect. Mobile is a thin client into those same cloud sessions or into a local session via Remote Control, and can send tasks to Desktop with Dispatch. You can mix surfaces on the same project. Configuration, project memory, and MCP servers are shared across the local surfaces. ##
modified How Claude Code uses prompt caching View current →
--- a/prompt-caching.md +++ b/prompt-caching.md @@ -30,8 +30,8 @@ Caching happens server-side, in whichever infrastructure serves your model. Where that is depends on how you authenticate: * **API key, Claude subscription, or[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)**: the cache lives in Anthropic’s infrastructure, accessed through the [Claude API](<https://platform.claude.com/docs>) - * **Bedrock or Vertex AI** : the cache lives in your cloud provider’s serving infrastructure - * **Foundry** : requests route to Anthropic’s infrastructure + * **Amazon Bedrock or Google Cloud’s Agent Platform** : the cache lives in your cloud provider’s serving infrastructure + * **Microsoft Foundry** : requests route to Anthropic’s infrastructure * **Custom`ANTHROPIC_BASE_URL` or [LLM gateway](</docs/en/llm-gateway>)**: the cache lives wherever your requests are forwarded, and whether caching works depends on the gateway For what each provider stores and processes, see [data usage](</docs/en/data-usage>). Wherever the cache lives, entries expire after a period of inactivity, and Cache lifetime below covers the TTL and how to extend it. @@ -88,7 +88,7 @@ Tool definitions sit in the system prompt layer, so the cache invalidates when the set of tool definitions in the request changes between turns. Toggling the [advisor tool](</docs/en/advisor>) is an exception: its definition sits after the cache breakpoint, so enabling or disabling `/advisor` keeps the cached prefix intact. Whether an [MCP server](</docs/en/mcp>) change does this depends on whether its tools are deferred by [tool search](</docs/en/mcp#scale-with-mcp-tool-search>) or loaded into the prefix: * **Deferred tools** , the default on supported models: a server connecting, disconnecting, or changing its tool list only appends new content and doesn’t disturb anything already cached. - * **Tools loaded into the prefix** : any change to them invalidates the cache. This happens when [tool search is unavailable or disabled](</docs/en/mcp#configure-tool-search>), such as on Haiku models, on Vertex AI, or with a custom `ANTHROPIC_BASE_URL` gateway. It also happens for a server or tool marked [`alwaysLoad`](</docs/en/mcp#exempt-a-server-from-deferral>), and for definitions kept upfront by [threshold-based loading](</docs/en/mcp#configure-tool-search>). + * **Tools loaded into the prefix** : any change to them invalidates the cache. This happens when [tool search is unavailable or disabled](</docs/en/mcp#configure-tool-search>), such as on Haiku models, on Google Cloud’s Agent Platform, or with a custom `ANTHROPIC_BASE_URL` gateway. It also happens for a server or tool marked [`alwaysLoad`](</docs/en/mcp#exempt-a-server-from-deferral>), and for definitions kept upfront by [threshold-based loading](</docs/en/mcp#configure-tool-search>). When tools load into the prefix, the most common cause of an invalidation is a server connecting or disconnecting mid-session, which can happen without any action on your part: a stdio server’s process exits, an HTTP session expires, or a server [reconnects automatically after a transient failure](</docs/en/mcp#automatic-reconnection>). A connected server can also push a [dynamic tool update](</docs/en/mcp#dynamic-tool-updates>) that changes its tool list. Editing your MCP config does not by itself change the cache. The new config takes effect only after a restart, which is when the server connects or disconnects. @@ -223,7 +223,7 @@ On an API key or third-party provider -On an API key, Bedrock, Vertex, Foundry, or Claude Platform on AWS, you pay the per-token rates, so the TTL stays at the cheaper five minutes by default. To opt into the [one-hour TTL](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration>), set `ENABLE_PROMPT_CACHING_1H=1`. On Bedrock, prompt caching support, minimum cacheable prefix length, and one-hour TTL availability all vary by model. If cache token counts stay at zero, check [supported models, regions, and limits](<https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html#prompt-caching-models>) in the Bedrock documentation. +On an API key, Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, you pay the per-token rates, so the TTL stays at the cheaper five minutes by default. To opt into the [one-hour TTL](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#1-hour-cache-duration>), set `ENABLE_PROMPT_CACHING_1H=1`. On Amazon Bedrock, prompt caching support, minimum cacheable prefix length, and one-hour TTL availability all vary by model. If cache token counts stay at zero, check [supported models, regions, and limits](<https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html#prompt-caching-models>) in the Amazon Bedrock documentation. ###
modified Agent SDK reference - Python View current →
--- a/python.md +++ b/python.md @@ -1746,7 +1746,7 @@ `uuid`| `str`| Unique identifier for this event `session_id`| `str`| Session identifier `event`| `dict[str, Any]`| The raw Claude API stream event data -`parent_tool_use_id`| `str | None`| Parent tool use ID if this event is from a subagent +`parent_tool_use_id`| `str | None`| Always `None`. Stream events are emitted for the main session only. For subagent attribution, use complete messages such as `AssistantMessage` ###
modified Quickstart View current →
--- a/quickstart.md +++ b/quickstart.md @@ -75,7 +75,7 @@ * [Claude Pro, Max, Team, or Enterprise](<https://claude.com/pricing?utm_source=claude_code&utm_medium=docs&utm_content=quickstart_login>) (recommended) * [Claude Console](<https://console.anthropic.com/>) (API access with pre-paid credits). On first login, a “Claude Code” workspace is automatically created in the Console for centralized cost tracking. - * [Amazon Bedrock, Google Vertex AI, or Microsoft Foundry](</docs/en/third-party-integrations>) (enterprise cloud providers) + * [Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry](</docs/en/third-party-integrations>) (enterprise cloud providers) * A self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>), if your organization runs one: your admin pre-configures the gateway URL, and `/login` opens directly on the **Cloud gateway** screen for you to sign in with corporate SSO Once logged in, your credentials are stored and you won’t need to log in again.
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -22,7 +22,7 @@ * **Subscription** : available on Pro, Max, Team, and Enterprise plans. API keys are not supported. On Team and Enterprise, an Owner must first enable the Remote Control toggle in [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>). * **Authentication** : run `claude` and use `/login` to sign in through claude.ai if you haven’t already. - * **API endpoint** : not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. As of v2.1.196, Remote Control is also disabled when [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>) points at a host other than `api.anthropic.com`, such as an [LLM gateway](</docs/en/llm-gateway>) or proxy. Unset the variable to use Remote Control. + * **API endpoint** : not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. As of v2.1.196, Remote Control is also disabled when [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>) points at a host other than `api.anthropic.com`, such as an [LLM gateway](</docs/en/llm-gateway>) or proxy. Unset the variable to use Remote Control. * **Workspace trust** : run `claude` in your project directory at least once to accept the workspace trust dialog. ## @@ -51,12 +51,15 @@ ---|--- `--name "My Project"`| Set a custom session title visible in the session list at claude.ai/code. `--remote-control-session-name-prefix <prefix>`| Prefix for auto-generated session names when no explicit name is set. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. Set `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` for the same effect. +`-c`, `--continue`| Resume the most recent Remote Control session started from this directory instead of creating a new one. Can’t be combined with `--session-id`, `--spawn`, `--capacity`, or `--create-session-in-dir`. Requires Claude Code v2.1.200 or later; earlier versions reject the flag as an unknown argument. +`--session-id <id>`| Resume a specific Remote Control session by its ID. Can’t be combined with `--continue`, `--spawn`, `--capacity`, or `--create-session-in-dir`. Requires Claude Code v2.1.200 or later; earlier versions reject the flag as an unknown argument. `--spawn <mode>`| How the server creates sessions. • `same-dir` (default): all sessions share the current working directory, so they can conflict if editing the same files. • `worktree`: each on-demand session gets its own [git worktree](</docs/en/worktrees>). Requires a git repository. • `session`: single-session mode. Serves exactly one session and rejects additional connections. Set at startup only. Press `w` at runtime to toggle between `same-dir` and `worktree`. `--capacity <N>`| Maximum number of concurrent sessions. Default is 32. Cannot be used with `--spawn=session`. +`--[no-]create-session-in-dir`| Pre-create one session in the current directory when the server starts, so you have somewhere to type immediately. In `worktree` mode this session stays in the current directory while on-demand sessions get isolated worktrees. On by default; pass `--no-create-session-in-dir` to start with none. `--verbose`| Show detailed connection and session logs. `--sandbox` / `--no-sandbox`| Enable or disable [sandboxing](</docs/en/sandboxing>) for filesystem and network isolation. Off by default. @@ -313,7 +316,7 @@ ”Remote Control is only available when using Claude via api.anthropic.com” -The session isn’t talking to the Anthropic API directly, so there is no claude.ai backend to pair with. This happens on Amazon Bedrock, Google Vertex AI, and Microsoft Foundry. As of v2.1.196 it also happens when [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>) points at a host other than `api.anthropic.com`, such as an [LLM gateway](</docs/en/llm-gateway>) or proxy, even if you sign in with claude.ai. Unset `ANTHROPIC_BASE_URL` and restart the session to use Remote Control. +The session isn’t talking to the Anthropic API directly, so there is no claude.ai backend to pair with. This happens on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. As of v2.1.196 it also happens when [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>) points at a host other than `api.anthropic.com`, such as an [LLM gateway](</docs/en/llm-gateway>) or proxy, even if you sign in with claude.ai. Unset `ANTHROPIC_BASE_URL` and restart the session to use Remote Control. ### @@ -343,6 +346,14 @@ * Not signed in: run `claude` and use `/login` to authenticate with your claude.ai account. API key authentication is not supported for Remote Control. * Network or proxy issue: a firewall or proxy may be blocking the outbound HTTPS request. Remote Control requires access to the Anthropic API on port 443. * Session creation failed: if you also see `Session creation failed — see debug log`, the failure happened earlier in setup. Check that your subscription is active. + +### + +​ + +”Couldn’t reconnect to your Remote Control session” + +When you resume a conversation with `claude --resume` or `claude --continue`, Claude Code reconnects to the Remote Control session recorded in that conversation. This message means the reconnection failed for a reason that may be temporary, such as a network interruption or a server error, so Claude Code can’t confirm whether the remote session still exists. When the server confirms the previous session no longer exists, Claude Code creates a new Remote Control session without showing this message. Your local session keeps running without Remote Control. Run `/remote-control` to retry the connection, or start Claude Code without `--resume` to create a new Remote Control session. Before v2.1.200, a reconnection failure created a new Remote Control session instead of showing this message, which left extra sessions in the session list at claude.ai/code. ###
modified Automate work with routines View current →
--- a/routines.md +++ b/routines.md @@ -390,7 +390,7 @@ The CLI hides `/schedule` when one of its requirements isn’t met, so the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule`. The cause is usually one of the following: - * You are authenticated with a Console API key or a cloud provider such as Bedrock, Vertex, or Foundry. `/schedule` requires a claude.ai subscription login. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login + * You are authenticated with a Console API key or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings#available-settings>). These disable feature-flag fetching, which `/schedule` depends on * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead * Your CLI is older than v2.1.81. Run `claude update`
modified Run prompts on a schedule View current →
--- a/scheduled-tasks.md +++ b/scheduled-tasks.md @@ -69,7 +69,7 @@ When you ask for a dynamic `/loop` schedule, Claude may use the [Monitor tool](</docs/en/tools-reference#monitor-tool>) directly. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does: the loop ends automatically seven days after you start it. -On Bedrock, Vertex AI, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead. +On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead. ### @@ -89,7 +89,7 @@ A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md. -On Bedrock, Vertex AI, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt. +On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt. ### @@ -115,7 +115,7 @@ Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated. -On Bedrock, Vertex AI, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead. +On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead. ###
modified Configure server-managed settings View current →
--- a/server-managed-settings.md +++ b/server-managed-settings.md @@ -231,12 +231,12 @@ Server-managed settings require a direct connection to `api.anthropic.com`, and delivery requires the session to authenticate with an organization OAuth login or a directly configured API key. Keys returned by an [`apiKeyHelper`](</docs/en/settings#available-settings>) script don’t trigger the settings fetch. Server-managed settings are not available when using third-party model providers: * Amazon Bedrock - * Google Vertex AI + * Google Cloud’s Agent Platform * Microsoft Foundry * [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) * Custom API endpoints via `ANTHROPIC_BASE_URL` or third-party [LLM gateways](</docs/en/llm-gateway>) -For Bedrock, Vertex AI, and Foundry deployments, a self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) provides the equivalent remote managed-settings delivery: gateway-signed-in clients fetch managed settings from the gateway instead of `api.anthropic.com`. The failure semantics differ at startup: a gateway client that can’t reach the gateway exits with an error instead of falling back to cached settings, while the hourly background refresh is fail-open on both channels. +For Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry deployments, a self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>) provides the equivalent remote managed-settings delivery: gateway-signed-in clients fetch managed settings from the gateway instead of `api.anthropic.com`. The failure semantics differ at startup: a gateway client that can’t reach the gateway exits with an error instead of falling back to cached settings, while the hourly background refresh is fail-open on both channels. ##
modified Claude Code settings View current →
--- a/settings.md +++ b/settings.md @@ -98,7 +98,7 @@ * **User settings** are defined in `~/.claude/settings.json` and apply to all projects. * **Project settings** are saved in your project directory: * `.claude/settings.json` for settings that are checked into source control and shared with your team - * `.claude/settings.local.json` for settings that are not checked in, useful for personal preferences and experimentation. When Claude Code creates `.claude/settings.local.json`, it configures git to ignore the file. If you create the file yourself, add it to your gitignore manually. + * `.claude/settings.local.json` for settings that are not checked in, useful for personal preferences and experimentation. When Claude Code creates `.claude/settings.local.json`, it configures git to ignore the file. If you create the file yourself, add it to your gitignore manually. Because this file is yours rather than the repository’s, its permission `allow` rules take effect without the [workspace trust](</docs/en/permissions#project-allow-rules-and-workspace-trust>) step that `.claude/settings.json` allow rules require. If the repository supplies the file, for example by committing it, workspace trust still applies. * **Managed settings** : For organizations that need centralized control, Claude Code supports multiple delivery mechanisms for managed settings. All use the same JSON format and cannot be overridden by user or project settings: * **Server-managed settings** : delivered remotely at sign-in, either from Anthropic’s servers via the claude.ai admin console or from a self-hosted [Claude apps gateway](</docs/en/claude-apps-gateway>). See [server-managed settings](</docs/en/server-managed-settings>). * **MDM/OS-level policies** : delivered through native device management on macOS and Windows: @@ -210,6 +210,7 @@ `allowManagedPermissionRulesOnly`| (Managed settings only) Prevent user and project settings from defining `allow`, `ask`, or `deny` permission rules. Only rules in managed settings apply. See [Managed-only settings](</docs/en/permissions#managed-only-settings>)| `true` `alwaysThinkingEnabled`| Enable [extended thinking](</docs/en/model-config#extended-thinking>) by default for all sessions. Typically configured via the `/config` command rather than editing directly. To force thinking off regardless of this setting, set [`MAX_THINKING_TOKENS=0`](</docs/en/env-vars>) in `env`, which disables thinking on the Anthropic API except on Fable 5, which cannot have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>) this omits the `thinking` parameter instead, and adaptive-reasoning models may still think| `true` `apiKeyHelper`| Custom command, run through the system shell (`/bin/sh` on macOS and Linux, `cmd` on Windows), to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests. Set the refresh interval with [`CLAUDE_CODE_API_KEY_HELPER_TTL_MS`](</docs/en/env-vars>)| `/bin/generate_temp_api_key.sh` +`askUserQuestionTimeout`| **Default** : `"never"`. Idle time before an unanswered [`AskUserQuestion`](</docs/en/tools-reference>) dialog auto-continues with whatever options you’d already selected. Accepts `"60s"`, `"5m"`, `"10m"`, or `"never"`. With the default, questions wait until you answer them. Appears in `/config` as **Question auto-continue timeout** , which writes this key to user settings. Not read from project or local settings. Requires Claude Code v2.1.200 or later| `"5m"` `attribution`| Customize attribution for git commits and pull requests. See Attribution settings| `{"commit": "🤖 Generated with Claude Code", "pr": ""}` `autoCompactEnabled`| **Default** : `true`. Automatically compact the conversation when context approaches the limit. Appears in `/config` as **Auto-compact**. To disable via environment variable, set [`DISABLE_AUTO_COMPACT`](</docs/en/env-vars>) in `env`| `false` `autoMemoryDirectory`| Custom directory for [auto memory](</docs/en/memory#storage-location>) storage. Accepts an absolute path or a `~/`-prefixed path. From project or local settings, this is honored only after you accept the workspace trust dialog, since a cloned repository can supply this file| `"~/my-memory-dir"` @@ -252,13 +253,13 @@ `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-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` +`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 Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft 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` `fileSuggestion`| Configure a custom script for `@` file autocomplete. See File suggestion settings| `{"type": "command", "command": "~/.claude/file-suggestion.sh"}` `footerLinksRegexes`| Render extra clickable badges in the footer when a regex matches turn output. Each entry has a `pattern`, a `url` template with `{name}` placeholders filled from named capture groups, and an optional `label`. Read from user, `--settings` flag, and managed settings only. See Footer link badges for URL constraints, scheme allowlist, and limits. Requires Claude Code v2.1.176 or later| `[{"type": "regex", "pattern": "\\b(?<key>PROJ-\\d+)\\b", "url": "https://issues.example.com/browse/{key}", "label": "{key}"}]` -`forceLoginMethod`| Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console accounts, or `gateway` to restrict login to a cloud gateway; see [Claude apps gateway](</docs/en/claude-apps-gateway>). When set to any value in managed settings, sessions authenticated by `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` are blocked at startup, since an environment credential cannot satisfy the required login method. Third-party provider sessions such as Bedrock, Vertex, and Foundry are not blocked: they authenticate against your cloud provider rather than Anthropic| `claudeai` +`forceLoginMethod`| Use `claudeai` to restrict login to Claude.ai accounts, `console` to restrict login to Claude Console accounts, or `gateway` to restrict login to a cloud gateway; see [Claude apps gateway](</docs/en/claude-apps-gateway>). When set to any value in managed settings, sessions authenticated by `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` are blocked at startup, since an environment credential cannot satisfy the required login method. Third-party provider sessions such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry are not blocked: they authenticate against your cloud provider rather than Anthropic| `claudeai` `forceLoginGatewayUrl`| Pre-fills and locks the gateway URL on the `/login` Cloud gateway screen. Either this key or `forceLoginMethod: "gateway"` surfaces that screen; set both so the URL is filled in. Honored only at the managed policy tier; ignored in user and project settings. See [Claude apps gateway](</docs/en/claude-apps-gateway#set-the-gateway-url>)| `"https://claude-gateway.example.com"` -`forceLoginOrgUUID`| Require login to belong to a specific Anthropic organization. Accepts a single UUID string, which also pre-selects that organization during login, or an array of UUIDs where any listed organization is accepted without pre-selection. When set in managed settings, login fails if the authenticated account does not belong to a listed organization, and sessions authenticated by `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` are blocked at startup since organization membership cannot be verified for them. Third-party provider sessions such as Bedrock, Vertex, and Foundry are not blocked: use your cloud IAM to restrict which cloud accounts can be used. An empty array fails closed and blocks login with a misconfiguration message| `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` or `["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"]` +`forceLoginOrgUUID`| Require login to belong to a specific Anthropic organization. Accepts a single UUID string, which also pre-selects that organization during login, or an array of UUIDs where any listed organization is accepted without pre-selection. When set in managed settings, login fails if the authenticated account does not belong to a listed organization, and sessions authenticated by `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` are blocked at startup since organization membership cannot be verified for them. Third-party provider sessions such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry are not blocked: use your cloud IAM to restrict which cloud accounts can be used. An empty array fails closed and blocks login with a misconfiguration message| `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` or `["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"]` `forceRemoteSettingsRefresh`| (Managed settings only) Block CLI startup until remote managed settings are freshly fetched from the server. If the fetch fails, the CLI exits rather than continuing with cached or no settings. When not set, startup continues without waiting for remote settings. See [fail-closed enforcement](</docs/en/server-managed-settings#enforce-fail-closed-startup>)| `true` `gcpAuthRefresh`| Custom script that refreshes GCP Application Default Credentials when they expire or cannot be loaded. See [advanced credential configuration](</docs/en/google-vertex-ai#advanced-credential-configuration>)| `gcloud auth application-default login` `hooks`| Configure custom commands to run at lifecycle events. See [hooks documentation](</docs/en/hooks>) for format| See [hooks](</docs/en/hooks>) @@ -268,7 +269,7 @@ `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-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:..."}` +`modelOverrides`| Map Anthropic model IDs to provider-specific model IDs such as Amazon 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"` `parentSettingsBehavior`| (Managed settings only) **Default** : `"first-wins"`. Controls whether managed settings supplied programmatically by an embedding host process, such as the Agent SDK or an IDE extension, apply when an admin-deployed managed tier is also present. `"first-wins"`: the parent-supplied settings are dropped and only the admin tier applies. `"merge"`: the parent-supplied settings apply under the admin tier, filtered so they can tighten policy but not loosen it. Has no effect when no admin tier is deployed. Requires Claude Code v2.1.133 or later| `"merge"` @@ -291,7 +292,7 @@ `skillListingBudgetFraction`| **Default** : `0.01` (1%). Fraction of the model’s context window reserved for the [skill listing](</docs/en/skills#skill-descriptions-are-cut-short>) Claude sees each turn. When the listing exceeds the budget, descriptions for the least-used skills are collapsed to bare names so Claude can still invoke them but won’t see why. Raise to keep more descriptions visible at the cost of more context per turn. `/doctor` shows the current truncation count and which skills are affected. Requires Claude Code v2.1.105 or later| `0.02` `skillListingMaxDescChars`| **Default** : `1536`. Per-skill character cap on the combined `description` and `when_to_use` text in the [skill listing](</docs/en/skills#skill-descriptions-are-cut-short>) Claude sees each turn. Text longer than this is truncated. Raise to keep long descriptions intact at the cost of more context per turn; lower to fit more skills under `skillListingBudgetFraction`. Requires Claude Code v2.1.105 or later| `2048` `skillOverrides`| Per-skill visibility overrides keyed by skill name. Value is `"on"`, `"name-only"`, `"user-invocable-only"`, or `"off"`. Lets you hide or collapse a skill without editing its SKILL.md. Does not apply to plugin skills, which are managed through `/plugin`. The `/skills` menu writes these to `.claude/settings.local.json`. See [Override skill visibility from settings](</docs/en/skills#override-skill-visibility-from-settings>). Requires Claude Code v2.1.129 or later| `{"legacy-context": "name-only", "deploy": "off"}` -`skipWebFetchPreflight`| Skip the [WebFetch domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>) that sends each requested hostname to `api.anthropic.com` before fetching. Set to `true` in environments that block traffic to Anthropic, such as Bedrock, Vertex AI, or Foundry deployments with restrictive egress. When skipped, WebFetch attempts any URL without consulting the blocklist| `true` +`skipWebFetchPreflight`| Skip the [WebFetch domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>) that sends each requested hostname to `api.anthropic.com` before fetching. Set to `true` in environments that block traffic to Anthropic, such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry deployments with restrictive egress. When skipped, WebFetch attempts any URL without consulting the blocklist| `true` `spinnerTipsEnabled`| **Default** : `true`. Show tips in the spinner while Claude is working. Set to `false` to disable tips| `false` `spinnerTipsOverride`| Override spinner tips with custom strings. `tips`: array of tip strings. `excludeDefault`: if `true`, only show custom tips; if `false` or absent, custom tips are merged with built-in tips| `{ "excludeDefault": true, "tips": ["Use our internal tool X"] }` `spinnerVerbs`| Customize the action verbs shown while a turn is in progress. Set `mode` to `"replace"` to use only your verbs, or `"append"` to add them to the defaults| `{"mode": "append", "verbs": ["Pondering", "Crafting"]}` @@ -360,7 +361,7 @@ `ask`| Array of permission rules to ask for confirmation upon tool use. See Permission rule syntax below| `[ "Bash(git push *)" ]` `deny`| Array of permission rules to deny tool use. Use this to exclude sensitive files from Claude Code access. Tool names accept glob patterns: `"*"` denies every tool and `"mcp__*"` denies all MCP tools. See Permission rule syntax and [Bash permission limitations](</docs/en/permissions#tool-specific-permission-rules>)| `[ "WebFetch", "Bash(curl *)", "Read(./.env)", "Read(./secrets/**)" ]` `additionalDirectories`| Additional [working directories](</docs/en/permissions#working-directories>) for file access. Most `.claude/` configuration is [not discovered](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) from these directories| `[ "../docs/" ]` -`defaultMode`| Default [permission mode](</docs/en/permission-modes>) when opening Claude Code. Valid values: `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions`. As of Claude Code v2.1.142, `auto` is ignored when set in project or local settings (`.claude/settings.json`, `.claude/settings.local.json`) so a repository cannot grant itself auto mode. Set it in `~/.claude/settings.json` instead. The `--permission-mode` CLI flag overrides this setting for a single session| `"acceptEdits"` +`defaultMode`| Default [permission mode](</docs/en/permission-modes>) when opening Claude Code. Valid values: `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions`, and `manual` as an alias for `default`, the mode labeled Manual in the CLI and the VS Code and JetBrains extensions. The `manual` alias requires Claude Code v2.1.200 or later. `auto` is ignored when set in project or local settings, so a repository can’t grant itself auto mode; set it in `~/.claude/settings.json` instead. Before v2.1.142, project settings could set `auto`. The `--permission-mode` CLI flag overrides this setting for a single session| `"acceptEdits"` `disableBypassPermissionsMode`| Set to `"disable"` to prevent `bypassPermissions` mode from being activated. This disables the `--dangerously-skip-permissions` command-line flag. Typically placed in [managed settings](</docs/en/permissions#managed-settings>) to enforce organizational policy, but works from any scope| `"disable"` `skipDangerousModePermissionPrompt`| Skip the confirmation prompt shown before entering bypass permissions mode via `--dangerously-skip-permissions` or `defaultMode: "bypassPermissions"`. Ignored when set in project settings (`.claude/settings.json`) to prevent untrusted repositories from auto-bypassing the prompt| `true`
modified Advanced setup View current →
--- a/setup.md +++ b/setup.md @@ -140,7 +140,7 @@ Authenticate -Claude Code requires a Pro, Max, Team, Enterprise, or Console account. The free Claude.ai plan does not include Claude Code access. You can also use Claude Code with a third-party API provider like [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>). After installing, log in by running `claude` and following the browser prompts. See [Authentication](</docs/en/authentication>) for all account types and team setup options. +Claude Code requires a Pro, Max, Team, Enterprise, or Console account. The free Claude.ai plan does not include Claude Code access. You can also use Claude Code with a third-party API provider like [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>). After installing, log in by running `claude` and following the browser prompts. See [Authentication](</docs/en/authentication>) for all account types and team setup options. ## @@ -410,7 +410,7 @@ Check the binary against the manifest -Compare the SHA256 checksum of your downloaded binary with the value listed under `platforms.<platform>.checksum` in `manifest.json`. +Compare the SHA256 checksum of the binary with the value listed under `platforms.<platform>.checksum` in `manifest.json`. The commands below assume a `claude` binary in the current directory. To verify an installed native binary instead, run the command against `~/.local/share/claude/versions/VERSION`, replacing VERSION with the release you set in Step 2. * Linux
modified Stream responses in real-time View current →
--- a/streaming-output.md +++ b/streaming-output.md @@ -62,9 +62,9 @@ uuid: str # Unique identifier for this event session_id: str # Session identifier event: dict[str, Any] # The raw Claude API stream event - parent_tool_use_id: str | None # Parent tool ID if from a subagent - -The `event` field contains the raw streaming event from the [Claude API](<https://platform.claude.com/docs/en/build-with-claude/streaming#event-types>). Common event types include: + parent_tool_use_id: str | None # Always None + +The `parent_tool_use_id` field is always `None` in Python and `null` in TypeScript. Stream events are emitted for the main session only; token-level deltas from subagents aren’t forwarded. To attribute output to a subagent, use complete messages, which carry `parent_tool_use_id`. See [Detect subagent invocation](</docs/en/agent-sdk/subagents#detect-subagent-invocation>). The `event` field contains the raw streaming event from the [Claude API](<https://platform.claude.com/docs/en/build-with-claude/streaming#event-types>). Common event types include: Event Type| Description ---|---
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -225,7 +225,7 @@ `tools`| No| Tools the subagent can use. Inherits all tools if omitted. To preload Skills into context, use the `skills` field rather than listing `Skill` here `disallowedTools`| No| Tools to deny, removed from inherited or specified list `model`| No| Model to use: `sonnet`, `opus`, `haiku`, `fable`, a full model ID (for example, `claude-opus-4-8`), or `inherit`. Defaults to `inherit` -`permissionMode`| No| Permission mode: `default`, `acceptEdits`, `auto`, `dontAsk`, `bypassPermissions`, or `plan`. Ignored for plugin subagents +`permissionMode`| No| Permission mode: `default`, `acceptEdits`, `auto`, `dontAsk`, `bypassPermissions`, `plan`, or `manual` as an alias for `default`. The `manual` alias requires Claude Code v2.1.200 or later. Ignored for plugin subagents `maxTurns`| No| Maximum number of agentic turns before the subagent stops `skills`| No| [Skills](</docs/en/skills>) to preload into the subagent’s context at startup. The full skill content is injected, not only the description. Subagents can still invoke unlisted project, user, and plugin skills through the Skill tool `mcpServers`| No| [MCP servers](</docs/en/mcp>) available to this subagent. Each entry is either a server name referencing an already-configured server (e.g., `"slack"`) or an inline definition with the server name as key and a full [MCP server config](</docs/en/mcp#installing-mcp-servers>) as value. Ignored for plugin subagents @@ -678,7 +678,7 @@ As of v2.1.199, a subagent whose run ends on an API error, such as a usage limit or a repeated server error, reports that failure back to Claude instead of returning the error text as if it were the subagent’s findings. What Claude receives depends on where the subagent ran: - * **Foreground** : if a rate limit, overload, or server error cuts off a subagent that already produced output, the Agent tool returns that partial output with a note that the subagent was cut off and didn’t finish its task. Otherwise the tool call fails with [`Agent terminated early due to an API error`](</docs/en/errors#agent-terminated-early-due-to-an-api-error>), followed by the error detail. + * **Foreground** : if a rate limit, overload, or server error cuts off a subagent that already produced text output, the Agent tool returns that partial output with a note that the subagent was cut off and didn’t finish its task. A subagent that produced nothing, or whose only output was tool calls, fails with [`Agent terminated early due to an API error`](</docs/en/errors#agent-terminated-early-due-to-an-api-error>), followed by the error detail. In v2.1.199, a rate limit, overload, or server error that cut off the tool-calls-only shape returned an empty partial result containing only the cut-off note instead. * **Background** : the subagent is marked failed, and the message Claude receives when it ends names the API error and includes the subagent’s last output, so partial work isn’t lost. Once the underlying API error clears, ask Claude to retry the task or resume the subagent.
modified Subagents in the SDK View current →
--- a/subagents.md +++ b/subagents.md @@ -173,7 +173,7 @@ The parent receives the subagent’s final message verbatim as the Agent tool result, but may summarize it in its own response. To preserve subagent output verbatim in the user-facing response, include an instruction to do so in the prompt or `systemPrompt` option you pass to the main `query()` call. -As of Claude Code v2.1.199, an API error that ends the subagent early, such as a rate limit, is never delivered as its result. If the subagent already produced output, the Agent tool returns that partial output with a note that the subagent didn’t finish; otherwise the tool result is an error message, `Agent terminated early due to an API error`, followed by the error detail. See [API errors in subagents](</docs/en/sub-agents#api-errors-in-subagents>) for the foreground and background behavior. +An API error that ends the subagent early, such as a rate limit, is never delivered as its result. If a rate limit, overload, or server error cuts off a foreground subagent that already produced text output, the Agent tool returns that partial output with a note that the subagent didn’t finish. A subagent that produced nothing, or whose only output was tool calls with no text, fails with an error message, `Agent terminated early due to an API error`, followed by the error detail. See [API errors in subagents](</docs/en/sub-agents#api-errors-in-subagents>) for the foreground and background behavior. This partial-output handling requires Claude Code v2.1.199 or later. In v2.1.199, a rate limit, overload, or server error left the tool-calls-only shape with an empty partial result containing only the cutoff note. ##
modified Enterprise deployment overview View current →
Show diff (102 lines)
--- a/third-party-integrations.md +++ b/third-party-integrations.md @@ -6,7 +6,7 @@ Compare deployment options -For most organizations, Claude for Teams or Claude for Enterprise provides the best experience. Team members get access to both Claude Code and Claude on the web with a single subscription, centralized billing, and no infrastructure setup required. **Claude for Teams** is self-service and includes collaboration features, admin tools, and billing management. Best for smaller teams that need to get started quickly. **Claude for Enterprise** adds SSO and domain capture, role-based permissions, compliance API access, and managed policy settings for deploying organization-wide Claude Code configurations. Best for larger organizations with security and compliance requirements. Learn more about [Team plans](<https://support.claude.com/en/articles/9266767-what-is-the-team-plan>) and [Enterprise plans](<https://support.claude.com/en/articles/9797531-what-is-the-enterprise-plan>). If your organization has specific infrastructure requirements, compare the options below: Feature| Claude for Teams/Enterprise| Anthropic Console| Amazon Bedrock| Claude Platform on AWS| Google Vertex AI| Microsoft Foundry +For most organizations, Claude for Teams or Claude for Enterprise provides the best experience. Team members get access to both Claude Code and Claude on the web with a single subscription, centralized billing, and no infrastructure setup required. **Claude for Teams** is self-service and includes collaboration features, admin tools, and billing management. Best for smaller teams that need to get started quickly. **Claude for Enterprise** adds SSO and domain capture, role-based permissions, compliance API access, and managed policy settings for deploying organization-wide Claude Code configurations. Best for larger organizations with security and compliance requirements. Learn more about [Team plans](<https://support.claude.com/en/articles/9266767-what-is-the-team-plan>) and [Enterprise plans](<https://support.claude.com/en/articles/9797531-what-is-the-enterprise-plan>). If your organization has specific infrastructure requirements, compare the options below: Feature| Claude for Teams/Enterprise| Anthropic Console| Amazon Bedrock| Claude Platform on AWS| Google Cloud’s Agent Platform, formerly Vertex AI| Microsoft Foundry ---|---|---|---|---|---|--- Best for| Most organizations (recommended)| Individual developers| AWS-native deployments| AWS Marketplace billing with Claude API features| GCP-native deployments| Azure-native deployments Billing| **Teams:** $150/seat (Premium) with PAYG available @@ -21,10 +21,10 @@ * [Claude for Teams or Enterprise](</docs/en/authentication#claude-for-teams-or-enterprise>) * [Anthropic Console](</docs/en/authentication#claude-console-authentication>) - * [Claude apps gateway](</docs/en/claude-apps-gateway>), a self-hosted gateway that adds IdP sign-in in front of Amazon Bedrock, Claude Platform on AWS, Google Vertex AI, Microsoft Foundry, or the Anthropic API + * [Claude apps gateway](</docs/en/claude-apps-gateway>), a self-hosted gateway that adds IdP sign-in in front of Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, Microsoft Foundry, or the Anthropic API * [Amazon Bedrock](</docs/en/amazon-bedrock>) * [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) - * [Google Vertex AI](</docs/en/google-vertex-ai>) + * [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) * [Microsoft Foundry](</docs/en/microsoft-foundry>) ## @@ -50,7 +50,7 @@ * LLM Gateway -Route Bedrock traffic through your corporate proxy by setting the following [environment variables](</docs/en/env-vars>): +Route Amazon Bedrock traffic through your corporate proxy by setting the following [environment variables](</docs/en/env-vars>): # Enable Bedrock export CLAUDE_CODE_USE_BEDROCK=1 @@ -59,7 +59,7 @@ # Configure corporate proxy export HTTPS_PROXY='https://proxy.example.com:8080' -Route Bedrock traffic through your LLM gateway by setting the following [environment variables](</docs/en/env-vars>): +Route Amazon Bedrock traffic through your LLM gateway by setting the following [environment variables](</docs/en/env-vars>): # Enable Bedrock export CLAUDE_CODE_USE_BEDROCK=1 @@ -78,7 +78,7 @@ * LLM Gateway -Route Foundry traffic through your corporate proxy by setting the following [environment variables](</docs/en/env-vars>): +Route Microsoft Foundry traffic through your corporate proxy by setting the following [environment variables](</docs/en/env-vars>): # Enable Microsoft Foundry export CLAUDE_CODE_USE_FOUNDRY=1 @@ -88,7 +88,7 @@ # Configure corporate proxy export HTTPS_PROXY='https://proxy.example.com:8080' -Route Foundry traffic through your LLM gateway by setting the following [environment variables](</docs/en/env-vars>): +Route Microsoft Foundry traffic through your LLM gateway by setting the following [environment variables](</docs/en/env-vars>): # Enable Microsoft Foundry export CLAUDE_CODE_USE_FOUNDRY=1 @@ -101,15 +101,15 @@ ​ -Google Vertex AI +Google Cloud’s Agent Platform * Corporate proxy * LLM Gateway -Route Vertex AI traffic through your corporate proxy by setting the following [environment variables](</docs/en/env-vars>): - - # Enable Vertex +Route Google Cloud’s Agent Platform traffic through your corporate proxy by setting the following [environment variables](</docs/en/env-vars>): + + # Enable Agent Platform export CLAUDE_CODE_USE_VERTEX=1 export CLOUD_ML_REGION=us-east5 export ANTHROPIC_VERTEX_PROJECT_ID=your-project-id @@ -117,9 +117,9 @@ # Configure corporate proxy export HTTPS_PROXY='https://proxy.example.com:8080' -Route Vertex AI traffic through your LLM gateway by setting the following [environment variables](</docs/en/env-vars>): - - # Enable Vertex +Route Google Cloud’s Agent Platform traffic through your LLM gateway by setting the following [environment variables](</docs/en/env-vars>): + + # Enable Agent Platform export CLAUDE_CODE_USE_VERTEX=1 # Configure LLM gateway @@ -171,7 +171,7 @@ Pin model versions for cloud providers -If you deploy through [Bedrock](</docs/en/amazon-bedrock>), [Vertex AI](</docs/en/google-vertex-ai>), [Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin specific model versions using `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Without pinning, model aliases resolve to Claude Code’s built-in default for that provider, which can lag the newest release and may not yet be enabled in your account. Pinning lets you control when your users move to a new model. See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for what each provider does when the default is unavailable. +If you deploy through [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), [Microsoft Foundry](</docs/en/microsoft-foundry>), or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), pin specific model versions using `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Without pinning, model aliases resolve to Claude Code’s built-in default for that provider, which can lag the newest release and may not yet be enabled in your account. Pinning lets you control when your users move to a new model. See [Model configuration](</docs/en/model-config#pin-models-for-third-party-deployments>) for what each provider does when the default is unavailable. ###
modified Todo Lists View current →
Show diff (183 lines)
--- a/todo-tracking.md +++ b/todo-tracking.md @@ -1,6 +1,6 @@ Todo tracking provides a structured way to manage tasks and display progress to users. The Claude Agent SDK includes built-in todo functionality that helps organize complex workflows and keep users informed about task progression. -As of TypeScript Agent SDK 0.3.142 and Claude Code v2.1.142, sessions use the structured Task tools `TaskCreate`, `TaskUpdate`, `TaskGet`, and `TaskList` instead of `TodoWrite`. See Migrate to Task tools for how monitoring code changes. The examples on this page set `CLAUDE_CODE_ENABLE_TASKS=0` to keep showing `TodoWrite` for sessions that have not migrated yet. +As of TypeScript Agent SDK 0.3.142 and Claude Code v2.1.142, sessions use the structured Task tools `TaskCreate`, `TaskUpdate`, `TaskGet`, and `TaskList` instead of `TodoWrite`. The Python SDK gets this change from the Claude Code CLI it launches, not from the Python package version: the switch applies once that CLI — the copy bundled inside the pip package, or one you point to with `cli_path` — is v2.1.142 or later. See Migrate to Task tools for how monitoring code changes. The examples on this page set `CLAUDE_CODE_ENABLE_TASKS=0` to keep showing `TodoWrite` for sessions that have not migrated yet. ### @@ -21,20 +21,22 @@ When Todos Are Used -The SDK automatically creates todos for: +The SDK creates todos for most multi-step work, such as: * **Complex multi-step tasks** requiring 3 or more distinct actions * **User-provided task lists** when multiple items are mentioned * **Non-trivial operations** that benefit from progress tracking * **Explicit requests** when users ask for todo organization +It may skip todos for very short or single-step requests. + ## ​ Examples -Before running these examples, install the Claude Agent SDK by following the [quickstart](</docs/en/agent-sdk/quickstart>). +Before running these examples, install the Claude Agent SDK by following the [quickstart](</docs/en/agent-sdk/quickstart>). Each example runs until the agent finishes and yields its final result message. If a session reaches its turn limit first, that result message has the `error_max_turns` subtype. Check `subtype` to detect that ending. These examples use single-shot `query()` calls. After yielding an `error_max_turns` result, `query()` raises an error that includes `Reached maximum number of turns`. Each example wraps its loop in a try block to exit cleanly when that happens. See [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>) for the result subtypes. ### @@ -48,27 +50,33 @@ import { query } from "@anthropic-ai/claude-agent-sdk"; - for await (const message of query({ - prompt: "Optimize my React app performance and track progress with todos", - // Re-enable TodoWrite, which this example monitors. Without it, the SDK uses - // Task tools instead and these tool_use blocks never appear. - options: { maxTurns: 15, env: { ...process.env, CLAUDE_CODE_ENABLE_TASKS: "0" } } - })) { - // Todo updates are reflected in the message stream - if (message.type === "assistant") { - for (const block of message.message.content) { - if (block.type === "tool_use" && block.name === "TodoWrite") { - const todos = block.input.todos; - - console.log("Todo Status Update:"); - todos.forEach((todo, index) => { - const status = - todo.status === "completed" ? "✅" : todo.status === "in_progress" ? "🔧" : "❌"; - console.log(`${index + 1}. ${status} ${todo.content}`); - }); + try { + for await (const message of query({ + prompt: "Optimize my React app performance and track progress with todos", + // Re-enable TodoWrite, which this example monitors. Without it, the SDK uses + // Task tools instead and these tool_use blocks never appear. + options: { maxTurns: 15, env: { ...process.env, CLAUDE_CODE_ENABLE_TASKS: "0" } } + })) { + // Todo updates are reflected in the message stream + if (message.type === "assistant") { + for (const block of message.message.content) { + if (block.type === "tool_use" && block.name === "TodoWrite") { + const todos = block.input.todos; + + console.log("Todo Status Update:"); + todos.forEach((todo, index) => { + const status = + todo.status === "completed" ? "✅" : todo.status === "in_progress" ? "🔧" : "❌"; + console.log(`${index + 1}. ${status} ${todo.content}`); + }); + } } } } + } catch (error) { + // A single-shot query() throws after yielding an error result, + // such as when the maxTurns limit is hit. + console.log(`Session ended with an error: ${error}`); } ### @@ -105,19 +113,25 @@ } async trackQuery(prompt: string) { - for await (const message of query({ - prompt, - // Re-enable TodoWrite, which this tracker watches for. - options: { maxTurns: 20, env: { ...process.env, CLAUDE_CODE_ENABLE_TASKS: "0" } } - })) { - if (message.type === "assistant") { - for (const block of message.message.content) { - if (block.type === "tool_use" && block.name === "TodoWrite") { - this.todos = block.input.todos; - this.displayProgress(); + try { + for await (const message of query({ + prompt, + // Re-enable TodoWrite, which this tracker watches for. + options: { maxTurns: 20, env: { ...process.env, CLAUDE_CODE_ENABLE_TASKS: "0" } } + })) { + if (message.type === "assistant") { + for (const block of message.message.content) { + if (block.type === "tool_use" && block.name === "TodoWrite") { + this.todos = block.input.todos; + this.displayProgress(); + } } } } + } catch (error) { + // A single-shot query() throws after yielding an error result, + // such as when the maxTurns limit is hit. + console.log(`Session ended with an error: ${error}`); } } } @@ -141,7 +155,7 @@ Item shape: `{ content, status, activeForm }`| `TaskCreate` input: `{ subject, description, activeForm?, metadata? }`. `TaskUpdate` input: `{ taskId, status?, subject?, description?, activeForm?, addBlocks?, addBlockedBy?, owner?, metadata? }`. `status` is `"pending"`, `"in_progress"`, or `"completed"`; set `status: "deleted"` to delete Render `block.input.todos` directly| Accumulate items across calls, or read a snapshot from a `TaskList` tool result -The assigned task ID is not in the `TaskCreate` input. It comes back in the matching `tool_result` as `{ task: { id, subject } }`, so capture it from the result block to key your map. The following example shows the minimal change to the Monitoring Todo Changes loop. To render a complete list, watch for a `TaskList` tool result in the stream or accumulate `TaskCreate` results and `TaskUpdate` inputs into a map. The streamed `tool_use` input is the raw shape the model emitted. Claude Code repairs some close-but-incorrect key names before execution, mapping `id` or `task_id` to `taskId` and `active_form` to `activeForm`, but that repair is not reflected in the stream. Read `TaskUpdate` input fields defensively, as the samples below do, rather than assuming the canonical name is always present. +The assigned task ID is not in the `TaskCreate` input. It comes back in the matching `tool_result` as `{ task: { id, subject } }`, so capture it from the result block to key your map. The following example shows the minimal change to the Monitoring Todo Changes loop. It reads only `tool_use` inputs and skips capturing IDs from `tool_result` blocks. To render a complete list, watch for a `TaskList` tool result in the stream or accumulate `TaskCreate` results and `TaskUpdate` inputs into a map. The streamed `tool_use` input is the raw shape the model emitted. Claude Code repairs some close-but-incorrect key names before execution, mapping `id` or `task_id` to `taskId` and `active_form` to `activeForm`, but that repair is not reflected in the stream. Read `TaskUpdate` input fields defensively, as the samples below do, rather than assuming the canonical name is always present. TypeScript @@ -149,26 +163,32 @@ import { query } from "@anthropic-ai/claude-agent-sdk"; - for await (const message of query({ - prompt: "Optimize my React app performance", - })) { - if (message.type !== "assistant") continue; - for (const block of message.message.content) { - if (block.type !== "tool_use") continue; - if (block.name === "TaskCreate") { - const input = block.input as { subject: string }; - console.log(`+ ${input.subject}`); - } else if (block.name === "TaskUpdate") { - const input = block.input as { - taskId?: string; - id?: string; - task_id?: string; - status?: string; - }; - const taskId = input.taskId ?? input.id ?? input.task_id; - if (taskId && input.status) console.log(` ${taskId} -> ${input.status}`); + try { + for await (const message of query({ + prompt: "Optimize my React app performance and track progress with todos", + options: { maxTurns: 15 }, + })) { + if (message.type !== "assistant") continue; + for (const block of message.message.content) { + if (block.type !== "tool_use") continue; + if (block.name === "TaskCreate") { + const input = block.input as { subject: string }; + console.log(`+ ${input.subject}`); + } else if (block.name === "TaskUpdate") { + const input = block.input as { + taskId?: string; + id?: string; + task_id?: string; + status?: string; + }; + const taskId = input.taskId ?? input.id ?? input.task_id; + if (taskId && input.status) console.log(` ${taskId} -> ${input.status}`); + } } } + } catch (error) { + // A single-shot query() throws after yielding an error result. + console.log(`Session ended with an error: ${error}`); } ##
modified Scale to many tools with tool search View current →
--- a/tool-search.md +++ b/tool-search.md @@ -21,12 +21,12 @@ Configure tool search -Tool search is on by default. It is disabled by default on Vertex AI, where it is supported for Claude Sonnet 4.5 and later and Claude Opus 4.5 and later. It is also disabled when `ANTHROPIC_BASE_URL` points to a non-first-party host, since most proxies do not forward `tool_reference` blocks. You can override either default with the `ENABLE_TOOL_SEARCH` environment variable: +Tool search is on by default. It is disabled by default on Google Cloud’s Agent Platform, where it is supported for Claude Sonnet 4.5 and later and Claude Opus 4.5 and later. It is also disabled when `ANTHROPIC_BASE_URL` points to a non-first-party host, since most proxies do not forward `tool_reference` blocks. You can override either default with the `ENABLE_TOOL_SEARCH` environment variable: Value| Behavior ---|--- -(unset)| Tool search is on. Tool definitions are deferred and discovered on demand. Falls back to loading upfront on Vertex AI or a non-first-party `ANTHROPIC_BASE_URL`. -`true`| Tool search is always on. The SDK sends the beta header even on Vertex AI and through proxies. Requests fail on Vertex AI models earlier than Sonnet 4.5 or Opus 4.5, or on proxies that do not support `tool_reference` blocks. +(unset)| Tool search is on. Tool definitions are deferred and discovered on demand. Falls back to loading upfront on Google Cloud’s Agent Platform or a non-first-party `ANTHROPIC_BASE_URL`. +`true`| Tool search is always on. The SDK sends the beta header even on Google Cloud’s Agent Platform and through proxies. Requests fail on Google Cloud’s Agent Platform models earlier than Sonnet 4.5 or Opus 4.5, or on proxies that do not support `tool_reference` blocks. `auto`| Checks the combined token count of all tool definitions against the model’s context window. If they exceed 10%, tool search activates. If they’re under 10%, all tools are loaded into context normally. `auto:N`| Same as `auto` with a custom percentage. `auto:5` activates when tool definitions exceed 5% of the context window. Lower values activate sooner. `false`| Tool search is off. All tool definitions are loaded into context on every turn.
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -4,7 +4,7 @@ ---|---|--- `Agent`| Spawns a [subagent](</docs/en/sub-agents>) with its own context window to handle a task. See Agent tool behavior| No `Artifact`| Publishes an HTML or Markdown file as an [artifact](</docs/en/artifacts>): a private, interactive page on claude.ai. On Team and Enterprise plans, you can share it inside your organization. Requires a Pro, Max, Team, or Enterprise plan and `/login` authentication; see [Availability](</docs/en/artifacts#availability>)| Yes -`AskUserQuestion`| Asks multiple-choice questions to gather requirements or clarify ambiguity. As of v2.1.198, if you don’t respond within 60 seconds the dialog closes on its own: it submits any options you’d already selected and tells Claude you may be away from your keyboard, so Claude proceeds on its own judgment and can re-ask later. A countdown appears for the last 20 seconds. Any keypress keeps the dialog open, and so does a focused window on terminals that report focus. Set the [`CLAUDE_AFK_TIMEOUT_MS`](</docs/en/env-vars#variables>) environment variable to change how long Claude Code waits, or to a large value like `86400000`, 24 hours, to keep questions open while you’re away. This timeout applies only to `AskUserQuestion`’s multiple-choice questions; permission prompts, including plan approval, never auto-resolve on idle| No +`AskUserQuestion`| Asks multiple-choice questions to gather requirements or clarify ambiguity. Questions stay open until you answer them: there’s no idle timeout by default. To have an idle dialog auto-continue instead, set the [`askUserQuestionTimeout`](</docs/en/settings#available-settings>) setting to `60s`, `5m`, or `10m`, either in your user `settings.json` or from the **Question auto-continue timeout** row in `/config`. Once the chosen idle time passes with no input, the dialog closes on its own: it submits any options you’d already selected and tells Claude you may be away from your keyboard, so Claude proceeds on its own judgment and can re-ask later. A countdown appears for the last 20 seconds. Any keypress restarts the timer, and so does a focused window on terminals that report focus. The timeout applies only to `AskUserQuestion`’s multiple-choice questions; permission prompts, including plan approval, never auto-resolve on idle. In v2.1.198 and v2.1.199, the dialog auto-continued after 60 seconds of idle by default, and [`CLAUDE_AFK_TIMEOUT_MS`](</docs/en/env-vars#variables>) was the only way to change that| No `Bash`| Executes shell commands in your environment. See Bash tool behavior| Yes `CronCreate`| Schedules a recurring or one-shot prompt within the current session. Tasks are session-scoped and restored on `--resume` or `--continue` if unexpired. See [scheduled tasks](</docs/en/scheduled-tasks>)| No `CronDelete`| Cancels a scheduled task by ID| No @@ -21,14 +21,14 @@ `Monitor`| Runs a command in the background and feeds each output line back to Claude, so it can react to log entries, file changes, or polled status mid-conversation. Can also open a WebSocket and treat each incoming message as an event. See Monitor tool| Yes `NotebookEdit`| Modifies Jupyter notebook cells. See NotebookEdit tool behavior| Yes `PowerShell`| Executes PowerShell commands natively. See PowerShell tool for availability| Yes -`PushNotification`| Sends a desktop notification, and a phone push when [Remote Control](</docs/en/remote-control>) is connected, so a long-running task or [scheduled task](</docs/en/scheduled-tasks>) can reach you when you step away. Push delivery runs through Anthropic-hosted infrastructure, which is not accessible from Amazon Bedrock, Google Vertex AI, or Microsoft Foundry| No +`PushNotification`| Sends a desktop notification, and a phone push when [Remote Control](</docs/en/remote-control>) is connected, so a long-running task or [scheduled task](</docs/en/scheduled-tasks>) can reach you when you step away. Push delivery runs through Anthropic-hosted infrastructure, which is not accessible from Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry| No `Read`| Reads the contents of files. See Read tool behavior| No `ReadMcpResourceTool`| Reads a specific MCP resource by URI| No -`RemoteTrigger`| Creates, updates, runs, and lists [Routines](</docs/en/routines>) on claude.ai. Backs the `/schedule` command. Routines live on claude.ai and require a Pro, Max, Team, or Enterprise plan, so this tool is not accessible from Amazon Bedrock, Google Vertex AI, or Microsoft Foundry| No +`RemoteTrigger`| Creates, updates, runs, and lists [Routines](</docs/en/routines>) on claude.ai. Backs the `/schedule` command. Routines live on claude.ai and require a Pro, Max, Team, or Enterprise plan, so this tool is not accessible from Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry| No `ReportFindings`| Reports code-review findings as a structured list, with a file, summary, and failure scenario per finding, so Claude Code can render them instead of printing them as text. Claude calls it when active code-review instructions tell it to. Requires Claude Code v2.1.196 or later. As of v2.1.199, a finding can also carry an optional `category` slug, such as `correctness` or `test-coverage`, shown next to the file location in the rendered list| No -`ScheduleWakeup`| Reschedules the next iteration of a [self-paced `/loop`](</docs/en/scheduled-tasks#let-claude-choose-the-interval>). Claude calls this at the end of each iteration to pick when the next one runs, between one minute and one hour out; you don’t call it directly. The pending wakeup appears in `session_crons` in [Stop hook input](</docs/en/hooks#stop-input>). Not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry, where a `/loop` prompt with no interval runs on a fixed schedule instead| No +`ScheduleWakeup`| Reschedules the next iteration of a [self-paced `/loop`](</docs/en/scheduled-tasks#let-claude-choose-the-interval>). Claude calls this at the end of each iteration to pick when the next one runs, between one minute and one hour out; you don’t call it directly. The pending wakeup appears in `session_crons` in [Stop hook input](</docs/en/hooks#stop-input>). Not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, where a `/loop` prompt with no interval runs on a fixed schedule instead| No `SendMessage`| Sends a message to an [agent team](</docs/en/agent-teams>) teammate, or [resumes a subagent](</docs/en/sub-agents#resume-subagents>) by its agent ID or name. Stopped subagents auto-resume in the background. Structured team-protocol messages require agent teams. A receiver never treats a message from another agent as your consent or approval. As of v2.1.198, a subagent treats a message from the agent that launched it as normal task direction rather than as a peer request. As of v2.1.199, a send to a name that now resolves to a different agent than it did earlier in the conversation is refused instead of delivered; see [Resume subagents](</docs/en/sub-agents#resume-subagents>)| No -`SendUserFile`| Sends files from the session to you with an optional caption, so a generated report, diagram, screenshot, or built artifact reaches your device instead of only being mentioned in the transcript. As of v2.1.196, the optional `display` input controls presentation: `render` opens the file inline in the client, `attach` shows a download card only, and when unset the client decides by file type. Available when a [Remote Control](</docs/en/remote-control>) client is connected or the session runs in a managed cloud environment such as [Claude Code on the web](</docs/en/claude-code-on-the-web>). Delivery runs through Anthropic-hosted infrastructure, so the tool is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry| No +`SendUserFile`| Sends files from the session to you with an optional caption, so a generated report, diagram, screenshot, or built artifact reaches your device instead of only being mentioned in the transcript. As of v2.1.196, the optional `display` input controls presentation: `render` opens the file inline in the client, `attach` shows a download card only, and when unset the client decides by file type. Available when a [Remote Control](</docs/en/remote-control>) client is connected or the session runs in a managed cloud environment such as [Claude Code on the web](</docs/en/claude-code-on-the-web>). Delivery runs through Anthropic-hosted infrastructure, so the tool is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry| No `ShareOnboardingGuide`| Uploads `ONBOARDING.md` and returns a share link teammates can open in Claude Code. Called from `/team-onboarding` after the guide is written. Available to claude.ai subscribers on Pro, Max, Team, and Enterprise plans| Yes `Skill`| Executes a [skill](</docs/en/skills#control-who-invokes-a-skill>) within the main conversation| Yes `TaskCreate`| Creates a new task in the task list| No @@ -192,7 +192,7 @@ * Track output from any long-running script you point it at * Connect to a WebSocket feed and report each message as it arrives -For most watches, Claude writes a small script, runs it in the background, and receives each output line as it arrives. For a server that already pushes events, Claude can open a WebSocket instead of running a script. You keep working in the same session and Claude interjects when an event arrives. Stop a monitor by asking Claude to cancel it or by ending the session. When Monitor runs a command, it uses the same [permission rules as Bash](</docs/en/permissions#tool-specific-permission-rules>), so `allow` and `deny` patterns you have set for Bash apply here too. The WebSocket source has its own approval prompt. The tool is not available on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. It is also not available when `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. Plugins can declare monitors that start automatically when the plugin is active, instead of asking Claude to start them. See [plugin monitors](</docs/en/plugins-reference#monitors>). +For most watches, Claude writes a small script, runs it in the background, and receives each output line as it arrives. For a server that already pushes events, Claude can open a WebSocket instead of running a script. You keep working in the same session and Claude interjects when an event arrives. Stop a monitor by asking Claude to cancel it or by ending the session. When Monitor runs a command, it uses the same [permission rules as Bash](</docs/en/permissions#tool-specific-permission-rules>), so `allow` and `deny` patterns you have set for Bash apply here too. The WebSocket source has its own approval prompt. The tool is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. It is also not available when `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. Plugins can declare monitors that start automatically when the plugin is active, instead of asking Claude to start them. See [plugin monitors](</docs/en/plugins-reference#monitors>). ### @@ -322,7 +322,7 @@ WebSearch runs a query against Anthropic’s [web search](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool>) backend and returns result titles and URLs. It doesn’t fetch the result pages. To read a page Claude finds in search results, it follows up with WebFetch. The tool may issue up to eight backend searches per call, refining the search internally before returning results. Claude can scope results with `allowed_domains` to include only certain hosts, or `blocked_domains` to exclude them. The two lists can’t be combined in a single call. The search backend is not configurable. To search with a different provider, add an [MCP server](</docs/en/mcp>) that exposes a search tool. WebSearch permission rules take no specifier. A bare `WebSearch` entry in `allow` or `deny` is the only form. -WebSearch is available on the Claude API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and Microsoft Foundry. On Google Cloud Vertex AI it works with Claude 4 and later models, including Opus, Sonnet, and Haiku. Amazon Bedrock doesn’t expose the server-side web search tool. +WebSearch is available on the Claude API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and Microsoft Foundry. On Google Cloud’s Agent Platform it works with Claude 4 and later models, including Opus, Sonnet, and Haiku. Amazon Bedrock doesn’t expose the server-side web search tool. ##
modified Troubleshoot installation and login View current →
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -14,7 +14,7 @@ `syntax error near unexpected token '<'`| Install script returns HTML `curl: (22) The requested URL returned error: 403`| Install script returned 403 `curl: (23)` or `curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer -`Killed` during install on Linux| Add swap space for low-memory servers +`Killed` during install on Linux, or `Installation was killed before it could finish (exit code 137)`| Free memory or add swap space `TLS connect error` or `SSL/TLS secure channel`| Update CA certificates `Failed to fetch version` or can’t reach download server| Check network and proxy settings `irm is not recognized` or `&& is not valid`| Use the right command for your shell @@ -33,8 +33,8 @@ `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). `unable to get local issuer certificate`| Configure corporate CA certificates `OAuth error` or `403 Forbidden`| Fix authentication -`Could not load the default credentials` or `Could not load credentials from any providers`| Bedrock, Vertex, or Foundry credentials -`ChainedTokenCredential authentication failed` or `CredentialUnavailableError`| Bedrock, Vertex, or Foundry credentials +`Could not load the default credentials` or `Could not load credentials from any providers`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials +`ChainedTokenCredential authentication failed` or `CredentialUnavailableError`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials `API Error: 500`, `529 Overloaded`, `429`, or other 4xx and 5xx errors not listed above| See the [Error reference](</docs/en/errors>) If your issue isn’t listed, work through the diagnostic checks below to narrow down the cause. @@ -413,13 +413,14 @@ Install killed on low-memory Linux servers -If you see `Killed` during installation on a VPS or cloud instance: +A `Killed` message during install usually means the Linux out-of-memory (OOM) killer terminated the `claude install` step because the system ran out of free memory. This is common on small VPS and cloud instances. The install script reports the cause and exits with code 137: Setting up Claude Code... - Installing Claude Code native build latest... bash: line 142: 34803 Killed "$binary_path" install ${TARGET:+"$TARGET"} - -The Linux OOM killer terminated the process because the system ran out of memory. Claude Code requires at least 4 GB of available RAM. **Solutions:** + Installation was killed before it could finish (exit code 137). This usually means the system ran out of memory. + Claude Code needs roughly 512MB of free memory to install. Free up memory, then run this script again. + +Before v2.1.200, the script exited with only the shell’s bare `Killed` line and no explanation. Installing needs roughly 512 MB of free memory, and running Claude Code needs more. See the [system requirements](</docs/en/setup#system-requirements>). **Solutions:** 1. **Add swap space** if your server has limited RAM. Swap uses disk space as overflow memory, letting the install complete even with low physical RAM. Create a 2 GB swap file and enable it: @@ -692,13 +693,13 @@ ​ -Bedrock, Vertex, or Foundry credentials not loading - -If you configured Claude Code to use a cloud provider and see `Could not load credentials from any providers` on Bedrock, `Could not load the default credentials` on Vertex, or `ChainedTokenCredential authentication failed` on Foundry, your cloud provider CLI is likely not authenticated in the current shell. For Bedrock, confirm your AWS credentials are valid: +Bedrock, Agent Platform, or Foundry credentials not loading + +If you configured Claude Code to use a cloud provider and see `Could not load credentials from any providers` on Amazon Bedrock, `Could not load the default credentials` on Google Cloud’s Agent Platform, or `ChainedTokenCredential authentication failed` on Microsoft Foundry, your cloud provider CLI is likely not authenticated in the current shell. For Amazon Bedrock, confirm your AWS credentials are valid: aws sts get-caller-identity -For Vertex AI, confirm `ANTHROPIC_VERTEX_PROJECT_ID` and `CLOUD_ML_REGION` are set in your shell, then set application default credentials: +For Google Cloud’s Agent Platform, confirm `ANTHROPIC_VERTEX_PROJECT_ID` and `CLOUD_ML_REGION` are set in your shell, then set application default credentials: gcloud auth application-default login @@ -706,7 +707,7 @@ az login -If credentials work in your terminal but not in the VS Code or JetBrains extension, the IDE process likely didn’t inherit your shell environment. Set the provider environment variables in the IDE’s own settings, or launch the IDE from a terminal where they’re already exported. See [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>) for full provider setup. +If credentials work in your terminal but not in the VS Code or JetBrains extension, the IDE process likely didn’t inherit your shell environment. Set the provider environment variables in the IDE’s own settings, or launch the IDE from a terminal where they’re already exported. See [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>) for full provider setup. ##
modified Troubleshooting View current →
--- a/troubleshooting.md +++ b/troubleshooting.md @@ -3,7 +3,7 @@ Symptom| Go to ---|--- `command not found`, install fails, PATH issues, `EACCES`, TLS errors| [Troubleshoot installation and login](</docs/en/troubleshoot-install>) -Login loops, OAuth errors, `403 Forbidden`, “organization disabled”, Bedrock/Vertex/Foundry credentials| [Troubleshoot installation and login](</docs/en/troubleshoot-install#login-and-authentication>) +Login loops, OAuth errors, `403 Forbidden`, “organization disabled”, Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials| [Troubleshoot installation and login](</docs/en/troubleshoot-install#login-and-authentication>) Settings not applying, hooks not firing, MCP servers not loading| [Debug your configuration](</docs/en/debug-your-config>) `API Error: 5xx`, `529 Overloaded`, `429`, request validation errors| [Error reference](</docs/en/errors>) `model not found` or `you may not have access to it`| [Error reference](</docs/en/errors#there%E2%80%99s-an-issue-with-the-selected-model>)
modified Agent SDK reference - TypeScript View current →
--- a/typescript.md +++ b/typescript.md @@ -1276,7 +1276,7 @@ `SDKPartialAssistantMessage` -Streaming partial message (only when `includePartialMessages` is true). +Streaming partial message (only when `includePartialMessages` is true). The `parent_tool_use_id` field is always `null`: stream events are emitted for the main session only. For subagent attribution, use complete messages, which carry `parent_tool_use_id`, or enable `forwardSubagentText` to receive subagent text and thinking as complete messages. type SDKPartialAssistantMessage = { type: "stream_event";
modified Plan in the cloud with ultraplan View current →
--- a/ultraplan.md +++ b/ultraplan.md @@ -6,7 +6,7 @@ * **Hands-off drafting** : the plan is generated remotely, so your terminal stays free for other work * **Flexible execution** : approve the plan to run on the web and open a pull request, or send it back to your terminal -Ultraplan requires a [Claude Code on the web](</docs/en/claude-code-on-the-web>) account and a GitHub repository. Because it runs on Anthropic’s cloud infrastructure, it is not available when using Amazon Bedrock, Google Cloud Vertex AI, or Microsoft Foundry. The cloud session runs in your account’s default [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>). If you don’t have a cloud environment yet, ultraplan creates one automatically when it first launches. +Ultraplan requires a [Claude Code on the web](</docs/en/claude-code-on-the-web>) account and a GitHub repository. Because it runs on Anthropic’s cloud infrastructure, it is not available when using Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. The cloud session runs in your account’s default [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>). If you don’t have a cloud environment yet, ultraplan creates one automatically when it first launches. ##
modified Find bugs with ultrareview View current →
--- a/ultrareview.md +++ b/ultrareview.md @@ -6,7 +6,7 @@ * **Broader coverage** : a larger fleet of reviewer agents explores the change in parallel, which surfaces issues that a medium-effort local review can miss * **No local resource use** : the review runs entirely in a remote sandbox, so your terminal stays free for other work while it runs -Ultrareview requires authentication with a Claude.ai account because it runs on Claude Code on the web infrastructure. If you are signed in with an API key only, run `/login` and authenticate with Claude.ai first. Ultrareview is not available when using Claude Code with Amazon Bedrock, Google Cloud Vertex AI, or Microsoft Foundry, and it is not available to organizations that have enabled Zero Data Retention. +Ultrareview requires authentication with a Claude.ai account because it runs on Claude Code on the web infrastructure. If you are signed in with an API key only, run `/login` and authenticate with Claude.ai first. Ultrareview is not available when using Claude Code with Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, and it is not available to organizations that have enabled Zero Data Retention. ##
modified Handle approvals and user input View current →
--- a/user-input.md +++ b/user-input.md @@ -484,6 +484,8 @@ 4. **Map answers** : The code checks if input is numeric (uses the option’s label) or free text (uses the text directly) 5. **Return to Claude** : The response includes both the original `questions` array and the `answers` mapping +Save the TypeScript version as `ask.ts` and run it with `npx tsx ask.ts`, or save the Python version as `ask.py` and run it with `python ask.py`. + Python TypeScript
modified Voice dictation View current →
--- a/voice-dictation.md +++ b/voice-dictation.md @@ -12,7 +12,7 @@ Voice dictation streams your recorded audio to Anthropic’s servers for transcription. Audio is not processed locally. It needs all of the following: - * **A Claude.ai account** : the speech-to-text service is only available when you authenticate with one, and is not available when Claude Code is configured to use an Anthropic API key directly, Amazon Bedrock, Google Vertex AI, or Microsoft Foundry. + * **A Claude.ai account** : the speech-to-text service is only available when you authenticate with one, and is not available when Claude Code is configured to use an Anthropic API key directly, Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. * **An organization without HIPAA compliance enabled** : `/voice` shows `Voice mode is disabled by your organization's policy` when this restriction applies. * **A local microphone** : voice dictation does not work in remote environments such as [Claude Code on the web](</docs/en/claude-code-on-the-web>) or SSH sessions. * **WSLg, if you run Claude Code in WSL** : WSLg is included with WSL2 when installed from the Microsoft Store on Windows 10 or 11. If WSLg is not available, for example on WSL1, run Claude Code in native Windows instead. @@ -157,6 +157,7 @@ * **Nothing happens when holding`Space` in hold mode**: watch the prompt input while you hold. If spaces keep accumulating, voice dictation is likely off; run `/voice hold` to enable it. If only one or two spaces appear and then nothing, voice dictation is on but hold detection is not triggering. Hold detection requires your terminal to send key-repeat events, so it can’t detect a held key if key-repeat is disabled at the OS level. Switch to tap mode with `/voice tap` to avoid the key-repeat requirement. * **Tapping`Space` types a space instead of recording in tap mode**: the first tap only starts recording when the prompt input is empty. Clear the input first, or check that you are in tap mode by running `/voice tap`. * **`No audio detected from microphone`** : recording started but captured silence. Confirm the correct input device is set as the system default and that its input level is not muted or near zero. On Windows, open Settings → System → Sound → Input and select your microphone. On macOS, open System Settings → Sound → Input. + * **`Voice connection failed`** : your recording never reached the transcription service because the connection failed. Check your network and try again. A recording that captures no audio reports `No audio detected from microphone` instead of this message. Before v2.1.200, a silent microphone could report a connection failure, which suggested a network problem when the actual issue was the input device. * **`No speech detected`** : audio reached the transcription service but no words were recognized. Speak closer to the microphone, reduce background noise, and confirm your dictation language matches the language you are speaking. * **Transcription is garbled or in the wrong language** : dictation defaults to English. If you are dictating in another language, set it in `/config` first. See Change the dictation language.
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -9,7 +9,7 @@ Before installing, make sure you have: * VS Code 1.98.0 or higher - * An Anthropic account: any paid Claude subscription (Pro, Max, Team, or Enterprise) or a Claude Console account works, and no API key is required. You’ll [sign in](</docs/en/authentication#log-in-to-claude-code>) with this account when you first open the extension. If you access Claude through a third-party provider like Amazon Bedrock or Google Vertex AI, see Use third-party providers for setup instructions. + * An Anthropic account: any paid Claude subscription (Pro, Max, Team, or Enterprise) or a Claude Console account works, and no API key is required. You’ll [sign in](</docs/en/authentication#log-in-to-claude-code>) with this account when you first open the extension. If you access Claude through a third-party provider like Amazon Bedrock or Google Cloud’s Agent Platform, see Use third-party providers for setup instructions. The extension bundles its own copy of the CLI (command-line interface) for the chat panel. To run `claude` in VS Code’s integrated terminal, you also need the [standalone CLI install](</docs/en/setup>). See VS Code extension vs. Claude Code CLI for details. @@ -82,7 +82,10 @@ The prompt box supports several features: - * **Permission modes** : click the mode indicator at the bottom of the prompt box to switch modes. In normal mode, Claude asks permission before each action. In Plan mode, Claude describes what it will do and waits for approval before making changes. VS Code automatically opens the plan as a full markdown document where you can add inline comments to give feedback before Claude begins. In auto-accept mode, Claude makes edits without asking. Set the default in VS Code settings under `claudeCode.initialPermissionMode`. + * **Permission modes** : click the mode indicator at the bottom of the prompt box to switch modes, or set the default in VS Code settings under `claudeCode.initialPermissionMode`. See [permission modes](</docs/en/permission-modes#switch-permission-modes>) for every mode the indicator offers. + * **Manual** : Claude asks permission before each action. + * **Plan mode** : Claude describes what it will do and waits for approval before making changes. VS Code automatically opens the plan as a full markdown document where you can add inline comments to give feedback before Claude begins. + * **Edit automatically** : Claude makes edits without asking. * **Command menu** : click `/` or type `/` to open the command menu. Options include attaching files, switching models, toggling extended thinking, viewing plan usage (`/usage`), and starting a [Remote Control](</docs/en/remote-control>) session (`/remote-control`). The Customize section provides access to MCP servers, hooks, memory, permissions, and plugins. Items with a terminal icon open in the integrated terminal. * **Context indicator** : the prompt box shows how much of Claude’s context window you’re using. Claude automatically compacts when needed, or you can run `/compact` manually. * **Extended thinking** : lets Claude spend more time reasoning through complex problems. Toggle it on via the command menu (`/`). Claude’s reasoning appears in the conversation as collapsed blocks: click a block to read it, or press `Ctrl+O` to expand or collapse every thinking block in the session. See [Extended thinking](</docs/en/model-config#extended-thinking>) for details. @@ -324,7 +327,7 @@ Setting| Default| Description ---|---|--- `useTerminal`| `false`| Launch Claude in terminal mode instead of graphical panel -`initialPermissionMode`| `default`| Controls approval prompts for new conversations: `default`, `plan`, `acceptEdits`, or `bypassPermissions`. See [permission modes](</docs/en/permission-modes>). +`initialPermissionMode`| `default`| Controls approval prompts for new conversations: `default`, `plan`, `acceptEdits`, or `bypassPermissions`. `manual` is an alias for `default` and selects the mode labeled **Manual** in the mode indicator. Requires Claude Code v2.1.200 or later. See [permission modes](</docs/en/permission-modes>). `preferredLocation`| `panel`| Where Claude opens: `sidebar` (right) or `panel` (new tab) `autosave`| `true`| Auto-save files before Claude reads or writes them `useCtrlEnterToSend`| `false`| Use Ctrl/Cmd+Enter instead of Enter to send prompts @@ -453,7 +456,7 @@ Use third-party providers -By default, Claude Code connects directly to Anthropic’s API. If your organization uses Amazon Bedrock, Google Vertex AI, or Microsoft Foundry to access Claude, configure the extension to use your provider instead: +By default, Claude Code connects directly to Anthropic’s API. If your organization uses Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry to access Claude, configure the extension to use your provider instead: 1 @@ -468,7 +471,7 @@ Follow the setup guide for your provider: * [Claude Code on Amazon Bedrock](</docs/en/amazon-bedrock>) - * [Claude Code on Google Vertex AI](</docs/en/google-vertex-ai>) + * [Claude Code on Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) * [Claude Code on Microsoft Foundry](</docs/en/microsoft-foundry>) These guides cover configuring your provider in `~/.claude/settings.json`, which ensures your settings are shared between the VS Code extension and the CLI.
modified Get started with Claude Code on the web View current →
--- a/web-quickstart.md +++ b/web-quickstart.md @@ -37,7 +37,7 @@ **Code runs on**| Anthropic cloud VM| Your machine| Your machine| Your machine or cloud VM **You chat from**| claude.ai or mobile app| claude.ai or mobile app| Your terminal| The Desktop UI **Uses your local config**| No, repo only| Yes| Yes| Yes for local, no for cloud -**Requires GitHub**| Yes, or [bundle a local repo](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) via `--remote`| No| No| Only for cloud sessions +**Requires GitHub**| Yes, or [bundle a local repo](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>) via `--cloud`| No| No| Only for cloud sessions **Keeps running if you disconnect**| Yes| While terminal stays open| No| Depends on session type **[Permission modes](</docs/en/permission-modes>)**| Accept edits, Plan, Auto| Ask, Auto accept edits, Plan| All modes| Depends on session type **Network access**| Configurable per environment| Your machine’s network| Your machine’s network| Depends on session type @@ -109,7 +109,7 @@ /web-setup -This syncs your `gh` token to your Claude account. If you don’t have a cloud environment yet, `/web-setup` creates one with Trusted network access and no setup script. You can [edit the environment or add variables](</docs/en/claude-code-on-the-web#configure-your-environment>) afterward. Once `/web-setup` completes, you can start cloud sessions from your terminal with [`--remote`](</docs/en/claude-code-on-the-web#from-terminal-to-web>) or set up recurring tasks with [`/schedule`](</docs/en/routines>). +This syncs your `gh` token to your Claude account. If you don’t have a cloud environment yet, `/web-setup` creates one with Trusted network access and no setup script. You can [edit the environment or add variables](</docs/en/claude-code-on-the-web#configure-your-environment>) afterward. Once `/web-setup` completes, you can start cloud sessions from your terminal with [`--cloud`](</docs/en/claude-code-on-the-web#from-terminal-to-web>) or set up recurring tasks with [`/schedule`](</docs/en/routines>). ## @@ -236,7 +236,7 @@ ​ -”Could not create a cloud environment” or “No cloud environment available” when using `--remote` or ultraplan +”Could not create a cloud environment” or “No cloud environment available” when using `--cloud` or ultraplan Remote-session features create a default cloud environment automatically if you don’t have one. If you see “Could not create a cloud environment”, automatic creation failed. If you see “No cloud environment available”, your CLI predates automatic creation. In either case, run `/web-setup` in the Claude Code CLI to create one manually, or visit [claude.ai/code](<https://claude.ai/code>) and follow the **Create your environment** step above.
modified Orchestrate subagents at scale with dynamic workflows View current →
--- a/workflows.md +++ b/workflows.md @@ -1,4 +1,4 @@ -Dynamic workflows require Claude Code v2.1.154 or later and are available on all paid plans, with Anthropic API access, and on Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry. On Pro, turn them on from the Dynamic workflows row in `/config`. +Dynamic workflows require Claude Code v2.1.154 or later and are available on all paid plans, with Anthropic API access, and on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. On Pro, turn them on from the Dynamic workflows row in `/config`. A dynamic workflow is a JavaScript script that orchestrates [subagents](</docs/en/sub-agents>) at scale. Claude writes the script for the task you describe, and a runtime executes it in the background while your session stays responsive. Reach for a workflow when a task needs more agents than one conversation can coordinate, or when you want the orchestration codified as a script you can read and rerun. Examples include a codebase-wide bug sweep, a 500-file migration, a research question that needs sources cross-checked against each other, and a hard plan worth drafting from several independent angles before you commit to one.
modified Run parallel sessions with worktrees View current →
--- a/worktrees.md +++ b/worktrees.md @@ -18,7 +18,7 @@ claude --worktree -You can also ask Claude to “work in a worktree” during a session, and it will create one with the [`EnterWorktree`](</docs/en/tools-reference>) tool. Once in a worktree, Claude can switch directly to another one under `.claude/worktrees/` by calling `EnterWorktree` with the target path. The previous worktree stays on disk untouched. As of v2.1.198, entering or exiting a worktree also relocates the session transcript to that directory’s project storage, the same way [`/cd`](</docs/en/commands>) does, so `/desktop` and `--resume` find the session there afterward. Worktrees created by a `WorktreeCreate` hook are excluded and keep the transcript at the launch directory. Before using `--worktree` interactively in a directory for the first time, accept the workspace trust dialog by running `claude` once in that directory. If trust has not yet been accepted, `--worktree` exits with an error and prompts you to run `claude` in the directory first. Non-interactive runs with `-p` skip the [trust check](</docs/en/security>), so `claude -p --worktree` proceeds without it. +You can also ask Claude to “work in a worktree” during a session, and it will create one with the [`EnterWorktree`](</docs/en/tools-reference>) tool. Once in a worktree, Claude can switch directly to another one under `.claude/worktrees/` by calling `EnterWorktree` with the target path. The previous worktree stays on disk untouched. As of v2.1.198, entering or exiting a worktree also relocates the session transcript to that directory’s project storage, the same way [`/cd`](</docs/en/commands>) does, so `/desktop` and `--resume` find the session there afterward. Worktrees created by a `WorktreeCreate` hook are excluded and keep the transcript at the launch directory. Before using `--worktree` interactively in a directory for the first time, accept the workspace trust dialog by running `claude` once in that directory. If trust has not yet been accepted, `--worktree` exits with an error and prompts you to run `claude` in the directory first. Non-interactive runs with `-p` skip the [trust check](</docs/en/security>), so `claude -p --worktree` proceeds without it. Plugins installed at [project scope](</docs/en/plugins-reference#plugin-installation-scopes>) from the main checkout also load in worktrees of the same repository, so you don’t need to reinstall them per worktree. This applies whether you create the worktree with `--worktree` or with `git worktree add`. Requires Claude Code v2.1.200 or later. Add `.claude/worktrees/` to your `.gitignore` so worktree contents don’t appear as untracked files in your main checkout.
modified Zero data retention View current →
--- a/zero-data-retention.md +++ b/zero-data-retention.md @@ -9,7 +9,7 @@ * [Server-managed settings](</docs/en/server-managed-settings>) * Audit logs -ZDR for Claude Code on Claude for Enterprise applies only to Anthropic’s direct platform. For Claude deployments on Amazon Bedrock, Google Vertex AI, or Microsoft Foundry, refer to those platforms’ data retention policies. +ZDR for Claude Code on Claude for Enterprise applies only to Anthropic’s direct platform. For Claude deployments on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, refer to those platforms’ data retention policies. ##