Changes on
40 changes detected
--- a/admin-setup.md
+++ b/admin-setup.md
@@ -86,7 +86,7 @@
[Customization lockdown](</docs/en/settings-reference#strictpluginonlycustomization>)| Block skills, agents, hooks, and MCP servers from user and project sources, so they can only come from plugins or managed settings. Locking skills also stops the [skills your developers enable on claude.ai](</docs/en/skills#where-synced-skills-load>) from syncing| `strictPluginOnlyCustomization`
[Disable claude.ai sync](</docs/en/settings-reference#syncclaudeaiskills>)| Stop Claude Code from loading the [skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#synced-plugins>) your developers enable on claude.ai. If you turn off Skills for your organization on claude.ai, Claude Code stops syncing both, and on v2.1.273 or later it also removes the ones it already synced. To stop either one without turning Skills off, set its key to `false` in managed settings| `syncClaudeAiSkills`, `syncClaudeAiPlugins`
[Hook restrictions](</docs/en/settings-reference#allowmanagedhooksonly>)| Restrict which hooks run and restrict HTTP hook URLs; see [what runs under `allowManagedHooksOnly`](</docs/en/settings-reference#what-runs-under-allowmanagedhooksonly>) for the full effect list| `allowManagedHooksOnly`, `allowedHttpHookUrls`
-[Login enforcement](</docs/en/settings-reference#forceloginmethod>)| Restrict login to a specific method or Anthropic organization. The method restriction applies across the VS Code extension, Agent SDK, `claude setup-token`, and `/install-github-app`, and the terminal’s interactive login screen, reached by `/login` or first-run onboarding, pre-selects the method without enforcing it; Claude Code verifies the organization for claude.ai account logins in the terminal, VS Code extension, and Agent SDK, and doesn’t check it for Claude Console logins or for [gateway](</docs/en/claude-apps-gateway>) sign-in. Before v2.1.212, only terminal logins applied either key. When set, sessions authenticated by `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` are blocked at startup; cloud provider sessions aren’t affected| `forceLoginMethod`, `forceLoginOrgUUID`
+[Login enforcement](</docs/en/settings-reference#forceloginmethod>)| Restrict login to a specific method or Anthropic organization. The method restriction applies across the VS Code extension, Agent SDK, `claude setup-token`, and `/install-github-app`, and the terminal’s interactive login screen, reached by `/login` or first-run onboarding, pre-selects the method without enforcing it; Claude Code verifies the organization for claude.ai account logins in the terminal, VS Code extension, and Agent SDK, and doesn’t check it for Claude Console logins or for [gateway](</docs/en/claude-apps-gateway>) sign-in. Before v2.1.212, only terminal logins applied either key. When set, sessions authenticated by `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` are blocked at startup; cloud provider sessions aren’t affected unless one of those credentials, or an API key saved by an earlier Claude Console login, is also present| `forceLoginMethod`, `forceLoginOrgUUID`
[Disable agent view](</docs/en/agent-view#how-background-sessions-are-hosted>)| Turn off `claude agents`, `--bg`, `/background`, and the on-demand supervisor| `disableAgentView`
[Configure the corporate launcher](</docs/en/corporate-launcher>)| Prefix the [background-agent supervisor](</docs/en/agent-view#how-background-sessions-are-hosted>), its workers, and the [other covered background processes](</docs/en/corporate-launcher#what-the-launcher-covers>) with a required corporate launcher instead of turning agent view off| `processWrapper`
[Model restrictions](</docs/en/model-config#restrict-model-selection>)| `availableModels` filters which models appear in the picker. Adding `enforceAvailableModels` also constrains the auto-selected default model. See [surface coverage](</docs/en/model-config#surface-coverage>) for how this setting reaches the CLI, web, and IDE| `availableModels`, `enforceAvailableModels`
--- a/agent-view.md
+++ b/agent-view.md
@@ -538,7 +538,7 @@
What persists across restarts
-The permission mode, model, and effort you chose for a background session, along with the configuration flags it carries, all persist when the supervisor later stops and restarts its process. A session you launched with `claude --bg --dangerously-skip-permissions` or `claude --bg --permission-mode bypassPermissions` stays in `bypassPermissions` after that restart. A model or effort you changed mid-session with `/model` or `/effort` is kept too. If the session took its effort from your settings rather than from `--effort` or `/effort`, Claude Code reads your settings again each time it starts a process for the session. After you edit the saved effort in `settings.json`, the change reaches sessions you background with `←` or `/bg`, and their later restarts. The saved effort is the [`effortLevel`](</docs/en/settings-reference#effortlevel>) key or a [`modelSettings`](</docs/en/settings-reference#modelsettings>) entry. Claude Code also keeps a name you set with [`/rename`](</docs/en/commands>) or `Ctrl+R` across that restart, so you can still run [`claude --resume <name>`](</docs/en/sessions#name-your-sessions>) to reach the session. A prompt you stashed with [`Ctrl+S`](</docs/en/interactive-mode#general-controls>) while attached is kept with the session too. Reopen the session after its process was stopped or restarted, and `Ctrl+S` restores the stashed text. Pasted content in the stash doesn’t survive the restart.
+The permission mode, model, and effort you chose for a background session, along with the configuration flags it carries, all persist when the supervisor later stops and restarts its process. A session you launched with `claude --bg --dangerously-skip-permissions` or `claude --bg --permission-mode bypassPermissions` stays in `bypassPermissions` after that restart. A model or effort you changed mid-session with `/model` or `/effort` is kept too. If the session took its effort from your settings rather than from `--effort` or `/effort`, Claude Code reads your settings again each time it starts a process for the session. After you edit the saved effort in `settings.json`, the change reaches sessions you background with `←` or `/bg`, and their later restarts. The saved effort is the [`effortLevel`](</docs/en/settings-reference#effortlevel>) key or a [`modelSettings`](</docs/en/settings-reference#modelsettings>) entry. Claude Code also keeps a name you set with [`/rename`](</docs/en/commands>) or `Ctrl+R` across that restart, so you can still run [`claude --resume <name>`](</docs/en/sessions#name-your-sessions>) to reach the session. A prompt you stashed with [`Ctrl+S`](</docs/en/interactive-mode#general-controls>) while attached is kept with the session too. Reopen the session after its process was stopped or restarted, and press `Ctrl+S` to restore the stashed text. Pasted content in the stash doesn’t survive the restart.
###
--- a/authentication.md
+++ b/authentication.md
@@ -160,17 +160,17 @@
Restrict login to your organization
-To require that developers’ claude.ai logins belong to a specific Anthropic organization, set [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) and [`forceLoginOrgUUID`](</docs/en/settings-reference#forceloginorguuid>) in [managed settings](</docs/en/managed-settings>). Set `forceLoginOrgUUID` to your organization ID, shown in [claude.ai admin settings](<https://claude.ai/admin-settings/organization>) for Claude for Teams or Enterprise organizations. Claude Code reports an error for a claude.ai login to any other organization and exits at startup if the claude.ai credential in use belongs to an organization that isn’t listed. For Claude Console logins, Claude Code uses `forceLoginOrgUUID` to pre-select the organization on the Console sign-in page when you set it to a single Console organization ID, shown at [platform.claude.com/settings/organization](<https://platform.claude.com/settings/organization>). It doesn’t check which organization the resulting Console credential belongs to, at login or at startup, and a developer who logged in with a Console account before you deployed the keys stays logged in. If you set `forceLoginOrgUUID` in any settings file, Claude Code stops offering the keyless Console sign-in in the sessions that file applies to and creates an API key instead. To direct developers to claude.ai sign-in instead, set `forceLoginMethod` to `"claudeai"`. Developers can log in from several paths: the terminal `/login` flow, the [VS Code extension](</docs/en/vs-code>), the Agent SDK, `claude setup-token`, `/install-github-app`, and [gateway](</docs/en/claude-apps-gateway>) sign-in for organizations that route through a cloud gateway. On Claude Code v2.1.212 or later, every path applies `forceLoginMethod`; before v2.1.212, only terminal logins applied either key. On the terminal’s interactive login screen, reached by `/login` or first-run onboarding, Claude Code pre-selects a `claudeai` or `console` method without enforcing it, so even with `forceLoginMethod` set to `"claudeai"`, a developer can still complete a Console login there. The paths differ on `forceLoginOrgUUID`:
+To require that developers’ claude.ai logins belong to a specific Anthropic organization, set [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) and [`forceLoginOrgUUID`](</docs/en/settings-reference#forceloginorguuid>) in [managed settings](</docs/en/managed-settings>). Set `forceLoginOrgUUID` to your organization ID, shown in [claude.ai admin settings](<https://claude.ai/admin-settings/organization>) for Claude for Teams or Enterprise organizations. Claude Code reports an error for a claude.ai login to any other organization and exits at startup if the claude.ai credential in use belongs to an organization that isn’t listed. For Claude Console logins, Claude Code uses `forceLoginOrgUUID` to pre-select the organization on the Console sign-in page when you set it to a single Console organization ID, shown at [platform.claude.com/settings/organization](<https://platform.claude.com/settings/organization>). It doesn’t check which organization the resulting Console credential belongs to, at login or at startup. A developer who logged in with a Console account before you deployed the keys stays logged in, and that saved key is blocked on a machine that also requires the [gateway](</docs/en/claude-apps-gateway>) sign-in or in a session that selects a cloud provider. If you set `forceLoginOrgUUID` in any settings file, Claude Code stops offering the keyless Console sign-in in the sessions that file applies to and creates an API key instead. To direct developers to claude.ai sign-in instead, set `forceLoginMethod` to `"claudeai"`. Developers can log in from several paths: the terminal `/login` flow, the [VS Code extension](</docs/en/vs-code>), the Agent SDK, `claude setup-token`, `/install-github-app`, and [gateway](</docs/en/claude-apps-gateway>) sign-in for organizations that route through a cloud gateway. On Claude Code v2.1.212 or later, every path applies `forceLoginMethod`; before v2.1.212, only terminal logins applied either key. On the terminal’s interactive login screen, reached by `/login` or first-run onboarding, Claude Code pre-selects a `claudeai` or `console` method without enforcing it, so even with `forceLoginMethod` set to `"claudeai"`, a developer can still complete a Console login there. The paths differ on `forceLoginOrgUUID`:
* **Terminal, VS Code extension, and Agent SDK logins** : verify `forceLoginOrgUUID` for claude.ai account logins
* **`claude setup-token` and `/install-github-app`**: enforce only `forceLoginMethod`, so they can mint a token in a different organization
* **[Gateway](</docs/en/claude-apps-gateway>) sign-in**: selected by `forceLoginMethod: "gateway"` rather than restricted by it, and doesn’t authenticate against an Anthropic organization, so `forceLoginOrgUUID` doesn’t apply; use your gateway identity provider to restrict access
-Deploy the keys through your device management tooling. [Server-managed settings](</docs/en/server-managed-settings>) reach only accounts that are already authenticated into your organization, so they can’t redirect a developer’s first login. If your organization distributes server-managed settings as well, set the keys in both places: managed-settings sources [don’t merge](</docs/en/server-managed-settings#settings-precedence>), and cached server-managed settings replace the device-managed file apart from a few [per-key exceptions](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>). `forceLoginOrgUUID` and the `"claudeai"` and `"console"` values of `forceLoginMethod` aren’t among those exceptions, so keep them in both places. The keys also decide whether a session that doesn’t use a login credential can start. See [`forceLoginOrgUUID`](</docs/en/settings-reference#forceloginorguuid>) in the settings reference for the full behavior.
-
- * **`ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper`**: blocked at startup, since organization membership can’t be verified for an environment credential
- * **Cloud provider sessions such as Amazon Bedrock** : not blocked, because they authenticate against your cloud provider. Restrict those through your cloud IAM policies
- * **Anthropic profile or federation credentials** : not blocked, and the keys don’t check which organization the profile belongs to
+Deploy the keys through your device management tooling. [Server-managed settings](</docs/en/server-managed-settings>) reach only accounts that are already authenticated into your organization, so they can’t redirect a developer’s first login. If your organization distributes server-managed settings as well, set the keys in both places: managed-settings sources [don’t merge](</docs/en/server-managed-settings#settings-precedence>), and cached server-managed settings replace the device-managed file apart from a few [per-key exceptions](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>). `forceLoginOrgUUID` and the `"claudeai"` and `"console"` values of `forceLoginMethod` aren’t among those exceptions, so keep them in both places. In a [gateway](</docs/en/claude-apps-gateway>) deployment, also keep `forceLoginMethod` and `forceLoginOrgUUID` out of the [settings the gateway serves](</docs/en/claude-apps-gateway-config#managed>). The keys also decide whether a session that doesn’t use a login credential can start. See [`forceLoginOrgUUID`](</docs/en/settings-reference#forceloginorguuid>) in the settings reference for the full behavior.
+
+ * **`ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper`**: blocked at startup. Under `forceLoginOrgUUID`, organization membership can’t be verified for an environment credential, and under `forceLoginMethod` the credential would stand in for the required sign-in. When the managed settings also require the [gateway](</docs/en/claude-apps-gateway>) sign-in, Claude Code blocks an API key saved by an earlier Claude Console login the same way. See [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>)
+ * **Cloud provider sessions such as Amazon Bedrock** : blocked only while an `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` credential, or an API key saved by an earlier Claude Console login, is still present on the machine. Remove it and the session starts. These sessions authenticate against your cloud provider, whose access policies govern them
+ * **Anthropic profile or federation credentials** : not blocked unless an `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` credential, or an API key saved by an earlier Claude Console login, is also present on the machine. The keys don’t check which organization the profile belongs to
##
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
@@ -384,7 +384,7 @@
Six parent-supplied settings pass the filter even with all five locks set. Under the default first-wins setting, an admin value blocks the parent’s only when it sits in the highest-priority admin source, except for `allowedMcpServers` while the MCP server lock is on. Under the `managedSourcesBehavior` merge opt-in, [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s value applies instead.
- * **`forceLoginOrgUUID`** : Claude Code honors a parent-supplied value when the highest-priority admin source doesn’t set an org UUID. Gateway sign-in doesn’t check this key, so it matters only for fleets that also use first-party Anthropic logins. An org UUID in the highest-priority admin source blocks the parent’s value and is the one Claude Code enforces, so set `forceLoginOrgUUID` there.
+ * **`forceLoginOrgUUID`** : Claude Code honors a parent-supplied value when the highest-priority admin source doesn’t set an org UUID. Gateway sign-in doesn’t check this key. An org UUID in the highest-priority admin source blocks the parent’s value and is the one Claude Code enforces.
* **`allowedMcpServers`** : Claude Code honors a parent-supplied allowlist when no admin list is in force. `allowManagedMcpServersOnly` doesn’t block it, because the lock enforces whichever list wins as the managed value, including a parent-supplied one when no admin source supplies a list. A list in the highest-priority admin source blocks the parent’s and is the list Claude Code enforces, so set `allowedMcpServers` there, next to the lock. Before v2.1.223, a value for either key in any admin source blocked the parent’s.
* **`availableModels`** : Claude Code honors a parent-supplied model list when the winning managed source doesn’t set one. If your fleet restricts models, set `availableModels` in the winning source.
* **`strictKnownMarketplaces`** : Claude Code honors a parent-supplied plugin marketplace allowlist when the winning managed source doesn’t set one. If your fleet restricts marketplaces, set `strictKnownMarketplaces` in the winning source. Requires Claude Code v2.1.282 or later.
@@ -420,7 +420,7 @@
* In the embedded sessions Claude Desktop launches, the CLI sends its exports to the configured `OTEL_EXPORTER_OTLP_ENDPOINT`. The CLI attaches the gateway session token to those exports only when that endpoint points at the gateway itself.
* With no destination configured for a signal, the gateway accepts and discards it.
* If you already collect Claude Code telemetry directly, add your collector as a `forward_to` destination, or name it in a policy to skip the relay.
- * **Credentials** : the gateway token is the session’s only credential. [Anthropic profiles](</docs/en/authentication#anthropic-profiles-and-federation-credentials>) and any earlier claude.ai login are ignored while signed in, so developers don’t need to log out of claude.ai first. For a configured `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` credential, see [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>).
+ * **Credentials** : the gateway token is the session’s only credential. [Anthropic profiles](</docs/en/authentication#anthropic-profiles-and-federation-credentials>) and any earlier claude.ai login are ignored while signed in, so developers don’t need to log out of claude.ai first. For a configured `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` credential, or an API key saved by an earlier Claude Console login, see [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>).
* **Managed settings** : locked keys can’t be overridden locally. The CLI applies the policy at startup and applies changes on each hourly poll, apart from the [changes that apply only at the next launch](</docs/en/server-managed-settings#fetch-and-caching-behavior>).
* **Startup with the gateway unreachable** : signed-in sessions exit at startup with an error after about 10 seconds rather than starting without their settings.
* **Startup after the gateway ends the session** : see [Enforce fail-closed startup](</docs/en/server-managed-settings#enforce-fail-closed-startup>) for the launches that open signed out of the gateway and the ones that exit when the gateway answers with a `401`.
--- a/claude-apps-gateway-config.md
+++ b/claude-apps-gateway-config.md
@@ -158,6 +158,7 @@
`password`| No| Database credential. Set it here rather than in `postgres_url` so the credential stays out of the URL. Accepts any characters and takes precedence over URL credentials.
`max_connections`| No| Postgres connection-pool size per replica. Default `5`, which is conservative and friendly to shared databases. With spend limits enabled, the hot path does a few operations per inference request, so raise it for a dedicated database under load, and keep replicas × this below the database’s `max_connections`.
`connect_timeout_seconds`| No| Seconds the gateway waits when it opens a Postgres connection. A whole number from `1` to `60`, default `5`. Raise it if connection attempts time out when a new gateway instance starts. Requires Claude Code v2.1.274 or later on the gateway server. Earlier versions refuse to start when the key is set.
+`readiness_grace_seconds`| No| How many seconds `/readyz` keeps reporting ready after Postgres stops answering. A whole number from `0` to `3600`, default `0`. See [Outage behavior](</docs/en/claude-apps-gateway-deploy#outage-behavior>) for how to pick a value. Requires Claude Code v2.1.282 or later on the gateway server. Earlier versions refuse to start when the key is set.
For local development, point `postgres_url` at a throwaway Postgres container, for example `docker run --rm -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres`.
@@ -967,6 +968,7 @@
postgres_url: ${GATEWAY_POSTGRES_URL}
# max_connections: 5
# connect_timeout_seconds: 5
+ # readiness_grace_seconds: 300 # keep passing the readiness check through a database failover
# Enables /v1/organizations/spend_limits (mirrors the Anthropic Admin API)
# and per-developer spend enforcement on /v1/messages. Omit to disable.
@@ -1083,7 +1085,7 @@
"parentSettingsBehavior": "merge"
}
-`parentSettingsBehavior: "merge"` keeps Claude Desktop’s delivery of the egress allowlist to its embedded Claude Code sessions working; [Deliver policy to Claude Desktop sessions](</docs/en/claude-apps-gateway#deliver-policy-to-claude-desktop-sessions>) explains the mechanism and where the opt-in must sit. Deploy the `managed-settings.json` file to each device, typically via your MDM platform. The file path differs by platform. See [where each mechanism stores the policy](</docs/en/managed-settings#where-each-mechanism-stores-the-policy>). By default, a registry policy on Windows or a managed-preferences plist on macOS replaces the `managed-settings.json` file rather than merging with it, apart from the exception keys and cross-source checks above. All three keys in this snippet follow the highest-priority-source rule, so fleets that deliver policy through Group Policy or configuration profiles must put all three in that mechanism instead. For Claude Desktop, set the `bootstrapUrl` key in Claude Desktop’s own [managed configuration](<https://claude.com/docs/third-party/claude-desktop/configuration>) to `<listen.public_url>/user/bootstrap`. The sign-in flow and per-group policy then match the CLI’s once a policy opts in server-side with a `desktop` key; without the opt-in, `/user/bootstrap` returns 404. See Claude Desktop overlay for the server-side half. Claude Code honors [`forceLoginGatewayUrl`](</docs/en/settings-reference#forcelogingatewayurl>), [`gatewayInternalNetworks`](</docs/en/settings-reference#gatewayinternalnetworks>), and the `"gateway"` value of [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) only from a managed source on the machine: `managed-settings.json`, the macOS plist or Windows HKLM registry, or a policy helper. A developer setting them in their own `~/.claude/settings.json` has no effect, and neither does setting them in the gateway payload.
+`parentSettingsBehavior: "merge"` keeps Claude Desktop’s delivery of the egress allowlist to its embedded Claude Code sessions working; [Deliver policy to Claude Desktop sessions](</docs/en/claude-apps-gateway#deliver-policy-to-claude-desktop-sessions>) explains the mechanism and where the opt-in must sit. Deploy the `managed-settings.json` file to each device, typically via your MDM platform. The file path differs by platform. See [where each mechanism stores the policy](</docs/en/managed-settings#where-each-mechanism-stores-the-policy>). By default, a registry policy on Windows or a managed-preferences plist on macOS replaces the `managed-settings.json` file rather than merging with it, apart from the exception keys and cross-source checks above. All three keys in this snippet follow the highest-priority-source rule, so fleets that deliver policy through Group Policy or configuration profiles must put all three in that mechanism instead. For Claude Desktop, set the `bootstrapUrl` key in Claude Desktop’s own [managed configuration](<https://claude.com/docs/third-party/claude-desktop/configuration>) to `<listen.public_url>/user/bootstrap`. The sign-in flow and per-group policy then match the CLI’s once a policy opts in server-side with a `desktop` key; without the opt-in, `/user/bootstrap` returns 404. See Claude Desktop overlay for the server-side half. Claude Code honors [`forceLoginGatewayUrl`](</docs/en/settings-reference#forcelogingatewayurl>), [`gatewayInternalNetworks`](</docs/en/settings-reference#gatewayinternalnetworks>), and the `"gateway"` value of [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) only from a managed source on the machine: `managed-settings.json`, the macOS plist or Windows HKLM registry, or a policy helper. Setting them in a developer’s own `~/.claude/settings.json` or in the gateway payload doesn’t configure the gateway sign-in. Leave `forceLoginMethod` and `forceLoginOrgUUID` out of the payload. Claude Code still reads both keys from the payload for its startup credential check, so a developer who keeps an Anthropic-issued credential on the machine gets the startup exit described under [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) even after they sign in.
##
--- a/claude-apps-gateway-deploy.md
+++ b/claude-apps-gateway-deploy.md
@@ -156,7 +156,7 @@
Health
-The gateway serves `GET /healthz` as a liveness probe and `GET /readyz` as a readiness probe; `/readyz` verifies the store is reachable. Both are exempt from `access_control.allow_cidrs`, so probes keep working on a locked-down listener. The OAuth discovery document at `/.well-known/oauth-authorization-server` also returns `200` only after config load, OIDC discovery, upstream client construction, and Postgres migration all succeed, so it doubles as an end-to-end boot check.
+The gateway serves `GET /healthz` as a liveness probe and `GET /readyz` as a readiness probe. `/readyz` verifies the store is reachable. If you set [`store.readiness_grace_seconds`](</docs/en/claude-apps-gateway-config#store>), `/readyz` keeps reporting ready for up to that many seconds after the store stops answering. Both endpoints are exempt from `access_control.allow_cidrs`, so probes keep working on a locked-down listener. The OAuth discovery document at `/.well-known/oauth-authorization-server` also returns `200` only after config load, OIDC discovery, upstream client construction, and Postgres migration all succeed, so it doubles as an end-to-end boot check.
###
@@ -184,9 +184,17 @@
* **Existing sessions** : bearer tokens validate locally with the JWT secret, session refreshes don’t touch the store, and the gateway process can still serve inference
* **New sign-ins** : fail until Postgres recovers, because the device flow and its rate-limit counters live in Postgres
* **[Spend-limit enforcement](</docs/en/claude-apps-gateway-spend-limits#postgres-availability>)** : fails open by default during the outage, so inference still flows; flip it to fail closed if you’d rather block than run unmetered
- * **Readiness** : `/readyz` reports not-ready during the outage, so orchestrators that gate traffic on readiness remove every replica from rotation at once. In that topology all traffic, including inference the gateway could still serve, fails at the load balancer until Postgres recovers. The liveness probe on `/healthz` keeps passing, so replicas aren’t restarted. Point the readiness probe at `/healthz` instead if you’d rather signed-in developers keep working through a store outage; the cost is that new sign-ins fail against a replica that still reports ready.
+ * **Readiness** : by default `/readyz` reports not-ready as soon as Postgres is unreachable, so every replica fails its readiness check at once. Where traffic only reaches replicas that pass the check, all traffic, including inference the gateway could still serve, fails until Postgres recovers. The liveness probe on `/healthz` keeps passing throughout.
If your IdP goes down, existing sessions work until `ttl_hours` and new logins fail. A session refresh gets a try-again answer and succeeds once the IdP is back. Set a longer `ttl_hours` if your IdP has frequent maintenance windows.
+
+####
+
+
+
+Readiness grace period
+
+To keep signed-in developers working through a short Postgres outage such as a database failover, set [`store.readiness_grace_seconds`](</docs/en/claude-apps-gateway-config#store>) to longer than the failover takes, for example `300`. With spend limits on and the default fail-open behavior, requests through a replica that stays ready are unmetered until Postgres recovers, so keep the value as low as covers your failover. If you set [`enforcement.fail_closed_on_error: true`](</docs/en/claude-apps-gateway-config#enforcement>), the gateway refuses signed-in developers’ inference with the `429` `spend limit unavailable` message until Postgres recovers, even while replicas still pass their readiness check. The setting requires Claude Code v2.1.282 or later on the gateway server. An earlier gateway refuses to start when it finds the key, so upgrade every replica before you add it. Upgrades covers rolling back. If you point the readiness probe at `/healthz` instead, replicas also keep passing it through an outage, but `/healthz` never reports not-ready, so a replica whose Postgres connection doesn’t recover keeps passing too.
###
@@ -322,7 +330,7 @@
A developer’s requests fail with `Not signed in to the Cloud gateway — run /login.`| The machine’s managed settings set `forceLoginMethod: "gateway"` or `forceLoginGatewayUrl`, and the session has no gateway sign-in. A leftover claude.ai login doesn’t satisfy the requirement.| Have the developer run `/login` and complete the gateway sign-in. See also [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>).
Claude Desktop reports that its bootstrap configuration couldn’t be fetched| `/user/bootstrap` returned 404: the policy matching the user doesn’t carry a `desktop` key, or no policy matched. The gateway’s audit log records each rejection as `desktop_bootstrap.denied` with the reason.| Add a `desktop` block to the policy that matches the user, or to the `match: {}` base layer; an empty `desktop: {}` suffices. See [Claude Desktop overlay](</docs/en/claude-apps-gateway-config#claude-desktop-overlay>).
Startup shows `Gateway login is configured in managed settings, but this Claude Code build does not include Cloud gateway support.`| The installed Claude Code build predates gateway support| Have the developer update Claude Code to a release that includes Cloud gateway support
-Startup exits with `Administrator policy requires a Cloud gateway sign-in on this machine`| The developer’s environment sets `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN`, their settings configure an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>), or an API key from an earlier Claude Console login is still saved| Have the developer clear each that applies: unset the variable, remove the `apiKeyHelper` entry, or run `claude auth logout` to remove the saved key. Then have them start `claude` and sign in with `/login`. See also [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>).
+Startup exits with `Administrator policy requires a Cloud gateway sign-in on this machine`| The developer’s environment sets `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN`, their settings configure an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>), or an API key from an earlier Claude Console login is still saved| Have the developer clear each that applies: unset the variable, remove the `apiKeyHelper` entry, or run `claude auth logout` to remove the saved key. A session that selects a cloud provider with `CLAUDE_CODE_USE_*` then starts with no sign-in; for every other session, have them start `claude` and sign in with `/login`. See also [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>).
Startup or `/login` reports `Claude Code may not be enabled for your organization` after a 403 on the managed settings load| The gateway, or something in front of it, answered the `/managed/settings` request with 403. The gateway’s own settings route never answers 403. The status comes from the [`access_control`](</docs/en/claude-apps-gateway-config#http-tuning>) IP checks or from a proxy or WAF in front of the gateway. The audit log records an IP-check denial as `access.denied` with the reason. The developer stays signed in.| Check the audit log for `access.denied` at the time of the failure and fix the `access_control` lists or the front end, then have the developer start `claude` again
CLI `/login`: `The gateway is limiting sign-in attempts right now`, or `Request failed with status code 429` on older versions. The `/device` page may show `Too many attempts` to developers who haven’t tried before| The per-IP sign-in rate limit was reached. Either `listen.trusted_proxies` doesn’t cover the load balancer, so every developer shares its address, or many developers share a NAT or VPN egress address. Audit events with `result: rate_limited` show the same one or few `client_ip` values.| Set `listen.trusted_proxies` to the load balancer’s source ranges first, then raise `rate_limits` if developers still share addresses. See Large rollouts.
CLI `/login`: `Gateway hosts must be on your organization's private network; <host> resolves to the public (or unrecognized) address <ip>`| The gateway hostname resolves to at least one public IP address. Claude Code checks each resolved address and requires every one to be private. A common cause is a dual-stack name where one family resolves to a public address, including AWS internal dual-stack load balancers, which return public-range AAAA addresses.| Have the gateway name resolve only to private addresses on developer machines. For a dual-stack name, drop the public-range record or serve a separate internal-only DNS name. See the [private-network prerequisite](</docs/en/claude-apps-gateway#prerequisites>). If the address is public space your organization owns and uses internally, [declare that block](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>) instead.
--- a/claude-apps-gateway-on-aws.md
+++ b/claude-apps-gateway-on-aws.md
@@ -224,6 +224,8 @@
store:
postgres_url: ${GATEWAY_POSTGRES_URL} # EKS: ${file:/secrets/postgres-url}
+ # readiness_grace_seconds: 300 # keep passing the health check
+ # through an RDS failover
upstreams:
- provider: bedrock
@@ -371,7 +373,7 @@
--network-configuration "awsvpcConfiguration={subnets=[$(echo $PRIVATE_SUBNETS | tr ' ' ',')],securityGroups=[$GW_SG],assignPublicIp=DISABLED}" \
--load-balancers "targetGroupArn=$TG_ARN,containerName=gateway,containerPort=8080"
-The 60-second grace period gives a cold task time to pull the image, connect to the store, and answer its first health check before ECS starts counting failures against the deployment. The target group’s health check on `GET /readyz` verifies the store is reachable, so a task that can’t reach Postgres never enters rotation; see [Outage behavior](</docs/en/claude-apps-gateway-deploy#outage-behavior>) for the tradeoff and the `/healthz` alternative.The tasks run in private subnets with no public IP, so all egress (to Bedrock, your IdP, Secrets Manager, ECR, and CloudWatch Logs) goes through the NAT gateway. To keep Bedrock traffic off the public path, create a `bedrock-runtime` interface VPC endpoint and point the upstream’s `base_url` at it, as shown in the [Bedrock upstream reference](</docs/en/claude-apps-gateway-config#amazon-bedrock>); the IdP still needs internet egress.Finish by giving developers a privately resolvable hostname: in a Route 53 private hosted zone, alias the gateway’s internal DNS name to the ALB, and set `listen.public_url` to that hostname. The ALB’s own `*.elb.amazonaws.com` name resolves to private addresses on an internal ALB, but it can’t carry your ACM certificate, so use your own name.Update the OAuth client’s authorized redirect URI to `<public_url>/oauth/callback` before the first sign-in. After changing `public_url`, rebuild and push the image under a new tag, register a new task definition revision, and redeploy. On ECS the setting lives in the image’s embedded `gateway.yaml`, and the gateway builds its public origin only from that setting, ignoring `X-Forwarded-Host` and `X-Forwarded-Proto`. `X-Forwarded-For` is honored for client IPs only when `listen.trusted_proxies` is set.
+The 60-second grace period gives a cold task time to pull the image, connect to the store, and answer its first health check before ECS starts counting failures against the deployment.The target group’s health check on `GET /readyz` verifies the store is reachable, so a task that can’t reach Postgres never enters rotation. To keep tasks passing the check through a short database outage such as an RDS failover, set `store.readiness_grace_seconds` as described in [Outage behavior](</docs/en/claude-apps-gateway-deploy#outage-behavior>), which also covers the `/healthz` alternative.The tasks run in private subnets with no public IP, so all egress (to Bedrock, your IdP, Secrets Manager, ECR, and CloudWatch Logs) goes through the NAT gateway. To keep Bedrock traffic off the public path, create a `bedrock-runtime` interface VPC endpoint and point the upstream’s `base_url` at it, as shown in the [Bedrock upstream reference](</docs/en/claude-apps-gateway-config#amazon-bedrock>); the IdP still needs internet egress.Finish by giving developers a privately resolvable hostname: in a Route 53 private hosted zone, alias the gateway’s internal DNS name to the ALB, and set `listen.public_url` to that hostname. The ALB’s own `*.elb.amazonaws.com` name resolves to private addresses on an internal ALB, but it can’t carry your ACM certificate, so use your own name.Update the OAuth client’s authorized redirect URI to `<public_url>/oauth/callback` before the first sign-in. After changing `public_url`, rebuild and push the image under a new tag, register a new task definition revision, and redeploy. On ECS the setting lives in the image’s embedded `gateway.yaml`, and the gateway builds its public origin only from that setting, ignoring `X-Forwarded-Host` and `X-Forwarded-Proto`. `X-Forwarded-For` is honored for client IPs only when `listen.trusted_proxies` is set.
This track needs `kubectl` and `eksctl` installed locally, and an existing EKS cluster with an IAM OIDC provider and the AWS Load Balancer Controller installed. The cluster must be on `$VPC_ID` so pods can reach the RDS private endpoint, and the `claude-gateway-db` security group must admit the cluster’s pod or node security group in place of `$GW_SG`.On EKS the gateway gets its Bedrock credentials through IRSA rather than the ECS roles. The `ecs-tasks.amazonaws.com` trust policy from the IAM step does not apply here; IRSA needs a role whose trust policy federates on the cluster’s OIDC provider, scoped to `system:serviceaccount:claude-gateway:gateway`. `eksctl create iamserviceaccount` creates that role, attaches the policies, and annotates the Kubernetes service account with the role ARN in one step. Turn the two policy documents from the IAM step into managed policies it can attach:
--- a/claude-apps-gateway-on-gcp.md
+++ b/claude-apps-gateway-on-gcp.md
@@ -170,6 +170,8 @@
store:
postgres_url: ${GATEWAY_POSTGRES_URL} # GKE: ${file:/secrets/postgres-url}
+ # readiness_grace_seconds: 300 # keep passing the readiness probe
+ # through a Cloud SQL failover
upstreams:
- provider: vertex
--- a/claude-apps-gateway-spend-limits.md
+++ b/claude-apps-gateway-spend-limits.md
@@ -68,7 +68,7 @@
Postgres availability
-The pre-check queries Postgres with a two-second timeout. If the store is unreachable or times out, enforcement fails open by default: the request proceeds, the gateway logs a warning, and the response carries no `anthropic-ratelimit-unified-*` headers. Set [`enforcement.fail_closed_on_error: true`](</docs/en/claude-apps-gateway-config#enforcement>) to fail closed instead, which returns the same `429 billing_error` but with the message `spend limit unavailable` and no period, reset time, or `retry-after` header. Fail-open keeps a store outage from becoming an inference outage; fail-closed guarantees no unmetered spend.
+The pre-check queries Postgres with a two-second timeout. If the store is unreachable or times out, enforcement fails open by default: the request proceeds, the gateway logs a warning, and the response carries no `anthropic-ratelimit-unified-*` headers. Set [`enforcement.fail_closed_on_error: true`](</docs/en/claude-apps-gateway-config#enforcement>) to fail closed instead, which returns the same `429 billing_error` but with the message `spend limit unavailable` and no period, reset time, or `retry-after` header. Fail-open keeps a store outage from becoming an inference outage; fail-closed guarantees no unmetered spend. Fail-open only helps while your load balancer or orchestrator still routes traffic to the gateway. See [Outage behavior](</docs/en/claude-apps-gateway-deploy#outage-behavior>) for `store.readiness_grace_seconds`, which keeps replicas passing their readiness check through a short outage.
###
--- a/claude-code-on-the-web.md
+++ b/claude-code-on-the-web.md
@@ -101,7 +101,7 @@
Send local repositories without GitHub
-When you run `claude --cloud` from a repository that has no git remote, or from a github.com repository that the Claude GitHub App isn’t installed on, Claude Code bundles your local repository and uploads it directly to the cloud session. This applies even if you connected GitHub with `/web-setup`. The bundle includes your full repository history across all branches, plus uncommitted changes to tracked files. On macOS, Linux, and WSL, Claude Code leaves uncommitted changes to files named like credentials or keys out of the upload and names the files it left out. This covers `.env` files, Terraform `*.tfvars` files, and key files such as `id_rsa` and `*.pem`. The session starts with the committed version of each, or without the file if none is committed. In a linked worktree, submodule, or similar layout, Claude Code uploads these changes with the rest and names the files it uploads. To upload a bundle even when Claude Code would otherwise clone from the remote, set `CCR_FORCE_BUNDLE=1`:
+When you run `claude --cloud` from a repository that has no git remote, or from a github.com repository that the Claude GitHub App isn’t installed on, Claude Code bundles your local repository and uploads it directly to the cloud session. This applies even if you connected GitHub with `/web-setup`. The bundle includes your full repository history across all branches, plus uncommitted changes to tracked files. On macOS, Linux, and WSL, Claude Code leaves uncommitted changes to files named like credentials or keys out of the upload and names the files it left out. This covers `.env` files, Terraform `*.tfvars` files, and key files such as `id_rsa` and `*.pem`. The session starts with the committed version of each, or without the file if none is committed. To upload a bundle even when Claude Code would otherwise clone from the remote, set `CCR_FORCE_BUNDLE=1`:
CCR_FORCE_BUNDLE=1 claude --cloud "Run the test suite and fix any failures"
--- a/commands.md
+++ b/commands.md
@@ -58,7 +58,7 @@
`/design-sync [hint]`| **[Skill](</docs/en/skills#bundled-skills>).** Convert your repo’s React design system and upload it to [Claude Design](<https://claude.ai/design>), so designs it produces use your real components. Optionally name the design system, for example `/design-sync Acme DS`. A first-time sync verifies every component and can take a few hours on a large repo. Available on the Anthropic API. It needs claude.ai, which the CLI doesn’t contact on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, or through a [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>), so the command is unavailable there
`/desktop`| Continue the current session in the Claude Code Desktop app. Requires macOS or x64 Windows and a Claude subscription. Alias: `/app`
`/diff`| Review the changes in your working tree, including the edits Claude has made so far. See [Review changes with /diff](</docs/en/interactive-mode#review-changes-with-%2Fdiff>)
-`/doctor`| **[Skill](</docs/en/skills#bundled-skills>).** Run a setup checkup that diagnoses issues and can fix them. Checks installation health, including duplicate or leftover installs, `PATH` problems, and unparseable settings files. Finds unused skills, MCP servers, and plugins versus their context cost, flags slow [hooks](</docs/en/hooks>), and checks for a newer version on your [release channel](</docs/en/setup#configure-release-channel>). Deduplicates local `CLAUDE.md` files against checked-in ones, trims checked-in [`CLAUDE.md`](</docs/en/memory#my-claude-md-is-too-large>) files by cutting content Claude could derive from the codebase, and migrates the always-loaded guidance that remains into [skills](</docs/en/skills>) and nested `CLAUDE.md` files that load on demand. Also offers to make [auto mode](</docs/en/permissions#permission-modes>) your default and to [pre-approve](</docs/en/permissions>) frequently denied read-only commands. Reports findings first and asks for confirmation before changing anything. From the terminal, `claude doctor` prints read-only installation diagnostics without starting a session. Alias: `/checkup`. The `CLAUDE.md` trim check requires Claude Code v2.1.206 or later. Before v2.1.205, `/doctor` opened a read-only diagnostics screen and pressing `f` sent the report to Claude
+`/doctor [prompt-audit [path]]`| **[Skill](</docs/en/skills#bundled-skills>).** Run a setup checkup that diagnoses issues and can fix them. Checks installation health, including duplicate or leftover installs, `PATH` problems, and unparseable settings files. Finds unused skills, MCP servers, and plugins versus their context cost, flags slow [hooks](</docs/en/hooks>), and checks for a newer version on your [release channel](</docs/en/setup#configure-release-channel>). Deduplicates local `CLAUDE.md` files against checked-in ones, trims checked-in [`CLAUDE.md`](</docs/en/memory#my-claude-md-is-too-large>) files by cutting content Claude could derive from the codebase, and migrates the always-loaded guidance that remains into [skills](</docs/en/skills>) and nested `CLAUDE.md` files that load on demand. Also offers to make [auto mode](</docs/en/permissions#permission-modes>) your default and to [pre-approve](</docs/en/permissions>) frequently denied read-only commands. Reports findings first and asks for confirmation before changing anything. From the terminal, `claude doctor` prints read-only installation diagnostics without starting a session. Alias: `/checkup`. Run `/doctor prompt-audit` to have Claude [audit your `CLAUDE.md` files, skills, and other configuration](</docs/en/memory#write-effective-instructions>) for outdated or conflicting instructions instead of running the checkup. The `prompt-audit` subcommand requires Claude Code v2.1.283 or later. The `CLAUDE.md` trim check requires Claude Code v2.1.206 or later. Before v2.1.205, `/doctor` opened a read-only diagnostics screen and pressing `f` sent the report to Claude
`/effort [level|auto|status]`| Set the [effort level](</docs/en/model-config#adjust-effort-level>): `low` to `xhigh`, `max`, [`ultracode`](</docs/en/workflows#let-claude-decide-with-ultracode>), or `auto`; `status` prints it. `max` and `ultracode` are session-only; the [`ultracode`](</docs/en/settings-reference#ultracode>) key persists. Run it while Claude is responding and, once you confirm the [cache warning](</docs/en/prompt-caching#changing-effort-level>), if Claude Code shows one, Claude Code applies the new level to the next request in that turn. Before v2.1.242, Claude Code decided from a feature flag it fetched from Anthropic whether to run the command mid-turn or queue it until the turn finished, and always queued it in a session that doesn’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as on a [third-party provider](</docs/en/third-party-integrations>). Works in `-p`
`/exit`| Exit the CLI. In an attached [background session](</docs/en/agent-view#attach-to-a-session>), this detaches and the session keeps running. Alias: `/quit`
`/export [filename]`| Export the current conversation as plain text. With a filename, writes directly to that file. Without, opens a dialog to copy to clipboard or save to a file
--- a/create.md
+++ b/create.md
@@ -183,7 +183,7 @@
From a folder of plugins
-To load several plugins from one place, pass a folder that holds them, such as `--plugin-dir ./plugins`. Loading a folder of plugins requires Claude Code v2.1.265 or later. If the folder has no `.claude-plugin/` directory and no plugin components at its top level, Claude Code treats it as a folder of plugins. Each immediate subfolder that has a `.claude-plugin/plugin.json` manifest then loads as a separate plugin. Everything else in the folder is skipped without an error, including a subfolder that has no manifest. If a plugin in the folder doesn’t load, check that its subfolder has a `.claude-plugin/plugin.json`. In an interactive session, you can also add and remove plugins in the folder after startup:
+To load several plugins from one place, pass a folder that holds them, such as `--plugin-dir ./plugins`. Loading a folder of plugins requires Claude Code v2.1.265 or later. If the folder has no `.claude-plugin/` directory and no plugin components at its top level, Claude Code treats it as a folder of plugins. Each immediate subfolder that has a `.claude-plugin/plugin.json` manifest then loads as a separate plugin. Everything else in the folder is skipped without an error, including a subfolder that has no manifest. If a plugin in the folder doesn’t load, check that its subfolder has a `.claude-plugin/plugin.json`. You can also pass a folder that keeps a `.claude-plugin/marketplace.json` beside its plugin folders. As long as that `.claude-plugin/` directory holds no `plugin.json`, the plugin folders still load. Nothing is installed or enabled from the marketplace file, because Claude Code doesn’t read it. Loading plugins from such a folder requires Claude Code v2.1.281 or later. In an interactive session, you can also add and remove plugins in the folder after startup:
* A subfolder you add loads as a new plugin once its manifest exists.
* When you remove a subfolder, its plugin unloads.
--- a/custom-tools.md
+++ b/custom-tools.md
@@ -122,7 +122,7 @@
See the [`tool()`](</docs/en/agent-sdk/typescript#tool>) TypeScript reference or the [`@tool`](</docs/en/agent-sdk/python#tool>) Python reference for full parameter details, including JSON Schema input formats and return value structure.
-To make a parameter optional: in TypeScript, add `.default()` to the Zod field. In Python, the dict schema treats every key as required, so leave the parameter out of the schema, mention it in the description string, and read it with `args.get()` in the handler. The `get_precipitation_chance` tool below shows both patterns.
+To make a parameter optional: in TypeScript, add `.optional()` to the Zod field and apply the default in the handler. In Python, the dict schema treats every key as required, so leave the parameter out of the schema, mention it in the description string, and read it with `args.get()` in the handler. The `get_precipitation_chance` tool below shows both patterns.
###
@@ -235,18 +235,19 @@
.int()
.min(1)
.max(24)
- .default(12) // .default() makes the parameter optional
+ .optional() // .optional() lets Claude omit the parameter
.describe("How many hours of forecast to return")
},
async (args) => {
+ const hours = args.hours ?? 12; // Apply the default in the handler
const response = await fetch(
`https://api.open-meteo.com/v1/forecast?latitude=${args.latitude}&longitude=${args.longitude}&hourly=precipitation_probability&forecast_days=1`
);
const data: any = await response.json();
- const chances = data.hourly.precipitation_probability.slice(0, args.hours);
+ const chances = data.hourly.precipitation_probability.slice(0, hours);
return {
- content: [{ type: "text", text: `Next ${args.hours} hours: ${chances.join("%, ")}%` }]
+ content: [{ type: "text", text: `Next ${hours} hours: ${chances.join("%, ")}%` }]
};
}
);
@@ -454,7 +455,7 @@
Images
-An image block carries the image bytes inline, encoded as base64. There is no URL field. To return an image that lives at a URL, fetch it in the handler, read the response bytes, and base64-encode them before returning. The result is processed as visual input.
+An image block carries the image bytes inline, encoded as base64. There is no URL field. To return an image that lives at a URL, fetch it in the handler, read the response bytes, and base64-encode them before returning. A PNG, JPEG, GIF, or WebP image reaches Claude as visual input; an image of any other type is saved to disk and Claude receives its file path as text instead.
Field| Type| Notes
---|---|---
@@ -522,7 +523,7 @@
Resources
-A resource block embeds a piece of content identified by a URI. The URI is a label for Claude to reference; the actual content rides in the block’s `text` or `blob` field. Use this when your tool produces something that makes sense to address by name later, such as a generated file or a record from an external system.
+A resource block embeds a piece of content identified by a URI. The actual content rides in the block’s `text` or `blob` field. Use this when your tool produces a generated file or a record from an external system.
Field| Type| Notes
---|---|---
@@ -532,7 +533,7 @@
`resource.blob`| `string`| The content base64-encoded, if it’s binary. TypeScript only: the Python SDK drops binary resources from the tool result and logs a warning
`resource.mimeType`| `string`| Optional
-This example shows a resource block returned from inside a tool handler. The URI `file:///tmp/report.md` is a label that Claude can reference later; the SDK does not read from that path.
+This example shows a resource block returned from inside a tool handler. The SDK doesn’t read from the example’s URI, `file:///tmp/report.md`.
TypeScript
@@ -556,7 +557,7 @@
{
"type": "resource",
"resource": {
- "uri": "file:///tmp/report.md", # Label for Claude to reference, not a path the SDK reads
+ "uri": "file:///tmp/report.md", # Not a path the SDK reads
"mimeType": "text/markdown",
"text": "# Report\n...", # The actual content, inline
},
--- a/data-usage.md
+++ b/data-usage.md
@@ -108,7 +108,7 @@
Telemetry services
-Claude Code sends two kinds of operational telemetry: usage metrics and error reports. You can turn each off individually with the environment variables below, or disable all non-essential traffic at once by setting `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`. Setting `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` also disables the feature-flag evaluation that [Remote Control](</docs/en/remote-control#requirements>) depends on; `DISABLE_ERROR_REPORTING` doesn’t. **Metrics** : latency, reliability, and usage patterns, sent to Anthropic and to third-party logging infrastructure over TLS. Metrics never include your code, prompts, or file paths. Set `DISABLE_TELEMETRY=1` to opt out. **Error reports** : error messages and stack traces from Claude Code’s own internals, sent to a third-party error tracking service over TLS. Claude Code redacts known patterns of secrets, file paths, email addresses, and other personal information before anything leaves your machine. Set `DISABLE_ERROR_REPORTING=1` to opt out. Error reporting is on only when all of these apply:
+Claude Code sends two kinds of operational telemetry: usage metrics and error reports. You can turn each off individually with the environment variables below, or disable all non-essential traffic at once by setting `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`. Setting `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` also disables feature-flag evaluation, which can make [Remote Control](</docs/en/remote-control#requirements>) unavailable; `DISABLE_ERROR_REPORTING` doesn’t. **Metrics** : latency, reliability, and usage patterns, sent to Anthropic and to third-party logging infrastructure over TLS. Metrics never include your code, prompts, or file paths. Set `DISABLE_TELEMETRY=1` to opt out. **Error reports** : error messages and stack traces from Claude Code’s own internals, sent to a third-party error tracking service over TLS. Claude Code redacts known patterns of secrets, file paths, email addresses, and other personal information before anything leaves your machine. Set `DISABLE_ERROR_REPORTING=1` to opt out. Error reporting is on only when all of these apply:
* you sign in with a Claude Pro or Max subscription
* you’re running Claude Code v2.1.198 or later
Show diff (116 lines)
--- a/errors.md
+++ b/errors.md
@@ -225,6 +225,8 @@
`Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load`| Command-line errors
``plugin eval` is currently in early access` / ``plugin eval` is currently unavailable`| Plugin errors
`Marketplace "<name>" is registered from an untrusted source`| Plugin errors
+`Claude Code refuses the marketplace name "<name>"`| Plugin errors
+`Marketplace name impersonates an official Anthropic/Claude marketplace`| Plugin errors
`Marketplace "<name>" is already added from a different source`| Plugin errors
`"<name>" is another spelling of "<reserved>", a reserved marketplace name`| Plugin errors
`references ${user_config.*} in a shell-form command`| Plugin errors
@@ -238,6 +240,8 @@
`Failed to load marketplace configuration`| Plugin errors
`Marketplace configuration file is corrupted`| Plugin errors
`Plugin "<name>@synced" is required by your organization and can't be disabled here`| Plugin errors
+`"<plugin>" was not uninstalled: it is still switched on in <file>`| Plugin errors
+`"<plugin>" was not uninstalled: <file> is there and could not be read`| Plugin errors
`would be spawned with zero tools — refusing`| Tool errors
`File is covered by a Read deny rule in your permission settings`| Tool errors
`cannot contain null bytes (\0)`| Tool errors
@@ -257,6 +261,7 @@
`Refusing to read <path>: its symlink resolution changed after permission was checked (<reason>)` / `Refusing to search <path>: its symlink resolution changed after permission was checked`| Tool errors
`Refusing to write <path>: its parent-directory symlink resolution changed after permission was checked` / `Refusing to write <path>: it is a symbolic link. Write to the link's target path instead`| Tool errors
`Refusing to write through symlink: <path>` / `Refusing to write into symlinked directory: <path>`| Tool errors
+`Refusing to write <path>: where it leads on disk could not be determined` / `Refusing to read <path>: where it leads on disk could not be determined`| Tool errors
`Refusing to search <path>: a path one of its Read deny rules is written through changed while the search was being prepared` / `Refusing to search <path>: it could not be opened`| Tool errors
`its permission check expired before it ran (too many concurrent file operations)` / `ripgrep was found only by name on PATH`| Tool errors
`task output swap refused (tasks dir moved or linked)`| Tool errors
@@ -1189,7 +1194,7 @@
Not signed in to the Cloud gateway — run /login.
-Model requests fail with this message when the session has no gateway sign-in, for example because you haven’t run `/login` since the policy reached the machine. If you also have an `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` credential configured and the managed settings set `forceLoginMethod`, Claude Code exits at startup instead with a message that begins:
+Model requests fail with this message when the session has no gateway sign-in, for example because you haven’t run `/login` since the policy reached the machine. If the machine also holds an Anthropic-issued credential and the managed settings set `forceLoginMethod` or `forceLoginOrgUUID`, Claude Code exits at startup instead. That credential can be an `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` variable, an `apiKeyHelper` setting, or an API key saved by an earlier Claude Console login. The message begins:
Administrator policy requires a Cloud gateway sign-in on this machine; the
Anthropic-issued credential configured here (ANTHROPIC_API_KEY,
@@ -1198,7 +1203,7 @@
**What to do:**
* Run `/login` and complete the sign-in on the **Cloud gateway** screen
- * For the startup message, remove the `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` setting you configured, then start `claude` and run `/login`
+ * For the startup message, remove the `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` setting you configured. To remove a saved Console API key, run `claude auth logout`, which also removes a saved claude.ai login. If you select a cloud provider with `CLAUDE_CODE_USE_*`, the session then starts with no sign-in. Otherwise start `claude` and run `/login`
* If you believe the machine shouldn’t require the gateway, ask the administrator who manages it to remove `forceLoginMethod` and `forceLoginGatewayUrl` from its managed settings
On v2.1.265, a regression also showed the first message in some LLM-gateway and proxy configurations that authenticate with an API key, `apiKeyHelper`, or custom headers, even with no administrator requirement on the machine. Update to v2.1.266 or later. You don’t need to change your configuration. Before v2.1.261, on machines that set `forceLoginMethod` to `"gateway"`, Claude Code used a leftover saved login instead of failing model requests, and reported a configured environment credential with `This machine's managed settings require a first-party login` instead of the startup message. Before v2.1.265, a machine whose managed settings set only `forceLoginGatewayUrl` didn’t require the gateway sign-in, and Claude Code used a leftover credential there.
@@ -3210,6 +3215,22 @@
+Claude Code refuses the marketplace name
+
+A registered marketplace’s name [impersonates an official Anthropic marketplace](</docs/en/plugins/marketplace-reference#reserved-names>) under the rules that section lists. If a marketplace was registered under such a name before the check blocked it, the marketplace and the plugins installed from it stop loading, because Claude Code checks the name every time it reads the marketplace’s catalog. When the name imitates an official one, `claude plugin list` and the `/plugin` **Errors** tab report each affected plugin with a message that begins:
+
+ Claude Code refuses the marketplace name "anthropic-plugins-v2"
+
+For an imitating name, the marketplace’s own error reads `Claude Code refuses this marketplace's name: it looks like one of Anthropic's own` instead. `claude plugin marketplace add` refuses any impersonating name with `Marketplace name impersonates an official Anthropic/Claude marketplace`. Before v2.1.282, `claude plugin list` and `/plugin` reported the plugins of an imitating name as failed to load too, without naming the marketplace’s name as the cause. **What to do:**
+
+ * Run `claude plugin marketplace remove <name>`. This also uninstalls the plugins installed from the marketplace and deletes their saved data
+ * To keep the marketplace instead, wait until its maintainer renames it, then run `claude plugin marketplace update <name>`
+ * If you publish the marketplace, rename it in your `marketplace.json`; users then update the marketplace instead of removing it
+
+###
+
+
+
Marketplace is already added from a different source
You confirmed adding a marketplace through [`/plugin install <plugin> --marketplace <source>`](</docs/en/plugins/install#add-a-marketplace-and-install-in-one-command>), and the catalog Claude Code fetched from that source names itself the same as a marketplace you already added from a different source. Claude Code keeps the existing marketplace instead of replacing it, and the plugin isn’t installed.
@@ -3379,6 +3400,27 @@
Claude Code saves nothing and the plugin stays enabled. When you try to disable a plugin that a required plugin depends on, Claude Code refuses the same way, with a message naming the required plugin that needs it. **What to do:**
* Ask an admin of your claude.ai organization to change the plugin’s required status on claude.ai
+
+###
+
+
+
+Plugin was not uninstalled
+
+You ran [`claude plugin uninstall`](</docs/en/plugins/cli-reference#plugin-uninstall>), or chose **Uninstall** in the `/plugin` **Installed** tab, and the uninstall stopped with a message starting `"<plugin>" was not uninstalled:`. When Claude Code removed the plugin’s entry from `enabledPlugins` and read that scope’s settings files back, either the plugin was still switched on there, or a file that could switch it on couldn’t be read or checked. Deleting the plugin’s saved options, secrets, and data while a settings entry could switch it back on would lose them, so the uninstall stops instead: the plugin stays installed and nothing it saved is deleted.
+
+ ✘ Failed to uninstall plugin "formatter": "formatter" was not uninstalled: it is still switched on in /home/user/project/.claude/settings.local.json, although the settings change reported no error. It is still installed. Take it out of "enabledPlugins" in that file yourself, then uninstall it again.
+
+The middle of the message names the file and the cause:
+
+ * `it is still switched on in <file>, although the settings change reported no error`: the settings write reported success but the entry is still there when the file is read back
+ * `it is still switched on in <file>, and the settings change failed (<error>)`: the file couldn’t be saved, for the reason in parentheses
+ * `<file> is there and could not be read`: the file exists but couldn’t be read as settings, for example because it isn’t valid JSON, so it may still enable the plugin
+ * `<file> (not read: it is on a network path or is a link to one, or could not be checked)`: Claude Code didn’t read the project or local settings file because the file, or the `.claude` folder that holds it, is a link that leads to a network location, or because it couldn’t examine that path
+
+`claude plugin uninstall` exits 1, and with `--json` the result carries `failureCode: "settings_still_on"`. `/plugin` shows the same message. **What to do:**
+
+ * Follow the last sentence of the message: repair or replace the settings file it names, or remove the plugin’s entry from `enabledPlugins` in that file yourself, then run the uninstall again
##
@@ -3607,7 +3649,8 @@
* `its symlink resolution changed after permission was checked`: a symlink along the path, or at a Grep or Glob search root, was replaced between the permission check and the operation. In a read refusal, the parenthesized phrase names which comparison failed.
* `its parent-directory symlink resolution changed after permission was checked`: a directory the write path passes through no longer resolves to the approved location
- * `it is a symbolic link. Write to the link's target path instead`: a symbolic link sits at the approved write location itself, for example a `CLAUDE.md` that is a symlink to `AGENTS.md`; the message directs Claude to the link’s target
+ * `where it leads on disk could not be determined (a link on the way could not be examined, or the links do not resolve)`: Claude Code couldn’t follow the path to a final location on disk, for example because symlinks on it form a loop
+ * `it is a symbolic link. Write to the link's target path instead`: a symbolic link sits at the requested write location itself, for example a `CLAUDE.md` that is a symlink to `AGENTS.md`; the message directs Claude to the link’s target
* `Refusing to write through symlink: <path>. Resolve the symlink and pass the real target path explicitly.`: the same condition caught when another writer opens the file, such as a write to a symlinked `.mcp.json`
* `Refusing to write into symlinked directory: <path>`: the directory that holds the file is itself a symbolic link, for example a project’s `.claude/` directory linked to another location
* `a path one of its Read deny rules is written through changed while the search was being prepared. Retry.`: a `Read` deny rule for the search names a path that passes through a symlink, and that link changed while Claude Code was preparing the search
@@ -3623,7 +3666,7 @@
* If a read refusal appears on macOS for a file that nothing is rewriting, such as a screenshot dragged into the prompt, upgrade to v2.1.273 or later
* For the ripgrep refusal, install ripgrep with your package manager so `rg` resolves to an absolute path on `PATH`, or keep searches under the working directory
-Before v2.1.251, Claude Code re-checked a path’s resolution only for file writes, so a link replaced after the permission check could redirect a read or search to a different location without a message. Of these, only the parent-directory, through-symlink, and symlinked-directory write refusals appear on earlier versions.
+Before v2.1.251, Claude Code re-checked a path’s resolution only for file writes, so a link replaced after the permission check could redirect a read or search to a different location without a message. Of these, only the parent-directory, through-symlink, and symlinked-directory write refusals appear on earlier versions. Before v2.1.280, the `where it leads on disk could not be determined` refusal didn’t appear.
###
--- a/examples.md
+++ b/examples.md
@@ -1,4 +1,4 @@
-This page routes you to complete, runnable Agent SDK projects and guided Claude Cookbook recipes. TypeScript applications live in the [`claude-agent-sdk-demos`](<https://github.com/anthropics/claude-agent-sdk-demos>) repo, and Python recipes live in the [Claude Cookbook](<https://platform.claude.com/cookbook>).
+This page routes you to complete, runnable Agent SDK projects and guided Claude Cookbook recipes. The applications live in the [`claude-agent-sdk-demos`](<https://github.com/anthropics/claude-agent-sdk-demos>) repo, and Python recipes live in the [Claude Cookbook](<https://platform.claude.com/cookbook>).
##
@@ -15,9 +15,9 @@
-Explore a TypeScript application
+Explore a demo application
-The TypeScript applications in [`claude-agent-sdk-demos`](<https://github.com/anthropics/claude-agent-sdk-demos>) are demos for local development, from an email client to a multi-agent research system. Clone the demo whose shape matches what you’re building.
+The applications in [`claude-agent-sdk-demos`](<https://github.com/anthropics/claude-agent-sdk-demos>) are demos for local development, from an email client to a multi-agent research system. Clone the demo whose shape matches what you’re building.
##
--- a/file-checkpointing.md
+++ b/file-checkpointing.md
@@ -227,7 +227,7 @@
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. 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:
+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>). 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>
--- a/glossary.md
+++ b/glossary.md
@@ -435,6 +435,31 @@
Surface
Any place you access Claude Code: the CLI, VS Code, JetBrains, Desktop, or claude.ai. All surfaces share the same engine. Sessions on your machine read your local CLAUDE.md, settings, and skills; [cloud sessions](</docs/en/cloud-environments#what-carries-over-from-your-setup>) start from a fresh clone of your repository and don’t read `~/.claude/` on your machine. Slack and the Chrome extension are integrations that connect to a surface rather than surfaces themselves. Learn more: [Platforms and integrations](</docs/en/platforms>)
+
+###
+
+
+
+System prompt
+
+The instructions Claude Code sends ahead of your conversation on every request, covering how Claude uses tools, behaves safely, and formats its responses. You can add to the system prompt with `--append-system-prompt` or replace it with `--system-prompt`. The system prompt is the first layer of the [prompt cache](</docs/en/prompt-caching#how-the-cache-is-organized>). Your CLAUDE.md files and the instructions of your output style aren’t part of the system prompt. Claude Code delivers them in the conversation as system reminders. Learn more: [System prompt flags](</docs/en/cli-reference#system-prompt-flags>)
+
+###
+
+
+
+System reminder
+
+A message that Claude Code, as the harness, adds to the conversation to give Claude context. You don’t send system reminders yourself. Claude Code inserts them as a session runs, for example when the session starts, when a hook returns text, or when a file changes on disk. Claude reads them alongside your messages. The following all reach Claude as system reminders:
+
+ * Your CLAUDE.md files
+ * The instructions of your output style
+ * Text a hook returns as `additionalContext`
+ * The list of available skills
+ * A note that a file Claude read earlier has changed on disk
+ * The commit and pull request attribution lines
+
+In a logged API request, a system reminder appears wrapped in `<system-reminder>` tags inside a user message, or on some models as a separate message with the `system` role. Learn more: [Context Claude Code adds outside the system prompt](</docs/en/agent-sdk/modifying-system-prompts#context-claude-code-adds-outside-the-system-prompt>)
##
--- a/hooks-guide.md
+++ b/hooks-guide.md
@@ -470,7 +470,7 @@
Each hook has a `type` that determines how it runs. Most hooks use `"type": "command"`, which runs a shell command. Four other types are available:
* `"type": "http"`: POST event data to a URL. See HTTP hooks.
- * `"type": "mcp_tool"`: call a tool on an already-connected MCP server. See [MCP tool hooks](</docs/en/hooks#mcp-tool-hook-fields>).
+ * `"type": "mcp_tool"`: call a tool on a configured MCP server. See [MCP tool hooks](</docs/en/hooks#mcp-tool-hook-fields>).
* `"type": "prompt"`: single-turn LLM evaluation. See Prompt-based hooks.
* `"type": "agent"`: multi-turn verification with tool access. Agent hooks are experimental and may change. See Agent-based hooks.
@@ -877,7 +877,7 @@
Keep these constraints in mind when designing hooks:
- * Command hooks communicate through stdout, stderr, and exit codes only. They can’t trigger `/` commands or tool calls. Text returned via `additionalContext` is injected as a system reminder that Claude reads as plain text. HTTP hooks communicate through the response body instead.
+ * Command hooks communicate through stdout, stderr, and exit codes only. They can’t trigger `/` commands or tool calls. Text returned via `additionalContext` is injected as a [system reminder](</docs/en/glossary#system-reminder>) that Claude reads as plain text. HTTP hooks communicate through the response body instead.
* Hook timeouts vary by type. Override per hook with the `timeout` field in seconds.
* `command`, `http`, `mcp_tool`: 10 minutes. Claude Code lowers this default to 30 seconds for `UserPromptSubmit`, `PreModelSwitch`, and `PostModelSwitch` hooks, and to 10 seconds for `MessageDisplay`.
* `prompt`: 30 seconds.
--- a/hosting.md
+++ b/hosting.md
@@ -293,7 +293,7 @@
* Pass `settingSources: []` in TypeScript or `setting_sources=[]` in Python to skip user, project, and local settings.
* Set `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1` in `env`. [Auto memory](</docs/en/memory#auto-memory>) at `~/.claude/projects/<project>/memory/` loads into the system prompt regardless of `settingSources`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for the other inputs that load unconditionally.
- * Point `CLAUDE_CONFIG_DIR` at a per-tenant directory so tenants do not share the `~/.claude.json` global config. When each config directory serves one working directory and you don’t share a [`SessionStore`](</docs/en/agent-sdk/session-storage>) across tenants, you can also set [`CLAUDE_CODE_PROJECT_DIR_NAME`](</docs/en/sessions#name-the-project-directory-yourself>) in `env` to keep the transcript paths under it short. Requires TypeScript Agent SDK v0.3.234 or later, or Python Agent SDK v0.2.140 or later.
+ * Point `CLAUDE_CONFIG_DIR` at a per-tenant directory so tenants do not share the `~/.claude.json` global config. When each config directory serves one working directory and you don’t pass a [`SessionStore`](</docs/en/agent-sdk/session-storage>), you can also set [`CLAUDE_CODE_PROJECT_DIR_NAME`](</docs/en/sessions#name-the-project-directory-yourself>) in `env` to keep the transcript paths under it short. Requires TypeScript Agent SDK v0.3.234 or later, or Python Agent SDK v0.2.140 or later.
* Use a per-tenant working directory. Pass `cwd` explicitly on every `query()` call.
* Apply per-tenant egress rules at your proxy, such as distinct outbound IPs, credentials, or domain allowlists, so a compromised tenant cannot exfiltrate data via another tenant’s outbound policy.
--- a/how-claude-code-works.md
+++ b/how-claude-code-works.md
@@ -126,6 +126,21 @@
+Context Claude Code adds on its own
+
+If Claude follows a rule you didn’t write, such as adding a `Co-Authored-By` trailer to a commit, the rule may have come from a [system reminder](</docs/en/glossary#system-reminder>). As you work, Claude Code adds its own context to the conversation alongside your messages:
+
+ * Your CLAUDE.md files
+ * The instructions of your [output style](</docs/en/output-styles>)
+ * A note when a file Claude read earlier changes on disk
+ * The commit and pull request attribution lines
+
+To change or remove the attribution lines, set [`attribution`](</docs/en/settings-reference#attribution>). To remove Claude Code’s built-in commit and pull request instructions, set [`includeGitInstructions`](</docs/en/settings-reference#includegitinstructions>) to `false`. For the other switches, see [Turn off the context your agent replaces](</docs/en/agent-sdk/modifying-system-prompts#turn-off-the-context-your-agent-replaces>).
+
+####
+
+
+
When context fills up
Claude Code manages context automatically as you approach the limit. It clears older tool outputs first, then summarizes the conversation if needed. Your requests and key code snippets are preserved; detailed instructions from early in the conversation may be lost. Put persistent rules in CLAUDE.md rather than relying on conversation history. To control what’s preserved during compaction, add a “Compact Instructions” section to CLAUDE.md or run `/compact` with a focus (like `/compact focus on the API changes`). If a single file or tool output is so large that context refills immediately after each summary, Claude Code stops auto-compacting after a few attempts and shows an error instead of looping. See [Auto-compaction stops with a thrashing error](</docs/en/troubleshooting#auto-compaction-stops-with-a-thrashing-error>) for recovery steps. Run `/context` to see what’s using space. MCP tool definitions are deferred by default and loaded on demand via [tool search](</docs/en/mcp#scale-with-mcp-tool-search>), so only tool names and server instructions consume context until Claude uses a specific tool.
--- 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 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>).
+While a [gateway credential variable](</docs/en/llm-gateway-connect#set-the-credential-variable>) or `apiKeyHelper` is active, requests carry that credential in place of a developer’s claude.ai subscription login, and the subscription’s usage limits don’t apply to them. Claude Code keeps a saved claude.ai login on the machine but doesn’t send it with those requests. 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>).
##
--- a/llm-gateway-connect.md
+++ b/llm-gateway-connect.md
@@ -522,7 +522,7 @@
`/fast` reports `Fast mode has been disabled by your organization` in a session authenticated with `ANTHROPIC_AUTH_TOKEN`, even though the organization has fast mode enabled| The availability check requires a claude.ai login or an Anthropic API key; with only a bearer token, Claude Code treats fast mode as disabled without sending the check| Set `CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK=1`; see [use fast mode behind proxies and LLM gateways](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>)
Claude Code asks you to log in even though the curl test succeeds| The CLI has no credential of its own: a reachable base URL isn’t one, and in an interactive session an `env` block in a project’s `.claude/settings.json` or `.claude/settings.local.json` applies only after the first-run wizard and [trust prompt](</docs/en/permissions#what-runs-before-you-trust-a-folder>)| Set `ANTHROPIC_AUTH_TOKEN` somewhere Claude Code reads before first-run setup: a shell export, the `env` block in `~/.claude/settings.json`, or managed settings
`ANTHROPIC_API_KEY` is set but ignored, with no prompt| The key needs a one-time approval in interactive sessions, and a previously declined key is ignored without asking again| Enable it under `/config` with the `Use custom API key` option
-`This machine's managed settings require a first-party login`| Managed settings include `forceLoginMethod` or `forceLoginOrgUUID`, which cannot coexist with `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper`| Your administrator must remove `forceLoginMethod` and `forceLoginOrgUUID` from managed settings to use gateway credentials, or remove the gateway credential to use first-party login. The two cannot be combined
+`This machine's managed settings require a first-party login`, or [`Administrator policy requires a Cloud gateway sign-in`](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) when managed settings set `forceLoginMethod` to `"gateway"` or also set `forceLoginGatewayUrl`| Managed settings include `forceLoginMethod` or `forceLoginOrgUUID`, which cannot coexist with `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper`| Your administrator must remove `forceLoginMethod`, `forceLoginOrgUUID`, and `forceLoginGatewayUrl` from managed settings to use gateway credentials, or remove the gateway credential and use the sign-in the managed settings require. The two cannot be combined
`403` with an HTML body such as `403 Forbidden`, when the gateway’s own logs show no request received| A web application firewall or reverse proxy in front of the gateway blocked the request body before it reached the gateway. Claude Code prompts include XML-style tags and source code that match cross-site-scripting body rules, so a short curl test passes while a real session doesn’t| Exempt the gateway’s `/v1/messages` path from request-body inspection. On AWS WAF this is the `CrossSiteScripting_Body` managed rule; on nginx with ModSecurity it is the equivalent OWASP CRS body rules
Certificate or TLS errors such as `SSL certificate verification failed` or `Self-signed certificate detected`, when the curl test succeeds| Claude Code’s runtime isn’t trusting the same certificate authority that `curl` uses. Common behind corporate TLS-inspection proxies| Set `NODE_EXTRA_CA_CERTS` to the CA bundle path; see [CA certificate store](</docs/en/network-config#ca-certificate-store>)
--- a/llm-gateway-rollout.md
+++ b/llm-gateway-rollout.md
@@ -184,7 +184,7 @@
"apiKeyHelper": "/usr/local/bin/get-gateway-key"
}
-Add the conditional variables from the table to the same `env` block. A managed `ANTHROPIC_BASE_URL` is enforced and cannot be overridden by a developer’s shell export, since Claude Code applies it over the process environment and lower-precedence settings. Don’t include `forceLoginMethod` or `forceLoginOrgUUID` in managed settings alongside a gateway credential. Either key, with any value, blocks `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, and `apiKeyHelper` at startup, and developers can’t proceed. They see `This machine's managed settings require a first-party login`, or [`Administrator policy requires a Cloud gateway sign-in`](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) under a `"gateway"` value. [Server-managed settings](</docs/en/server-managed-settings#platform-availability>) delivery requires a direct connection to `api.anthropic.com`, so it does not reach gateway-routed sessions. Gateway deployments use this file-based managed settings path, which enforces the same keys. For the credential, distribute one [`apiKeyHelper`](</docs/en/llm-gateway-connect#rotate-credentials-with-apikeyhelper>) command in the managed settings file as shown above; the command authenticates to your secrets store as the local developer, so each machine receives its own key. Alternatively, deliver each developer their key through your existing secrets process and have them set `ANTHROPIC_AUTH_TOKEN` themselves. Some environments need separate delivery:
+Add the conditional variables from the table to the same `env` block. A managed `ANTHROPIC_BASE_URL` is enforced and cannot be overridden by a developer’s shell export, since Claude Code applies it over the process environment and lower-precedence settings. Don’t include `forceLoginMethod`, `forceLoginOrgUUID`, or `forceLoginGatewayUrl` in managed settings alongside a gateway credential. `forceLoginMethod` or `forceLoginOrgUUID`, with any value, blocks `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, and `apiKeyHelper` at startup, and developers can’t proceed. They see `This machine's managed settings require a first-party login`, or [`Administrator policy requires a Cloud gateway sign-in`](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) when the file sets `forceLoginMethod` to `"gateway"` or sets `forceLoginGatewayUrl`. [Server-managed settings](</docs/en/server-managed-settings#platform-availability>) delivery requires a direct connection to `api.anthropic.com`, so it does not reach gateway-routed sessions. Gateway deployments use this file-based managed settings path, which enforces the same keys. For the credential, distribute one [`apiKeyHelper`](</docs/en/llm-gateway-connect#rotate-credentials-with-apikeyhelper>) command in the managed settings file as shown above; the command authenticates to your secrets store as the local developer, so each machine receives its own key. Alternatively, deliver each developer their key through your existing secrets process and have them set `ANTHROPIC_AUTH_TOKEN` themselves. Some environments need separate delivery:
* The desktop app reads gateway routing from its third-party inference configuration, not from managed settings; deploy that file through MDM alongside managed settings so desktop sessions route through the gateway too. See the [desktop third-party configuration docs](<https://claude.com/docs/third-party/claude-desktop/configuration>) and the [desktop gateway docs](<https://claude.com/docs/third-party/claude-desktop/gateway>)
* CI runners need `ANTHROPIC_BASE_URL` and the credential set in the [runner’s environment](</docs/en/llm-gateway-connect#configure-each-surface>)
--- a/loading.md
+++ b/loading.md
@@ -174,7 +174,7 @@
Path| What it holds
---|---
`cache/<marketplace>/<plugin>/<version>/`| One directory per installed version of a marketplace plugin. `<plugin>` is the marketplace entry name and `<version>` is the resolved version. `${CLAUDE_PLUGIN_ROOT}` points at this directory
-`data/<plugin-id>/`| The plugin’s persistent directory, exposed as `${CLAUDE_PLUGIN_DATA}`. For how `<plugin-id>` is formed, see [Path variables and persistent data](</docs/en/plugins/components#path-variables-and-persistent-data>). Claude Code creates it when a plugin component first uses it and keeps it across updates. Claude Code deletes it when you uninstall the plugin from its last scope, unless you pass `--keep-data`
+`data/<plugin-id>/`| The plugin’s persistent directory, exposed as `${CLAUDE_PLUGIN_DATA}`. For how `<plugin-id>` is formed, see [Path variables and persistent data](</docs/en/plugins/components#path-variables-and-persistent-data>). Claude Code creates it when a plugin component first uses it and keeps it across updates. By default, Claude Code deletes it when you uninstall the plugin from its last scope. For `--keep-data` and the other cases where it stays, see [plugin uninstall](</docs/en/plugins/cli-reference#plugin-uninstall>)
`marketplaces/<name>/`| The clone or download of a marketplace added from GitHub, another Git host, or a URL. A marketplace added from a local `file` or `directory` source has no copy here, and its `installLocation` in `known_marketplaces.json` is the path you gave
`synced/`| The plugins Claude Code synced from your claude.ai account
`.trash/`| Plugins that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing
--- a/managed-settings.md
+++ b/managed-settings.md
@@ -282,7 +282,7 @@
Find entries Claude Code dropped
-When a managed settings file, MDM profile, registry value, or server-managed payload fails schema validation, Claude Code first skips the individual entries it can repair, such as one invalid permission rule, with a warning for each, then drops any top-level key whose value still fails and keeps enforcing every remaining valid key. Claude Code is stricter with the `managedSettings` a [`policyHelper`](</docs/en/settings-reference#policyhelper>) emits: it makes the same entry repairs, but any schema violation that survives fails the whole helper run, and at startup Claude Code refuses to start, the same as for a helper that exits non-zero. When a managed settings file, drop-in file, MDM plist, or HKLM registry value is present but can’t be parsed as a JSON object, Claude Code refuses to start and prints [an error naming the source](</docs/en/errors#managed-settings-document-could-not-be-parsed>), even when another admin source delivers a valid policy. Each source fails this way when:
+If your managed settings file, MDM profile, registry value, or server-managed payload fails schema validation, Claude Code first skips each individual entry it can repair, such as one invalid permission rule, and warns about each one. Claude Code then drops any value that still fails, unless the value belongs to one of the keys that fail closed instead. Claude Code is stricter with the `managedSettings` a [`policyHelper`](</docs/en/settings-reference#policyhelper>) emits: it makes the same entry repairs, but any schema violation that survives fails the whole helper run, and at startup Claude Code refuses to start, the same as for a helper that exits non-zero. When a managed settings file, drop-in file, MDM plist, or HKLM registry value is present but can’t be parsed as a JSON object, Claude Code refuses to start and prints [an error naming the source](</docs/en/errors#managed-settings-document-could-not-be-parsed>), even when another admin source delivers a valid policy. Each source fails this way when:
* **Managed settings file or drop-in file** : the file isn’t valid JSON, or its top level isn’t an object
* **MDM plist** : macOS’s `plutil` reports the plist malformed, or its converted content isn’t a JSON object
@@ -329,9 +329,25 @@
`deniedMcpServers`| An individual invalid entry is stripped and the valid subset is enforced. A wholly invalid value is dropped with a warning, since denying every server would block servers the policy never named.
[`deniedModels`](</docs/en/settings-reference#deniedmodels>)| A non-string entry is stripped and the rest of the list is enforced. A wholly invalid value is dropped with a warning and blocks no models until it is fixed.
`blockedMarketplaces`| An individual invalid entry is stripped and the valid subset is enforced. An entry that parses but can never match, such as a `hostPattern` regex that doesn’t compile, is kept with a warning. It blocks nothing until fixed, but [marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>) stay active. A wholly invalid value is dropped with a warning, since blocking every marketplace would block sources the policy never named.
+`sandbox`| When one value inside the block is invalid, Claude Code doesn’t drop the whole block. For what happens to each kind of invalid field, see Invalid values inside `sandbox`.
`sandbox.credentials`| A recoverable invalid entry is degraded to `mode: "deny"` with a warning; an unrecoverable one is stripped; valid entries stay enforced. See [invalid credential entries](</docs/en/settings-reference#invalid-credential-entries-in-managed-settings>)
`allowedHttpHookUrls` and `httpHookAllowedEnvVars` merge across settings files, so entries in your user, project, or local settings still apply while the managed list is empty. The fallbacks for those two keys and for `allowedChannelPlugins` require Claude Code v2.1.267 or later; earlier versions drop the whole key when its value or any entry is invalid. The `strictKnownMarketplaces`, `blockedMarketplaces`, and `disableSideloadFlags` fallbacks require Claude Code v2.1.277 or later; earlier versions drop the whole key when its value or any entry is invalid. `requiredMinimumVersion` and `requiredMaximumVersion` fail open by design: an invalid value is dropped rather than enforced. This tolerance applies only to managed settings. User, project, and local settings files remain strict: a file whose JSON or top-level shape fails validation is rejected as a whole and reported, and an individual entry that fails, such as a malformed permission rule, is skipped with a warning while the rest of the file applies.
+
+####
+
+
+
+Invalid values inside `sandbox`
+
+When one value in your managed `sandbox` block is invalid, Claude Code doesn’t drop the whole block, because it validates each field on its own. This per-field handling requires Claude Code v2.1.283 or later. On versions before v2.1.283, Claude Code drops every `sandbox` field except [`credentials`](</docs/en/settings-reference#invalid-credential-entries-in-managed-settings>) when a value outside `credentials` is invalid. The warning you get for an invalid field names the field and tells you what happens to it. What happens depends on what the field controls:
+
+ * If you set a Boolean key to a quoted `"true"` or `"false"`, the value counts as that Boolean. Instead of a warning, `/status` shows a notice asking you to remove the quotes.
+ * If `failIfUnavailable` is invalid, Claude Code drops the value rather than treating it as `true`, so an unreadable value never stops sessions from starting across your fleet.
+ * Claude Code treats every other invalid Boolean as the value that keeps the sandbox strictest until you fix it. A key that turns the sandbox or one of its restrictions on, such as `enabled` or `network.allowManagedDomainsOnly`, counts as `true`. A key that loosens it, such as `allowUnsandboxedCommands`, counts as `false`.
+ * In a list outside `credentials`, such as `excludedCommands` or `network.allowedDomains`, Claude Code drops an invalid entry and keeps the rest of the list. A list that isn’t an array, or that has no valid entry, doesn’t apply at all.
+ * While `network.deniedDomains` or any entry in it is invalid, Claude Code also withholds `network.allowedDomains`, so the managed allowlist grants nothing until you fix the deny list.
+ * While `filesystem.denyRead`, `filesystem.denyWrite`, or any entry in either is invalid, Claude Code also withholds both `filesystem.allowRead` and `filesystem.allowWrite` until you fix the deny list.
##
--- a/manifest-reference.md
+++ b/manifest-reference.md
@@ -99,6 +99,11 @@
* **`Validation passed`** : the manifest loads
* **`Validation passed with warnings`** : the manifest loads, but the validator found something to fix, such as an unknown top-level field that Claude Code strips, a `name` that isn’t kebab-case, or a missing `version`, `description`, or `author`. Pass `--strict` to turn warnings into failures in CI
* **`Validation failed`** : the manifest has a type mismatch, a path that is missing or escapes the plugin root, or an unknown key inside a `userConfig` option, `channels` entry, `lspServers` config, or `monitors` entry. Claude Code reports the same problem when it loads the plugin
+
+The command also checks each MCP server entry the plugin declares in `.mcp.json`, in a `.json` file that `mcpServers` names, or inline in `plugin.json`. These MCP checks require Claude Code v2.1.281 or later and include:
+
+ * **Errors** : an entry Claude Code would drop when it loads the plugin, a `${user_config.KEY}` reference to an option the manifest doesn’t declare, and a remote `url` that isn’t a valid absolute URL
+ * **Warnings** : an `http://` or `ws://` URL to a non-loopback host, and a header value that looks like a literal credential
##
@@ -541,7 +546,7 @@
`${CLAUDE_PLUGIN_DATA}`| `~/.claude/plugins/data/<id>/`, created on first reference and kept across plugin updates. `<id>` is the plugin identifier with every character other than a letter, digit, `_`, or `-` replaced by `-`| Installed dependencies such as `node_modules`, generated code, and caches
`${CLAUDE_PROJECT_DIR}`| The project root| Project-local scripts and config files
-`${CLAUDE_PLUGIN_ROOT}` changes when the plugin updates, so don’t write state there. For where the root moves and when the old directory is cleaned up, see the [loading page](</docs/en/plugins/loading>). When you uninstall the plugin from the last place it’s installed, the `${CLAUDE_PLUGIN_DATA}` directory is deleted unless you pass [`--keep-data`](</docs/en/plugins/cli-reference>).
+`${CLAUDE_PLUGIN_ROOT}` changes when the plugin updates, so don’t write state there. For where the root moves and when the old directory is cleaned up, see the [loading page](</docs/en/plugins/loading>). By default, Claude Code deletes the `${CLAUDE_PLUGIN_DATA}` directory when you uninstall the plugin from the last place it’s installed. For `--keep-data` and the other cases where it stays, see [plugin uninstall](</docs/en/plugins/cli-reference#plugin-uninstall>).
###
@@ -573,7 +578,7 @@
* **Hook commands** : use [exec form](</docs/en/hooks#exec-form-and-shell-form>) with `args` so each path is one argument with no quoting
* **Shell-form hooks and monitor commands** : wrap the variable in double quotes so a path with spaces stays one word
-This shell-form hook runs a script bundled with the plugin:
+If you leave one of these variables outside quotes in a shell-form command in a hooks file, `claude plugin validate` warns about it unless the hook sets [`shell`](</docs/en/hooks#command-hook-fields>) to `"powershell"`. This shell-form hook runs a script bundled with the plugin:
{
"hooks": {
--- a/marketplace-reference.md
+++ b/marketplace-reference.md
@@ -31,11 +31,13 @@
* **Official marketplace names** : `claude-code-marketplace`, `claude-code-plugins`, `claude-plugins-official`, `anthropic-marketplace`, `anthropic-plugins`, `agent-skills`, `anthropic-agent-skills`, `life-sciences`, `knowledge-work-plugins`, `claude-for-legal`, `claude-for-financial-services`, `financial-services-plugins`, `first-party-plugins`, and `claude-tag-plugins`. Reserved unless the marketplace comes from a `github` or `git` marketplace source under `github.com/anthropics/`.
* **Community marketplace names** : `claude-community`, `claude-plugins-community`, and `healthcare`. Reserved under the same rule as the official names.
* **Plugin directory names** : `anthropic-plugin-directory` and `claude-plugin-directory`. Reserved under the same rule as the official names.
- * **Names that impersonate an official marketplace** : names such as `official-claude-plugins` or `claude-plugins-v2`, and any name containing a non-ASCII character. The error is `Marketplace name impersonates an official Anthropic/Claude marketplace`. A control or bidirectional-formatting character in a name also reports `Marketplace name cannot contain control or bidirectional-formatting characters`.
+ * **Names that impersonate an official marketplace** : names such as `official-claude-plugins` or `claude-plugins-v2`, and any name containing a non-ASCII character. The error is `Marketplace name impersonates an official Anthropic/Claude marketplace`. A control or bidirectional-formatting character in a name also reports `Marketplace name cannot contain control or bidirectional-formatting characters`. A marketplace already registered under such a name stops loading, along with its plugins.
* **Another spelling of a reserved name** : a name that differs from a reserved name only by a trailing dot, or by a symbol other than an underscore in place of a hyphen, so `claude.code.plugins` counts as `claude-code-plugins`. `claude plugin validate` accepts such a name; adding the marketplace fails with [`is another spelling of "<reserved>", a reserved marketplace name`](</docs/en/errors#marketplace-name-is-another-spelling-of-a-reserved-name>), and a marketplace already registered under one stops loading. This check requires Claude Code v2.1.280 or later.
* **Names Claude Code uses for plugins that don’t come from a marketplace** : `inline` for plugins loaded with [`--plugin-dir`](</docs/en/cli-reference>), `builtin` for built-in plugins, `skills-dir` for plugins auto-loaded from [`.claude/skills/`](</docs/en/skills>), and `synced` for plugins synced from your claude.ai account. `claude-plugin-test` is also reserved. `skills-dir` also appears as `{"source": "skills-dir"}` in `strictKnownMarketplaces` and `blockedMarketplaces`, described under Source values valid only in policy lists.
* **`npm`, `pip`, `uv`, `cargo`, `github`, and `gh`**: reserved in any casing. This check requires Claude Code v2.1.275 or later.
* **Names starting with`claudeai-`**: reserved for marketplaces hosted on claude.ai. `claude plugin marketplace add` refuses any other marketplace that uses one with `Cannot add marketplace "<name>": names starting with "claudeai-" are reserved for marketplaces hosted on claude.ai`.
+
+When a registered marketplace stops loading because its name imitates an official one, `claude plugin list` and `/plugin` report `Claude Code refuses the marketplace name "<name>"`. The message tells you to remove the marketplace. Removing it also uninstalls its plugins and deletes their saved data. This named refusal message requires Claude Code v2.1.282 or later.
##
--- a/memory.md
+++ b/memory.md
@@ -93,7 +93,7 @@
* “Run `npm test` before committing” instead of “Test your changes”
* “API handlers live in `src/api/handlers/`” instead of “Keep files organized”
-**Consistency** : if two rules contradict each other, Claude may pick one arbitrarily. Review your CLAUDE.md files, nested CLAUDE.md files in subdirectories, and `.claude/rules/` periodically to remove outdated or conflicting instructions. In monorepos, use `claudeMdExcludes` to skip CLAUDE.md files from other teams that aren’t relevant to your work.
+**Consistency** : if two rules contradict each other, Claude may pick one arbitrarily. Review your CLAUDE.md files, nested CLAUDE.md files in subdirectories, and `.claude/rules/` periodically to remove outdated or conflicting instructions. In monorepos, use `claudeMdExcludes` to skip CLAUDE.md files from other teams that aren’t relevant to your work. To have Claude check these files for outdated or conflicting instructions, run `/doctor prompt-audit` in a session. Claude reads your CLAUDE.md, CLAUDE.local.md, and AGENTS.md files, plus the rules, skills, commands, subagents, and output styles under `.claude/` and `~/.claude/`. It looks for problems such as instructions written for older models, references to files or commands that don’t exist, and files that contradict each other. You get a report of findings and a set of proposed edits, and nothing in your files changes until you ask Claude to apply them. To audit one file or directory instead, pass its path, for example `/doctor prompt-audit .claude/skills/deploy`. The audit runs through the bundled `/claude-api` skill, so it’s unavailable while that skill is turned off in [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) or with [`disableBundledSkills`](</docs/en/settings-reference#disablebundledskills>). `/doctor prompt-audit` requires Claude Code v2.1.283 or later.
###
@@ -554,6 +554,7 @@
* Check that the relevant CLAUDE.md is in a location that gets loaded for your session (see Choose where to put CLAUDE.md files).
* Make instructions more specific. “Use 2-space indentation” works better than “format code nicely.”
* Look for conflicting instructions across CLAUDE.md files. If two files give different guidance for the same behavior, Claude may pick one arbitrarily.
+ * Check whether your instruction competes with guidance Claude Code adds on its own. If your CLAUDE.md sets commit or pull request rules, turn off the built-in ones with [`includeGitInstructions`](</docs/en/settings-reference#includegitinstructions>) and set the attribution text with [`attribution`](</docs/en/settings-reference#attribution>).
If the instruction is something that must run at a specific point, such as before every commit or after each file edit, write it as a [hook](</docs/en/hooks-guide>) instead. Hooks execute as shell commands at fixed lifecycle events and apply regardless of what Claude decides to do. For instructions you want at the system prompt level, use [`--append-system-prompt`](</docs/en/cli-reference#system-prompt-flags>). You pass it at launch, so it’s better suited to scripts and automation than interactive use. For how it behaves when you resume a conversation, see [System prompt flags in resumed conversations](</docs/en/cli-reference#system-prompt-flags-in-resumed-conversations>).
Show diff (115 lines)
--- a/modifying-system-prompts.md
+++ b/modifying-system-prompts.md
@@ -393,6 +393,112 @@
Turn recording off while you iterate on wording
While you iterate on prompt wording and want each edit to reach a session you resume, set `snapshot` to false on the object form of the system prompt. Claude Code then rebuilds the prompt on every request. The field is available on the preset and custom forms of [`systemPrompt`](</docs/en/agent-sdk/typescript#options>) in TypeScript and of [`system_prompt`](</docs/en/agent-sdk/python#systempromptpreset>) in Python, and requires `@anthropic-ai/claude-agent-sdk` v0.3.257 or later, or `claude-agent-sdk` v0.2.153 or later. Keep recording on in production. With recording off, a different `append` or custom prompt on a resumed session reaches Claude on the next turn, and that request can’t reuse the session’s [prompt cache](</docs/en/prompt-caching#how-the-cache-is-organized>). Where the API enforces [preserved thinking](<https://platform.claude.com/docs/en/build-with-claude/preserved-thinking>), Claude also loses its thinking from earlier turns. Outside of [cloud sessions](</docs/en/cloud-environments>), if you start Claude Code in [bare mode](</docs/en/headless#start-faster-with-bare-mode>) by passing `--bare` through `extraArgs` or setting `CLAUDE_CODE_SIMPLE=1`, recording stays off unless you set `snapshot: true`. Recording an `append` or custom prompt by default requires Claude Code v2.1.265 or later, which the TypeScript Agent SDK bundles from v0.3.265 and the Python Agent SDK from v0.2.153. Before Claude Code v2.1.268, sessions that don’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), including sessions on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, rebuilt the prompt on every request and `snapshot` had no effect.
+
+##
+
+
+
+Context Claude Code adds outside the system prompt
+
+System reminders are messages Claude Code adds to the conversation during a session to give Claude context, such as the contents of your CLAUDE.md files or a note that a file changed on disk. Claude Code sends them in the conversation, not in the system prompt, so they reach Claude whether you use the `claude_code` preset or pass your own string as `systemPrompt`. This section covers the reminders most likely to change how your agent behaves, how to turn off the ones your agent replaces, and how to see what Claude received in a specific request.
+
+###
+
+
+
+Reminders Claude Code adds to the conversation
+
+System reminders are text Claude Code adds to the conversation alongside the prompts your code sends. The following reminders are the ones most likely to change how your agent behaves:
+
+ * **Project instructions** : the CLAUDE.md files that your `settingSources` option loads
+ * **Output style instructions** : the instructions of the active output style, in the main conversation
+ * **Commit and pull request attribution** : the `Co-Authored-By` trailer and pull request footer from the [`attribution`](</docs/en/settings-reference#attribution>) setting
+ * **Hook output** : text your [hooks](</docs/en/agent-sdk/hooks#outputs>) return as `additionalContext`
+ * **Available skills** : the names and descriptions of the [skills](</docs/en/agent-sdk/skills>) Claude can call
+ * **Available subagents** : the names and descriptions of the [subagents](</docs/en/agent-sdk/subagents>) Claude can start
+ * **Task list nudges** : in a [session that has the task-tracking tools](</docs/en/agent-sdk/todo-tracking#model-availability>), a prompt to update the task list when Claude hasn’t touched it for several turns
+ * **File-changed notes** : a note that a file Claude read earlier has changed on disk
+
+Claude Code introduces your CLAUDE.md files with a line telling Claude that the instructions override default behavior. If you pass your own string as `systemPrompt`, add a sentence to it that says what a system reminder is. The `claude_code` preset has one, and your string replaces the whole preset. Without it, nothing in your prompt tells Claude that reminders such as CLAUDE.md content and hook output come from the application rather than the user. For example:
+
+ The application adds system reminders to this conversation. Treat them as context from the application, not as messages from the user.
+
+###
+
+
+
+Turn off the context your agent replaces
+
+Turn off a piece of built-in context when your agent supplies its own version of the same guidance. For example, if your prompt tells Claude to write commit messages as `PROJ-142: fix login redirect` with no trailers, Claude Code still tells Claude to end each commit message with a `Co-Authored-By` trailer, so Claude receives two conflicting instructions for the same commit. Pass settings keys through the [`settings`](</docs/en/agent-sdk/typescript#options>) option in TypeScript or [`settings`](</docs/en/agent-sdk/python#claudeagentoptions>) in Python, and environment variables through the `env` option. In TypeScript, [`env`](</docs/en/agent-sdk/typescript#options>) replaces the inherited environment, so spread `process.env` into it.
+
+Built-in context| How to turn it off
+---|---
+The built-in commit and pull request instructions and the git status snapshot| Set [`includeGitInstructions`](</docs/en/settings-reference#includegitinstructions>) to `false`, or `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1`
+The `Co-Authored-By` trailer and the pull request footer| Set [`attribution.commit`](</docs/en/settings-reference#attribution-commit>) and [`attribution.pr`](</docs/en/settings-reference#attribution-pr>) to your own text, or to empty strings to remove them
+The user or project settings source, including its CLAUDE.md| Leave `'user'` or `'project'` out of [`settingSources`](</docs/en/agent-sdk/claude-code-features#control-filesystem-settings-with-settingsources>)
+Every CLAUDE.md file| Set `CLAUDE_CODE_DISABLE_CLAUDE_MDS=1`
+Task list nudges, file-changed notes, and the skill list| Set `CLAUDE_CODE_DISABLE_ATTACHMENTS=1`
+
+Claude Code’s built-in commit and pull request instructions aren’t a reminder. They are part of the Bash tool’s description, so they also reach Claude when you pass a custom `systemPrompt`. If you set `CLAUDE_CODE_DISABLE_ATTACHMENTS`, Claude Code also sends `@` file mentions as plain text instead of expanding them into file content. The list of available subagents and background task notifications still arrive. The following example is for an agent that carries its own commit rules in `append`. It sets both `attribution` keys to empty strings to remove the trailer and footer, and turns off `includeGitInstructions` so Claude Code’s own commit workflow instructions don’t compete with yours:
+
+TypeScript
+
+Python
+
+ import { query } from "@anthropic-ai/claude-agent-sdk";
+
+ for await (const message of query({
+ prompt: "Commit the staged changes for ticket PROJ-142",
+ options: {
+ systemPrompt: {
+ type: "preset",
+ preset: "claude_code",
+ append: "Write commit messages as: <ticket id>: <summary>. Add no trailers."
+ },
+ settings: {
+ includeGitInstructions: false,
+ attribution: { commit: "", pr: "" }
+ },
+ allowedTools: ["Bash(git *)"]
+ }
+ })) {
+ if (message.type === "result") console.log(message.subtype);
+ }
+
+ import asyncio
+ from claude_agent_sdk import query, ClaudeAgentOptions
+
+ async def main():
+ async for message in query(
+ prompt="Commit the staged changes for ticket PROJ-142",
+ options=ClaudeAgentOptions(
+ system_prompt={
+ "type": "preset",
+ "preset": "claude_code",
+ "append": "Write commit messages as: <ticket id>: <summary>. Add no trailers.",
+ },
+ settings='{"includeGitInstructions": false, "attribution": {"commit": "", "pr": ""}}',
+ allowed_tools=["Bash(git *)"],
+ ),
+ ):
+ print(message)
+
+ asyncio.run(main())
+
+To confirm the change, run the example in a repository with staged changes and check the new commit with `git log -1`. The message ends without a `Co-Authored-By` trailer.
+
+###
+
+
+
+See what Claude received
+
+The SDK message stream doesn’t include system reminders, so reading the messages your code receives won’t show you what Claude saw. To see them, log the requests Claude Code sends:
+
+ * **Raw request logging** : set [`OTEL_LOG_RAW_API_BODIES`](</docs/en/monitoring-usage#api-request-body-event>) to `file:<dir>`. Claude Code writes each request body to that directory.
+ * **A gateway you control** : point [`ANTHROPIC_BASE_URL`](</docs/en/llm-gateway>) at a proxy that logs request bodies.
+
+In a logged request, look in the `messages` array. A reminder appears inside a user message wrapped in `<system-reminder>` tags or, on some models, as a separate message with the `system` role.
##
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -181,7 +181,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, `rm` and `rmdir` removals targeting a critical path, and all other Bash commands except the [built-in read-only set](</docs/en/permissions#read-only-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, and `Remove-Item` gets its own check. A positional argument that contains a quote character, such as the apostrophe in `Set-Content .\notes.txt "It's done"`, still prompts even on in-scope paths, because Claude Code can’t statically validate an argument whose quoted and unquoted readings differ. Pass the content through a named parameter such as `-Value` to avoid the prompt. Use `acceptEdits` when you want to review changes in your editor or via `git diff` after the fact rather than approving each edit inline. Press `Shift+Tab` once from Manual 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`. Each path also goes through the [symlink check](</docs/en/permissions#symlinks>), so a write that resolves outside that scope isn’t auto-approved either. Paths outside that scope, writes to protected paths, `rm` and `rmdir` removals targeting a critical path, and all other Bash commands except the [built-in read-only set](</docs/en/permissions#read-only-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, and `Remove-Item` gets its own check. A positional argument that contains a quote character, such as the apostrophe in `Set-Content .\notes.txt "It's done"`, still prompts even on in-scope paths, because Claude Code can’t statically validate an argument whose quoted and unquoted readings differ. Pass the content through a named parameter such as `-Value` to avoid the prompt. Use `acceptEdits` when you want to review changes in your editor or via `git diff` after the fact rather than approving each edit inline. Press `Shift+Tab` once from Manual mode to enter it, or start with it directly:
claude --permission-mode acceptEdits
@@ -422,8 +422,10 @@
* MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) prompt you directly even when an allow rule matches, and so do connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code
* A shell command that carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>) also routes to the classifier even when an allow rule matches, because a rule approves the command, not its hosts
* Ask rules that match on a command’s content, such as `Bash(git push *)`, fall back to a permission prompt
+ * A write that the [symlink check](</docs/en/permissions#symlinks>) resolves to a protected path prompts you when the path Claude requested isn’t itself protected
2. Read-only actions and file edits in your working directory are auto-approved, except writes to protected paths and the first read outside the working directories, which prompts you
* In a session with server-side classifier review, read-only and [sandboxed](</docs/en/sandboxing#sandbox-modes>) shell commands wait for that review and are blocked if it flags them
+ * A write inside your working directory that the [symlink check](</docs/en/permissions#symlinks>) resolves to a location outside it prompts you
3. Everything else goes to the classifier, apart from critical-path removals under their default handling. The connector tools and `requiresUserInteraction` MCP tools that prompt you directly in step 1 never reach the classifier either, so neither an org-required approval nor a consent step is auto-approved
4. If the classifier blocks, Claude receives the reason and tries an alternative. In most sessions the reason names the rule the classifier matched, such as `[Data Exfiltration]`, rather than giving a written explanation; see [Review denials](</docs/en/auto-mode-config#review-denials>)
@@ -502,7 +504,7 @@
`dontAsk`| Denied
`bypassPermissions`| Allowed
-In a session started with [`--restricted`](</docs/en/cli-reference#cli-flags>), which requires Claude Code v2.1.248 or later, the classifier can’t approve protected-path writes. [`permissions.allow`](</docs/en/permissions#manage-permissions>) rules in settings files do not pre-approve protected-path writes. The safety check runs before Claude Code evaluates allow rules from settings, so an entry such as `Edit(.claude/**)` in `~/.claude/settings.json` or `.claude/settings.json` does not change the per-mode outcome in the table above. In permission modes that prompt, the prompt for a write to the project’s `.claude/` folder or to `~/.claude/` can offer one of these session-scoped options:
+In a session started with [`--restricted`](</docs/en/cli-reference#cli-flags>), which requires Claude Code v2.1.248 or later, the classifier can’t approve protected-path writes. In the modes that route protected-path writes to the classifier, a write that the [symlink check](</docs/en/permissions#symlinks>) resolves to a protected path prompts you instead when the path Claude requested isn’t itself protected. [`permissions.allow`](</docs/en/permissions#manage-permissions>) rules in settings files do not pre-approve protected-path writes. The safety check runs before Claude Code evaluates allow rules from settings, so an entry such as `Edit(.claude/**)` in `~/.claude/settings.json` or `.claude/settings.json` does not change the per-mode outcome in the table above. In permission modes that prompt, the prompt for a write to the project’s `.claude/` folder or to `~/.claude/` can offer one of these session-scoped options:
* For the project’s `.claude/` folder: **Yes, and allow Claude to edit files in this project’s .claude folder for this session**
* For `~/.claude/`: **Yes, and allow Claude to edit files in its ~/.claude folder for this session**
--- a/permissions.md
+++ b/permissions.md
@@ -271,7 +271,7 @@
Plan mode (`plan`)
-Claude explores the codebase and produces a plan without editing your source files. Read-only tools run as they do in the `default` permission mode. File edits are never auto-approved in plan mode, even when an allow rule matches. They prompt through your `canUseTool` callback instead. On Claude Code v2.1.212 or later, shell commands that modify files, such as `touch` and `rm`, reach your `canUseTool` callback the same way. If you set `allowDangerouslySkipPermissions: true` alongside `permissionMode: 'plan'`, file edits and shell commands that modify files still reach your `canUseTool` callback. The option lets you switch to `bypassPermissions` later with `setPermissionMode()`. Claude may use `AskUserQuestion` to clarify requirements before finalizing the plan. See [Handle approvals and user input](</docs/en/agent-sdk/user-input#handle-clarifying-questions>) for handling these prompts. **Use when:** you want Claude to propose changes without executing them, such as during code review or when you need to approve changes before they’re made.
+Claude explores the codebase and produces a plan without editing your source files. Read-only tools run as they do in the `default` permission mode. File edits are never auto-approved in plan mode, even when an allow rule matches. They prompt through your `canUseTool` callback instead. On Claude Code v2.1.212 or later, shell commands that modify files, such as `touch` and `rm`, reach your `canUseTool` callback the same way. In the TypeScript SDK, if you set `allowDangerouslySkipPermissions: true` alongside `permissionMode: 'plan'`, file edits and shell commands that modify files still reach your `canUseTool` callback. The option lets you switch to `bypassPermissions` later with `setPermissionMode()`. Claude may use `AskUserQuestion` to clarify requirements before finalizing the plan. See [Handle approvals and user input](</docs/en/agent-sdk/user-input#handle-clarifying-questions>) for handling these prompts. **Use when:** you want Claude to propose changes without executing them, such as during code review or when you need to approve changes before they’re made.
##
--- a/prompt-caching.md
+++ b/prompt-caching.md
@@ -223,7 +223,7 @@
Editing files in your repository
-File contents enter context only when Claude reads them, and reads append to the conversation. Editing a file Claude previously read does not retroactively change the earlier read in history. Instead, Claude Code appends a `<system-reminder>` noting the file changed, and Claude re-reads it if needed.
+File contents enter context only when Claude reads them, and reads append to the conversation. Editing a file Claude previously read does not retroactively change the earlier read in history. Instead, Claude Code appends a [`<system-reminder>`](</docs/en/glossary#system-reminder>) noting the file changed, and Claude re-reads it if needed.
###
--- a/python.md
+++ b/python.md
@@ -295,7 +295,7 @@
Property| Type| Description
---|---|---
`session_id`| `str`| Unique session identifier
-`summary`| `str`| Display title: custom title, auto-generated summary, or first prompt
+`summary`| `str`| Display title: custom title, most recent prompt, auto-generated summary, or first prompt
`last_modified`| `int`| Last modified time in milliseconds since epoch
`file_size`| `int | None`| Session file size in bytes (`None` for remote storage backends)
`custom_title`| `str | None`| Session title: the user-set title, or the auto-generated title when none is set
@@ -3605,7 +3605,7 @@
asyncio.run(main())
-Commands running with `dangerouslyDisableSandbox: True` have full system access. Ensure your `can_use_tool` handler validates these requests carefully.If `permission_mode` is set to `bypassPermissions` and `allow_unsandboxed_commands` is enabled, the model can autonomously execute commands outside the sandbox without approval prompts, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). This combination effectively allows the model to escape sandbox isolation silently.
+Commands running with `dangerouslyDisableSandbox: True` have full system access. Ensure your `can_use_tool` handler validates these requests carefully.If `permission_mode` is set to `bypassPermissions` and `allowUnsandboxedCommands` is enabled, the model can autonomously execute commands outside the sandbox without approval prompts, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). This combination effectively allows the model to escape sandbox isolation silently.
##
--- a/settings-reference.md
+++ b/settings-reference.md
@@ -5570,7 +5570,7 @@
`forceLoginGatewayUrl`
-Set the gateway URL the `/login` Cloud gateway screen connects to, so people reach your [cloud gateway](</docs/en/claude-apps-gateway>) without typing its address. The screen has no URL field: with this key set, it shows your gateway URL and connects when the person presses Enter; without it, it tells them to contact their IT administrator. Either this key or `forceLoginMethod: "gateway"` makes the machine gateway-only, so `/login` opens on the Cloud gateway screen with no login-method picker. See [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) for what happens to a leftover first-party login or API key. Set both keys so the screen connects instead of showing an error.
+Set the gateway URL the `/login` Cloud gateway screen connects to, so people reach your [cloud gateway](</docs/en/claude-apps-gateway>) without typing its address. The screen has no URL field: with this key set, it shows your gateway URL and connects when the person presses Enter; without it, it tells them to contact their IT administrator. Either this key or `forceLoginMethod: "gateway"` makes the machine gateway-only, except for sessions that select a cloud provider with `CLAUDE_CODE_USE_*`. `/login` then opens on the Cloud gateway screen with no login-method picker. See [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) for what happens to a leftover first-party login or API key. Set both keys so the screen connects instead of showing an error.
* **Scope** : `Managed`. Read only from a source on the machine: `managed-settings.json`, the macOS plist or Windows HKLM registry, or a policy helper. Claude Code ignores it in HKCU and server-managed settings.
* **Type** : string, a full URL including the scheme
--- a/streaming-output.md
+++ b/streaming-output.md
@@ -310,7 +310,7 @@
Known limitations
- * **Structured output** : the JSON result appears only in the final `ResultMessage.structured_output`, not as streaming deltas. See [structured outputs](</docs/en/agent-sdk/structured-outputs>) for details.
+ * **Structured output** : with partial messages enabled, the JSON streams as a tool call’s unvalidated `input_json_delta` chunks, and only the validated result reaches the final `ResultMessage.structured_output`. See [structured outputs](</docs/en/agent-sdk/structured-outputs>) for details.
##
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -939,7 +939,7 @@
* **CLAUDE.md files** : every level of the [CLAUDE.md hierarchy](</docs/en/memory#how-claude-md-files-load>) the main conversation loads, including `~/.claude/CLAUDE.md`, project rules, `CLAUDE.local.md`, managed policy files, and any [`AGENTS.md` files](</docs/en/memory#agents-md>) loaded as project instructions. The built-in Explore and Plan agents skip this. A subagent whose definition sets `omitClaudeMd` loads only the managed policy files, or none at all when the definition comes from managed settings.
* **Git status** : a snapshot Claude Code reads from your repository when the subagent starts. Absent outside a Git repository or whenever the snapshot is turned off; see [`includeGitInstructions`](</docs/en/settings-reference#includegitinstructions>). Explore and Plan skip it regardless.
* **Preloaded skills** : full content of any skill named in the agent’s `skills` field. Built-in agents don’t preload skills.
- * **Sibling roster** : a system reminder listing `main` and every other named agent in the session, each a valid `to` value for `SendMessage`. Requires Claude Code v2.1.206 or later. The roster appears only when the subagent’s tools include `SendMessage` and at least one other agent has a name, whether Claude named it when spawning it or it runs as an [agent team](</docs/en/agent-teams>) teammate. It is a snapshot taken when the subagent starts, so agents named later don’t appear.
+ * **Sibling roster** : a [system reminder](</docs/en/glossary#system-reminder>) listing `main` and every other named agent in the session, each a valid `to` value for `SendMessage`. Requires Claude Code v2.1.206 or later. The roster appears only when the subagent’s tools include `SendMessage` and at least one other agent has a name, whether Claude named it when spawning it or it runs as an [agent team](</docs/en/agent-teams>) teammate. It is a snapshot taken when the subagent starts, so agents named later don’t appear.
To launch one of your own subagents without the user, project, and local CLAUDE.md files, set `omitClaudeMd: true` in its frontmatter or `--agents` JSON. The main conversation still has your full CLAUDE.md when it reads these subagents’ results, so most rules don’t need to reach the subagent itself. If a rule must, such as “ignore the `vendor/` directory,” restate it in the prompt you give Claude when delegating. You can’t change which subagents receive git status. Only Explore and Plan skip it. Some main-conversation state never reaches a non-fork subagent:
--- a/troubleshooting.md
+++ b/troubleshooting.md
@@ -152,7 +152,7 @@
structured_output is None but the result says success
-A result message can end with `subtype: "success"` while `structured_output` is `None` in Python or `undefined` in TypeScript. The run completes, but no validated output exists. One way to hit this is a schema no output can satisfy, for example conflicting length constraints. The run ends without a validation error, and the only signal is the missing `structured_output`. Treat this result as a failure in application code. Check both that `subtype` is `success` and that `structured_output` is present before using it. The [Error handling](</docs/en/agent-sdk/structured-outputs#error-handling>) section shows this pattern for both SDKs. If it happens repeatedly with a schema you believe is correct, verify the schema is satisfiable, then simplify it until outputs validate, and reintroduce constraints one at a time.
+A result message can end with `subtype: "success"` while `structured_output` is `None` in Python or `undefined` in TypeScript. The run completes, but no validated output exists. One way to hit this is a schema no output can satisfy, for example conflicting length constraints. Treat this result as a failure in application code. Check both that `subtype` is `success` and that `structured_output` is present before using it. The [Error handling](</docs/en/agent-sdk/structured-outputs#error-handling>) section shows this pattern for both SDKs. If it happens repeatedly with a schema you believe is correct, verify the schema is satisfiable, then simplify it until outputs validate, and reintroduce constraints one at a time.
##
Show diff (305 lines)
--- a/typescript.md
+++ b/typescript.md
@@ -213,7 +213,7 @@
`ToolAnnotations`
-Re-exported from `@modelcontextprotocol/sdk/types.js`. All fields are optional hints; clients should not rely on them for security decisions.
+Defined in `@modelcontextprotocol/sdk/types.js`. All fields are optional hints; clients should not rely on them for security decisions.
Field| Type| Default| Description
---|---|---|---
@@ -299,7 +299,7 @@
Property| Type| Description
---|---|---
`sessionId`| `string`| Unique session identifier (UUID)
-`summary`| `string`| Display title: custom title, auto-generated summary, or first prompt
+`summary`| `string`| Display title: custom title, most recent prompt, auto-generated summary, or first prompt
`lastModified`| `number`| Last modified time in milliseconds since epoch
`fileSize`| `number | undefined`| Session file size in bytes. Only populated for local JSONL storage
`customTitle`| `string | undefined`| User-set session title (via `/rename`)
@@ -681,7 +681,11 @@
path: string,
options?: { maxBytes?: number; encoding?: 'utf-8' | 'base64' }
): Promise<SDKControlReadFileResponse | null>;
+ reloadPlugins(options?: {
+ holdOnCacheImpact?: boolean;
+ }): Promise<SDKControlReloadPluginsResponse>;
reloadSkills(): Promise<SDKControlReloadSkillsResponse>;
+ reloadOutputStyles(): Promise<SDKControlReloadOutputStylesResponse>;
accountInfo(): Promise<AccountInfo>;
reconnectMcpServer(serverName: string): Promise<void>;
toggleMcpServer(serverName: string, enabled: boolean): Promise<void>;
@@ -715,7 +719,9 @@
`mcpServerStatus()`| Returns the status of connected MCP servers as `McpServerStatus``[]`
`getContextUsage(opts?)`| Returns an `SDKControlGetContextUsageResponse` breaking down the session’s context window usage by category, skill, and tool. With the default `detail`, it is the same data `/context` shows in an interactive session. The `detail` option requires Agent SDK v0.3.257 or later
`readFile(path, options?)`| Reads a file from the session’s filesystem. Claude Code resolves the path against `cwd`; What `readFile()` can read lists the files it serves. Pass `{ maxBytes }` to change the read cap (default 1 MB, ceiling 10 MB) and `{ encoding: 'base64' }` for binary files such as images. Resolves with an `SDKControlReadFileResponse`, or `null` on permission denial, a missing file, or a transport error. Requires TypeScript SDK v0.2.121 or later
+`reloadPlugins(options?)`| Reloads plugins from disk, so plugins you install or edit mid-session reach the running session. Resolves with an `SDKControlReloadPluginsResponse` listing the session’s commands, subagents, plugins, and MCP server status. Requires Agent SDK v0.2.85 or later. The `holdOnCacheImpact` option requires Agent SDK v0.3.268 or later
`reloadSkills()`| Reloads skills from disk, so skills you add or edit mid-session become available to the running session. Resolves with an `SDKControlReloadSkillsResponse` listing the skills available after the reload. Requires Agent SDK v0.3.163 or later
+`reloadOutputStyles()`| Re-reads [output styles](</docs/en/output-styles>) from disk, so a style file you add or edit mid-session becomes available to the running session. Resolves with an `SDKControlReloadOutputStylesResponse` listing the style names available after the reload. Requires Agent SDK v0.3.261 or later
`accountInfo()`| Returns account information
`reconnectMcpServer(serverName)`| Reconnect an MCP server by name. If the name also matches an entry in a settings file such as `.mcp.json` or `~/.claude.json`, Claude Code reconnects the server you configured through `mcpServers` or `setMcpServers()`, not the settings-file entry. That resolution order requires Claude Code v2.1.257 or later
`toggleMcpServer(serverName, enabled)`| Enable or disable an MCP server by name, with the same name resolution as `reconnectMcpServer()`. Disabling disconnects the server
@@ -891,6 +897,7 @@
tokens: number;
color: string;
isDeferred?: boolean;
+ kind: "used" | "free" | "buffer" | "deferred";
}[];
totalTokens: number;
maxTokens: number;
@@ -979,7 +986,7 @@
Read token attribution from the collection fields:
- * `categories` holds the per-category totals.
+ * `categories` holds the per-category totals. Each entry’s `kind` classifies the row with the same values as `SDKContextUsageCategory`. Classify rows on it rather than on the display `name`. The field requires Agent SDK v0.3.268 or later.
* `mcpTools` and `agents` attribute tokens to individual MCP tools and subagents.
* `memoryFiles` lists each loaded memory file with its cost.
* `skills.skillFrontmatter` attributes the skill listing’s tokens to each included skill. The per-skill counts measure each skill’s listing entry as Claude Code actually sends it, which can be shorter than the skill’s full frontmatter. Compare `skills.totalSkills` with `skills.includedSkills` to see whether every discovered skill made it into the listing.
@@ -1020,6 +1027,47 @@
+`SDKControlReloadPluginsResponse`
+
+Return type of `reloadPlugins()`.
+
+ type SDKControlReloadPluginsResponse = {
+ commands: SlashCommand[];
+ agents: AgentInfo[];
+ plugins: {
+ name: string;
+ path: string;
+ source?: string;
+ version?: string;
+ }[];
+ mcpServers: McpServerStatus[];
+ error_count: number;
+ held?: boolean;
+ cache_impact?: {
+ mcp_servers_added: string[];
+ mcp_servers_removed: string[];
+ lsp_tool_change: ("adds" | "may-add" | "removes" | "may-remove") | null;
+ };
+ };
+
+The collection fields describe the session after the call:
+
+ * `commands`, `agents`, and `mcpServers`: the session’s commands, subagents, and MCP server status, in the same shapes that `supportedCommands()`, `supportedAgents()`, and `mcpServerStatus()` return. `supportedAgents()` keeps returning the list captured at initialization, so read `agents` here for the set after a reload
+ * `plugins`: each loaded plugin with its `name` and install `path`. `version` repeats what the plugin’s manifest declares and is plugin-author-controlled, so validate it before trusting it. It’s omitted when the manifest declares none
+ * `error_count`: the number of errors from loading plugins
+
+Pass `{ holdOnCacheImpact: true }` to `reloadPlugins()` to hold a reload that would invalidate the conversation’s prompt cache instead of applying it. Claude Code runs the check that the interactive `/reload-plugins` command makes before it [warns about the cache cost](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>). The option requires Agent SDK v0.3.268 or later. A Claude Code executable older than v2.1.268, such as one you point `pathToClaudeCodeExecutable` at, ignores the option and applies the reload. When you pass the option, read `held` to learn what happened:
+
+ * `true`: the reload wasn’t applied, and the collection fields describe the session as it still is. `cache_impact` says what applying would change. To apply anyway, call `reloadPlugins()` again without the option.
+ * `false`: the check found no cache impact, and the reload was applied.
+ * Absent: you didn’t pass the option, or the Claude Code executable is older than v2.1.268 and applied the reload.
+
+`cache_impact` is present only alongside `held: true`. `mcp_servers_added` and `mcp_servers_removed` name the plugin MCP servers the reload would register or drop, as scoped `plugin:<plugin>:<server>` names. The names are plugin-authored, so validate them before showing them. `lsp_tool_change` says whether applying would add or remove the LSP tool, or `null` when it would do neither. The `may-` forms mean the check couldn’t fully see the pending plugin set.
+
+###
+
+
+
`SDKControlReloadSkillsResponse`
Return type of `reloadSkills()`.
@@ -1029,6 +1077,20 @@
};
`skills` lists the skills available after the reload, in the same `SlashCommand` shape that `supportedCommands()` returns.
+
+###
+
+
+
+`SDKControlReloadOutputStylesResponse`
+
+Return type of `reloadOutputStyles()`.
+
+ type SDKControlReloadOutputStylesResponse = {
+ available_output_styles: string[];
+ };
+
+`available_output_styles` lists the names of the built-in and custom output styles available after the reload.
###
@@ -1205,6 +1267,8 @@
blockedPath?: string;
mcpServer?: { name: string; source: string };
decisionReason?: string;
+ defaultToNo?: boolean;
+ suppressAlwaysAllowRule?: boolean;
toolUseID: string;
agentID?: string;
requestId: string;
@@ -1218,6 +1282,8 @@
`blockedPath`| `string`| The file path that triggered the permission request, if applicable
`mcpServer`| `{ name: string; source: string }`| For an `mcp__*` tool, the MCP server that serves it and where that server’s definition came from, with the fields of `McpServerProvenance`. Absent for other tools. Requires Agent SDK v0.3.274 or later
`decisionReason`| `string`| Explains why this permission request was triggered
+`defaultToNo`| `boolean`| When `true`, a single stray keystroke must not approve this request: open your prompt on its decline option, don’t pre-select approve, and offer no one-key approve shortcut. Requires Agent SDK v0.3.268 or later
+`suppressAlwaysAllowRule`| `boolean`| When `true`, don’t offer a persistent always-allow choice for this request, because the rule it would write grants more than the request’s own action. Requires Agent SDK v0.3.268 or later
`toolUseID`| `string`| Unique identifier for this specific tool call within the assistant message
`agentID`| `string`| If running within a sub-agent, the sub-agent’s ID
`requestId`| `string`| The `control_request` envelope’s `request_id`. A `control_response` your application sends outside the SDK, such as a signed HTTP POST, must echo this value so the Claude Code process can match the reply to the request
@@ -1441,6 +1507,7 @@
context_usage?: SDKContextUsage;
user_message_uuid?: string;
user_message_uuids?: string[];
+ resume_reason?: string;
};
The `message` field is a [`BetaMessage`](<https://platform.claude.com/docs/en/api/messages/create>) from the Anthropic SDK. It includes fields like `id`, `content`, `model`, `stop_reason`, and `usage`. `SDKAssistantMessageError` is one of: `'authentication_failed'`, `'oauth_org_not_allowed'`, `'account_on_hold'`, `'billing_error'`, `'rate_limit'`, `'overloaded'`, `'invalid_request'`, `'model_not_found'`, `'server_error'`, `'max_output_tokens'`, `'cloud_credential_error'`, or `'unknown'`. Four of these values mean more than their names say:
@@ -1450,7 +1517,7 @@
* `'account_on_hold'`: [your account is on hold](</docs/en/errors#your-account-is-on-hold>)
* `'cloud_credential_error'`: Claude Code couldn’t obtain usable AWS or Google Cloud credentials on the machine it runs on, so no request reached the cloud provider. The usual cause is a cloud sign-in that expired or was never completed on that machine, though a briefly unreachable credential service reports the same value. See [Could not load AWS or Google Cloud credentials](</docs/en/errors#could-not-load-aws-or-google-cloud-credentials>). Requires TypeScript Agent SDK v0.3.267 or later, which bundles Claude Code v2.1.267
-`aborted` is `true` when an interrupt or abort truncated the assistant message before the stream completed: the message has no `stop_reason` and the content may end mid-word. The field is absent on normally completed messages. It requires Agent SDK v0.3.214 or later. Claude Code sets `user_message_uuid` and `user_message_uuids` on the turn’s first assistant message, under the conditions in `user_message_uuid`. `timestamp` is the ISO 8601 time when the message’s content finished generating on the process that produced it. The value comes from that machine’s clock, so use it for display only and don’t order messages by it. One API turn can produce several assistant messages that share a `message.id`, each with its own `timestamp`. When the field is absent, fall back to the time you received the message. `context_usage` is a structured copy of the `/context` report, typed as `SDKContextUsage`, and requires Agent SDK v0.3.232 or later. When you send `/context` as a prompt, Claude Code delivers the report as an assistant message whose `message.content` holds the markdown table, and attaches `context_usage` to that same message. Claude Code doesn’t set the field on any other assistant message, and earlier versions deliver the `/context` table without it, so read the breakdown from the field when it’s present and fall back to the markdown text when it isn’t.
+`aborted` is `true` when an interrupt or abort truncated the assistant message before the stream completed: the message has no `stop_reason` and the content may end mid-word. The field is absent on normally completed messages. It requires Agent SDK v0.3.214 or later. Claude Code sets `user_message_uuid` and `user_message_uuids` on the turn’s first assistant message, under the conditions in `user_message_uuid`. When Claude Code re-runs a turn that a restart interrupted, the re-run’s assistant messages that carry those fields also carry `resume_reason`. `timestamp` is the ISO 8601 time when the message’s content finished generating on the process that produced it. The value comes from that machine’s clock, so use it for display only and don’t order messages by it. One API turn can produce several assistant messages that share a `message.id`, each with its own `timestamp`. When the field is absent, fall back to the time you received the message. `context_usage` is a structured copy of the `/context` report, typed as `SDKContextUsage`, and requires Agent SDK v0.3.232 or later. When you send `/context` as a prompt, Claude Code delivers the report as an assistant message whose `message.content` holds the markdown table, and attaches `context_usage` to that same message. Claude Code doesn’t set the field on any other assistant message, and earlier versions deliver the `/context` table without it, so read the breakdown from the field when it’s present and fall back to the markdown text when it isn’t.
###
@@ -1530,6 +1597,8 @@
ttft_stream_ms?: number;
user_message_uuid?: string;
user_message_uuids?: string[];
+ resume_reason?: string;
+ local_command?: string;
request_sent_wall_ms?: number;
first_content_frame_ms?: number;
first_stream_post_ms?: number;
@@ -1543,6 +1612,7 @@
structured_output?: unknown;
deferred_tool_use?: { id: string; name: string; input: Record<string, unknown> };
terminal_reason?: TerminalReason;
+ result_index?: number;
fast_mode_state?: FastModeState;
fast_mode_disabled_reason?: FastModeDisabledReason;
origin?: SDKMessageOrigin;
@@ -1570,7 +1640,9 @@
startup_failure_reason?: SDKStartupFailureReason;
user_message_uuid?: string;
user_message_uuids?: string[];
+ resume_reason?: string;
terminal_reason?: TerminalReason;
+ result_index?: number;
fast_mode_state?: FastModeState;
fast_mode_disabled_reason?: FastModeDisabledReason;
origin?: SDKMessageOrigin;
@@ -1583,6 +1655,8 @@
* `ttft_stream_ms`: time in milliseconds until the first `message_start` stream event, when the response stream opens. Lower than `ttft_ms`; the gap between the two is time spent streaming the first message. Present on the success arm only.
* `user_message_uuid`: the `uuid` of the message you sent that this turn answered. See `user_message_uuid` for which results carry it.
* `user_message_uuids`: the `uuid`s of every message you sent that Claude Code answered in this turn. See `user_message_uuids`.
+ * `resume_reason`: why Claude Code re-ran this turn after a restart interrupted it. Present on both arms, and only on such a re-run. See `resume_reason`.
+ * `local_command`: the name of the command the turn dispatched, on the success result of a turn that a command completed without entering the agent loop, such as `/compact`. The name is folded to lowercase letters and underscores, so `/reload-plugins` reports `reload_plugins`. A command that an MCP server provides, and the built-in `/mcp`, report `mcp`. A command you defined yourself reports `custom`. The arguments are never included. Absent on every turn that entered the agent loop and on sends that ran no command. Requires Agent SDK v0.3.268 or later.
* `request_sent_wall_ms`: epoch milliseconds at which Claude Code dispatched the API request, for joins against server-side timestamps. Present only together with `user_message_uuid`, on a success result with `is_error` false whose turn sent an API request.
* `first_content_frame_ms`: time in milliseconds until the first `content_block_start` or `content_block_delta` stream event, counting thinking blocks as content. Present on the success arm only, when `is_error` is false. Requires Agent SDK v0.3.260 or later.
* `first_stream_post_ms`, `first_stream_post_ack_ms`, `first_stream_post_wall_ms`: timings for uploading the turn’s first stream event. Claude Code records them only in sessions it streams to claude.ai, such as [cloud sessions](</docs/en/claude-code-on-the-web>), and the results `query()` yields don’t carry them. Requires Agent SDK v0.3.260 or later.
@@ -1590,6 +1664,7 @@
* `modelUsage`: per-model totals for every model call made through the query pipeline during this `query()` call, including the main loop, subagents, and internal calls such as compaction and Workflow agents. Helper calls outside that pipeline, such as the permission classifier and token-counting requests, are excluded. A call that resumes a session also counts the [per-model totals restored from the session’s earlier calls](</docs/en/agent-sdk/cost-tracking#accumulate-costs-across-multiple-calls>). In streaming-input sessions the totals are cumulative across turns, so read the latest result rather than summing across results. See [Track costs in streaming input mode](</docs/en/agent-sdk/cost-tracking#track-costs-in-streaming-input-mode>) for resets and [Recover totals after a session crash](</docs/en/agent-sdk/cost-tracking#recover-totals-after-a-session-crash>) for zeroed results.
* `total_cost_usd`: cumulative estimated cost in USD, covering the same calls as `modelUsage` and reset at the same points. A call that resumes a session also counts the [totals restored from the session’s earlier calls](</docs/en/agent-sdk/cost-tracking#accumulate-costs-across-multiple-calls>). It is an estimate, not a billing statement. See [Track cost and usage](</docs/en/agent-sdk/cost-tracking>) for accuracy caveats.
* `queued_turn_count`: the number of messages you sent with `origin: { kind: "human" }` that are still waiting when Claude Code produced the result. See `queued_turn_count` for what `0` and an absent field tell you.
+ * `result_index`: where this result falls in the run’s delivery order, counting from 0 across every result the process writes. Present on both arms. A result whose write fails still consumes its number, so a gap in the sequence means a result was lost. Requires Agent SDK v0.3.268 or later.
* `startup_failure_reason`: why Claude Code refused to start, on the `error_during_execution` result it writes before exiting on a known startup failure. See `startup_failure_reason` for the values and which failures carry it. Requires Agent SDK v0.3.274 or later.
* `terminal_reason`: why the loop ended. One of `"completed"`, `"max_turns"`, `"tool_deferred"`, `"aborted_streaming"`, `"aborted_tools"`, `"hook_stopped"`, `"stop_hook_prevented"`, `"background_requested"`, `"blocking_limit"`, `"rapid_refill_breaker"`, `"prompt_too_long"`, `"image_error"`, `"model_error"`, `"api_error"`, `"malformed_tool_use_exhausted"`, `"budget_exhausted"`, `"structured_output_retry_exhausted"`, `"tool_deferred_unavailable"`, or `"turn_setup_failed"`.
* `fast_mode_state`: one of `"on"`, `"off"`, or `"cooldown"`.
@@ -1622,7 +1697,8 @@
* **A regular message you sent** , meaning one without `isSynthetic: true`: the turn answers that message for its whole run. When you send several messages close together, Claude Code can merge them into one turn, and the field then carries only the last message’s `uuid`. To match the reply to any of the merged messages, use `user_message_uuids`.
* **A message you sent with`isSynthetic: true`**: the turn answers that message at first. If Claude Code picks up a regular message of yours between tool calls, the turn answers the picked-up message from then on. Echoing a synthetic message’s `uuid` requires Agent SDK v0.3.265 or later; earlier versions echo nothing on synthetic turns.
- * **A prompt Claude Code generated itself** , such as the turn that continues interrupted work after a session restarts: the turn answers no message of yours at first and its frames carry no echo. If Claude Code picks up a regular message of yours between tool calls, the turn answers that message from then on. The pickup echo requires Agent SDK v0.3.265 or later; earlier versions echo nothing on these turns.
+ * **The prompt Claude Code generates to re-run an interrupted turn under[`CLAUDE_CODE_RESUME_INTERRUPTED_TURN`](</docs/en/env-vars>)**: when the interrupted turn’s last prompt is a regular message you sent, whether it opened the turn or Claude Code picked it up during the turn, the re-run answers that message at first. `resume_reason` tells the re-run’s frames from the interrupted attempt’s. When the last prompt isn’t a regular message of yours, the re-run answers no message of yours at first. If Claude Code picks up a regular message of yours between tool calls, the turn answers the picked-up message from then on. Echoing the interrupted turn’s prompt requires Agent SDK v0.3.268 or later.
+ * **Any other prompt Claude Code generated itself** : the turn answers no message of yours at first and its frames carry no echo. If Claude Code picks up a regular message of yours between tool calls, the turn answers that message from then on. The pickup echo requires Agent SDK v0.3.265 or later; earlier versions echo nothing on these turns.
Claude Code echoes the answered message’s `uuid` on three kinds of frame:
@@ -1634,7 +1710,7 @@
* Reply frames other than those first replies
* Subagent frames
- * Turns that answer no message with a `uuid`: the turn answered a message you sent without one, or Claude Code started the turn itself and picked up no regular message that has one
+ * Turns that answer no message of yours, or answer a message you sent without a `uuid`
* Results that answer no message you sent, such as the zeroed result after a crashed worker process
####
@@ -1644,6 +1720,19 @@
`user_message_uuids`
The `uuid`s of every message you sent that Claude Code answered in this turn. When you send several messages close together, Claude Code can merge them into one turn, and `user_message_uuid` then names only the last of them. To match the reply to any of the merged messages, look for that message’s `uuid` anywhere in this list. Requires Agent SDK v0.3.259 or later. Claude Code sets the list together with `user_message_uuid` on each reply frame that carries that field and on the result. For the full set of turn frames that echo the answered message’s `uuid`, and the version each requires, see `user_message_uuid`. The list always contains `user_message_uuid` and holds at most 64 entries. When Claude Code picks up a regular message you sent while a turn was running, it adds that message’s `uuid` to the result’s list. When a first reply or result carries `user_message_uuid` without the list, it came from an earlier Claude Code version, so fall back to the single field.
+
+####
+
+
+
+`resume_reason`
+
+Why Claude Code re-ran this turn after a restart. Claude Code sets this field on a turn it re-ran under [`CLAUDE_CODE_RESUME_INTERRUPTED_TURN`](</docs/en/env-vars>), so you can tell the re-run’s reply and result from the interrupted attempt’s. Requires Agent SDK v0.3.268 or later. Claude Code sets the field on two kinds of frame:
+
+ * **The re-run’s result** : on the success and error arms alike, whether or not the result carries `user_message_uuid`.
+ * **The re-run’s reply frames** : those that carry `user_message_uuid`.
+
+The value is a short lowercase token naming why the turn was re-run, such as `interrupted_turn`. The field is absent on every other turn.
####
@@ -1787,9 +1876,10 @@
ttft_ms?: number; // Time to first token in ms, present only on message_start events
user_message_uuid?: string;
user_message_uuids?: string[];
- };
-
-Claude Code sets `user_message_uuid` and `user_message_uuids` on the turn’s first non-ping stream event, and again when the message the turn is answering changes, under the conditions in `user_message_uuid`.
+ resume_reason?: string;
+ };
+
+Claude Code sets `user_message_uuid` and `user_message_uuids` on the turn’s first non-ping stream event, and again when the message that the turn is answering changes, under the conditions in `user_message_uuid`. When Claude Code re-runs a turn that a restart interrupted, the re-run’s stream events that carry those fields also carry `resume_reason`.
###
@@ -2915,7 +3005,7 @@
Tool Input Types
-Documentation of input schemas for all built-in Claude Code tools. These types are exported from `@anthropic-ai/claude-agent-sdk` and can be used for type-safe tool interactions.
+Documentation of input schemas for all built-in Claude Code tools. These types are exported from `@anthropic-ai/claude-agent-sdk/sdk-tools` and can be used for type-safe tool interactions.
###
@@ -2923,7 +3013,7 @@
`ToolInputSchemas`
-Union of tool input types exported from `@anthropic-ai/claude-agent-sdk`; members include:
+Union of tool input types exported from `@anthropic-ai/claude-agent-sdk/sdk-tools`; members include:
type ToolInputSchemas =
| AgentInput
@@ -3699,7 +3789,7 @@
Tool Output Types
-Documentation of output schemas for all built-in Claude Code tools. These types are exported from `@anthropic-ai/claude-agent-sdk` and represent the actual response data returned by each tool.
+Documentation of output schemas for all built-in Claude Code tools. These types are exported from `@anthropic-ai/claude-agent-sdk/sdk-tools` and represent the actual response data returned by each tool.
###
@@ -3707,7 +3797,7 @@
`ToolOutputSchemas`
-Union of tool output types exported from `@anthropic-ai/claude-agent-sdk`; members include:
+Union of tool output types exported from `@anthropic-ai/claude-agent-sdk/sdk-tools`; members include:
type ToolOutputSchemas =
| AgentOutput
@@ -5796,7 +5886,7 @@
`allowedDomains`| `string[]`| `[]`| Domain names that sandboxed processes can access
`deniedDomains`| `string[]`| `[]`| Domain names that sandboxed processes cannot access. Takes precedence over `allowedDomains`
`strictAllowlist`| `boolean`| `false`| Deny sandboxed commands access to hosts outside the [network allowlist](</docs/en/sandboxing#network-isolation>) instead of prompting. Enforced for sandboxed commands only; in-process tools such as WebFetch aren’t gated by it. Only honored from user, managed, or CLI `--settings` settings; project settings are ignored. Requires Claude Code v2.1.219 or later
-`allowManagedDomainsOnly`| `boolean`| `false`| Managed-settings only. When set in [managed settings](</docs/en/managed-settings>), only `allowedDomains` entries and `WebFetch(domain:...)` allow rules from managed settings are honored, and allow entries from user, project, or local settings are ignored. Has no effect when set via SDK options
+`allowManagedDomainsOnly`| `boolean`| `false`| Managed-settings only. When set in [managed settings](</docs/en/managed-settings>), only `allowedDomains` entries and `WebFetch(domain:...)` allow rules from managed settings are honored, and allow entries from user, project, or local settings are ignored. From the SDK, pass it through the `managedSettings` option
`allowLocalBinding`| `boolean`| `false`| Allow processes to bind to local ports (for example, for dev servers)
`allowUnixSockets`| `string[]`| `[]`| Unix socket paths that processes can access (for example, Docker socket)
`allowAllUnixSockets`| `boolean`| `false`| Allow access to all Unix sockets
--- a/user-input.md
+++ b/user-input.md
@@ -261,7 +261,7 @@
return { behavior: "allow", updatedInput: input };
};
-The user approves and doesn’t want to be asked again for this kind of call. The third callback argument carries `suggestions`, an array of ready-made [`PermissionUpdate`](</docs/en/agent-sdk/typescript#permissionupdate>) entries. Echo one back in `updatedPermissions` to apply it. A suggestion with the `localSettings` destination writes the rule to `.claude/settings.local.json` so future sessions skip the prompt for matching calls.The Python example requires `claude-agent-sdk` 0.1.80 or later.
+The user approves and doesn’t want to be asked again for this kind of call. The third callback argument carries `suggestions`, an array of ready-made [`PermissionUpdate`](</docs/en/agent-sdk/typescript#permissionupdate>) entries. Echo one back in `updatedPermissions` to apply it. A suggestion with the `localSettings` destination writes the rule to `.claude/settings.local.json` so future sessions skip the prompt for matching calls.In TypeScript, skip the always-allow choice for a request whose options carry [`suppressAlwaysAllowRule: true`](</docs/en/agent-sdk/typescript#canusetool>). The hint requires Agent SDK v0.3.268 or later, and the Python `context` doesn’t carry it.The Python example requires `claude-agent-sdk` 0.1.80 or later.
Python