Changes on
60 changes detected
--- a/admin.md
+++ b/admin.md
@@ -50,9 +50,9 @@
* **Mods are on.** A user can install a plugin that contains a mod from any marketplace your plugin settings allow, or load one from a directory with `--plugin-dir`.
* **A built-in guard runs first.** Claude Code loads a built-in mod named `sec-default@builtin` ahead of every mod a user installs. Users can’t turn it off. `/plugin` and the debug log list it as `cc-plugin-sec-default`. The guard loads when either of these is true:
- * The machine has managed settings
+ * The machine has managed settings or a [`managed-mcp.json`](</docs/en/managed-mcp#deploy-managed-mcp-json>) file
* The session runs on [`/login` credentials](</docs/en/authentication#authentication-precedence>) for a Team or Enterprise plan
-A user who authenticates with an API key, or through Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, gets the guard only on a machine that has managed settings. A session that runs on a long-lived [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/authentication#generate-a-long-lived-token>) doesn’t count as that login either, even when a Team or Enterprise login is stored on the machine.
+A user with an API key, or on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, gets the guard only on a machine with managed settings or `managed-mcp.json`. A session that runs on a long-lived [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/authentication#generate-a-long-lived-token>) doesn’t count as that login either, even when a Team or Enterprise login is stored on the machine.
* **The guard protects what you manage.** A user’s mod can’t change what your managed hooks receive or decide, the system prompt, your managed `CLAUDE.md` and other managed instructions, what any mod reads as settings, or the tools and descriptions of your managed MCP servers.
* **Outside what you manage, a user’s mod acts as that user.** The mod keeps that user’s permissions: it can still read and write files, start processes, and make network requests. It can also rewrite tool calls and prompts, deny a tool call, and draw in the interface.
* **Permission rules and`PreToolUse` hooks take precedence over a user’s mod.** With the guard loaded, by default a user’s mod can’t approve a call that a `deny` rule refuses or an `ask` rule prompts for, whichever settings file holds the rule. The mod can’t approve a call that any `PreToolUse` hook blocked, either. Permission rules and `PreToolUse` hooks apply to Claude’s tool calls, not to a mod’s [`$.fs` and `$.process` calls](</docs/en/plugins/mods/api#reach-files-processes-and-the-network>). With `Read(.env)` denied, a mod can still read that file with `$.fs.read` or start a program that does. To limit a mod’s own `$.fs` and `$.process` calls, keep the mod from loading or handle them in a policy mod.
@@ -70,7 +70,7 @@
* **Settings hooks keep working.** Command, HTTP, prompt, and agent hooks in settings files and in plugins’ `hooks/hooks.json` run as before, alongside mods.
* **Deny rules take precedence where the guard loads.** A user’s mod can’t approve a call that a `deny` rule refuses, unless you set `allowModsToOverrideDenyRules`.
- * **Managed hooks run first.** A `PreToolUse` hook in managed settings runs before any mod’s [`tool.call`](</docs/en/plugins/mods/reference#tools>) hook, and when that managed hook blocks a tool call, no mod’s `tool.call` hook runs for that call. If the call goes ahead and a mod rewrites it, your managed hooks run again on the rewritten call, so they can still block it. `PreToolUse` hooks from other settings files and from plugins run after the last mod. If a mod answers the tool call itself, the tool never runs and neither do those hooks. See [The order mods run in](</docs/en/plugins/mods/events#the-order-mods-run-in>).
+ * **Managed hooks run first.** A `PreToolUse` hook in managed settings runs before any mod’s [`tool.call`](</docs/en/plugins/mods/reference#tools>) hook, and when that managed hook blocks a tool call, no mod’s `tool.call` hook runs for that call. If the call goes ahead and a mod rewrites it, your managed hooks run again on the rewritten call, so by default they can still block it. `PreToolUse` hooks from other settings files and from plugins run after the last mod. If a mod answers the tool call itself, the tool never runs and neither do those hooks. See [The order mods run in](</docs/en/plugins/mods/events#the-order-mods-run-in>).
* **Network policy covers`$.http.fetch`.**
* **Your organization’s policy doesn’t allow WebFetch** : Claude Code also refuses every mod’s `$.http.fetch` request. See [WebFetch availability](</docs/en/tools-reference#webfetch-availability>).
* **You turn off the WebFetch tool with[`CLAUDE_CODE_DISABLE_WEB_FETCH`](</docs/en/env-vars#variables>) or a `WebFetch` [deny rule](</docs/en/permissions#tool-specific-permission-rules>), in managed settings or any other settings file**: mods can still make `$.http.fetch` requests. To stop them for every mod your users install, keep user-installed mods from loading, or hook `http.fetch` in a policy mod and refuse requests from users’ mods. Give that hook a [`.catch` handler](</docs/en/plugins/mods/events#handle-a-hook-that-fails>) that refuses too, because Claude Code skips a hook that fails and the request then goes ahead. If you only [restrict which plugins users can install](</docs/en/plugins/org#restrict-what-users-can-install>), fewer mods load, but those you allow still make these requests.
@@ -256,7 +256,7 @@
Option| Unset| `true`
---|---|---
`allowManagedModsOnly`| Users’ own mods run| Only your organization’s mods, and mods built into Claude Code, run their hooks. Claude Code refuses every other mod, including one a user installed or named with `--plugin-dir`.
-`allowModsToOverrideDenyRules`| Deny rules take precedence over users’ mods| A user’s mod that approves tool calls can approve a call that a `deny` rule refuses
+`allowModsToOverrideDenyRules`| Deny rules take precedence over users’ mods| A user’s mod that approves tool calls can approve a call past most of [the outcomes that stay in place by default](</docs/en/permissions#precedence-among-rules-hooks-and-mods>), including a `deny` rule
These rules decide whether an option takes effect:
@@ -346,7 +346,8 @@
* **The list replaces the default** : when you set `prependPlugins` in managed settings, name `sec-default@builtin` in it to keep the built-in guard. The guard is built in and needs no `enabledPlugins` entry.
* **Your own ids must count as yours** : in managed settings, Claude Code skips an id whose plugin doesn’t meet the conditions for an organization’s mod
- * **Repositories can’t set them** : Claude Code reads both settings from managed settings, never from a repository’s settings file. A user can set them in `~/.claude/settings.json` to order their own mods only on a machine with no managed settings, and only when the session’s credential isn’t a Team or Enterprise `/login`. Anywhere else, Claude Code ignores both keys in user settings. A list there neither adds nor removes the built-in guard.
+ * **Repositories can’t set either list** : Claude Code ignores both in a repository’s settings file, so set them in managed settings.
+ * **A user can set them to order their own mods** : in `~/.claude/settings.json`, only on a machine with no managed settings or `managed-mcp.json` file, and only when the session’s credential isn’t a Team or Enterprise `/login`. Anywhere else, Claude Code ignores both keys in user settings. A list there neither adds nor removes the built-in guard.
###
--- a/advisor.md
+++ b/advisor.md
@@ -158,7 +158,7 @@
* **API billing** : you pay the advisor model’s input and output rates for advisor tokens
* **Subscription plans** : advisor usage counts toward your plan’s usage limits, except that a Fable advisor bills to [usage credits](</docs/en/model-config#fable-and-usage-credits>) on plans where Fable usage does
-If your account requires the usage-credits consent, a Fable advisor bills nothing before you give it, because Claude Code doesn’t apply the selection until then. Claude calls the advisor at decision points rather than on every turn, so pairing a faster main model with a stronger advisor typically costs less than running the stronger model throughout. Advisor usage counts toward the session totals shown by [`/usage`](</docs/en/costs#track-your-costs>). For how advisor tokens are reported in API responses, see [Usage and billing](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool#usage-and-billing>) in the Claude API documentation.
+For how a Fable advisor works with usage credits, see Fable advisor and usage credits. Claude calls the advisor at decision points rather than on every turn, so pairing a faster main model with a stronger advisor typically costs less than running the stronger model throughout. Advisor usage counts toward the session totals shown by [`/usage`](</docs/en/costs#track-your-costs>). For how advisor tokens are reported in API responses, see [Usage and billing](<https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool#usage-and-billing>) in the Claude API documentation.
##
--- a/agent-teams.md
+++ b/agent-teams.md
@@ -1,4 +1,4 @@
-Agent teams are experimental and disabled by default. Enable them by setting `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` in your [settings.json](</docs/en/settings>) or environment. Without that variable, no team is set up at session start, no team directories are written, and Claude does not spawn or propose teammates. Agent teams have known limitations around session resumption, task coordination, and shutdown behavior.
+Agent teams are experimental and disabled by default. Enable them by setting `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` in your [settings.json](</docs/en/settings>) or environment. Agent teams have known limitations around session resumption, task coordination, and shutdown behavior.
Agent teams let you coordinate multiple Claude Code instances working together. One session acts as the team lead, coordinating work, assigning tasks, and synthesizing results. Teammates work independently, each in its own context window, and communicate directly with each other. You can also talk to any teammate directly without going through the lead. Before you set up a team, check whether a lighter option does the job. [Subagents](</docs/en/sub-agents>) work within a single session, and with [cross-session messaging](</docs/en/cross-session-messaging>) Claude can pass findings between the sessions you run yourself.
--- a/agent-view.md
+++ b/agent-view.md
@@ -795,7 +795,7 @@
`~/.claude/jobs/<id>/state.json`| Per-session state shown in agent view. Read it through `claude agents --json` instead of parsing the file
`~/.claude/jobs/<id>/tmp/`| Per-session scratch directory. Claude’s `Write` and `Edit` calls here don’t prompt for permission. Removed when the session is deleted
-Each background session has the `CLAUDE_JOB_DIR` environment variable set to its `~/.claude/jobs/<id>` directory, so shell commands the session runs can write temporary files to `$CLAUDE_JOB_DIR/tmp` without colliding with parallel sessions. To inspect this state without reading the files directly, run `claude daemon status`. It reports whether the supervisor is reachable, its process ID and version, the socket directory, and how many background sessions are live. The command also warns when the running supervisor is on a different version than the `claude` you invoked, which happens after an update the supervisor hasn’t restarted into yet. The warning shows both versions and tells you to run `claude daemon stop --any` to pick up the new version. Sessions survive that version mismatch intact: an older Claude Code version that updates a session’s `state.json` preserves fields it doesn’t recognize and keeps the session listed. The session list in `roster.json` follows the same rule, so sessions started by the newer version stay reachable and keep accepting input after the supervisor restarts.
+Each background session has the `CLAUDE_JOB_DIR` environment variable set to its `~/.claude/jobs/<id>` directory, so shell commands the session runs can write temporary files to `$CLAUDE_JOB_DIR/tmp` without colliding with parallel sessions. To inspect this state without reading the files directly, run `claude daemon status`. It reports whether the supervisor is reachable, its process ID and version, the socket directory, and how many background sessions are live. The command also warns when the running supervisor is on a different version than the `claude` you invoked, which happens after an update the supervisor hasn’t restarted into yet. The warning shows both versions and tells you to run `claude daemon stop --any` to pick up the new version.
###
--- a/amazon-bedrock.md
+++ b/amazon-bedrock.md
@@ -366,7 +366,7 @@
`ap-*`| `apac.`
All other regions| `global.`
-Set `ANTHROPIC_BEDROCK_REGION_PREFIX` to choose the prefix Claude Code tries first; when Claude Code can check profile availability and finds no matching profile for a model, it falls back as described in the resolution order below. Valid values are `us`, `eu`, `apac`, `jp`, `au`, and `global`. For example, set it to `global` when your account has `global.` profiles enabled but Claude Code would derive a geography-specific one from your AWS region. Requires Claude Code v2.1.224 or later. This example routes the default models through `global.` profiles:
+Set `ANTHROPIC_BEDROCK_REGION_PREFIX` to choose the prefix Claude Code tries first. Valid values are `us`, `eu`, `apac`, `jp`, `au`, and `global`. For example, set it to `global` when your account has `global.` profiles enabled but Claude Code would derive a geography-specific one from your AWS region. This example routes the default models through `global.` profiles:
export ANTHROPIC_BEDROCK_REGION_PREFIX=global
# In a us-* region, the primary model now resolves to
Show diff (151 lines)
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,148 @@
This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Longer releases are grouped by type of change, with long lists of improvements and bug fixes collapsed. Run `claude --version` to check your installed version.
+
+
+
+2.1.322
+
+November 10, 2026
+
+ * Added fast mode on Vertex in the global, us and eu regions, falling back to standard speed if Vertex refuses it
+
+
+
+2.1.321
+
+November 9, 2026
+
+**Added**
+
+ * Added Claude Fable 5.2 (`claude-fable-5-2`), now the default Fable model — 1M context, $8/$40 per Mtok with $0.20/Mtok cache reads
+ * Added `--settings <file>` to `claude remote-control`, which applies a settings file to every session it starts; if the file changes, no new session starts until you restart `claude remote-control`
+ * [VSCode] Added a warning above the prompt box when both an auth token and an API key are set, matching the terminal’s startup warning
+
+**Changed**
+
+ * Updated the session-feedback message and the `allowedProviders` setting description to name Ultra alongside Pro and Max, and the `forceLoginMethod` description to cover every paid Claude plan
+ * Updated the bundled dataviz skill to suggest a list of meters, one row per item, for several ratios that each have their own limit
+ * Updated the “Upgrade to Max” options to say “Upgrade to Max or Ultra”
+ * Changed mods Claude writes to turn on without asking in auto and bypass modes, even with managed `allowUnsandboxedCommands: false` or `allowManagedDomainsOnly`, and not to load in `dontAsk` mode
+ * Changed mods’ own tool calls (`$.tool.call`, `$.mcp.call`) to raise no permission prompt, even under your own ask rules or in `dontAsk` and `-p` runs; deny rules and organization policy still apply
+ * Changed saved Fable 5.1 model picks to move to `fable`: on Pro and Max plans at once, on Team and Enterprise plans once your organization allows it; use `/model claude-fable-5-1` to switch back
+ * Changed the fast mode labels in `/fast`, `/config` and `/model` to name your current model when it supports fast mode, and removed “(Opus only)” from the VS Code row
+ * Changed nested skill loading: `.claude/skills` folders inside `~/.claude/plugins` no longer load when Claude works on files there
+ * Self-hosted runner: Changed an on-demand runner that the server refuses because it is not needed (session ended or paused, work order superseded) to exit 0 instead of 1
+ * Windows: Changed how Claude Code finds programs it starts itself, such as git, to skip relative and UNC PATH entries and links onto a network share, and to pick up PATH changes from settings
+ * Changed OpenTelemetry hook events in non-interactive sessions to leave two built-in hooks out of `num_hooks` and `num_success` after Bash and PowerShell calls
+ * Changed the number of messages a Claude Desktop Code tab session can send to your other sessions before it waits for you to type again from 10 to 20
+ * Changed `AskUserQuestion` in `claude -p` and SDK sessions to deny a host’s permission answer that sets the undocumented `afkTimeoutMs` input field
+ * Changed managed `extraKnownMarketplaces`: a declared name can’t be added from another source, an entry from elsewhere is hidden, and plugins the declared marketplace lists are reinstalled from it
+ * Changed Claude in Chrome tools that an app running Claude Code provides, such as the Claude desktop app’s Code tab, to follow your organization’s Claude in Chrome policy
+ * Changed `policy_mode: layered` in the Claude apps gateway: managed MCP servers now add up over every matching policy, `match: {}` included, so a gateway already on it serves more after the upgrade
+ * Gateway: Changed Bedrock, Vertex and Foundry upstreams to ignore the `ANTHROPIC_*_BASE_URL` variables in the gateway’s environment. Set `base_url` on the upstream to use another endpoint
+ * Changed headless sessions to reload mods in `.claude/skills` when their files change; set `CLAUDE_CODE_PLUGIN_DIR_WATCH=0` to turn this off
+ * Changed the Cyber Verification Program sentence on a cyber safeguard block to use the same words as claude.ai
+ * Changed Cowork cloud sessions: a PostToolUse hook can no longer replace the answer to AskUserQuestion or the plan in ExitPlanMode’s result; Claude reads the originals
+ * Changed `cp` and `mv` spelled by a path, such as `/bin/cp`, to get the same path checks as `cp` and `mv`
+ * Changed background command notifications and TaskStop results to show Claude only the start and end of a command over 1,000 characters, which saves context
+ * Changed artifact design guidance to treat Inter and Space Grotesk as good default typefaces
+ * Changed the account email check to refuse only a shell command that holds your email and names a User-Agent, without asking, so other commands and scheduled runs no longer stop at its prompt
+ * Changed Remote Control sessions to keep the folder they were started in: a connected client can no longer move a session to another folder
+ * Changed managed `extraKnownMarketplaces` take-overs from an undeclared source: saved data is set aside for `cleanupPeriodDays`, and options and secrets until `claude plugin restore-set-aside`
+
+Show 15 improvements
+
+ * Improved the `/model` picker: “More models” is now an unnumbered row below every other, and older models open under it without renumbering the rest
+ * Gateway: Improved spend limits on a busy replica, which now skips fewer checks and records spend sooner
+ * Improved the Claude apps gateway’s sign-in limit messages in Claude Code and on the `/device` page: they no longer name gateway settings, which the gateway’s own log still names
+ * Improved `claude install` and the install scripts: they finish 2 to 4 seconds sooner
+ * Improved how soon a Remote Control session whose process crashed can pick up a new message
+ * Windows: Improved startup and first-command time by finding programs on PATH without starting a helper process
+ * Improved auto mode in headless sessions, the desktop app and VS Code: reports from background subagents that wait together are answered in one model call, as in the terminal
+ * Improved the agent view’s row for a `claude --bg --worktree` session that couldn’t set up its worktree: it now shows the error from its beginning, not an internal tag or its last 200 characters
+ * Improved the messages shown when an artifact is in another organization: `/login` is offered only if it’s one of yours, and Claude now says where a copy may be after an account move
+ * Improved sessions with more images than fit in one request: Claude is told whether it has already seen a dropped image, and repeat reads of an unchanged image are limited
+ * Improved `claude remote-control`’s messages for an unanswered first-run question: each now says what to do next
+ * Improved start-up time by loading trusted TLS certificates faster
+ * Improved Claude apps gateway error messages to show the gateway’s address without any user name or password
+ * Improved the Claude apps gateway’s spend limit error: the reset now shows in your local time, such as “resets 4pm (America/Los_Angeles)”
+ * Windows: Improved startup time with a standard Git for Windows install by no longer checking which git.exe to run on every launch
+
+Show 74 bug fixes
+
+ * Fixed MCP OAuth requests sending secrets such as refresh tokens to another host when a server redirected them
+ * Fixed a case where a read-only Bash command ran outside the sandbox without a permission prompt
+ * Fixed a case where Bash permission checks judged a file write from the wrong folder and didn’t prompt
+ * Fixed deny rules and protected-file prompts not applying to the file that a `cp` or `mv` into a directory writes
+ * Fixed the “Draws from usage credits” note showing after a switch to Fable on Enterprise seats whose plan includes Fable
+ * Fixed the fallback model sometimes declining a request or mentioning a stopped response when the first model was blocked before replying
+ * Fixed `claude mcp login` printing a SEP-2352 issuer warning each time you sign in again to a server that Claude Code registered with
+ * Fixed `NotebookEdit` deleting or overwriting a notebook’s first cell when the call named no cell, on network paths (UNC shares, WSL folders, `/net` mounts)
+ * Fixed Edit changing the first of several matches, replacing a whole file on an empty `old_string`, or editing a notebook as text, on network paths (UNC shares, WSL folders, `/net` mounts)
+ * Fixed `/config` showing Manual as the default permission mode when new sessions start in auto mode; pressing Space on “Auto (default)” now saves Don’t Ask, not Plan
+ * Windows: Fixed `FileChanged` hooks stopping for paths set through `watchPaths` after the first shell command, when the session’s working directory had a lowercase drive letter
+ * Fixed `--plugin-dir .` and `--plugin-dir ./builtin` writing generated type files for Claude Code’s built-in plugins into a `builtin` folder
+ * Fixed context usage estimates overcounting tool definitions when exact token counts are unavailable
+ * Fixed `/compact` showing twice in Remote Control on web and mobile
+ * Fixed plugin auto-updates and `/plugin` marketplace updates downloading a plugin again for each worktree or folder of a repository
+ * Fixed auto mode losing a background subagent’s report that had started a turn when the conversation was compacted before Claude answered it
+ * Fixed project skills, commands and agents staying missing after their folder was removed and came back mid-session, such as with `git stash`, including after entering a worktree
+ * Fixed `claude -p` sometimes telling Claude that background commands get 30 minutes when they are stopped after 10
+ * Fixed `pkill`, `pgrep` and `pidwait` in cloud sessions matching the session’s own parent processes
+ * Fixed Claude in Chrome and computer use server processes staying alive after their parent exits behind a proxy that stalls connections
+ * Fixed a large hook output pointing Claude to a file that held another hook’s output from the same tool call
+ * Fixed apps that embed Claude Code getting their own PreToolUse hook’s `ask` reason instead of another hook’s when both asked
+ * Fixed a PreToolUse hook’s `ask` being lost when another hook’s `defer` finished first and could not be honored
+ * Fixed a rare crash on permission prompts and background tasks
+ * Fixed project skills, commands and agents disappearing from the menu in SDK and desktop sessions after Claude entered a worktree
+ * Fixed `/desktop` on macOS saying Claude Desktop is not installed when it is in `~/Applications`
+ * Fixed OpenTelemetry repository attributes (`vcs.*`) missing from Claude Desktop sessions that start on a pre-started process
+ * Fixed WebFetch passing “No response from model” to Claude as page content when the model reading the page returned no text; the call now fails with a clear error
+ * Fixed screen reader mode delaying the prompt at startup when the system clock moved back while Claude Code was starting
+ * Fixed a command’s panel sometimes not coming back after a dialog closed, leaving no panel or prompt on screen until the next redraw
+ * Fixed a project’s MCP server being disconnected after the first message in a Claude Desktop Code tab session when the desktop app has an MCP server or extension of the same name
+ * Fixed a turn ending with “API Error: EPROTO: The TLS handshake failed” when the connection broke partway through a reply; the partial reply is kept or the request is retried, as before 2.1.302
+ * Fixed high memory use in long sessions that repeatedly read single lines from large files
+ * Fixed fast mode losing replies, switching models or retrying for minutes when fast serving is rate-limited, overloaded or failing; it now tries standard speed on the same model first
+ * Fixed one request carrying far more background agent reports than intended after Claude was stopped while several were waiting
+ * Fixed messages from a Claude Desktop Code tab session to your other sessions staying paused after you typed while Claude was still working
+ * Fixed `claude agents` ignoring `--permission-mode`, `--dangerously-skip-permissions`, `--model`, `--effort` or `--agent` typed before `agents` when a flag such as `--verbose` was also on the line
+ * Fixed a case where Remote Control showed as off with “login expired” in the desktop app while its connection was still up, because the app was briefly unable to hand over a sign-in token
+ * Fixed a Remote Control message sent with “Queue for later” reaching Claude in the middle of the running turn
+ * Fixed the git status given to Claude at session start reading as clean when git status failed; it now reads as unavailable
+ * Fixed the git status given to Claude at session start showing the first listed file as staged when its changes were not staged
+ * Fixed a hang or out-of-memory crash when a connector in a cloud session lists resources with very long names
+ * Fixed Remote Control showing as connected after its connection closed for good while the session’s history was still uploading
+ * Fixed screen reader mode turning off when you return to a conversation from agent view
+ * Fixed screen reader mode y/n questions taking as yes a stray “y” at the end of text typed as the question opened
+ * Fixed cloud sessions telling Claude that a host is probably not allowed when it is allowed and the network proxy could not connect to it
+ * Fixed an MCP server sometimes showing as connected with no tools after it was reconnected or the session’s directory changed while its tools were still loading
+ * Fixed Bash commands sometimes running in the wrong folder when Claude sent several at once and an earlier one changed folders
+ * Fixed files Claude sends from cloud and Remote Control sessions failing at once when an upload gets an HTTP 507 from a proxy; the upload now gets a second try
+ * Fixed new messages not being saved, and `claude -p`, SDK and VS Code sessions hanging, when memory ran out while the transcript was being read
+ * Fixed sign-in, token refresh and logout waiting indefinitely when something on the network accepts the connection but never answers the TLS handshake
+ * Fixed a sent file showing under a different name in the Claude apps when its name hid text-direction or control characters; Claude now refuses to send such a file
+ * Fixed sub-agent progress summaries running a request to its end after the model replied with a tool call
+ * Fixed Bash reads such as `grep -r foo "$PWD/src"` asking for permission when the same command with the path typed out runs without asking
+ * Fixed Claude apps gateway refusing to start when a `desktop` setting holds a field newer than the gateway, such as a managed MCP server’s `oauth.omitResource`; it now warns and serves it
+ * Fixed Bash commands coming back empty for zsh users whose `.zshrc` sets `KSH_OPTION_PRINT`
+ * macOS: Fixed “Unable to read managed policy settings” at startup when a valid MDM profile was slow to read: the read is retried once, and a timeout is now reported as a timeout
+ * Fixed agent view erasing another agent view’s saved input text when it restarted for an update with nothing typed
+ * Fixed remote sessions giving no reply after a restart when a `UserPromptSubmit` hook blocked a replayed permission answer; these hooks no longer run on that replay
+ * Fixed `claude remote-control` accepting a `y` typed without Enter at its first-run question when the terminal’s input ended
+ * Fixed Claude Desktop not showing spend limit warnings behind a Claude apps gateway whose policy has no `code:` rules
+ * Fixed fullscreen sessions with some plugins ending with an error when a tool result that had got shorter scrolled off the top of the screen
+ * Fixed prompt suggestions making extra API requests when the model replied with a tool call
+ * Fixed `PreToolUse` `mcp_tool` hooks on stdio and HTTP MCP servers being skipped when their answer was over 16 MiB; the tool call is now refused
+ * Fixed skill and command names holding a Bamum letter that some fonts draw as blank: they are now refused
+ * Fixed `claude -p` on Linux exiting 0 in silence when a full NFS export or a used-up NFS quota lost transcript lines: it now prints an error and, in text and json output, exits 1
+ * Fixed background agents being reported as stopped by the user, and refused a resume, when a service interrupted a cloud session and nobody pressed Stop
+ * Fixed NotebookEdit reporting success to hooks and telemetry when the edit failed, for example when the notebook changed while the permission prompt was open
+ * Fixed a blank screen or no answer at startup, and empty `claude mcp list` output, when a stored MCP sign-in record was null
+ * Fixed the Artifact tool telling Claude to add filters when an artifact’s database collection is too large to sort; it now says to read the collection page by page and sort the results
+ * Fixed a restarted cloud session dropping a message with a large image when the restart came before Claude’s first reply to it
+ * Fixed a restarted cloud session leaving a subagent’s message to the main conversation unanswered
+ * Fixed Claude not being told when you stop or pause a running workflow, so it no longer says the workflow is still running
+ * [VSCode] Fixed a plugin’s permission request showing a name with hidden characters: it now reads “a plugin”
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
@@ -162,7 +162,7 @@
volumes: ["pgdata:/var/lib/postgresql/data"]
volumes: { pgdata: }
-The gateway is a single Linux binary that reads the config, connects to Postgres and applies its schema migrations, runs OIDC discovery against your IdP, builds upstream clients, and starts listening.Boot is fail-closed for the config, the Postgres connection, OIDC discovery, and upstream client construction. If any of those is unreachable or misconfigured, the gateway exits with an error rather than serving traffic in a degraded state.A successful boot doesn’t validate the inference path, because Amazon Bedrock and Google Cloud’s Agent Platform instance credentials resolve on the first request, not at boot.Watch stderr for the boot sequence. Log lines use the format `[gateway] <timestamp> <level> <message>`, audit events are single-line JSON with an `evt` field, and a startup banner, omitted below, prints between the migration and listening lines. A fresh database prints one `migration N applied` line per schema migration; an already-migrated database prints none. You should see, in order:
+The gateway is a single Linux binary that reads the config, connects to Postgres and applies its schema migrations, runs OIDC discovery against your IdP, builds upstream clients, and starts listening.Boot is fail-closed for the config, the Postgres connection, OIDC discovery, and upstream client construction. If any of those is unreachable or misconfigured, the gateway exits with an error rather than serving traffic in a degraded state.A successful boot doesn’t validate the inference path, because Amazon Bedrock and Google Cloud’s Agent Platform instance credentials resolve on the first request, not at boot.Watch stderr for the boot sequence. By default, log lines use the format `[gateway] <timestamp> <level> <message>`, and a startup banner, omitted below, prints between the migration and listening lines. Audit events are single-line JSON with an `evt` field. A fresh database prints one `migration N applied` line per schema migration; an already-migrated database prints none. You should see, in order:
{"ts":"2026-06-10T17:03:21.114Z","evt":"config.load","path":"/etc/claude/gateway.yaml","sha256":"…"}
[gateway] 2026-06-10T17:03:21.395Z info waiting for migration lock (another replica may be migrating; check pg_locks for key 6775156 if this persists)
--- a/claude-apps-gateway-config.md
+++ b/claude-apps-gateway-config.md
@@ -16,6 +16,7 @@
**Optional sections:**
+ * `login_notice`: a notice developers see when they sign in
* `admin`: Admin API auth and retention for spend limits
* `enforcement`: spend-limit fail-open or fail-closed behavior
* `pricing`: contracted rates and a multiplier for the spend meter and for the cost figures developers see
@@ -775,6 +776,18 @@
+`login_notice`
+
+To show developers a notice when they sign in, set the top-level `login_notice` key to the notice text, up to 500 characters. This example says who the gateway is for and where to ask for access:
+
+ login_notice: This gateway is for Example Corp staff. For access questions, email it-help@example.com.
+
+Developers see the text under `Notice from <gateway hostname>` on the gateway’s verification page in the browser and on the interactive sign-in screen in the terminal. Line breaks in the text become spaces. The notice appears before sign-in, so anyone who can reach the gateway can read it. Requires Claude Code v2.1.319 or later on the gateway server, and also on the developer’s machine for the terminal screen. An earlier gateway refuses to start when it finds the key. Upgrade every replica before you add the key, and remove the key before you roll back.
+
+###
+
+
+
`admin`
Optional. Enables `/v1/organizations/spend_limits`, which mirrors Anthropic’s public Admin API, and per-developer spend enforcement on `/v1/messages`. See [Spend limits](</docs/en/claude-apps-gateway-spend-limits>) for how caps are set and enforced; this section covers the `gateway.yaml` keys that turn the feature on and tune it.
@@ -792,6 +805,9 @@
# IdP groups granted full admin via the normal gateway JWT (no API key).
admin_groups: [platform-finops]
blocked_message: request an increase at https://go.example.com/claude-limits
+ # Try eng-platform's pooled budget first, then eng-all's, then any other group's.
+ pooled_conflict_rule: priority_list
+ pooled_priority_order: [eng-platform, eng-all]
Field| Required| Description
---|---|---
@@ -803,6 +819,21 @@
`spend_retention_months`| No| Default `13`. `spend` counter rows older than this are swept. The default keeps a full year plus the current partial month for year-over-year reporting.
`identity_retention_days`| No| Default `90`. Last-seen TTL for `principal_emails` rows, which hold each developer’s email, display name, and groups (PII). Deliberately shorter than spend retention so a deprovisioned identity ages out while its anonymous spend counters remain.
`group_limit_mode`| No| `min` (default) or `max`. When a developer is in several groups with caps, `min` enforces the most restrictive and `max` the least. Used by both enforcement and `/effective`.
+`pooled_conflict_rule`| No| `default_order` (default) or `priority_list`. The order the gateway tries a developer’s pooled budgets in. See Pooled budget order. Requires v2.1.319 or later.
+`pooled_priority_order`| With `priority_list`| Up to 50 group names, each listed once and spelled as your IdP sends it. The groups whose pooled budgets the gateway tries first. See Pooled budget order. Requires v2.1.319 or later.
+
+####
+
+
+
+Pooled budget order
+
+A pooled budget is one monthly limit that a whole group spends against. To set one, add `pooled_budget` to the [request that sets the group’s monthly cap](</docs/en/claude-apps-gateway-spend-limits#set-a-cap>), as in `"pooled_budget": {"amount": "500000"}` for $5,000. The request also takes the group’s `scope`, `"period": "monthly"`, and `amount`, which stays each member’s own cap. For a developer in several such groups, each request counts against the first budget whose spend is below its limit, and is refused when every budget is used up. `pooled_conflict_rule` sets the order the gateway tries the budgets in:
+
+ * **`default_order`** : the largest limit first, and equal limits in ascending group-name order
+ * **`priority_list`** : the budgets of the groups in `pooled_priority_order`, in list order, then the other groups’ budgets by group name
+
+If you list groups without `pooled_conflict_rule: priority_list`, the gateway ignores the list and logs a warning at boot. A gateway server earlier than v2.1.319 refuses to start when it finds `pooled_conflict_rule` or `pooled_priority_order`. Upgrade every replica before you add either key, and remove both keys before you roll back.
###
@@ -1512,6 +1543,8 @@
# environment variable (debug | info | warn | error; default info). debug
# also logs the claim names in each id_token, for groups_claim diagnosis.
# It does not affect audit events, which are always emitted.
+ # Set CLAUDE_GATEWAY_LOG_FORMAT=json to write operational log lines as JSON
+ # objects with severity, time, and message.
listen:
host: 0.0.0.0
@@ -1552,6 +1585,9 @@
# connect_timeout_seconds: 5
# readiness_grace_seconds: 300 # keep passing the readiness check through a database failover
+ # Notice shown at sign-in. Anyone who can reach the gateway can read it.
+ # login_notice: This gateway is for Example Corp staff. For access questions, email it-help@example.com.
+
# Enables /v1/organizations/spend_limits (mirrors the Anthropic Admin API)
# and per-developer spend enforcement on /v1/messages. Omit to disable.
# Caps themselves are set via the admin API, not here.
@@ -1566,6 +1602,8 @@
# # spend_retention_months: 13
# # identity_retention_days: 90
# # group_limit_mode: min
+ # # pooled_conflict_rule: priority_list
+ # # pooled_priority_order: [eng-platform, eng-all]
# enforcement:
# fail_closed_on_error: false
--- a/claude-apps-gateway-deploy.md
+++ b/claude-apps-gateway-deploy.md
@@ -163,6 +163,18 @@
* `guardrail.trace` records [which filter fired](</docs/en/claude-apps-gateway-config#log-which-guardrail-filter-fired>), without the matched text
* `admin.denied` records a rejected admin-API auth attempt with the client IP, method, path, and a reason, without the presented key material: `invalid_key` when an `x-api-key` was presented but matched no configured key, `bearer_rejected` when only an `Authorization` header was presented and it didn’t verify as a gateway session in `admin.admin_groups`, or `no_credentials` when neither header was presented
* **Operational logs** : human-readable `[gateway]`-prefixed lines for boot, warnings, and upstream errors. The `CLAUDE_GATEWAY_LOG_LEVEL` environment variable controls verbosity and accepts `debug`, `info`, `warn`, or `error`, with `info` as the default. At `debug`, each sign-in and refresh also logs the names, not the values, of the claims in the id_token, plus the names of the userinfo claims when `userinfo_fallback` supplied any, so you can diagnose `email_claim` and `groups_claim` settings without logging PII. It doesn’t affect audit events, which are always emitted.
+
+####
+
+
+
+Write operational logs as JSON
+
+If your log collector reads each line’s level from a JSON field, set `CLAUDE_GATEWAY_LOG_FORMAT=json` in the gateway’s environment. Requires Claude Code v2.1.319 or later on the gateway server. Each operational log line is then one object with `severity`, `time`, and `message`:
+
+ {"severity":"INFO","time":"2026-11-04T17:03:21.512Z","message":"claude gateway listening on http://0.0.0.0:8080"}
+
+`severity` is the log level in capitals, with `warn` written as `WARNING`. A failed start is an `ERROR` line. Audit events, which also go to stderr, don’t change. They carry `ts` and `evt`, and no `severity`.
###
--- a/claude-apps-gateway-spend-limits.md
+++ b/claude-apps-gateway-spend-limits.md
@@ -1,4 +1,4 @@
-Spend limits cap how much each developer can spend through your [Claude apps gateway](</docs/en/claude-apps-gateway>) in a given day, week, or month. When a developer passes their cap, the gateway returns `429` on their next request and blocks them until the period resets or an admin raises the cap. Use spend limits to give each developer, group, or the whole organization a ceiling on a credential everyone shares. By default, a Claude apps gateway forwards all inference through one shared upstream credential, so your provider’s bill attributes everything to that credential, not to individual developers. On Amazon Bedrock, [per-developer AWS cost attribution](</docs/en/claude-apps-gateway-config#per-developer-aws-cost-attribution>) changes this. Without per-developer limits, one runaway agent fleet can spend the organization’s entire commitment. Spend limits are the gateway’s per-developer view and circuit breaker on top of that shared bill.
+Spend limits cap how much each developer can spend through your [Claude apps gateway](</docs/en/claude-apps-gateway>) in a given day, week, or month. When a developer passes their cap, the gateway returns `429` on their following requests until an admin raises the cap, or until the cap resets if it’s above $0. Use spend limits to give each developer, group, or the whole organization a ceiling on a credential everyone shares. By default, a Claude apps gateway forwards all inference through one shared upstream credential, so your provider’s bill attributes everything to that credential, not to individual developers. On Amazon Bedrock, [per-developer AWS cost attribution](</docs/en/claude-apps-gateway-config#per-developer-aws-cost-attribution>) changes this. Without per-developer limits, one runaway agent fleet can spend the organization’s entire commitment. Spend limits are the gateway’s per-developer view and circuit breaker on top of that shared bill.
##
@@ -45,7 +45,11 @@
How enforcement works
-On each `/v1/messages` request, the gateway looks up the developer’s caps and period-to-date spend in one Postgres query. A developer over any cap gets a `429` with `error.type: billing_error` and header `x-should-retry: false`. The message names the period and reset time, such as `spend limit reached (daily; resets 2026-08-08 00:00 UTC)`, followed by your [`admin.blocked_message`](</docs/en/claude-apps-gateway-config#admin>) if set. When a developer exceeds several caps at once, the message names the cap that resets last. The response also carries a `retry-after` header with the seconds remaining until that reset. Before v2.1.225 on the gateway server, the message was `spend limit reached` with no period, reset time, or `retry-after` header. On v2.1.227 or later, the protocol reference at `<public_url>/protocol` also lists the exact usage-limit response headers and `429` body. Caps reset on UTC calendar boundaries: daily at 00:00 UTC, weekly on Monday, and monthly on the first. The gateway never blocks `/v1/messages/count_tokens`, because token counting is free.
+On each `/v1/messages` request, the gateway looks up the developer’s caps and period-to-date spend in one Postgres query. A developer over any cap gets a `429` with `error.type: billing_error` and header `x-should-retry: false`. For a cap above `"0"`, the message gives the UTC date that cap resets. If you set [`admin.blocked_message`](</docs/en/claude-apps-gateway-config#admin>), the gateway appends it, as in this example:
+
+ spend limit reached · resets Dec 1 · request an increase at https://go.example.com/claude-limits
+
+For a `"0"` cap, which a reset doesn’t lift, the message has no date. When a developer exceeds several caps at once, the message describes the cap that resets last. The response also carries a `retry-after` header with the seconds until that cap’s period ends. Before v2.1.319 on the gateway server, the message named the period and reset time, such as `spend limit reached (daily; resets 2026-08-08 00:00 UTC)`. Before v2.1.225, the message was `spend limit reached` with no period, reset time, or `retry-after` header. On v2.1.227 or later, the protocol reference at `<public_url>/protocol` also lists the exact usage-limit response headers and `429` body. Caps reset on UTC calendar boundaries: daily at 00:00 UTC, weekly on Monday, and monthly on the first. The gateway never blocks `/v1/messages/count_tokens`, because token counting is free.
###
@@ -91,6 +95,7 @@
Usage warnings at 75% and 95%| v2.1.225 or later| v2.1.225 or later
A **Spend limit** bar in `/usage` with the percentage of their cap used and when it resets, and a `rate_limits.spend_limit` object in the status line input| v2.1.251 or later| v2.1.225 or later
Their estimated spend and the cap in US dollars in the **Spend limit** bar, such as “$271.40 / $500.00 spent this month”, and the same amounts plus the cap’s period in the status line input| v2.1.284 or later| v2.1.284 or later
+On a gateway with an [`admin:`](</docs/en/claude-apps-gateway-config#admin>) block, when no cap applies to them, their estimated spend under **Spend (UTC)** in `/usage`, such as “$13.06 today · $80.76 this week · $272.06 this month”| v2.1.319 or later| v2.1.319 or later
The warnings and the percentage come from the `anthropic-ratelimit-unified-*` headers, which the gateway adds to each successful `/v1/messages` response for a developer who has a cap. The headers always describe the developer’s own cap: the gateway strips the upstream provider’s rate-limit headers, which describe your shared quota, and never forwards them. The spend a developer sees is the gateway’s own estimate, the same figure it enforces the cap with. It isn’t an amount from your provider’s bill. Claude Code reads the dollar amounts with a separate request to the gateway, which it sends even if you set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` on developers’ machines. Before v2.1.295, Claude Code skipped that request when the variable was set, and `/usage` and the status line showed the percentage and the reset date, with no dollar amounts.
--- a/claude-code-on-the-web.md
+++ b/claude-code-on-the-web.md
@@ -185,7 +185,7 @@
* **Using`/teleport`**: inside an existing CLI session, run `/teleport` or `/tp` to open the same session picker without restarting Claude Code.
* **From`/tasks`**: run `/tasks` to see your background sessions, then press `t` to teleport into one.
* **From claude.ai/code** : select **Open in > Terminal** from the session menu to copy a command you can paste into your terminal.
- * **From inside the cloud session** : type `/teleport` and Claude Code replies with the exact `claude --teleport <session-id>` command for that session, ready to run from a checkout of the repository. Requires Claude Code v2.1.223 or later in the session’s environment.
+ * **From inside the cloud session** : type `/teleport` and Claude Code replies with the exact `claude --teleport <session-id>` command for that session, ready to run from a checkout of the repository.
When you teleport a session, Claude verifies you’re in the correct repository, fetches and checks out the branch from the cloud session, and loads the conversation into your terminal.
@@ -571,9 +571,6 @@
* **Repository authentication** : you can only pull a cloud session into your terminal when you are authenticated to the same account
* **Platform restrictions** : repository cloning in Anthropic-hosted environments and pull request creation require GitHub. Self-hosted [GitHub Enterprise Server](</docs/en/github-enterprise-server>) instances are supported for Team and Enterprise plans. You can send a GitLab, Bitbucket, or other non-GitHub repository to a cloud session as a local bundle by setting `CCR_FORCE_BUNDLE=1`, but the session can’t push results back to that remote
* **Self-hosted environments** : for a repository on another git host, see the [requirements for starting a session with `--environment`](</docs/en/self-hosted-environments-deploy#start-a-session-on-a-repository-outside-github>).
- * **Organization IP allowlist** : cloud sessions call the Anthropic API from Anthropic-managed infrastructure, not your network, while sessions in a [self-hosted environment](</docs/en/self-hosted-environments>) call it from your own network. If your organization has [IP allowlisting](<https://support.claude.com/en/articles/13200993-restrict-access-to-claude-with-ip-allowlisting>) enabled, every Anthropic-hosted cloud session fails with an authentication error.
- * **Code Review and scheduled tasks** : the same applies to [Code Review](</docs/en/code-review>) and to [cloud scheduled tasks](</docs/en/routines>) that run on Anthropic-hosted environments. A scheduled task routed to a self-hosted environment calls the API from your own network.
- * **Getting an exemption** : contact [Anthropic support](<https://support.claude.com/>) to exempt Anthropic-hosted services from your organization’s IP allowlist.
##
--- a/cli-reference.md
+++ b/cli-reference.md
@@ -37,7 +37,7 @@
`claude mcp logout <name>`| Clear stored OAuth credentials for an MCP server| `claude mcp logout sentry`
`claude plugin`| Manage Claude Code [plugins](</docs/en/plugins/overview>). Alias: `claude plugins`. See [plugin reference](</docs/en/plugins/cli-reference#claude-plugin-commands>) for subcommands| `claude plugin install code-review@claude-plugins-official`
`claude purge [path]`| Delete all local Claude Code state for a project: transcripts, task lists, debug logs, file-edit history, prompt history lines, and the project’s entry in `~/.claude.json`. Omit `[path]` to pick from an interactive list. Flags: `--dry-run` to preview, `-y`/`--yes` to skip confirmation, `-i`/`--interactive` to confirm each item, `--all` for every project. See [Clear local data](</docs/en/claude-directory#clear-local-data>)| `claude purge ~/work/repo --dry-run`
-`claude remote-control`| Start a [Remote Control](</docs/en/remote-control>) server to control Claude Code from Claude.ai or the Claude app. Runs in server mode (no local interactive session). See [Server mode flags](</docs/en/remote-control#start-a-remote-control-session>). After you stop the server, you can bring back the sessions it was serving. See [Resume sessions after stopping the server](</docs/en/remote-control#resume-sessions-after-stopping-the-server>)| `claude remote-control --name "My Project"`
+`claude remote-control`| Start a [Remote Control](</docs/en/remote-control>) server to control Claude Code from claude.ai or the Claude app. Alias: `claude rc`. Runs in server mode (no local interactive session). See [Server mode flags](</docs/en/remote-control#start-a-remote-control-session>). After you stop the server, you can bring back the sessions it was serving. See [Resume sessions after stopping the server](</docs/en/remote-control#resume-sessions-after-stopping-the-server>)| `claude remote-control --name "My Project"`
`claude respawn <id>`| Restart a [background session](</docs/en/agent-view#manage-sessions-from-the-shell>), running or stopped, with its conversation intact. Use `--all` to restart every running session, e.g. to pick up an updated Claude Code binary| `claude respawn 7c5dcf5d`
`claude rm <id>`| Remove a [background session](</docs/en/agent-view#manage-sessions-from-the-shell>) from the list. When the removal is [refused over the session’s worktree](</docs/en/agent-view#what-deleting-a-session-removes>) and a second `claude rm` can resolve it, the refusal prints the exact flag and value to pass: `--discard-unpushed <commit>@<worktree-id>` discards a worktree that has unpushed commits along with those commits, and `--force-remove-worktree <worktree-id>` deletes a worktree directory that git or the `WorktreeRemove` hook couldn’t remove. `--discard-unpushed` requires Claude Code v2.1.260 or later, and `--force-remove-worktree` requires v2.1.268 or later. The conversation transcript stays on your local machine, available through `claude --resume`| `claude rm 7c5dcf5d`
`claude self-hosted-runner`| Start a runner process that registers this machine or container with a [self-hosted environment](</docs/en/self-hosted-environments>) and hosts Claude Code cloud sessions on your infrastructure. Run `claude self-hosted-runner setup` for a guided operator walkthrough, `claude self-hosted-runner doctor` to [diagnose a deployed runner](</docs/en/self-hosted-environments-deploy#troubleshooting>), and `claude self-hosted-runner orchestrator` to spawn [on-demand runners](</docs/en/self-hosted-environments-configuration#on-demand-runners>). Requires Claude Code v2.1.224 or later| `claude self-hosted-runner setup`
@@ -111,7 +111,7 @@
`--no-session-persistence`| Disable session persistence so sessions are not saved to disk and cannot be resumed. Print mode only. The [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](</docs/en/env-vars>) environment variable does the same in any mode| `claude -p --no-session-persistence "query"`
`--output-format`| Specify output format for print mode (options: `text`, `json`, `stream-json`)| `claude -p "query" --output-format json`
`--permission-mode`| Begin in a specified [permission mode](</docs/en/permission-modes>). Accepts `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions`, or `manual` as an alias for `default`. The `manual` alias selects the permission mode the UI labels Manual and requires Claude Code v2.1.200 or later; `claude --help` lists it in place of `default`, and both values work. Overrides `defaultMode` from settings files. Without this flag or `--dangerously-skip-permissions`, a new session starts in the permission mode described in [which permission mode a session starts in](</docs/en/permission-modes#which-mode-a-session-starts-in>), which also covers what a `-p` run starts in| `claude --permission-mode plan`
-`--permission-prompt-tool`| Specify an MCP tool to handle permission prompts in non-interactive mode. Pass the full name, such as `mcp__<server>__<tool>`, of a tool on an MCP server that the run loads. Claude Code waits for that tool’s MCP server to connect before running the first turn, up to the [`MCP_TIMEOUT`](</docs/en/env-vars>) startup timeout, 30 seconds by default.
+`--permission-prompt-tool`| Specify an MCP tool to handle permission prompts in non-interactive mode. Pass the full name, such as `mcp__<server>__<tool>`, of a tool on an MCP server that the run loads. Claude Code waits for that tool’s MCP server to connect before running the first turn, up to the [`MCP_TIMEOUT`](</docs/en/env-vars>) startup timeout, 30 seconds by default. See [what the tool must return](</docs/en/errors#permission-prompt-tool-returned-an-invalid-result>).
The prompt tool can’t approve an MCP tool marked as [requiring user interaction](</docs/en/mcp#require-approval-for-a-specific-tool>): Claude Code converts an `allow` result for one to a deny. This restriction requires Claude Code v2.1.199 or later| `claude -p --mcp-config ./mcp.json --permission-prompt-tool mcp__permissions__approve "query"`
`--permission-prompts`| Set who answers permission prompts in print mode. With the default `host`, Claude Code sends them to the Agent SDK host or the `--permission-prompt-tool` tool. Pass `none` when nobody can answer, and Claude Code denies them instead. See [Turn off permission prompts in unattended runs](</docs/en/headless#turn-off-permission-prompts-in-unattended-runs>). Requires Claude Code v2.1.259 or later| `claude -p --permission-prompts none "query"`
--- a/code-review-local.md
+++ b/code-review-local.md
@@ -2,7 +2,7 @@
To have every pull request in a repository reviewed automatically on GitHub, see [Code Review](</docs/en/code-review>), a managed service that an Owner turns on for your organization.
-`/review` is an alias of `/code-review`. Before v2.1.223, `/review` was a separate command that ran a single-pass, read-only review of a GitHub pull request.
+`/review` is an alias of `/code-review`.
1
@@ -90,8 +90,6 @@
* **Non-interactive runs** : a level you pass in a non-interactive `-p` run doesn’t update the remembered level
* **`ultra`** : the review neither uses nor updates the remembered level
* **No level ever typed** : the review uses the session’s current effort
-
-Before v2.1.223, a `/code-review` without a level always used the session’s current effort.
###
--- a/commands.md
+++ b/commands.md
@@ -82,7 +82,7 @@
`/install-github-app`| Install the Claude GitHub App for a repository, with an optional step to set up [GitHub Actions](</docs/en/github-actions>) workflows and secrets. Walks you through selecting a repo and configuring the integration. Works only with github.com repositories. When your repository’s git remote is on gitlab.com or bitbucket.org, the command prints a notice and exits instead of starting setup. To run Claude Code from GitLab pipelines, see [GitLab CI/CD](</docs/en/gitlab-ci-cd>)
`/install-slack-app`| Install the Claude Slack app. Opens a browser to complete the OAuth flow
`/keybindings`| Open your [keyboard shortcuts](</docs/en/keybindings>) file
-`/list-agents`| List the subagents, [agent team](</docs/en/agent-teams>) teammates, and other Claude Code sessions Claude can message, with the name to use for each. See [cross-session messaging](</docs/en/cross-session-messaging>). Also available as `/peers`. Requires Claude Code v2.1.224 or later; earlier versions report `Unknown command: /list-agents`. Teammate rows and the first line showing this session’s own name require v2.1.239 or later. Available only in sessions where [cross-session messaging is enabled](</docs/en/cross-session-messaging#availability>)
+`/list-agents`| List the subagents, [agent team](</docs/en/agent-teams>) teammates, and other Claude Code sessions Claude can message, with the name to use for each. See [cross-session messaging](</docs/en/cross-session-messaging>). Also available as `/peers`. Teammate rows and the first line showing this session’s own name require v2.1.239 or later. Available only in sessions where [cross-session messaging is enabled](</docs/en/cross-session-messaging#availability>)
`/login`| Sign in to your Anthropic account
`/logout`| Sign out from your Anthropic account
`/loop [interval] [prompt]`| **[Skill](</docs/en/skills#bundled-skills>).** Run a prompt repeatedly while the session stays open. Omit the interval and Claude [self-paces between iterations](</docs/en/scheduled-tasks#let-claude-choose-the-interval>). Omit the prompt and Claude runs the [built-in maintenance prompt](</docs/en/scheduled-tasks#run-the-built-in-maintenance-prompt>) or your [`loop.md`](</docs/en/scheduled-tasks#customize-the-default-prompt-with-loop-md>). Example: `/loop 5m check if the deploy finished`. See [Run prompts on a schedule](</docs/en/scheduled-tasks>). Alias: `/proactive`
@@ -110,7 +110,7 @@
`/rename [name]`| Rename the current session and show the name on the prompt bar. Without a name, auto-generates one from conversation history. Also available in non-interactive mode (`-p`). From every rename surface, including claude.ai and the desktop app, Claude Code replaces control and invisible characters in the new name with spaces and caps the name at 200 characters. If the name is empty once invisible characters are removed, Claude Code rejects it and shows `That name is empty once invisible characters are removed. Usage: /rename <name>`. The character replacement and length cap require Claude Code v2.1.221 or later
`/restart`| Restart Claude Code and resume this session, which applies an installed update. Run it when the footer offers it after an update installs. Requires a Pro, Max, or Ultra plan and a native install on macOS or Linux, not WSL. Requires Claude Code v2.1.288 or later. Alias: `/update`
`/resume [session]`| Resume a conversation by ID or name, or open the session picker. [Background sessions](</docs/en/agent-view>) appear in the picker marked with `bg`. Resuming one that is still running, from the picker or by ID or name, [opens that session](</docs/en/sessions#resume-a-running-background-session>): your current conversation moves to the background and this terminal attaches to the running one. Press `←` on an empty prompt to return to agent view, which also lists the conversation you left. Before v2.1.285, Claude Code refused and told you to open the session with `claude attach` or stop it first. Alias: `/continue`
-`/review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [--max-findings n|all|default] [pr#|branch|path]`| Alias of [`/code-review`](</docs/en/code-review-local>): reviews the current diff, or a PR number, branch, or path you pass, such as `/review 1234`, and takes the same effort levels and flags. With no level given, the review reuses the last `low` through `max` level you typed; see [Review locally with `/code-review`](</docs/en/code-review-local>) for the exact rules. For a deep cloud review, use [`/code-review ultra`](</docs/en/ultrareview>). Before v2.1.223, `/review` was a separate command that ran a single-pass, read-only review of a GitHub pull request by number, listing open PRs to pick from when run with no argument; from v2.1.186 through v2.1.201, it ran the same multi-agent engine as `/code-review medium`
+`/review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [--max-findings n|all|default] [pr#|branch|path]`| Alias of [`/code-review`](</docs/en/code-review-local>): reviews the current diff, or a PR number, branch, or path you pass, such as `/review 1234`, and takes the same effort levels and flags. With no level given, the review reuses the last `low` through `max` level you typed; see [Review locally with `/code-review`](</docs/en/code-review-local>) for the exact rules. For a deep cloud review, use [`/code-review ultra`](</docs/en/ultrareview>)
`/rewind`| Rewind the conversation and/or code to a previous point, or summarize from a selected message. See [checkpointing](</docs/en/checkpointing>). Aliases: `/checkpoint`, `/undo`
`/run`| **[Skill](</docs/en/skills#bundled-skills>).** Launch and drive your project’s app to see a change working, not only passing tests. See [Run and verify your app](</docs/en/skills#run-and-verify-your-app>)
`/run-skill-generator`| **[Skill](</docs/en/skills#bundled-skills>).** Teach `/run` and `/verify` how to build, launch, and drive your project’s app from a clean environment by writing a per-project [skill](</docs/en/skills#run-and-verify-your-app>)
@@ -140,7 +140,7 @@
`/ultrareview [PR or branch]`| Run a deep, multi-agent code review in a cloud sandbox with [ultrareview](</docs/en/ultrareview>). Pass a PR reference to review that pull request, or a base branch or commit to change the comparison base. The preferred invocation is `/code-review ultra`, and `/ultrareview` is an alias. Includes 3 free runs on Pro, Max, and Ultra, then requires [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>)
`/update-config [request]`| **[Skill](</docs/en/skills#bundled-skills>).** Describe a settings change, such as allowing a command, setting an environment variable, or adding a [hook](</docs/en/hooks>), and Claude edits the matching [`settings.json`](</docs/en/settings>) file. For options such as theme and model, use `/config` instead
`/upgrade`| Open the upgrade page in your browser to switch to a higher plan tier. When the browser fails to open, the command shows a sign-in prompt without printing the URL
-`/usage`| Show session cost, plan usage limits, and activity stats. On a Pro, Max, Ultra, Team, or Enterprise plan, includes a [breakdown of what counts against your plan limits](</docs/en/costs#plan-usage-breakdown>). `/cost` and `/stats` are aliases
+`/usage`| Show session cost, plan usage limits, and activity stats. On a Pro, Max, Ultra, Team, or Enterprise plan, includes a [breakdown of what counts against your plan limits](</docs/en/costs#plan-usage-breakdown>). Behind a Claude apps gateway that tracks spend, shows [your spend through the gateway](</docs/en/claude-apps-gateway-spend-limits#usage-warnings-in-claude-code>). `/cost` and `/stats` are aliases
`/usage-credits`| Configure usage credits, or request them from your admin, when you hit a limit. Opens your [usage-credits billing settings](</docs/en/costs#add-usage-credits-to-your-subscription>) in the browser, except that Team and Enterprise members without billing access instead send a usage-credits request to their admin from the CLI, after confirming in a dialog that the request notifies their admins. When no browser can open the billing page, for example over SSH, the command prints the URL to visit instead; this requires Claude Code v2.1.205 or later, and earlier versions showed nothing in that case. Previously `/extra-usage`
`/verify`| **[Skill](</docs/en/skills#bundled-skills>).** Confirm a code change does what it should by building your project’s app, running it, and observing the result, rather than relying on tests or type checks. See [Run and verify your app](</docs/en/skills#run-and-verify-your-app>)
`/vim`| Removed in v2.1.92. To toggle between Vim and Normal editing modes, use `/config` → Editor mode
--- a/costs.md
+++ b/costs.md
@@ -258,7 +258,7 @@
* Run `/usage-credits` to request usage beyond the allowance, if you have [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) turned on.
* On Claude Code v2.1.234 or later, [wait and continue the interrupted task automatically after the reset](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>); that section lists when Claude Code starts the wait on its own and when the developer picks it from `/rate-limit-options`. To control for your fleet whether Claude Code starts that wait on its own, set [`autoContinueAtUsageLimit`](</docs/en/settings-reference#autocontinueatusagelimit>) in [managed settings](</docs/en/settings#settings-precedence>).
* **“You’ve hit your individual spend limit”, “org’s monthly spend limit”, or “team’s shared budget”** : the developer’s request would be billed to usage credits, and those credits have reached a spend limit you set. To let the developer continue, go to [**Organization settings > Usage**](<https://claude.ai/admin-settings/usage>) and increase the limit the message names. When the message also names a plan reset time, the developer can instead wait until then. See [the error reference](</docs/en/errors#youve-hit-your-monthly-spend-limit>) for each variant.
- * **A spend limit message from a[Claude apps gateway](</docs/en/claude-apps-gateway>)**: the developer passed a spend cap you set on your self-hosted gateway, and the gateway blocks their requests until the period resets or you raise the cap. See [gateway spend limits](</docs/en/claude-apps-gateway-spend-limits>) for caps, reset schedules, and the message the developer sees.
+ * **A spend limit message from a[Claude apps gateway](</docs/en/claude-apps-gateway>)**: the developer passed a spend cap you set on your self-hosted gateway. The gateway blocks their requests until you raise the cap, or until the cap resets if it’s above $0. See [gateway spend limits](</docs/en/claude-apps-gateway-spend-limits>) for caps, reset schedules, and the message the developer sees.
* **A context or auto-compact warning** : not a usage limit. The conversation has grown close to the session’s [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>), the threshold where Claude Code summarizes older history to free space. Point the developer at reduce token usage.
* **Unexpectedly high spend on an API or cloud-provider plan** : usually traces back to long sessions that were never cleared or to Opus left as the default model. The highest-impact habits to share are clearing between unrelated tasks and matching the model to the job, both covered in reduce token usage.
@@ -334,7 +334,7 @@
Offload processing to hooks and skills
-Custom [hooks](</docs/en/hooks>) can preprocess data before Claude sees it. Instead of Claude reading a 10,000-line log file to find errors, a hook can grep for `ERROR` and return only matching lines, reducing context from tens of thousands of tokens to hundreds. A [skill](</docs/en/skills>) can give Claude domain knowledge so it doesn’t have to explore. For example, a “codebase-overview” skill could describe your project’s architecture, key directories, and naming conventions. When Claude invokes the skill, it gets this context immediately instead of spending tokens reading multiple files to understand the structure. For example, this PreToolUse hook filters test output to show only failures:
+Custom [hooks](</docs/en/hooks>) can preprocess data before Claude sees it. Instead of Claude reading a 10,000-line log file to find errors, a hook can grep for `ERROR` and return only matching lines, reducing context from tens of thousands of tokens to hundreds. This PreToolUse hook trims test output to its last 100 lines:
* settings.json
@@ -358,23 +358,23 @@
}
}
-The hook calls this script. Create the folder with `mkdir -p ~/.claude/hooks`, save the script below as `~/.claude/hooks/filter-test-output.sh`, and make it executable with `chmod +x ~/.claude/hooks/filter-test-output.sh`. It checks if the command is a test runner and modifies it to show only failures:
+The hook calls this script. Create the folder with `mkdir -p ~/.claude/hooks`, save the script below as `~/.claude/hooks/filter-test-output.sh`, and make it executable with `chmod +x ~/.claude/hooks/filter-test-output.sh`. It checks if the command is a test runner and, if so, keeps only the last 100 lines of its output:
#!/bin/bash
input=$(cat)
cmd=$(echo "$input" | jq -r '.tool_input.command')
- # If running tests, filter to show only failures
+ # If running tests, keep only the last 100 lines
pattern='^(npm test|pytest|go test)( [^;&|<>`$#\\[:cntrl:]]*)?$'
if [[ "$cmd" =~ $pattern ]]; then
- filtered_cmd="$cmd 2>&1 | grep -A 5 -E '(FAIL|ERROR|error:)' | head -100"
+ filtered_cmd="$cmd 2>&1 | tail -n 100"
echo "$input" | jq --arg filtered "$filtered_cmd" \
'{hookSpecificOutput: {hookEventName: "PreToolUse", updatedInput: (.tool_input + {command: $filtered})}}'
else
echo "{}"
fi
-To verify the setup, run `/hooks` and check that the hook appears under PreToolUse. You can also start Claude Code with `claude --debug-file ./claude-debug.txt` and ask Claude to run `npm test`. When the hook rewrites the command, that log file contains a `modified tool input keys` line listing `command` and the other Bash input fields.
+To verify the setup, run `/hooks` and check that the hook appears under PreToolUse. You can also start Claude Code with `claude --debug-file ./claude-debug.txt` and ask Claude to run `npm test`. When the hook rewrites the command, that log file contains a `modified tool input keys` line listing `command` and the other Bash input fields. A [skill](</docs/en/skills>) can give Claude domain knowledge so it doesn’t have to explore. For example, a “codebase-overview” skill could describe your project’s architecture, key directories, and naming conventions. When Claude invokes the skill, it gets this context immediately instead of spending tokens reading multiple files to understand the structure.
###
--- a/cross-session-messaging.md
+++ b/cross-session-messaging.md
@@ -46,7 +46,7 @@
Message delivery
-The receiving Claude reads the message between tool calls during an active turn, so a running tool is never interrupted. When the receiving session is idle, Claude Code starts a new turn with the message. A message from another session arrives as plain text. If it mentions a file or an [MCP resource](</docs/en/mcp#use-mcp-resources>) with `@`, Claude sees the mention as written and Claude Code attaches nothing, whether the message starts a new turn or arrives during one. Claude can still open a mentioned path on the receiving machine with its own tools, subject to that session’s permissions. Claude Code refuses a message in the following cases:
+The receiving Claude reads the message between tool calls during an active turn. When the receiving session is idle, Claude Code starts a new turn with the message. A message from another session arrives as plain text. If it mentions a file or an [MCP resource](</docs/en/mcp#use-mcp-resources>) with `@`, Claude sees the mention as written and Claude Code attaches nothing, whether the message starts a new turn or arrives during one. Claude can still open a mentioned path on the receiving machine with its own tools, subject to that session’s permissions. Claude Code refuses a message in the following cases:
* The message is over the size cap. Claude Code refuses it in the sending session, before it leaves.
* A rapid burst to a session on this machine has reached what that session’s inbox accepts. Claude Code refuses further messages to that session.
--- a/desktop.md
+++ b/desktop.md
@@ -280,7 +280,7 @@
Minimize a pane
-To keep the Terminal, Browser, or [iOS Simulator](</docs/en/desktop-ios-simulator>) in view at a small size, click **Minimize** in the pane’s header. The button requires Claude Desktop v4.0.0 or later and a Claude account rather than a [third-party provider](</docs/en/third-party-integrations>). The Browser pane has it only in local sessions. The minimized pane sits in the session details panel while that panel is on screen, and floats in a corner of the chat otherwise:
+To keep the Terminal, Browser, [iOS Simulator](</docs/en/desktop-ios-simulator>), or a side chat in view at a small size, click **Minimize** in the pane’s header. The button requires Claude Desktop v4.0.0 or later and a Claude account rather than a [third-party provider](</docs/en/third-party-integrations>). The Browser pane has it only in local sessions. The minimized pane sits in the session details panel while that panel is on screen, and floats in a corner of the chat otherwise:
* **In the panel** : the minimized pane sits below the panel’s cards, where you can’t move or resize it. To float it over the chat instead, hide the panel.
* **In a corner of the chat** : hover over the minimized pane to show its header. Drag the header to move it to another corner. To resize it, drag the corner of the minimized pane nearest the center of the chat.
@@ -1556,7 +1556,7 @@
When edits in a worktree keep working
-On a Linux or macOS remote machine, the check doesn’t go through Desktop, so edits inside the worktree keep working while Desktop is disconnected. Before Claude Desktop v2.37337.0, this holds on a Linux remote machine only.Edits still fail in some cases, including these:
+On a Linux or macOS remote machine, edits inside the worktree can keep working while Desktop is disconnected, because the check on each edit can run without Desktop. Before Claude Desktop v2.37337.0, this works on a Linux remote machine only.Edits still fail in some cases, including these:
* **Built-in SSH client** : Desktop uses it, for example in a Microsoft Store install, or on a Windows computer without Microsoft’s OpenSSH 9.4 or later
* **Repository location** : the repository is your home directory, a folder above it, or `~/.claude`
@@ -2188,7 +2188,7 @@
* **Local sessions on this machine** : a managed settings file deployed to disk applies. Managed settings pushed remotely through the admin console also reach these sessions on Anthropic’s API when the session authenticates with an [eligible login](</docs/en/server-managed-settings#platform-availability>), following the same [settings precedence](</docs/en/settings#settings-precedence>) as the terminal CLI.
* **Cloud sessions** : receive [server-managed settings](</docs/en/server-managed-settings>); device-deployed files don’t reach them, because they run on Anthropic-managed VMs. Sessions routed to a [self-hosted environment](</docs/en/self-hosted-environments>) also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies.
- * **SSH sessions** : the session reads the managed settings file from the remote host. Desktop itself reads `sshConfigs`, `sshHostAllowlist`, `disableSshSavedPasswords`, and `disableDesktopLocalSessions` on the local machine. If you deliver more than one managed source, it reads them from [one by default](</docs/en/managed-settings#how-claude-code-combines-managed-sources>).
+ * **SSH sessions** : the session reads the managed settings file from the remote host. Desktop itself reads `sshConfigs`, `sshHostAllowlist`, `disableSshSavedPasswords`, and `disableDesktopLocalSessions` on the local machine. If you deliver more than one managed source, it reads them from [one by default](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). If you set `permissions.disableBypassPermissionsMode` or `disableAutoMode` in the managed settings in force on the local machine, an SSH session’s mode selector doesn’t offer that mode, whatever the remote host sets.
* **[Cowork](<https://claude.com/docs/cowork/overview>) sessions**: in a Cowork session on this machine, Claude Code never fetches admin-console settings, even when the user signs in with a Team or Enterprise account, and reads policy deployed to the machine unless your Claude Desktop configuration sets `requireCoworkFullVmSandbox`. Remote Cowork sessions receive neither. See [where and when a policy applies](</docs/en/managed-settings#where-and-when-a-policy-applies>) for which device files reach Cowork, and [MCP permission rules](</docs/en/permissions#mcp>) for how `Bash` and `WebFetch` rules apply to Cowork’s tools.
In local and SSH sessions, the desktop app delivers each user’s connected claude.ai connectors to Claude Code directly. No MCP setting or `managed-mcp.json` reaches those connectors, whichever settings source or file location you use. To block a connector’s tools in these sessions, use your organization’s [connector tool controls](</docs/en/mcp#organization-controls-on-connector-tools>). [How connectors reach Claude Code](</docs/en/mcp#how-connectors-reach-claude-code>) shows which settings govern connectors in each kind of session. `permissions.disableBypassPermissionsMode` and `disableAutoMode` also work in user and project settings, but placing them in managed settings prevents users from overriding them. For the permission, plugin, and delivery keys only a managed source can set, see [Keys only managed settings can set](</docs/en/managed-settings#managed-only-settings>).
--- a/env-vars.md
+++ b/env-vars.md
@@ -347,7 +347,7 @@
`CLAUDE_CODE_PROMPT_CACHE_TTL`| Set `5m` or `1h`, the only values Claude Code accepts, to choose the [prompt cache TTL](</docs/en/prompt-caching#cache-lifetime>) for the main conversation: your interactive, `-p`, and SDK turns, plus the helpers that run inline with them. Takes precedence over the `promptCacheTtl` setting and over `ENABLE_PROMPT_CACHING_1H`, and `FORCE_PROMPT_CACHING_5M` overrides it. The API bills 1-hour cache writes at a higher rate. Requires Claude Code v2.1.242 or later
`CLAUDE_CODE_PROPAGATE_TRACEPARENT`| Set to `1` to propagate W3C trace context when `ANTHROPIC_BASE_URL` points at a custom proxy. Propagation covers the `traceparent` header on model and HTTP MCP requests and the `TRACEPARENT` environment variable for Bash, PowerShell, and hook subprocesses. By default, propagation is enabled only when connected directly to the Anthropic API. Added in v2.1.152. See [Traces (beta)](</docs/en/monitoring-usage#traces-beta>)
`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`| Set by host platforms that embed Claude Code and manage model provider routing on its behalf. When set, Claude Code ignores provider-selection, endpoint, and authentication variables such as `CLAUDE_CODE_USE_BEDROCK`, `ANTHROPIC_BASE_URL`, and `ANTHROPIC_API_KEY` in settings files, so user settings can’t override the host’s routing. Claude Code also ignores model-selection keys such as `model`, `fallbackModel`, and `modelOverrides` in [managed settings](</docs/en/managed-settings>), whichever managed source delivers them, so the host’s model configuration takes precedence over an out-of-date managed model pin. Claude Code also ignores model-selection variables such as `ANTHROPIC_MODEL` and the `ANTHROPIC_DEFAULT_*_MODEL` family in a managed `env` block; an [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist in managed settings still applies unless the host supplies its own. Claude Code also skips the automatic telemetry opt-out it otherwise applies on third-party providers such as Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, so telemetry follows the standard `DISABLE_TELEMETRY` opt-out. See [Default behaviors by API provider](</docs/en/data-usage#default-behaviors-by-api-provider>)
-`CLAUDE_CODE_PROXY_RESOLVES_HOSTS`| Set to `1` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution
+`CLAUDE_CODE_PROXY_RESOLVES_HOSTS`| Set to `1` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution. When `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST` is set, set this in the environment of the process that starts Claude Code
`CLAUDE_CODE_REMOTE`| Set automatically to `true` when Claude Code is running as a [cloud session](</docs/en/claude-code-on-the-web>). Read this from a hook or setup script to detect whether you are in a cloud session
`CLAUDE_CODE_REMOTE_SESSION_ID`| Set automatically in [cloud sessions](</docs/en/claude-code-on-the-web>) to the current session’s ID. Read this to construct a link back to the session transcript. See [Link output back to the session](</docs/en/cloud-environments#link-output-back-to-the-session>)
`CLAUDE_CODE_RESTRICTED`| Set to `1` to start the session in restricted mode, the same as passing [`--restricted`](</docs/en/cli-reference#cli-flags>). Claude Code ignores this variable in a settings file’s `env` block. Requires Claude Code v2.1.248 or later
@@ -484,12 +484,12 @@
`OTEL_LOG_TOOL_CONTENT`| Set to `1` to include tool content in the `tool.output` OpenTelemetry span event. Span attributes carry tool content under [their own gates](</docs/en/monitoring-usage#new-context-gates>). Requires [tracing](</docs/en/monitoring-usage#traces-beta>). Disabled by default to protect sensitive data. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>), apart from the off values that section describes. See [Monitoring](</docs/en/monitoring-usage#tool-output-span-event>)
`OTEL_LOG_TOOL_DETAILS`| Set to `1` to include tool input arguments; MCP server names; user-authored workflow names; raw error strings on tool failures; the refusal `category` on `api_refusal` events; real agent, skill, plugin, and MCP server names on [cost and token metrics](</docs/en/monitoring-usage#cost-counter>); and other tool details in OpenTelemetry metrics, traces, and logs. Disabled by default to protect PII. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>), apart from the off values that section describes. See [Monitoring](</docs/en/monitoring-usage>)
`OTEL_LOG_USER_PROMPTS`| Set to `1` to include user prompt text in OpenTelemetry traces and logs. Disabled by default (prompts are redacted). Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>), apart from the off values that section describes. See [Monitoring](</docs/en/monitoring-usage>)
-`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`| Set to `false` to exclude account UUID from metrics attributes (default: included). See [Monitoring](</docs/en/monitoring-usage>)
-`OTEL_METRICS_INCLUDE_ENTRYPOINT`| Set to `true` to include the session entrypoint in metrics attributes (default: excluded). Added in v2.1.152. See [Monitoring](</docs/en/monitoring-usage>)
+`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`| Set to `false` to exclude account UUID from metric and event attributes (default: included). See [Monitoring](</docs/en/monitoring-usage>)
+`OTEL_METRICS_INCLUDE_ENTRYPOINT`| Set to `true` to include the session entrypoint in metric and event attributes (default: excluded). Added in v2.1.152. See [Monitoring](</docs/en/monitoring-usage>)
`OTEL_METRICS_INCLUDE_REPOSITORY`| Set to `true` to tag OpenTelemetry metrics and events with `vcs.*` attributes identifying the session’s repository (default: excluded). Requires Claude Code v2.1.269 or later. See [Repository attributes](</docs/en/monitoring-usage#repository-attributes>)
`OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES`| As of v2.1.161, Claude Code attaches `OTEL_RESOURCE_ATTRIBUTES` keys to metric datapoint labels. Set to `false` to exclude them (default: included). See [Monitoring](</docs/en/monitoring-usage#multi-team-organization-support>)
-`OTEL_METRICS_INCLUDE_SESSION_ID`| Set to `false` to exclude session ID from metrics attributes (default: included). See [Monitoring](</docs/en/monitoring-usage>)
-`OTEL_METRICS_INCLUDE_VERSION`| Set to `true` to include Claude Code version in metrics attributes (default: excluded). See [Monitoring](</docs/en/monitoring-usage>)
+`OTEL_METRICS_INCLUDE_SESSION_ID`| Set to `false` to exclude session ID from metric and event attributes (default: included). See [Monitoring](</docs/en/monitoring-usage>)
+`OTEL_METRICS_INCLUDE_VERSION`| Set to `true` to include Claude Code version in metric and event attributes (default: excluded). See [Monitoring](</docs/en/monitoring-usage>)
`SLASH_COMMAND_TOOL_CHAR_BUDGET`| Override the character budget for skill metadata shown to the [Skill tool](</docs/en/skills#control-who-invokes-a-skill>). The budget scales dynamically at 1% of the context window, with a fallback of 8,000 characters. Legacy name kept for backwards compatibility
`TASK_MAX_OUTPUT_LENGTH`| Removed in v2.1.277 and now a no-op, together with the `TaskOutput` tool it sized. Previously set the maximum number of characters of a [background task’s](</docs/en/tools-reference#background-commands>) output that the `TaskOutput` tool kept. Claude reads a background task’s output file with `Read` instead
`USE_BUILTIN_RIPGREP`| Set to `0` to use system-installed `rg` instead of `rg` included with Claude Code
Show diff (280 lines)
--- a/errors.md
+++ b/errors.md
@@ -44,7 +44,7 @@
`Credit balance is too low`| Usage limits
`You've hit your monthly spend limit` / `You've hit your individual spend limit` / `You've hit your org's monthly spend limit` / `You've hit your channel's monthly spend limit` / `You've hit your team's shared budget` / `You've hit your individual usage limit`| Usage limits
`Could not update your spend limit`| Usage limits
-`spend limit reached` / `spend limit unavailable`| Usage limits
+`spend limit reached` / `spend limit unavailable` / `This request exceeds your group's budget`| Usage limits
`Not logged in · Please run /login`| Authentication
`Couldn't save your login`| Authentication
`Sign in again to take your previous account or API key off the config file.`| Authentication
@@ -234,10 +234,12 @@
`The current directory no longer exists (it was deleted or moved)` / `Can't read the current directory`| Command-line errors
`Temp directory <dir> ... Refusing to use it` / `Claude Code's temporary directory <dir> could not be created`| Command-line errors
`ENOSPC: no space left on device, mkdir '<dir>'`| Command-line errors
+`Error: Claude Code could not save ... because the disk is full (ENOSPC)` / `because your disk quota is used up (EDQUOT)`| Command-line errors
`couldn't be resolved to a real location, so its skills, commands, and agents weren't loaded`| Command-line errors
`Error: Workspace not trusted` when starting Remote Control| Command-line errors
`Error: Workspace not trusted` when running `claude ultrareview`| Command-line errors
`Ultrareview did not start`| Command-line errors
+`Remote Control did not start: "<question>" got no answer`| Command-line errors
``<flag>` before `remote-control` is not carried over to the sessions Remote Control starts`| Command-line errors
`--sandbox is not supported by claude remote-control` / `--no-sandbox is not supported by claude remote-control`| Command-line errors
``claude import` is not yet available in this build`| Command-line errors
@@ -328,6 +330,7 @@
`MCP server "<name>" connection closed before the tool call was answered`| Tool errors
`MCP server "<name>" is disabled — re-enable it via /mcp to use its tools`| Tool errors
`MCP server "<name>" tool "<tool>" timed out after <N>s. The server asked the user a question, and no answer came before the time limit.`| Tool errors
+`Permission prompt tool returned an invalid result`| Tool errors
`would be spawned with zero tools — refusing`| Tool errors
`File is covered by a Read deny rule in your permission settings`| Tool errors
`<path> is outside <dirs>; the permissions.blockWritesOutsideWorkingDirectories setting blocks writes outside the working directories`| Tool errors
@@ -378,6 +381,7 @@
`The safety check for domain ... is rate-limited`| Tool errors
`The safety check for domain ... is temporarily rate-limited`| Tool errors
`Unable to verify if domain ... is safe to fetch`| Tool errors
+`MCP tool "<tool>" on server "<server>" gave no answer that could be read` / `answered without its text`| [How an MCP tool hook’s result is read](</docs/en/hooks#how-the-tool%E2%80%99s-result-is-read>)
`Can't open MCP settings while no terminal is attached to this background session`| Background session errors
`Can't open MCP settings in a background session`| Background session errors
`blocked because the path is spelled in a form that cannot be safely resolved`| Background session errors
@@ -412,6 +416,7 @@
`The Claude Code program for this computer, the <build> build, could not be found`| Wrapper and IDE errors
`Restored the code, but skipped N files`| Rewind warnings and errors
`No files were restored: N files failed (backup missing, or the file could not be updated)`| Rewind warnings and errors
+`The file backups are still being copied. Nothing was changed. Try again in a moment.`| Select the same point in [`/rewind`](</docs/en/checkpointing>) again. When you restore code soon after [`/branch`](</docs/en/sessions#branch-a-session>), Claude Code can still be copying the file backups to the new session.
`Transcript writes are failing (...)`| Session saving warnings
`Transcript saving is off — CLAUDE_CODE_SKIP_PROMPT_HISTORY is set`| Session saving warnings
`Transcript saving is off — inherited CLAUDE_CODE_CHILD_SESSION marker`| Session saving warnings
@@ -423,6 +428,7 @@
`Not loaded: rename <path>, then restart — its name uses "<name>", a name reserved for the skills synced from your claude.ai account`| Configuration warnings
`N skill or command names refused: run with --debug to see which ([names]), rename, then restart`| Configuration warnings
`Ignoring N permissions.allow entries from ... this workspace has not been trusted`| Configuration warnings
+`Two Claude Code config files exist: this run uses <path>, not <path>`| Configuration warnings
`Make this change again later: <path> could not be updated, so it applies to this session only`| Configuration warnings
`is a network path, which cannot be added as a working directory`| Configuration warnings
`Remote managed settings failed to load (<cause>)`| Configuration warnings
@@ -460,6 +466,7 @@
`CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" isn't a usable size, so Claude Code ignores it`| [Values and warnings for `CLAUDE_CODE_AUTO_COMPACT_WINDOW`](</docs/en/model-config#claude_code_auto_compact_window-values>)
`Model "<model>" isn't recognized · context assumed to be 200k tokens`| [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>)
`Claude Code doesn't recognize the model "<model>", so it assumes a context window of 200k tokens`| [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>)
+`Model "<model>" isn't recognized · did you mean "<suggestion>"?` / `Claude Code doesn't recognize the model "<model>". Did you mean "<suggestion>"?`| [Fix a mistyped model name](</docs/en/model-config#fix-a-mistyped-model-name>)
`[claude-code:unrecognized_model]`| Configuration warnings
`is ignored — managed settings set allowManagedReadPathsOnly` / `is ignored — managed settings set allowManagedDomainsOnly`| Configuration warnings
`Sandbox mask files left behind at write-deny paths`| Configuration warnings
@@ -951,14 +958,23 @@
Spend limit reached
-You connect through a [Claude apps gateway](</docs/en/claude-apps-gateway>) and have passed a [spend cap](</docs/en/claude-apps-gateway-spend-limits>) your gateway operator set. The gateway blocks your requests until the named period resets or the operator raises the cap. It marks each blocked `429` response `x-should-retry: false`, so Claude Code shows this message without retrying.
-
- spend limit reached (daily; resets 2026-08-09 00:00 UTC)
-
-The message names the cap’s period and reset time, and when the operator configured a `blocked_message`, their instructions follow it. Before v2.1.225, the message read only `spend limit reached`; a gateway on an older version still sends that shorter form. **What to do:**
-
- * Wait for the reset time the message names, or follow the operator’s instructions if the message carries them
- * Ask your gateway operator to raise the cap if you hit it routinely
+You connect through a [Claude apps gateway](</docs/en/claude-apps-gateway>) and have reached a [spend cap](</docs/en/claude-apps-gateway-spend-limits>) your gateway operator set. The gateway blocks your requests until the operator raises the cap, or until the cap resets if it’s above $0. It marks each blocked `429` response `x-should-retry: false`, so in the terminal Claude Code shows this message without retrying.
+
+ spend limit reached · resets Dec 1
+
+Check the message for a date:
+
+ * **With a date** : the cap resets at 00:00 UTC on that date
+ * **With no date** : your cap is $0, or your gateway runs a version earlier than v2.1.225
+
+Any further text in the message is a note from your gateway operator. From v2.1.225 until v2.1.319 on the gateway server, the message named the cap’s period and reset time, as in `spend limit reached (daily; resets 2026-08-09 00:00 UTC)`. **What to do:**
+
+ * If the message has a date, wait for the reset, or follow the operator’s note if the message carries one
+ * Ask your gateway operator to raise the cap if the message has no date, if you’re still blocked after the date, or if you hit the cap routinely
+
+A second gateway message, `This request exceeds your group's budget`, means your group’s [pooled budget](</docs/en/claude-apps-gateway-config#pooled-budget-order>) is used up. Follow the steps it names:
+
+ This request exceeds your group's budget. Ask your organization's admins to raise it, or try again after it resets on November 1 at 00:00 UTC.
A related message, `spend limit unavailable`, means the gateway could not read its spend records and blocked the request as a precaution rather than over your cap. It usually clears on its own; if it persists, tell your gateway operator.
@@ -1361,7 +1377,7 @@
Failed to authenticate: OAuth session expired and could not be refreshed
-For a `Login expired` message that ends with `or re-authenticate your Anthropic profile`, see Anthropic profile login expired. This is not the same state as OAuth token revoked or expired. Those messages report a rejection the API returned. Claude Code itself produces `Login expired` for a login it already failed to renew, so it sends no request. When the renewal fails because the account itself is suspended rather than the login being stale, Claude Code shows Your account is on hold instead. Sessions authenticated with an API key, [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/env-vars>), or a third-party provider don’t use the saved login and never see this message. You can check for this state before a request fails: [`/status`](</docs/en/commands>) shows a `Login` row reading `Expired — log in again`, plus the organization and email it has saved for the expired login. The row appears only when the saved login is your active credential and can no longer be refreshed. Sessions authenticated another way don’t show the row, even if an expired login remains saved. Before v2.1.210, `/status` gave no indication in this state that a login had ever existed, because the cleared credential left it nothing to report. **What to do:**
+For a `Login expired` message that ends with `or re-authenticate your Anthropic profile`, see Anthropic profile login expired. This is not the same state as OAuth token revoked or expired. Those messages report a rejection the API returned. Claude Code itself produces `Login expired` for a login it already failed to renew, so it sends no request. When the renewal fails because the account itself is suspended rather than the login being stale, Claude Code shows Your account is on hold instead. You can check for this state before a request fails: [`/status`](</docs/en/commands>) shows a `Login` row reading `Expired — log in again`, plus the organization and email it has saved for the expired login. The row appears only when the saved login is your active credential and can no longer be refreshed. Sessions authenticated another way don’t show the row, even if an expired login remains saved. Before v2.1.210, `/status` gave no indication in this state that a login had ever existed, because the cleared credential left it nothing to report. **What to do:**
* Run `/login` to sign in again. Retrying without signing in shows the same message on every request.
* If you sign in with your claude.ai account in another Claude Code window, see Not logged in for when this session starts using that login on its own.
@@ -1382,7 +1398,7 @@
Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh. This is usually transient; retry in a minute, and if it persists close other Claude Code processes or sign in again
-Sessions authenticated with an API key, [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/env-vars>), or a third-party provider don’t use the saved login and never see this message. **What to do:**
+**What to do:**
* Try again in a minute. If another process completes the refresh first, this session uses the renewed login.
* If the message keeps returning, close other Claude Code windows and processes, then retry.
@@ -2168,7 +2184,7 @@
Couldn’t send feedback
-A message starting `Couldn't send feedback` means the feedback service didn’t confirm the report you submitted from the [`/feedback`, `/bug`, or `/share` dialog](</docs/en/commands#all-commands>), or a queued [feedback draft](</docs/en/tools-reference#sendfeedback-tool-behavior>). Treat it as not received. When a sentence about your organization follows the colon, your organization refuses feedback and the same report gets the same answer. The second of these two examples is an organization’s refusal:
+A message starting `Couldn't send feedback` means the feedback service didn’t confirm the report you submitted from the [`/feedback`, `/bug`, or `/share` dialog](</docs/en/commands#all-commands>), or a queued [feedback draft](</docs/en/tools-reference#sendfeedback-tool-behavior>). Treat it as not received. When a sentence about your organization follows the colon, your organization refuses feedback. The second example is an organization’s refusal:
Couldn't send feedback (couldn't reach the service). If it keeps failing, you can file at https://github.com/anthropics/claude-code/issues instead.
@@ -2177,7 +2193,7 @@
**What to do:**
* **Not signed in** : the message continues `: not signed in. Run /login, then retry.` Run `/login`, then send again
- * **Your organization’s refusal** : for example `: Feedback has not been enabled for your organization.` or `: Feedback collection is not available for organizations with custom data retention policies.` If the message adds `To report a bug, open an issue`, do so at [github.com/anthropics/claude-code/issues](<https://github.com/anthropics/claude-code/issues>). A queued draft stays queued, and you can [discard it](</docs/en/tools-reference#discard-or-keep-a-draft>)
+ * **Your organization’s refusal** : for example `: Feedback has not been enabled for your organization.` or `: Feedback collection is not available for organizations with custom data retention policies.` If the message adds `To report a bug, open an issue`, do so at [github.com/anthropics/claude-code/issues](<https://github.com/anthropics/claude-code/issues>). `/feedback` can then answer that it’s disabled by your organization’s policy for seven days. A queued draft stays queued and still [expires on schedule](</docs/en/tools-reference#discard-or-keep-a-draft>)
* **Refused credentials** : the message continues `: the sign-in this session uses is not allowed to send feedback` or `: the server did not accept the credentials this session uses`. Run `/status` at the Claude Code prompt to see which login, token, or API key this session sends
* **`(request timed out)` or `(couldn't reach the service)` straight after `Couldn't send feedback`**: send the report or the queued draft again. The dialog keeps your text, and a queued draft’s message says `The draft is still queued.` If other requests are failing too, check your network connection and see Unable to connect to API. If it keeps failing, file the report at [github.com/anthropics/claude-code/issues](<https://github.com/anthropics/claude-code/issues>)
* **`(server returned<status>)`, or no reason, straight after `Couldn't send feedback`**: the status is the service’s response code. The service’s own message follows it when one was sent, as in `(server returned 403: Access Forbidden)`. If it keeps failing, file the report at [github.com/anthropics/claude-code/issues](<https://github.com/anthropics/claude-code/issues>)
@@ -3201,6 +3217,21 @@
+Claude Code could not save because the disk is full
+
+This line on stderr after a [`claude -p`](</docs/en/headless>) run means the disk is full or your disk quota is used up, so Claude Code couldn’t save everything from the run:
+
+ Error: Claude Code could not save all of this session's transcript under /Users/you/.claude because the disk is full (ENOSPC). If you resume this session, part of the conversation may be missing. Free up space on that disk before the next run.
+
+With text or `json` output, the run exits with code 1, and the answer has already been printed. With `stream-json` output, the run keeps its usual exit code, and the answer still arrives. **What to do:**
+
+ * **`the disk is full (ENOSPC)`** : before your next run, free up space on the disk that holds the path in the message
+ * **`your disk quota is used up (EDQUOT)`** : before your next run, free up space or ask for a larger quota
+
+###
+
+
+
Directory couldn’t be resolved to a real location
You ran `/add-dir` for a subdirectory of your working directory, and Claude Code couldn’t resolve the directory to its real location. You already have file access to a subdirectory of the working directory, so `/add-dir` only loads its skills, commands, and agents. Before loading them, Claude Code checks that the directory’s real location, with any symlinks resolved, is inside the working directory. When Claude Code can’t resolve that location, it loads nothing and shows this message:
@@ -3261,6 +3292,22 @@
* **`Ultrareview did not start: `--trust-workspace` takes no value`** : something other than a flag follows `--trust-workspace`, such as a PR number or `false`. If you don’t trust the folder, leave the flag out. To trust it for this run, put the PR number or base branch before the flag: `claude ultrareview 1234 --trust-workspace`.
Before v2.1.309, `claude ultrareview` didn’t accept `--trust-workspace`.
+
+###
+
+
+
+Remote Control did not start because a question got no answer
+
+This message means [`claude remote-control`](</docs/en/remote-control>) asked the first-run question quoted in the message and got no answer:
+
+ Remote Control did not start: "Enable Remote Control?" got no answer. Run `claude remote-control` at a terminal and answer y once; it won't ask again.
+ Remote Control did not start: "Choose [1/2] (default: 1):" got no answer. You can run `claude remote-control` and choose, or pass --spawn=same-dir or --spawn=worktree.
+
+**What to do:**
+
+ * **`Enable Remote Control?`** : in a script or a service, standard input ends before anyone can answer. Run `claude remote-control` once in a terminal, as the user your script or service runs as, and answer `y`.
+ * **`Choose [1/2] (default: 1):`** : run `claude remote-control` again and [choose a spawn mode](</docs/en/remote-control#set-the-default-spawn-mode-for-a-project>), or pass [`--spawn=same-dir` or `--spawn=worktree`](</docs/en/remote-control#start-a-remote-control-session>) to skip the question
###
@@ -4070,15 +4117,21 @@
/feedback is disabled by your organization’s policy
-This message means your organization’s policy doesn’t allow product feedback from Claude Code, so `/feedback`, `/bug`, and `/share` don’t open the feedback dialog. The message names the command you typed at the Claude Code prompt:
+This message means product feedback is turned off, so the command you typed doesn’t open the feedback dialog. An organization’s policy and an earlier refusal both produce the message:
+
+ * **Organization policy** : your organization’s policy doesn’t allow product feedback from Claude Code. `/feedback`, `/bug`, and `/share` all answer with the message.
+ * **Earlier refusal** : the feedback service refused a report you sent, for example with `Couldn't send feedback: Feedback has not been enabled for your organization.` `/feedback` and `/bug` can then answer with the message. It lasts seven days from that refusal on this machine. This applies on every plan, including Pro and Max.
+
+The message names the command you typed at the Claude Code prompt:
/feedback is disabled by your organization's policy. To report a bug, open an issue at https://github.com/anthropics/claude-code/issues. Issues are public, so leave out anything confidential.
The message can also be its first sentence alone. **What to do:**
* To report a bug, open an issue at [github.com/anthropics/claude-code/issues](<https://github.com/anthropics/claude-code/issues>). Anyone can read issues there, so leave out code, transcripts, and anything else confidential.
-
-Before v2.1.302, the full message read `/feedback is disabled by your organization's policy. Contact your organization admin to enable it.`
+ * After an earlier refusal, wait until the seven days have passed, then send a report again to see whether the service still refuses it
+
+Before v2.1.319, an earlier refusal didn’t produce this message. Before v2.1.302, the full message read `/feedback is disabled by your organization's policy. Contact your organization admin to enable it.`
##
@@ -4476,6 +4529,25 @@
* In a TypeScript Agent SDK application, make your [`onElicitation`](</docs/en/agent-sdk/typescript#options>) callback return its answer before the limit runs out
* To give an answer more time, set a longer [`timeout`](</docs/en/mcp#time-limits-on-mcp-tool-calls>) in milliseconds in the server’s configuration entry, such as `"timeout": 600000` for 10 minutes
* Run the task in an interactive session instead and answer the server’s [dialog](</docs/en/mcp#respond-to-mcp-elicitation-requests>) yourself
+
+###
+
+
+
+Permission prompt tool returned an invalid result
+
+The tool you passed to [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) returned an answer Claude Code couldn’t read, so the tool call waiting on it didn’t run, even if the answer allowed the call:
+
+ Permission prompt tool returned an invalid result. Expected a single text block param with type="text" and a string text value.
+
+**What to do:**
+
+ * Return one text block whose text is `{"behavior": "allow"}` or `{"behavior": "deny", "message": "<reason>"}`. To change the input, add `updatedInput` to the `allow` object. From v2.1.86 through v2.1.206, an `allow` needed `"updatedInput": {}` to keep the input.
+ * Return no [`structuredContent`](</docs/en/agent-sdk/custom-tools#return-structured-data>), which your MCP SDK may add on its own. For example, register the tool:
+ * **`FastMCP` or `MCPServer` from `mcp.server`**: with `structured_output=False`
+ * **`FastMCP` from `fastmcp`**: with `output_schema=None`, and return a string
+ * **MCP TypeScript SDK** : without `outputSchema`
+ * If the error comes only with inputs of about 40 KB or more, don’t copy the input into `updatedInput` or a deny’s `message`. To change an input that large, [raise your prompt tool’s output limit](</docs/en/mcp#raise-the-limit-for-a-specific-tool>).
###
@@ -6235,6 +6307,51 @@
+Two Claude Code config files exist
+
+Claude Code is using the first file this message names, so what’s in the second file isn’t in effect. The first is `.config.json`, an older name for [`.claude.json`](</docs/en/claude-directory#ce-claude-json>). The message includes a check for which file holds your setup:
+
+ Two Claude Code config files exist: this run uses /home/you/.claude/.config.json, not /home/you/.claude.json. The file with the higher count here is usually yours, and this prints nothing else from them: grep -c -E '"(hasCompletedOnboarding|mcpServers)"' "/home/you/.claude/.config.json" "/home/you/.claude.json". To end this: if several hosts share this home, first get every host to version 2.1.319 or later, since an older one can write a moved .config.json back. Then stop your Claude processes on every host, move aside the one you do not want, and start none until no host lists it.
+
+On Windows, `The one with hasCompletedOnboarding or mcpServers in it is usually yours.` replaces the sentence with the `grep` command. **What to do:**
+
+1
+
+Find the file that holds your setup
+
+ * **On Windows** : open both files and see which one has `hasCompletedOnboarding` or `mcpServers` in it
+ * **On other platforms** : in your shell, run the `grep` command from the message and see which file has the higher count
+
+2
+
+Update every host that shares the home directory
+
+If several hosts share this home directory, first update Claude Code on every host to the version the message names or later. An older version can write a moved `.config.json` back.
+
+3
+
+Stop Claude Code
+
+Stop your Claude Code processes on every host.
+
+4
+
+Move the file you don't want
+
+Move the file you don’t want out of its folder. Move it rather than delete it, so you can put it back.
+
+5
+
+Wait before you start Claude Code again
+
+Don’t start Claude Code on any host until no host still lists the moved file at its old path.
+
+The message stops once one of the two files is gone.
+
+###
+
+
+
Make this change again later: ~/.claude.json could not be updated
This notice on stderr means a change to [`~/.claude.json`](</docs/en/claude-directory#ce-claude-json>), such as a sign-in or an answer to a trust prompt, wasn’t saved to the file:
--- a/events.md
+++ b/events.md
@@ -265,7 +265,7 @@
* **Your hook returns a`drop` after its `next(e)` call let the prompt through**: the turn still runs, and the hook fails with a message that includes `a drop after its next() was answered`
* **Your hook throws or times out** : Claude Code skips it and sends the prompt. Add a `.catch` handler so that a failure doesn’t send a prompt the hook would have stopped.
-[Other events](</docs/en/plugins/mods/reference#prompts-and-what-claude-reads>) cover the rest of what Claude reads: `prompt.section` for each section of the system prompt, `prompt.context` for the context sent with the first message, and `skill.prompt` for a skill’s text. Text from these hooks that changes between requests [invalidates the prompt cache](</docs/en/prompt-caching>). In a `skill.prompt` hook, you can also read [which plugin or file the skill came from](</docs/en/plugins/mods/reference#skill-prompt-fields>).
+[Other events](</docs/en/plugins/mods/reference#prompts-and-what-claude-reads>) cover the rest of what Claude reads: `prompt.section` for each section of the system prompt, `prompt.context` for the context sent with the first message, and `skill.prompt` for a skill’s text. To change a section after a conversation has started, see [Send a changed system prompt section or tool description](</docs/en/plugins/mods/reference#break-prompt-cache>). In a `skill.prompt` hook, you can also read [which plugin or file the skill came from](</docs/en/plugins/mods/reference#skill-prompt-fields>).
###
@@ -318,7 +318,7 @@
Check which mods get this event and your Claude Code version:
- * **The built-in guard** : with managed settings, or with a Team or Enterprise [`/login`](</docs/en/authentication#authentication-precedence>) as the session’s credential, the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) can skip this hook in a mod you install or load with `--plugin-dir`. To check, search the [debug log](</docs/en/plugins/mods/troubleshoot#read-the-debug-log>) for `settings.read bypassed by cc-plugin-sec-default`. If a line with that text names your mod, ask your organization’s administrator to [install the mod as one of the organization’s mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>).
+ * **The built-in guard** : where the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) loads, it can skip this hook in a mod you install or load with `--plugin-dir`. To check, search the [debug log](</docs/en/plugins/mods/troubleshoot#read-the-debug-log>) for `settings.read bypassed by cc-plugin-sec-default`. If a line with that text names your mod, ask your organization’s administrator to [install the mod as one of the organization’s mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>).
* **The version** : the event firing on Claude Code’s own read, and the `e.layers` field, require Claude Code v2.1.304 or later.
####
--- a/fast-mode.md
+++ b/fast-mode.md
@@ -231,7 +231,7 @@
To disable fast mode manually instead of waiting for cooldown, run `/fast` again. If you run out of usage credits mid-session, Claude Code retries each rejected fast mode request at standard speed and pricing, so you keep working, and there is no cooldown. How you see the rejection depends on the session type:
* In an interactive session, Claude Code shows a “Fast mode disabled · Out of usage credits” notification and turns fast mode off. Your saved fast mode preference doesn’t change; run `/fast` to turn fast mode back on.
- * In [non-interactive mode](</docs/en/headless>) with `--output-format stream-json`, and through the Agent SDK, Claude Code emits the same text on the message stream as a `system` message with subtype `notification`, once per turn while you’re out of usage credits. Fast mode stays on. Requires Claude Code v2.1.221 or later.
+ * In [non-interactive mode](</docs/en/headless>) with `--output-format stream-json`, and through the Agent SDK, Claude Code emits the same text on the message stream as a `system` message with subtype `notification`. The message arrives once per turn while you’re out of usage credits. Fast mode stays on.
##
--- a/gateways.md
+++ b/gateways.md
@@ -48,7 +48,7 @@
Subscriptions and gateways
-When developers connect through a gateway with a gateway credential, usage is billed to your organization’s provider account at API rates, and their claude.ai subscriptions aren’t used or charged. Setting [`ANTHROPIC_AUTH_TOKEN`](</docs/en/env-vars>) for a gateway you run, or signing in to a Claude apps gateway with `/login`, turns off subscription login for that session. Every request forwarded under that credential is charged to the account behind the gateway’s provider credential. The exception is setting only `ANTHROPIC_BASE_URL`, with no gateway credential. Requests still route through the gateway, but a saved claude.ai login stays the active credential, so the subscription’s usage limits and billing apply. [Other LLM gateways](</docs/en/llm-gateway#subscriptions-and-gateways>) covers that configuration and what the gateway has to forward for it to work.
+When developers connect through a gateway with a gateway credential, usage is billed to your organization’s provider account at API rates, and their claude.ai subscriptions aren’t used or charged. Every request forwarded under that credential is charged to the account behind the gateway’s provider credential. The exception is setting only `ANTHROPIC_BASE_URL`, with no gateway credential. Requests still route through the gateway, but a saved claude.ai login stays the active credential, so the subscription’s usage limits and billing apply. [Other LLM gateways](</docs/en/llm-gateway#subscriptions-and-gateways>) covers that configuration and what the gateway has to forward for it to work.
##
--- a/github-actions.md
+++ b/github-actions.md
@@ -133,6 +133,7 @@
Merge queues| Read
Metadata| Read
Pull requests| Read and write
+Repository creation| Read and write
Repository hooks| Read and write
Statuses| Read
Workflows| Read and write
--- a/github-enterprise-server.md
+++ b/github-enterprise-server.md
@@ -210,7 +210,7 @@
A few features behave differently on GHES than on github.com. The feature table summarizes support; this section covers the workarounds.
* **`/install-github-app` command**: follow the admin setup flow on claude.ai instead. If you also want GitHub Actions workflows on GHES, adapt the [example workflow](<https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml>) manually.
- * **GitHub MCP server** : use the `gh` CLI configured for your GHES host instead. Run `gh auth login --hostname github.example.com` to authenticate, then Claude can use `gh` commands in sessions.
+ * **GitHub MCP server** : in a session on your own machine, use the `gh` CLI configured for your GHES host instead. Run `gh auth login --hostname github.example.com` to authenticate, then Claude can use `gh` commands there.
##
--- a/goal.md
+++ b/goal.md
@@ -190,7 +190,7 @@
Requirements
-Claude Code makes `/goal` available under the same [workspace trust rule as hooks in settings files](</docs/en/permissions#what-runs-before-you-trust-a-folder>), because the evaluator is part of the hooks system. `/goal` is also unavailable when [`disableAllHooks`](</docs/en/hooks#disable-or-remove-hooks>) is `true` after settings precedence applies, or when [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) is set in managed settings. In each case, the command tells you why instead of silently doing nothing.
+Claude Code makes `/goal` available under the same [workspace trust rule as hooks in settings files](</docs/en/permissions#what-runs-before-you-trust-a-folder>), because the evaluator is part of the hooks system. `/goal` is also unavailable when [`disableAllHooks`](</docs/en/hooks#disable-or-remove-hooks>) is `true` after settings precedence applies, or when [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) is set in managed settings.
##
--- a/google-vertex-ai.md
+++ b/google-vertex-ai.md
@@ -144,7 +144,7 @@
* **Claude Opus 4.5, Sonnet 4.5, Haiku 4.5, and later** : Claude Code enables tool search by default.
* **Earlier models** : Claude Code loads MCP tool definitions upfront, because their Agent Platform serving stacks reject the required beta header. Setting `ENABLE_TOOL_SEARCH=true` doesn’t override this.
-Set `ENABLE_TOOL_SEARCH=false` to disable tool search on every model. Before v2.1.221, Claude Code disabled tool search for all models on Google Cloud’s Agent Platform unless you set `ENABLE_TOOL_SEARCH=true`.
+Set `ENABLE_TOOL_SEARCH=false` to disable tool search on every model.
###
--- a/hooks.md
+++ b/hooks.md
@@ -270,7 +270,7 @@
* **Top-level fields** are accepted on every event: `systemMessage` shows a message to the user, and `continue` (`continue_` in Python) determines whether the agent keeps running after this hook. Some events discard them or deliver them elsewhere. Each [event’s section](</docs/en/hooks#hook-events>) on the hooks page says where they land.
* **`hookSpecificOutput`** controls the current operation. The fields you set inside depend on the hook event type:
* For `PreToolUse` hooks, this is where you set `permissionDecision` (`"allow"`, `"deny"`, `"ask"`, or `"defer"`), `permissionDecisionReason`, and `updatedInput`. If you return `"defer"`, the turn ends with a result message whose `stop_reason` is `"tool_deferred"`, so you can [resume the call later](</docs/en/hooks#defer-a-tool-call-for-later>).
- * For `PostToolUse` hooks, you can set `additionalContext` to append information to the tool result. To replace the tool’s output before Claude sees it, set `updatedToolOutput`, which works for any tool in both SDKs. The older `updatedMCPToolOutput` field replaces MCP tool output only.
+ * For `PostToolUse` hooks, you can set `additionalContext` to append information to the tool result. To replace the tool’s output before Claude sees it, set `updatedToolOutput`, which works for built-in and MCP tools in both SDKs. The older `updatedMCPToolOutput` field replaces MCP tool output only.
* In the TypeScript SDK, a `PostToolUse` callback can also return `classifierContext`, a short note about the tool call’s result for the [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) permission classifier. Because your callback runs in your application’s own process, the classifier may weigh a user statement you relay in the note as user intent. The field requires TypeScript Agent SDK v0.3.236 or later. [Annotate a result for the auto mode classifier](</docs/en/hooks#annotate-a-result-for-the-auto-mode-classifier>) covers the length cap, the synchronous-only rule, and what not to put in the note.
Return `{}` to allow the operation without changes. SDK callback hooks use the same JSON output format as [Claude Code shell command hooks](</docs/en/hooks#json-output>), which documents every field and event-specific option. For the SDK type definitions, see the [TypeScript](</docs/en/agent-sdk/typescript#synchookjsonoutput>) and [Python](</docs/en/agent-sdk/python#synchookjsonoutput>) SDK references.
--- a/hooks-guide.md
+++ b/hooks-guide.md
@@ -898,7 +898,7 @@
In [plan mode](</docs/en/permissions#hook-approvals-in-plan-mode>), if your `PreToolUse` hook returns `"allow"` for a file edit, you get the same prompt, block, or approval the edit would get with no hook. To lift this limit on hook approvals, [approve the plan](</docs/en/permission-modes#review-and-approve-a-plan>) or switch to another permission mode.
* **`"deny"` in every permission mode**: a hook that returns `permissionDecision: "deny"` blocks the tool even in `bypassPermissions` mode or with `--dangerously-skip-permissions`. `PreToolUse` hooks fire before any permission-mode check, in every [permission mode](</docs/en/permission-modes>), including `dontAsk`. This lets you enforce policy that users can’t bypass by changing their permission mode.
-If your machine has no [managed settings](</docs/en/settings#check-what-your-organization-enforces>) and your session doesn’t use [`/login` credentials](</docs/en/authentication#authentication-precedence>) for a Team or Enterprise plan, a [mod](</docs/en/plugins/mods/overview>) can approve a call your `PreToolUse` hook blocked. A session that runs on an API key or a long-lived [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/authentication#generate-a-long-lived-token>) instead isn’t using that login, even when that login is stored.In plan mode, a mod can approve such a blocked call only when it’s read-only, so not a file edit. For the cases where a mod’s approval doesn’t get past your rules and hooks, see [Extend permissions with hooks](</docs/en/permissions#precedence-among-rules-hooks-and-mods>).
+Your machine might lack [managed settings](</docs/en/settings#check-what-your-organization-enforces>) and a [`managed-mcp.json` file](</docs/en/managed-mcp#deploy-managed-mcp-json>), and your session might not use [`/login` credentials](</docs/en/authentication#authentication-precedence>) for a Team or Enterprise plan. In that setup, a [mod](</docs/en/plugins/mods/overview>) can approve a call your `PreToolUse` hook blocked. A session that runs on an API key or a long-lived [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/authentication#generate-a-long-lived-token>) instead isn’t using that login, even when that login is stored.In plan mode, a mod can approve such a blocked call only when it’s read-only, so not a file edit. For the cases where a mod’s approval doesn’t get past your rules and hooks, see [Extend permissions with hooks](</docs/en/permissions#precedence-among-rules-hooks-and-mods>).
###
--- a/host-marketplace.md
+++ b/host-marketplace.md
@@ -133,7 +133,7 @@
Users without a git-host account can add a marketplace you serve as a `marketplace.json` URL or from a shared directory, but they can install only the plugins whose entry sources they can also reach. An entry that points at a private `github` repository still fails at install for them, because Claude Code fetches it with the same non-interactive `git` it uses for a git-hosted marketplace. These entry sources need no git account:
- * **`archive`** : a zip downloaded over HTTPS. Users need neither `git` nor an account, only network access to the URL. Requires Claude Code v2.1.224 or later. Pin each archive with `sha256` so Claude Code refuses a changed download. To send credentials with the download, see Authenticate archive downloads.
+ * **`archive`** : a zip downloaded over HTTPS. Users need neither `git` nor an account, only network access to the URL. Pin each archive with `sha256` so Claude Code refuses a changed download. To send credentials with the download, see Authenticate archive downloads.
* **A public git repository** : Claude Code clones a public `url` or `git-subdir` source over HTTPS without credentials when the entry gives an `https://` URL. For a `github` source, or a `git-subdir` source written as `owner/repo`, tell users without a GitHub SSH key to set `CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`.
Keep `CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1` in your instructions even if `claude plugin install` succeeds without it from the shell on a machine with no SSH key. For a `github` source, that command can fall back to HTTPS on its own, printing `SSH not configured, cloning via HTTPS`. Installs from `/plugin` inside a session and plugin updates don’t fall back, so without the variable they fail for users who have no GitHub SSH key. For a team on one network, a `directory` marketplace on a shared filesystem also works without git accounts. Users need only read access to the path.
--- a/install.md
+++ b/install.md
@@ -138,7 +138,7 @@
A plugin’s install scope decides who gets the plugin and which settings file records it as enabled:
* **User scope** : the plugin is enabled for you in every project on this machine. The entry goes in `enabledPlugins` in `~/.claude/settings.json`.
- * **Project scope** : the plugin is enabled for everyone who works in this repository. The entry goes in `.claude/settings.json`, which you commit. Committing that entry turns the plugin on for your collaborators but doesn’t download it to their machines, so each collaborator also runs `claude plugin install <name>@<marketplace> --scope project` once; see [Enabled in project settings but not installed](</docs/en/plugins/loading#enabled-in-project-settings-but-not-installed>).
+ * **Project scope** : the plugin is enabled for everyone who works in this repository. The entry goes in `.claude/settings.json`, which you commit. Committing that entry turns the plugin on for your collaborators but doesn’t download it to their machines. Each collaborator also runs `claude plugin install <name>@<marketplace> --scope project` once per clone; see [Enabled in project settings but not installed](</docs/en/plugins/loading#enabled-in-project-settings-but-not-installed>).
* **Local scope** : the plugin is enabled for you in this repository only. The entry goes in `.claude/settings.local.json`.
Some plugins are set by their author to start turned off, through the [`defaultEnabled`](</docs/en/plugins/manifest-reference#defaultenabled>) field. Such a plugin is installed but stays off until you turn it on with `claude plugin enable <name>` in your shell, or from the **Installed** tab of `/plugin` in a session. When the same plugin is set at several scopes, the local setting overrides the project setting, and the project setting overrides the user setting. See [Find where a plugin is enabled](</docs/en/plugins/loading#find-where-a-plugin-is-enabled>) for the full rule. The terminal, the desktop app’s local sessions, and the VS Code extension on one computer read the same settings files, so a plugin you install at user scope in any of them is available in the other two.
Show diff (103 lines)
--- a/interface.md
+++ b/interface.md
@@ -175,6 +175,8 @@
The band is a strip directly above the prompt input. It’s always there, and every mod shares it.Your hook returns a tree to show something in the band, or `next(e)` to show nothing. A tree replaces what the mods [after yours](</docs/en/plugins/mods/events#the-order-mods-run-in>) draw there. To keep theirs, put the result of `await next(e)` among the children of a `Box` in your tree.To draw in the band, filter on `{ component: 'AbovePrompt' }`.
+A mod can also place a row of its own in the transcript.
+
###
@@ -314,6 +316,91 @@
* **The question dialog** : at `AskUserQuestion`, the panel keeps its own question card and draws your elements above it. Props you pass to `next` don’t change the card.
* **Prompt suggestions** : `$.prompt.suggest` resolves with `isShown: false` and shows nothing, because the panel keeps the prompt box’s dim suggestion text for Claude’s own suggestions.
* **Text limits** : the panel cuts a status line at 200 characters or two rows, and a toast at 500 characters.
+
+###
+
+
+
+Place a row in the transcript
+
+A row is a line your mod adds to the transcript in the terminal, after the latest message. It stays at that spot as the conversation goes on, and Claude doesn’t see it. `$.ui.place` requires Claude Code v2.1.314 or later.
+
+1
+
+Place the row
+
+Call [`$.ui.place`](</docs/en/plugins/mods/reference#mods-api-methods>) with an `id`. The `id` is a name you make up for the row, such as `build-status`. It can be 1 to 64 letters, digits, `_`, or `-`, and each row your mod has in the transcript needs its own.
+
+2
+
+Draw the row
+
+Draw the row at the [`Placed`](</docs/en/plugins/mods/reference#render-sites>) render site.
+
+This example adds a `/build-status` command. When the user runs the command, the mod adds a row that shows `Build: passing`. The text is fixed to keep the example short, so a real mod would draw its own result:
+
+ export function register(on) {
+ on('session.start', async ($, e, next) => {
+ await $.command.register({ name: 'build-status', description: 'Show the build status' })
+ return next(e)
+ })
+
+ on('command.run', { command: 'build-status' }, async ($) => {
+ const placed = await $.ui.place({ id: 'build-status' })
+ // Where nothing draws the row, reply with text instead
+ return placed.isPlaced ? {} : { text: 'Build: passing' }
+ })
+
+ on('ui.render', { component: 'Placed' }, async ($, e, next) => {
+ // This hook runs for every mod's rows, and another mod can use the same id
+ if (e.props.plugin !== $.plugin.name || e.props.id !== 'build-status') return next(e)
+ const { Text } = $.ui.resolve(e)
+ return Text({ children: ['Build: passing'] })
+ })
+ }
+
+To try the example, put this code in a [mod](</docs/en/plugins/mods/create>). In a terminal session, run `/build-status` at the Claude Code prompt. `Build: passing` appears as a row at the end of the transcript. The call doesn’t always show a row, and a row can go away later, so handle these cases in your mod:
+
+ * **The result** : `{ isPlaced: true, requestId }` when the terminal draws the row. Otherwise `isPlaced` is `false` and `reason` says why, as in `no attached surface draws placed rows yet`. One reason is the [limit on rows](</docs/en/plugins/mods/reference#limits>) a mod can have at one time.
+ * **A second call with the same`id`**: while the first row is still in the transcript, the call adds no row and resolves with that row’s `requestId`. To change what the row shows, redraw the row.
+ * **When the row goes away** : when the conversation ends, when the user rewinds past the row, or, outside [fullscreen rendering](</docs/en/fullscreen>), when the conversation is compacted. `--resume` doesn’t bring the row back. To show the row again, call `$.ui.place` again.
+
+###
+
+
+
+Put a backdrop behind the conversation
+
+`$.theme.set` and `$.theme.clear` replace `$.ui.backdrop`, which Claude Code v2.1.319 removed. Change `$.ui.backdrop({ id: 'your-backdrop' })` to `$.theme.set({ backdrop: { id: 'your-backdrop' } })`, and `$.ui.backdrop(undefined)` to `$.theme.clear()`, which removes any mod’s backdrop.
+
+To put a backdrop behind the conversation in the Desktop app or the mobile app, call [`$.theme.set`](</docs/en/plugins/mods/reference#mods-api-methods>) with a `backdrop`, then draw the backdrop at the [`Backdrop`](</docs/en/plugins/mods/reference#render-sites>) render site. To take the backdrop off, call `$.theme.clear()`. The terminal draws no backdrop. `$.theme.set` and `$.theme.clear` require Claude Code v2.1.319 or later. This mod sets a backdrop when the session starts, draws the backdrop, and adds a `/plain` command that takes the backdrop off:
+
+ export function register(on) {
+ // Neither a reload of this mod nor --resume keeps the backdrop, so set it here
+ on('session.start', async ($, e, next) => {
+ await $.theme.set({ backdrop: { id: 'night-sky', colorScheme: 'dark' } })
+ await $.command.register({ name: 'plain', description: 'Take the backdrop off' })
+ return next(e)
+ })
+
+ on('ui.render', { component: 'Backdrop' }, async ($, e, next) => {
+ // This hook runs for every mod's backdrop, and another mod can use the same id
+ if (e.props.plugin !== $.plugin.name || e.props.id !== 'night-sky') return next(e)
+ const { Box, Text } = $.ui.resolve(e)
+ return Box({ backgroundColor: 'blue', children: [Text({ children: ['Night sky'] })] })
+ })
+
+ on('command.run', { command: 'plain' }, async ($) => {
+ const cleared = await $.theme.clear()
+ return { text: cleared.reason }
+ })
+ }
+
+To try the example, put this code in a [mod](</docs/en/plugins/mods/create>) and start a session in the Desktop app or the mobile app. To take the backdrop off, run `/plain` at the Claude Code prompt. The transcript shows `the theme is cleared` after the mod’s name, as in `night-sky: the theme is cleared` for a mod named `night-sky`. Check what `backdrop` takes, what the call’s result tells you, and what other mods can change:
+
+ * **The`backdrop` fields**: `id`, a [name](</docs/en/plugins/mods/reference#limits>) you choose, is required, and the other fields are optional. `colorScheme` is `'light'` or `'dark'` and says whether your drawing is light or dark. For `glass`, see [the types for your build](</docs/en/plugins/mods/create#get-the-types-for-your-build>).
+ * **Whether the backdrop is drawn** : `$.theme.set` resolves with `isDrawn: true` when a Desktop or mobile app connected to the session says it draws backdrops. Otherwise `isDrawn` is `false` and `reason` says why.
+ * **One backdrop for each session** : a `$.theme.set` call replaces the session’s backdrop and `$.theme.clear()` removes that backdrop, whichever mod set it. Call `$.theme.clear()` only when the user asks for it.
##
--- a/large-codebases.md
+++ b/large-codebases.md
@@ -193,7 +193,7 @@
* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.
* `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](</docs/en/plugins/troubleshooting#plugin-not-found-in-marketplace>).
-To enable a plugin for everyone in the repository rather than installing it yourself, add it to the [`enabledPlugins` project setting](</docs/en/settings-reference#plugin-settings>). Code intelligence plugins require the language’s language server binary on each developer’s machine. See [which binary each language requires](</docs/en/plugins/code-intelligence>). Installing from the official marketplace requires network access to GitHub, where the marketplace is hosted. On a restricted network, [add the marketplace from an internal Git host or local path](</docs/en/plugins/install#add-a-marketplace>) instead. This pairs well with `claudeMdExcludes` and the `Read` deny rules above. Those keep irrelevant content out of context, and code intelligence keeps Claude from reading through what remains to locate a definition.
+To turn a plugin on for everyone in the repository, add it to the [`enabledPlugins` project setting](</docs/en/settings-reference#plugin-settings>). Each person still [installs it](</docs/en/plugins/loading#enabled-in-project-settings-but-not-installed>). Code intelligence plugins require the language’s language server binary on each developer’s machine. See [which binary each language requires](</docs/en/plugins/code-intelligence>). Installing from the official marketplace requires network access to GitHub, where the marketplace is hosted. On a restricted network, [add the marketplace from an internal Git host or local path](</docs/en/plugins/install#add-a-marketplace>) instead. This pairs well with `claudeMdExcludes` and the `Read` deny rules above. Those keep irrelevant content out of context, and code intelligence keeps Claude from reading through what remains to locate a definition.
##
@@ -223,7 +223,11 @@
}
}
-When Claude creates a worktree, it checks out only `.claude/`, `packages/api/`, and `packages/shared/` instead of the full tree. Paths in `sparsePaths` are relative to the repository root, regardless of which subdirectory you start Claude from. Any directory paths work here, not only package roots. This is particularly useful for [subagent worktree isolation](</docs/en/worktrees#isolate-subagents-with-worktrees>). Subagents are parallel Claude instances spawned for subtasks, and each one that runs in a worktree gets a lightweight checkout instead of the full tree. All worktrees in a session share the same `sparsePaths`, so if one subagent needs `packages/api/` and another needs `packages/web/`, list both. List directories in `sparsePaths`, not individual files. Root-level files like `package.json`, `tsconfig.base.json`, and lock files are always checked out alongside the directories you list. Root-level directories are not, so include `.claude` in the list if you want the repository root’s `.claude/settings.json` or `.claude/rules/` available inside the worktree. For project skills, agents, and commands, see [What worktrees share with the main checkout](</docs/en/worktrees#what-worktrees-share-with-the-main-checkout>). Sparse checkout requires git to enable `extensions.worktreeConfig` in the repository’s shared `.git/config` while a sparse worktree exists. Claude Code removes that entry after the last worktree is removed, but only if Claude Code added it. It never removes a value you set yourself. To avoid duplicating large directories like `node_modules` across worktrees, pair `sparsePaths` with `symlinkDirectories` in the same `.claude/settings.json`:
+When Claude creates a worktree, it checks out only `.claude/`, `packages/api/`, and `packages/shared/` instead of the full tree. Paths in `sparsePaths` are relative to the repository root, regardless of which subdirectory you start Claude from. Any directory paths work here, not only package roots. This is particularly useful for [subagent worktree isolation](</docs/en/worktrees#isolate-subagents-with-worktrees>). Subagents are parallel Claude instances spawned for subtasks, and each one that runs in a worktree gets a lightweight checkout instead of the full tree. All worktrees in a session share the same `sparsePaths`, so if one subagent needs `packages/api/` and another needs `packages/web/`, list both. List directories in `sparsePaths`, not individual files. Root-level files like `package.json`, `tsconfig.base.json`, and lock files are always checked out alongside the directories you list. Root-level directories are not, so include `.claude` in the list if you want the repository root’s `.claude/settings.json` or `.claude/rules/` available inside the worktree. For project skills, agents, and commands, see [What worktrees share with the main checkout](</docs/en/worktrees#what-worktrees-share-with-the-main-checkout>).
+
+Sparse checkout requires git to enable `extensions.worktreeConfig` in the repository’s shared `.git/config` while a sparse worktree exists. Claude Code removes that entry after the last worktree is removed, but only if Claude Code added it.
+
+To avoid duplicating large directories like `node_modules` across worktrees, pair `sparsePaths` with `symlinkDirectories` in the same `.claude/settings.json`:
.claude/settings.json
--- a/llm-gateway-connect.md
+++ b/llm-gateway-connect.md
@@ -168,7 +168,7 @@
Conflicts with an existing login
-A gateway credential variable takes precedence over a saved claude.ai login or Console key. Your claude.ai login stays saved and unused while the variable is set; unset the variable and Claude Code goes back to it. With `ANTHROPIC_AUTH_TOKEN`, the variable takes precedence immediately. With `ANTHROPIC_API_KEY`, you are prompted once in interactive mode to approve the key before it takes over. Run `/status` to confirm which credential source is active. If startup shows an auth-conflict warning naming two sources, see the first row of the troubleshooting table for which one to drop. To clear a saved login so only the gateway credential remains, run `/logout`.
+A gateway credential variable takes precedence over a saved claude.ai login or Console key. With `ANTHROPIC_AUTH_TOKEN`, the variable takes precedence immediately. With `ANTHROPIC_API_KEY`, you are prompted once in interactive mode to approve the key before it takes over. Run `/status` to confirm which credential source is active. If startup shows an auth-conflict warning naming two sources, see the first row of the troubleshooting table for which one to drop. To clear a saved login so only the gateway credential remains, run `/logout`.
##
--- a/llm-gateway-rollout.md
+++ b/llm-gateway-rollout.md
@@ -247,7 +247,7 @@
* A login prompt means a credential gap. Run `/status` and open the **Status** tab: when the `Setting sources` line doesn’t include managed settings, the distribution didn’t reach the machine; when it does, the developer credential wasn’t delivered, so set `ANTHROPIC_AUTH_TOKEN` or the `apiKeyHelper`
* `Failed to authenticate` errors mean the gateway is rejecting requests; its log says which credential failed. A rejection the gateway logs itself names the developer key, while a `401` from `api.anthropic.com` or your provider’s endpoint means the provider credential the gateway holds was rejected
- * A one-time approval prompt for the key is expected on first use when the gateway expects keys in the `x-api-key` header, set as `ANTHROPIC_API_KEY`. With `ANTHROPIC_AUTH_TOKEN`, no prompt appears and the variable takes over silently; a previously saved claude.ai login is inactive for that session
+ * A one-time approval prompt for the key is expected on first use when the gateway expects keys in the `x-api-key` header, set as `ANTHROPIC_API_KEY`
If your organization uses [fast mode](</docs/en/fast-mode>), run `/fast` here too: the availability check calls `api.anthropic.com` directly rather than following the gateway base URL, so a gateway-routed session can report fast mode as unavailable or disabled even though inference works. [Use fast mode behind proxies and LLM gateways](</docs/en/fast-mode#use-fast-mode-behind-proxies-and-llm-gateways>) maps each message to the variable that restores it, distributed with the rest of the configuration. Finally, check the gateway’s logs for the message you sent: the credential identifies the developer, and the [`x-claude-code-session-id` header](</docs/en/llm-gateway-protocol#request-headers>) groups requests by session. If features fail with the [troubleshooting symptoms](</docs/en/llm-gateway-connect#troubleshoot-gateway-errors>), the gateway is stripping headers or rewriting errors; see the gateway requirements above.
--- a/loading.md
+++ b/loading.md
@@ -209,7 +209,21 @@
Enabled in project settings but not installed
-When a plugin’s only `true` is in the project’s `.claude/settings.json`, Claude Code doesn’t fetch it onto a machine where it isn’t installed, unless its marketplace entry has a [relative-path source](</docs/en/plugins/marketplace-reference#plugin-sources>) or a [seed directory](</docs/en/plugins/org#seed-containers-and-ci>) already holds it. Instead, the `/plugin` **Errors** tab shows `Plugin "<name>" is enabled in project settings but isn't installed here`. A relative-path plugin needs no install record because it loads from the marketplace itself. Claude Code fetches a plugin with an external source only when one of these sources sets it to `true`:
+By default, a plugin enabled only in your project’s `.claude/settings.json` doesn’t load at session start until you install it on your machine. With the marketplace on your machine, the `/plugin` **Errors** tab shows [`Plugin "<name>" is enabled in project settings but isn't installed here`](</docs/en/plugins/troubleshooting#plugin-is-enabled-in-project-settings-but-isnt-installed-here>) or [`Plugin "<name>" not cached at <path>`](</docs/en/plugins/troubleshooting#plugin-not-cached-at>).
+
+If the tab shows neither message, [add the marketplace](</docs/en/plugins/install#add-a-marketplace>) before you install. Find its source in the `extraKnownMarketplaces` setting of `.claude/settings.json`, or ask your maintainer.
+
+To install, run this in a shell from the project, using the plugin’s key in `enabledPlugins`:
+
+ claude plugin install <name>@<marketplace> --scope project
+
+To load the plugin, run `/reload-plugins` in your session or start a new session. Repeat the install in each of your clones, or use `--scope user` to cover all your projects. You can load a plugin without an install in these cases:
+
+ * **In a[seed directory](</docs/en/plugins/org#seed-containers-and-ci>)**: you have nothing to run
+ * **Listed by a[relative path](</docs/en/plugins/marketplace-reference#plugin-sources>) in a marketplace you added from a local path**: you have nothing to run, because the plugin loads at session start
+ * **Listed by a relative path, such as`./plugins/formatter`, in the `marketplace.json` of a git marketplace you’ve added**: run `/reload-plugins` to load it for the current session only. To load it for one [non-interactive `-p` run](</docs/en/headless>), set [`CLAUDE_CODE_SYNC_PLUGIN_INSTALL=1`](</docs/en/env-vars>).
+
+Claude Code fetches a plugin with an external source only when one of these sources sets the plugin to `true`:
* Your user settings
* A `.claude/settings.local.json` that git doesn’t track
--- a/manifest-reference.md
+++ b/manifest-reference.md
@@ -191,7 +191,7 @@
`metadata`
-A free-form object for your own data, such as catalog or entitlement fields. Claude Code doesn’t read it. Requires Claude Code v2.1.222 or later.
+A free-form object for your own data, such as catalog or entitlement fields. Claude Code doesn’t read it.
###
@@ -412,7 +412,7 @@
Every component path in a manifest is relative to the plugin root and must start with `./`. A path such as `commands/foo.md` fails validation. `skills` and `mcpServers` each accept one form outside that rule:
- * **`skills`** : also accepts `"."`. Both `"."` and `"./"` denote the plugin root. Before v2.1.221, `"."` failed manifest validation, so use `"./"` when the plugin must load on earlier versions
+ * **`skills`** : also accepts `"."`. Both `"."` and `"./"` denote the plugin root
* **`mcpServers`** : also accepts an `https://` bundle URL
`experimental.evals` isn’t a component path, so the rules in this section don’t cover it, and `claude plugin eval` checks the value when it runs instead. It names a directory below the plugin root, such as `"quality/evals"`, with or without the `./` prefix. With an array, only the first entry is used. For what the value accepts and what happens with an unusable one, see [Use a different eval directory](</docs/en/plugin-evals#use-a-different-eval-directory>).
--- a/marketplace-reference.md
+++ b/marketplace-reference.md
@@ -84,7 +84,7 @@
`dependencies`| array| Plugins that must be enabled for this one to work. Each item is `"name"`, `"name@marketplace"`, or an object. See [Plugin dependencies](</docs/en/plugins/dependencies>)
`defaultEnabled`| boolean| Default `true`. Whether the plugin starts enabled when the user hasn’t set it in [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>). The entry value takes precedence over `plugin.json`
`displayName`| string| Human-readable name shown in the UI. When neither the entry nor the plugin’s `plugin.json` sets one, users see the plugin’s `name`
-`metadata`| object| Free-form object for your own fields. Claude Code doesn’t read it. Requires Claude Code v2.1.222 or later
+`metadata`| object| Free-form object for your own fields. Claude Code doesn’t read it
`headers`| object| HTTP headers Claude Code sends when it downloads this entry’s archive. A header set here replaces a header of the same name from the marketplace source’s `headers`. Requires Claude Code v2.1.238 or later
`headersHelper`| string| Command that prints this entry’s archive-download headers as one JSON object, for a credential that expires. The entry must also set `"strict": false`. Requires Claude Code v2.1.238 or later. See [Authenticate archive downloads](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>)
@@ -150,7 +150,7 @@
`url`| `url`, `ref`, `sha`| Any git repository by URL
`git-subdir`| `url`, `path`, `ref`, `sha`| One subdirectory of a git repository, fetched with a sparse checkout
`npm`| `package`, `version`, `registry`| npm registry package or tarball link, fetched with your npm client and unpacked without running install scripts
-`archive`| `url`, `sha256`| Zip archive over HTTPS. Requires Claude Code v2.1.224 or later
+`archive`| `url`, `sha256`| Zip archive over HTTPS
`command`| `command`, `timeout`, `mode`| Directory printed by a command Claude Code runs on the user’s machine. Requires Claude Code v2.1.229 or later
The names `url` and `github` are also marketplace source types, where `url` means a direct link to a `marketplace.json` file rather than a git repository. `git` exists only as a marketplace source, and `npm` exists as both. `git-subdir`, `archive`, and `command` exist only as plugin sources. Use a relative path for a plugin in a subdirectory of the marketplace repository itself. Use `git-subdir` for a subdirectory of some other repository. `github`, `url`, and `git-subdir` sources share the `ref` and `sha` fields:
--- a/model-config.md
+++ b/model-config.md
@@ -83,7 +83,7 @@
Fable and usage credits
-Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code can show a Fable usage-credits consent prompt. Members of Enterprise plans with organization billing don’t see the prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt:
+Depending on your plan and seat tier, Fable usage can bill to [usage credits](<https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans>) instead of drawing on your plan’s included limits. When it does, the `/model` picker shows “Requires usage credits” on the Fable row. To manage usage credits, see [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>). In interactive sessions, Claude Code can show a Fable usage-credits consent prompt. You can continue on Fable using usage credits or switch to your default model. You can also dismiss the prompt:
* When you select a Fable model with `/model`, you keep your current model.
* Mid-session, Claude Code continues the turn on your default model.
@@ -126,7 +126,7 @@
* **Agent SDK or an app** : with Claude Code v2.1.268 or later, unless Claude Code accepts a model ID locally, as it does for your custom model option, it confirms the ID with your provider the first time the session switches to it. The confirmation runs on every provider, and an ID your provider doesn’t offer is refused at the switch instead of failing on your next request.
* **Remote Control** : on the Anthropic API, Claude Code checks the value locally and sends no request.
-See [Model is not a recognized model id](</docs/en/errors#model-is-not-a-recognized-model-id>) and [Model not found](</docs/en/errors#model-not-found>) for the messages. If you set the model with the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting, Claude Code doesn’t check it up front, and a mistyped value produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>) on the first request. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus:
+See [Model is not a recognized model id](</docs/en/errors#model-is-not-a-recognized-model-id>) and [Model not found](</docs/en/errors#model-not-found>) for the messages. If you set the model with the `--model` flag, the `ANTHROPIC_MODEL` environment variable, or the `model` setting, Claude Code doesn’t reject a mistyped value up front. The session starts, and the first request produces [There’s an issue with the selected model](</docs/en/errors#theres-an-issue-with-the-selected-model>). On the Anthropic API, a value that doesn’t start with `claude-` and nearly spells a model name or alias can also produce a startup warning that suggests it. When the requested model has a scheduled retirement date or is automatically remapped to a newer version, Claude Code shows a warning that names the requested model. Interactive sessions show it as a startup notice. From v2.1.182, the same warning is written to stderr in [non-interactive mode](</docs/en/headless>) when using the default text output format. The check also covers a `model` set in [subagent frontmatter](</docs/en/sub-agents>). The stderr warning is suppressed for `--output-format json` and `stream-json`; read the actual model from the `modelUsage` field of the [result message](</docs/en/headless#get-structured-output>) instead. For example, start a session on Opus:
claude --model opus
@@ -845,6 +845,20 @@
* **Any other window** : set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](</docs/en/env-vars>) to the window size in tokens in the environment that starts Claude Code, such as `CLAUDE_CODE_MAX_CONTEXT_TOKENS=400000`. For an unrecognized ID that doesn’t start with `claude-` and has no `[1m]` suffix, the variable takes effect on its own. For any other ID, check which IDs it applies to first.
Once Claude Code recognizes the ID or uses the window you gave it, the warning no longer appears when you start a session on that ID.
+
+####
+
+
+
+Fix a mistyped model name
+
+Either of these warnings means Claude Code doesn’t recognize the model ID you set, and the ID nearly spells a model name or alias it does recognize:
+
+ ⚠ Model "<model>" isn't recognized · did you mean "<suggestion>"?
+ Claude Code doesn't recognize the model "<model>". Did you mean "<suggestion>"?
+
+ * **You mistyped the ID** : change it to the suggestion wherever you set the model
+ * **The ID is deliberate** : leave it as it is. The session sends it as you wrote it. If the context window Claude Code assumes for it is wrong, correct the window
####
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -138,15 +138,15 @@
Metrics cardinality control
-The following environment variables control which attributes are included in metrics to manage cardinality:
+The following environment variables control which attributes are included in metrics and events to manage cardinality:
Environment Variable| Description| Default Value| Example to Disable
---|---|---|---
-`OTEL_METRICS_INCLUDE_SESSION_ID`| Include session.id and, on cloud sessions, ccr.session.id attributes in metrics| `true`| `false`
-`OTEL_METRICS_INCLUDE_VERSION`| Include app.version attribute in metrics| `false`| `true`
-`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`| Include user.account_uuid and user.account_id attributes in metrics| `true`| `false`
-`OTEL_METRICS_INCLUDE_ENTRYPOINT`| Include app.entrypoint attribute in metrics| `false`| `true`
-`OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES`| Include keys from `OTEL_RESOURCE_ATTRIBUTES` as attributes on metric datapoints| `true`| `false`
+`OTEL_METRICS_INCLUDE_SESSION_ID`| Include session.id and cloud sessions’ ccr.session.id attributes in metrics and events| `true`| `false`
+`OTEL_METRICS_INCLUDE_VERSION`| Include app.version attribute in metrics and events| `false`| `true`
+`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`| Include user.account_uuid and user.account_id attributes in metrics and events| `true`| `false`
+`OTEL_METRICS_INCLUDE_ENTRYPOINT`| Include app.entrypoint attribute in metrics and events| `false`| `true`
+`OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES`| Include keys from `OTEL_RESOURCE_ATTRIBUTES` as attributes on metric datapoints and events| `true`| `false`
`OTEL_METRICS_INCLUDE_REPOSITORY`| Include `vcs.*` repository identity attributes on metrics and events. Requires Claude Code v2.1.269 or later| `false`| `true`
Lower cardinality generally means better performance and lower storage costs but less granular data for analysis.
@@ -480,7 +480,7 @@
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf
- export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://metrics.example.com:4318
+ export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://metrics.example.com:4318/v1/metrics
export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=grpc
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://logs.example.com:4317
@@ -523,7 +523,7 @@
By default, metrics and events from a cloud session carry the standard attributes, including `session.id`, `ccr.session.id`, and `organization.id`, so you can filter by session or organization without extra configuration. The `ccr.session.id` value is the session’s `CLAUDE_CODE_REMOTE_SESSION_ID`. To turn it into the session’s transcript URL, see [Link output back to the session](</docs/en/cloud-environments#link-output-back-to-the-session>). To tell cloud sessions apart, group or filter on `ccr.session.id`, not `session.id`. To attribute telemetry in more detail, use these options:
- * **Identify Claude Tag sessions** : set `OTEL_METRICS_INCLUDE_ENTRYPOINT=true`, as described under Metrics cardinality control. Metrics then carry `app.entrypoint`, whose value is `claude-in-slack` for Claude Tag sessions.
+ * **Identify Claude Tag sessions** : set `OTEL_METRICS_INCLUDE_ENTRYPOINT=true`, as described under Metrics cardinality control. Metrics and events then carry `app.entrypoint`, whose value is `claude-in-slack` for Claude Tag sessions.
* **Add custom attributes** : set `OTEL_RESOURCE_ATTRIBUTES` in the same place you set the other `OTEL_*` variables for those sessions. If you `export` it in the environment’s [setup script](</docs/en/cloud-environments#setup-scripts>) instead, the value doesn’t reach Claude Code: the setup script is a separate Bash script that runs before Claude Code launches, and variables it exports end with it.
In Claude Tag channel sessions, Claude works as your organization’s [shared identity](</docs/en/cloud-environments#set-the-environment-a-claude-tag-channel-uses>) rather than as any member, so don’t rely on the `user.*` attributes to identify who tagged Claude.
@@ -547,7 +547,7 @@
`session.id`| Claude Code’s own session ID, which `/clear` replaces| `OTEL_METRICS_INCLUDE_SESSION_ID` (default: true)
`ccr.session.id`| Cloud session identifier, the value of `CLAUDE_CODE_REMOTE_SESSION_ID`, on sessions that run in a [cloud environment](</docs/en/cloud-environments>)| `OTEL_METRICS_INCLUDE_SESSION_ID` (default: true)
`app.version`| Current Claude Code version| `OTEL_METRICS_INCLUDE_VERSION` (default: false)
-`app.entrypoint`| How the session was launched, such as `cli`, `sdk-cli`, `sdk-ts`, `sdk-py`, `claude-vscode`, or `claude-in-slack` for Claude Tag sessions| `OTEL_METRICS_INCLUDE_ENTRYPOINT` (default: false)
+`app.entrypoint`| How the session was launched, such as `cli`, `sdk-cli`, `sdk-ts`, `sdk-py`, `claude-vscode`, `claude-desktop` for Claude Desktop Code tab sessions outside the cloud, `claude-desktop-3p` for the same sessions on a [third-party deployment](<https://claude.com/docs/third-party/claude-desktop/overview>), or `claude-in-slack` for Claude Tag sessions. Cloud session values include `remote`, plus `remote_desktop` and `remote_mobile` for sessions you start from Claude Desktop or the mobile app| `OTEL_METRICS_INCLUDE_ENTRYPOINT` (default: false)
`organization.id`| Organization UUID (when authenticated)| Always included when available
`user.account_uuid`| Account UUID (when authenticated)| `OTEL_METRICS_INCLUDE_ACCOUNT_UUID` (default: true)
`user.account_id`| Account ID in tagged format matching Anthropic admin APIs (when authenticated), such as `user_01BWBeN28...`| `OTEL_METRICS_INCLUDE_ACCOUNT_UUID` (default: true)
@@ -597,7 +597,7 @@
Metric Name| Description| Unit
---|---|---
-`claude_code.session.count`| Count of CLI sessions started| none
+`claude_code.session.count`| Count of sessions started| none
`claude_code.lines_of_code.count`| Count of lines of code modified| none
`claude_code.pull_request.count`| Number of pull requests created| none
`claude_code.commit.count`| Number of git commits created| none
@@ -622,7 +622,7 @@
Session counter
-Incremented at the start of each session. **Attributes** :
+Incremented at the start of each session. To count people instead, see Usage monitoring. **Attributes** :
* All standard attributes
* `start_type`: How the session was started. One of `"fresh"`, `"resume"`, `"continue"`, or `"agents_view"`. The `"agents_view"` value identifies the `claude agents` dashboard process, a user-launched local UI rather than a conversational session. Filter on this value to separate UI process launches from conversational sessions in your dashboards.
@@ -1500,9 +1500,10 @@
Metric| Analysis Opportunity
---|---
`claude_code.token.usage`| Break down by token `type`, user, team, model, `skill.name`, `plugin.name`, or `agent.name`
-`claude_code.session.count`| Track adoption and engagement over time
`claude_code.lines_of_code.count`| Measure productivity by tracking code additions and removals, broken down by model
`claude_code.commit.count` & `claude_code.pull_request.count`| Understand impact on development workflows
+
+To compare active users across surfaces, set `OTEL_METRICS_INCLUDE_ENTRYPOINT=true` to add `app.entrypoint` to metrics and events. Then count distinct `user.account_uuid` values per entrypoint on `claude_code.user_prompt` events, or on `claude_code.token.usage` if you export only metrics. For example, use `cli` for interactive CLI sessions, and group `claude-desktop`, `claude-desktop-3p`, and `remote_desktop` for the Claude Desktop Code tab. `user.account_uuid` doesn’t identify people in Claude Tag channel sessions and is missing from sessions with no Claude account: see Attribute actions to users. When one person starts many sessions, or a session receives no prompt, `claude_code.session.count` goes up without adding an active user.
###
@@ -1788,7 +1789,7 @@
Security and privacy
* OpenTelemetry export to your backend is opt-in and requires explicit configuration. For Anthropic’s separate operational telemetry and how to disable it, see [Data usage](</docs/en/data-usage#telemetry-services>)
- * Raw file contents and code snippets are not included in metrics or events. Trace spans are a separate data path: see the `OTEL_LOG_TOOL_CONTENT` bullet below
+ * By default, raw file contents and code snippets aren’t included in metrics or events. If you set a variable such as `OTEL_LOG_TOOL_DETAILS` or `OTEL_LOG_RAW_API_BODIES`, events can include them. Trace spans are a separate data path: see the `OTEL_LOG_TOOL_CONTENT` bullet below
* When authenticated via OAuth, `user.email` is included in telemetry attributes, sent only to the OTel endpoint you configure, never to Anthropic. If this is a concern for your organization, work with your telemetry backend to filter or redact this field
* User prompt content is not collected by default. Only prompt length is recorded. To include prompt content, set `OTEL_LOG_USER_PROMPTS=1`. When enabled:
* `user_prompt` events carry the prompt text in two attributes, `prompt` and `prompt_text`. If you drop or mask the event’s prompt text by attribute name in your collector, name both attributes in the rule This OpenTelemetry Collector `attributes` processor deletes both attributes in the pipelines that list it:
--- a/org.md
+++ b/org.md
@@ -83,7 +83,7 @@
* **Interactive sessions** : Claude Code registers the marketplace only after the contributor accepts the [workspace trust dialog](</docs/en/permissions#what-runs-before-you-trust-a-folder>) for that folder.
* **[Non-interactive`-p` runs](</docs/en/headless>)**: the entries apply only in a folder whose trust the user already accepted interactively, or whose `hasTrustDialogAccepted` flag you set in `~/.claude.json`.
-A plugin that the marketplace lists by a relative path loads from the marketplace copy once the repository’s `extraKnownMarketplaces` entries apply. A plugin whose marketplace entry points at an external source instead, such as the plugin’s own GitHub repository, doesn’t install from the repository’s settings alone. Each contributor sees `Plugin "<name>" is enabled in project settings but isn't installed` until they run `claude plugin install <name>@<marketplace> --scope project`, as [Install plugins](</docs/en/plugins/install>) describes. If you use a local `directory` or `file` source with a relative path, the path resolves against your repository’s main checkout. When you run Claude Code from a git worktree, the path still points at the main checkout, so all worktrees share the same marketplace location. To roll out a bundle of plugins with dependencies, put the bundle plugin in `enabledPlugins`, as [Plugin dependencies](</docs/en/plugins/dependencies>) describes.
+Setting `enabledPlugins` in the repository doesn’t install the plugin. Once the marketplace is registered, ask each contributor to run `claude plugin install <name>@<marketplace> --scope project`. Until they do, the `/plugin` **Errors** tab can show `Plugin "<name>" is enabled in project settings but isn't installed here` or [`not cached`](</docs/en/plugins/troubleshooting#plugin-not-cached-at>). Contributors don’t need the install when a local `directory` or `file` marketplace lists the plugin with a [relative-path `source`](</docs/en/plugins/marketplace-reference#plugin-sources>). If you use a local `directory` or `file` source with a relative path, the path resolves against your repository’s main checkout. When you run Claude Code from a git worktree, the path still points at the main checkout, so all worktrees share the same marketplace location. To roll out a bundle of plugins with dependencies, put the bundle plugin in `enabledPlugins`, as [Plugin dependencies](</docs/en/plugins/dependencies>) describes.
###
--- a/python.md
+++ b/python.md
@@ -2963,7 +2963,7 @@
Monitor
-**Tool name:** `Monitor` Runs a background source and delivers each event to Claude so it can react without polling: `command` runs a script and emits one event per stdout line, and `ws` opens a WebSocket and emits one event per text frame. Provide exactly one of `command` or `ws`. When Monitor runs a command, it follows the same permission rules as Bash; a WebSocket watch prompts for approval separately. The `ws` source requires Claude Code v2.1.195 or later. See the [Monitor tool reference](</docs/en/tools-reference#monitor-tool>) for behavior and provider availability. **Input:**
+**Tool name:** `Monitor` Runs a background source and delivers each event to Claude so it can react without polling: `command` runs a script and emits one event per stdout line, and `ws` opens a WebSocket and emits one event per text frame. Provide exactly one of `command` or `ws`. The `ws` source requires Claude Code v2.1.195 or later. When Monitor runs a command, it follows the same permission rules as Bash. See the [Monitor tool reference](</docs/en/tools-reference#monitor-tool>) for WebSocket permissions, behavior, and provider availability. **Input:**
{
"command": str | None, # Shell script; each stdout line is an event, exit ends the watch
Show diff (101 lines)
--- a/reference.md
+++ b/reference.md
@@ -61,7 +61,7 @@
---|---|---
[`tool.call`](</docs/en/plugins/mods/events#guard-or-change-a-tool-call>)| A tool is about to run| `next(e)`, `{ deny: reason }`, or `{ result }`
[`tool.check`](</docs/en/plugins/mods/events#where-settings-hooks-run-in-the-order>)| Claude Code decides whether a tool call may run, after the `tool.call` and `PreToolUse` hooks. `next(e)` resolves to the decision the rules, the permission mode, and those hooks reached.| `next(e)` or `{ decision }`, with `decision` set to `allow`, `ask`, or `deny` and an optional `reason`
-`tool.describe`| Once for each tool, when its description is first sent to Claude. A second time for an MCP tool when Claude loads it through [tool search](</docs/en/mcp#scale-with-mcp-tool-search>), with `e.description` set to the text Claude reads for the loaded tool.| `{ description }`, optionally with `isDeferred` set to `true` to put the tool behind tool search or `false` to load it upfront
+`tool.describe`| Once for each tool, when its description is first sent to Claude. A second time for an MCP tool when Claude loads it through [tool search](</docs/en/mcp#scale-with-mcp-tool-search>), with `e.description` set to the text Claude reads for the loaded tool.| `{ description }`, optionally with `isDeferred` set to `true` to put the tool behind tool search or `false` to load it upfront. Add `breakPromptCache: true` to send a changed description on the next turn.
####
@@ -99,7 +99,7 @@
`prompt.edit`| The user edits the prompt box| `next(e)`
`prompt.autocomplete`| The user types in the prompt box and a word ends at the cursor. `e.token` is that word. Claude Code doesn’t wait for the hook: its own autocomplete rows show first.| `{ suggestions }`, a list of `{ text, label, description }` rows shown below Claude Code’s own. Choosing a row writes its `text` over the word.
`prompt.compose`| Claude Code renders a system prompt| `{ sections }`, a list of `{ id, text, scope }` in the order they’re sent
-[`prompt.section`](</docs/en/plugins/mods/events#rewrite-or-add-to-a-prompt>)| Once for each named section of the system prompt. `e.name` is the section’s `id` in `prompt.compose`.| `{ text }`, or `{ text: null }` to omit the section
+[`prompt.section`](</docs/en/plugins/mods/events#rewrite-or-add-to-a-prompt>)| Once for each named section of the system prompt. `e.name` is the section’s `id` in `prompt.compose`.| `{ text }`, or `{ text: null }` to omit the section. Add `breakPromptCache: true` to send a changed section on the next turn.
[`prompt.context`](</docs/en/plugins/mods/events#rewrite-or-add-to-a-prompt>)| Once for each conversation, for the context sent with the first message| `{ blocks }`
`prompt.attachment`| Claude Code adds a message of its own for Claude, such as a reminder. `e.type` names the kind, and for the kinds the types declare, `e.detail` holds the facts the text was written from.| `{ text }`, or `{ text: null }` to omit it
`prompt.mention`| Claude Code is about to read a file that a prompt @-mentions. Requires Claude Code v2.1.290 or later.| `next({ ...e, path })` to read a different file, or `{ deny: reason }`
@@ -123,6 +123,14 @@
`e.frontmatterProblem`| string| The reason `e.frontmatter` is missing the file’s frontmatter or one of its keys, as in `is a list or a single value, not a table`. Absent when `e.frontmatter` holds the whole frontmatter or the skill has none.
A hook can pass a changed `text` or `frontmatter` to `next`: the hooks after it read both, and Claude reads the final `text`. A hook that changes any other field [fails](</docs/en/plugins/mods/events#handle-a-hook-that-fails>). On `skill.prompt`, `e.source`, `e.pluginName`, `e.path`, `e.frontmatter`, and `e.frontmatterProblem` require Claude Code v2.1.299 or later.
+
+####
+
+
+
+Send a changed system prompt section or tool description with `breakPromptCache`
+
+To change a section or a tool description in a running conversation, call `$.ui.invalidate('prompt.section')` or `$.ui.invalidate('tool.describe')` so your hook runs again. Return `{ text, breakPromptCache: true }` or `{ description, breakPromptCache: true }` from it. Without the field, Claude keeps reading the text [saved with the conversation](</docs/en/cli-reference#system-prompt-flags-in-resumed-conversations>) for a section or a tool loaded upfront until a new conversation or a [compaction](</docs/en/prompt-caching#compacting-the-conversation>). The changed text reaches Claude on the next turn, and the [prompt cache](</docs/en/prompt-caching>) starts over, so that turn is slower and more expensive. The field requires Claude Code v2.1.321 or later. From v2.1.299 until v2.1.321, a running conversation got the changed text on the next turn.
###
@@ -268,7 +276,8 @@
Namespace| Methods
---|---
`$.plugin`| `name`, `root`: this plugin’s name and directory
-[`$.ui`](</docs/en/plugins/mods/interface#pick-where-to-draw>)| `resolve`, `invalidate`, `open`, `close`, `panes`, `focus`, `scroll`, `toast`, `notify`, `status`, `log`, `notice`, `ask`, `copy`, `selection`, `blit`
+[`$.ui`](</docs/en/plugins/mods/interface#pick-where-to-draw>)| `resolve`, `invalidate`, `open`, `close`, `panes`, [`place`](</docs/en/plugins/mods/interface#place-a-row-in-the-transcript>), `focus`, `scroll`, `toast`, `notify`, `status`, `log`, `notice`, `ask`, `copy`, `selection`, `blit`, `view`. `view` requires Claude Code v2.1.300 or later and `place` v2.1.314 or later.
+[`$.theme`](</docs/en/plugins/mods/interface#put-a-backdrop-behind-the-conversation>)| `set`, `clear`: set a backdrop for the Desktop or mobile app to draw, and take the backdrop off. Requires Claude Code v2.1.319 or later.
[`$.command`](</docs/en/plugins/mods/api#add-a-command>)| `register`, `run`, `list`
[`$.tool`](</docs/en/plugins/mods/api#add-a-tool>)| `register`, `call`, `check`, `list`
`$.agent`| `register`, `spawn`, `list`. `list()` returns this session’s subagents and teammates, each with a `status` of `pending`, `running`, `waiting`, `idle`, `completed`, `failed`, or `killed`, where `idle` and `waiting` require Claude Code v2.1.289 or later.
@@ -301,15 +310,17 @@
---|---|---|---
[`Pane`](</docs/en/plugins/mods/interface#pick-where-to-draw>)| `title`, `isFocused`, `bodyColumns`, `placement`, `scroll`, `view`| The pane’s `id`| Terminal, Desktop, VS Code
[`AbovePrompt`](</docs/en/plugins/mods/interface#pick-where-to-draw>)| `hasSurvey`, `isWorking`, `maxRows`, `bodyColumns`, `scroll`, `view`| One instance| Terminal, Desktop
-`UserMessage`| `text`, `origin`, `isExpanded`, and `task` or `from` by origin| The message id| Terminal, Desktop, VS Code
-`AssistantMessage`| The reply’s text| The message id| Terminal, Desktop, VS Code
+[`Placed`](</docs/en/plugins/mods/interface#place-a-row-in-the-transcript>)| `id`, `plugin`, `onScreen`| The `requestId` that `$.ui.place` returned| Terminal
+[`Backdrop`](</docs/en/plugins/mods/interface#put-a-backdrop-behind-the-conversation>)| `id`, `plugin`, `glass`, `colorScheme`| `backdrop`| `desktop` and `mobile` surfaces. Your hook runs when the Desktop or mobile app asks to draw a backdrop.
+`UserMessage`| `text`, `origin`, `isExpanded`, and `task` or `from` by origin| The drawn row’s id| Terminal, Desktop, VS Code
+`AssistantMessage`| The reply’s text| The drawn row’s id| Terminal, Desktop, VS Code
`ToolUse`, `ToolResult`, `ToolGroup`| The tool’s name, input, and result| The tool call id| Terminal, Desktop, VS Code
-`CommandOutput`| `command`, `text`| The message id| Terminal, Desktop
+`CommandOutput`| `command`, `text`| The drawn row’s id| Terminal, Desktop
[`AskUserQuestion`](</docs/en/plugins/mods/interface#change-what-claude-code-already-draws>)| The question and options| The tool call id| Terminal, Desktop, VS Code
`ToolProgress`| `kind`| The tool call id| Terminal
[`Spinner`](</docs/en/plugins/mods/interface#change-what-claude-code-already-draws>)| `word`, `message`, `suffix`, `mode`| The agent id| Terminal, Desktop, VS Code
-`TurnDuration`| `word`, `durationMs`| The message id| Terminal
-`InfoNotice`| `text`, `command`| The message id| Terminal
+`TurnDuration`| `word`, `durationMs`| The drawn row’s id| Terminal
+`InfoNotice`| `text`, `command`| The notice’s `text` prefixed with `notice:`| Terminal
`SessionMode`| `modes`| One instance| Terminal, Desktop
`PromptHint`| `isDraft`, `isWorking`, `hint`| One instance| Terminal, Desktop
@@ -471,11 +482,12 @@
`$.ui.invalidate('ui.render')` redraws| Throttled to 10 a second, or 30 in the terminal for the visible pane, the expanded band, and the hint line under the prompt. Calls that come sooner are coalesced.
`$.ui.toast`| Shown for 4 seconds unless you pass `{ timeoutMs }`. In the [classic renderer](</docs/en/fullscreen#enable-fullscreen-rendering>), a mod’s newer toast can [take the place of its older one](</docs/en/plugins/mods/troubleshoot#a-toast-doesn%E2%80%99t-appear>) that’s showing or waiting to show.
A pane opened without the user asking| Placed from 144 terminal columns, 110 after they’ve opened it once
+Rows from `$.ui.place` that one mod has in a conversation at one time| 500\. At the limit, a call with a new `id` resolves to `{ isPlaced: false, reason: 'a plugin holds at most 500 placed rows' }`.
Nesting depth of a mods API call’s arguments| 28,000 levels. Past that, the call rejects with a message ending `nesting deeper than 28000 levels is not supported`. Requires Claude Code v2.1.299 or later.
Nesting depth of a changed event passed to `next`, outside async generator hooks such as one on `turn.step`| 28,000 levels. Past that, `next` rejects with a message ending `nesting deeper than 28000 levels is not supported`. Requires Claude Code v2.1.299 or later.
Nesting depth of a hook’s return value, outside `ui.render`, `ui.resolve`, and async generator hooks| 28,000 levels. Past that, the hook’s result is refused, and [the notice that reports it](</docs/en/plugins/mods/troubleshoot#find-out-why-a-mod-does-nothing>) includes `nesting deeper than 28000 levels is not supported`. Requires Claude Code v2.1.299 or later.
Scopes, such as functions, blocks, and loops, nested inside one another in one file of a hooks module| 2,000
-Command, tool, subagent type, and pane names| Letters, digits, `_`, and `-`, up to 64 characters
+Command, tool, subagent type, and pane names, and the `id` of a placed row or a backdrop| Letters, digits, `_`, and `-`, up to 64 characters
One `claude plugin test` test| 5 seconds unless the test sets `timeoutMs`
##
@@ -490,15 +502,15 @@
---|---|---
`CLAUDE_CODE_PLUGIN_DIRS`| Environment, or `env` in `~/.claude/settings.json`| Plugin directories to load as `--plugin-dir` does, for apps you can’t pass a flag to. Absolute paths separated by `:`, or `;` on Windows.
`CLAUDE_CODE_PLUGIN_DIR_WATCH`| Environment| `1` makes a long-running non-interactive session reload `--plugin-dir` mods on save
-`prependPlugins`, `appendPlugins`| Managed settings. User settings only on a machine with no managed settings, in a session whose credential isn’t a Team or Enterprise `/login`.| Lists of plugin ids, such as `acme-guard@acme-tools`. Mods in `prependPlugins` run before every mod a user installs, and mods in `appendPlugins` run after, in the listed order. See [The order mods run in](</docs/en/plugins/mods/events#the-order-mods-run-in>).
+`prependPlugins`, `appendPlugins`| Managed settings. User settings only on a machine with no managed settings or [`managed-mcp.json`](</docs/en/managed-mcp#deploy-managed-mcp-json>) file, in a session whose credential isn’t a Team or Enterprise `/login`.| Lists of plugin ids, such as `acme-guard@acme-tools`. Mods in `prependPlugins` run before every mod a user installs, and mods in `appendPlugins` run after, in the listed order. See [The order mods run in](</docs/en/plugins/mods/events#the-order-mods-run-in>).
`allowManagedModsOnly`| Managed settings, as an [option on the built-in guard](</docs/en/plugins/mods/admin#set-options-on-the-built-in-guard>)| Only mods that [count as your organization’s](</docs/en/plugins/mods/admin#install-your-organizations-mods>), and mods built into Claude Code, run their hooks. Users’ settings hooks keep running.
-`allowModsToOverrideDenyRules`| Managed settings, as an [option on the built-in guard](</docs/en/plugins/mods/admin#set-options-on-the-built-in-guard>)| Lets a mod a user installed approve a tool call that a `deny` rule refuses
+`allowModsToOverrideDenyRules`| Managed settings, as an [option on the built-in guard](</docs/en/plugins/mods/admin#set-options-on-the-built-in-guard>)| Lets a mod a user installed approve a tool call past most of [the outcomes that stay in place by default](</docs/en/permissions#precedence-among-rules-hooks-and-mods>), including a `deny` rule
`allowManagedHooksOnly`| Managed settings| Blocks hooks and installed mods that aren’t your organization’s. See [what keeps running](</docs/en/settings-reference#what-runs-under-allowmanagedhooksonly>).
`disableAllHooks`| Any settings file| In managed settings, no mod or hook from an installed plugin runs. In your own settings, what your organization manages keeps running. See [`disableAllHooks`](</docs/en/settings-reference#disableallhooks>).
`disableSideloadFlags`| Managed settings| Rejects `--plugin-dir` and `--plugin-url` at startup
`pluginConfigs`| User or managed settings| Holds `userConfig` values for a mod, keyed by the plugin’s id, such as `acme-guard@acme-tools`, or its name and `@inline`, such as `first-mod@inline`, for one loaded with `--plugin-dir`
-`sec-default@builtin` is a guard built into Claude Code, listed as `cc-plugin-sec-default` in `/plugin` and the debug log. It loads ahead of every mod a person installs on a machine with managed settings, or in a session whose credential is a Team or Enterprise [`/login`](</docs/en/authentication#authentication-precedence>). If managed `prependPlugins` is set, the guard loads only when that list names it, at the position listed. Its source is in the [`mods/sec-default` directory of the Claude Code repository](<https://github.com/anthropics/claude-code/tree/main/mods/sec-default>).
+`sec-default@builtin` is a guard built into Claude Code, listed as `cc-plugin-sec-default` in `/plugin` and the debug log. [Where it loads](</docs/en/plugins/mods/admin#know-what-happens-by-default>), it runs ahead of every mod a person installs. If managed `prependPlugins` is set, the guard loads only when that list names it, at the position listed. Its source is in the [`mods/sec-default` directory of the Claude Code repository](<https://github.com/anthropics/claude-code/tree/main/mods/sec-default>).
##
--- a/remote-control.md
+++ b/remote-control.md
@@ -51,7 +51,7 @@
claude remote-control
-Until you accept Remote Control’s one-time confirmation, `claude remote-control` explains what it does and asks `Enable Remote Control? (y/n)` before starting the server. Answer `y` to accept and start the server. If you decline, Claude Code exits without starting the server and asks again the next time you run the command.The process stays running in your terminal in server mode, waiting for remote connections. It displays a URL you can use to connect from another device, and you can press spacebar to show a QR code for quick access from your phone. While a remote session is active, the terminal shows connection status and tool activity.Pass any of these flags after `remote-control`:
+`claude rc` is an alias for this command.Until you accept Remote Control’s one-time confirmation, `claude remote-control` explains what it does and asks `Enable Remote Control? (y/n)` before starting the server. Answer `y` to accept and start the server. If you decline, Claude Code exits without starting the server and asks again the next time you run the command.The process stays running in your terminal in server mode, waiting for remote connections. It displays a URL you can use to connect from another device, and you can press spacebar to show a QR code for quick access from your phone. While a remote session is active, the terminal shows connection status and tool activity.Pass any of these flags after `remote-control`:
Flag| Description
---|---
@@ -176,7 +176,7 @@
* **VS Code extension** : **Enable Remote Control for all sessions** in the [command menu’s](</docs/en/vs-code#use-the-prompt-box>) Settings section.
* **Desktop app** : **Connect new sessions to Remote Control** in **Settings > Code** or **Settings > Claude Code**. See [Control which sessions appear on your other devices](</docs/en/desktop#control-which-sessions-appear-on-your-other-devices>).
-To turn auto-connect on from a settings file instead, set [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>) to `true` in your user `~/.claude/settings.json` or in [managed settings](</docs/en/managed-settings>). In project or local settings (`.claude/settings.json`, `.claude/settings.local.json`), Claude Code honors a `false` and turns auto-connect off for that repository, but ignores a `true`, so a checked-in file can’t turn on Remote Control for everyone who opens the repository. Auto-connect signs in with your own claude.ai account, so a session it starts appears only in your own account’s Claude apps and grants no one else access. With this setting on, each interactive Claude Code process registers one remote session. If you run multiple instances, each one gets its own remote session. To run multiple concurrent sessions from a single process, use server mode instead.
+To turn auto-connect on from a settings file instead, set [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>) to `true` in your user `~/.claude/settings.json` or in [managed settings](</docs/en/managed-settings>). In project or local settings (`.claude/settings.json`, `.claude/settings.local.json`), Claude Code honors a `false` and turns auto-connect off for that repository. It ignores a `true`, so you can’t use a checked-in file to turn on Remote Control for everyone who opens the repository. Auto-connect signs in with your own claude.ai account, so a session it starts appears only in your own account’s Claude apps and grants no one else access. With this setting on, each interactive Claude Code process registers one remote session. If you run multiple instances, each one gets its own remote session. To run multiple concurrent sessions from a single process, use server mode instead.
####
--- a/sandboxing.md
+++ b/sandboxing.md
@@ -917,6 +917,14 @@
+A git command fails with `Unable to create '…/index.lock'`
+
+If you started Claude Code in a repository’s subdirectory, this error can mean `.git` is outside what sandboxed commands can write to. Start Claude Code from the repository root instead, or from the worktree’s root in a [linked worktree](</docs/en/worktrees>).
+
+###
+
+
+
A folder named `objects` or `refs` disappears after a command
A top-level `objects` or `refs` folder that appeared during the session can be deleted after a sandboxed command ends. It doesn’t matter whether a command, Claude, or you created it. To keep a folder, leave something in it. If a `HEAD` file or symlink has been at the top level during the session, move it away, then restart every Claude Code session open there. Before v2.1.307, the folder was deleted even with something in it and no `HEAD`. On an earlier version, [update Claude Code](</docs/en/setup#update-claude-code>).
--- a/security-guidance.md
+++ b/security-guidance.md
@@ -50,7 +50,7 @@
}
}
-Administrators can enable the plugin organization-wide by setting [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>) in [managed settings](</docs/en/admin-setup>).
+Each teammate also [runs `claude plugin install security-guidance@claude-plugins-official --scope project`](</docs/en/plugins/loading#enabled-in-project-settings-but-not-installed>) once per clone. Administrators can enable the plugin organization-wide by setting [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>) in [managed settings](</docs/en/admin-setup>).
##
--- a/self-hosted-environments-configuration.md
+++ b/self-hosted-environments-configuration.md
@@ -150,7 +150,7 @@
---|---
`CLAUDE_RUNNER_REPO_URL`| Repository URL to clone, after any `--git-host-rewrite` and `--git-ssh-rewrite` have been applied
`CLAUDE_RUNNER_REPO_REF`| Revision to check out, as the session requested it: a branch, tag, commit SHA, or full reference name such as `refs/heads/<branch>` or `refs/pull/<number>/head`. Empty means the repository’s default branch.
-`CLAUDE_RUNNER_CHECKOUT_PATH`| Absolute path where the working tree must be left
+`CLAUDE_RUNNER_CHECKOUT_PATH`| Absolute path where the working tree must be left. See Checkout folder names.
`CLAUDE_RUNNER_SESSION_ID`| Session ID in the tagged `session_...` form, for logging and correlation
`CLAUDE_RUNNER_SESSION_UUID`| The same session ID in canonical UUID form
`CLAUDE_RUNNER_API_BASE_URL`| Anthropic API base URL for session-scoped calls
@@ -159,6 +159,14 @@
`GIT_CONFIG_COUNT`, `GIT_CONFIG_KEY_n`, `GIT_CONFIG_VALUE_n`| Git settings the runner fixes for the git your hook runs. Git configuration inside lifecycle hooks describes them. Requires Claude Code v2.1.280 or later.
The script must leave a working tree at `CLAUDE_RUNNER_CHECKOUT_PATH` checked out at the requested revision. A detached HEAD works, because the runner creates the session’s working branch on top. After your hook returns, the runner verifies that `CLAUDE_RUNNER_CHECKOUT_PATH` contains a `.git`. If your hook materializes a non-git source such as Perforce or an unpacked tarball, set `CLAUDE_RUNNER_SKIP_GIT_VERIFY=1` in the runner’s environment to skip that check. Git-based flows such as working-branch creation and pushing results require a git checkout, so export outcomes from non-git trees with a `post-session` hook.
+
+####
+
+
+
+Checkout folder names
+
+`CLAUDE_RUNNER_CHECKOUT_PATH` ends in a folder named `<repo-owner>-<repo>`, such as `acme-api`. Two repositories in a session can’t share a folder, even when their names differ only in case. For example, if a session lists `acme/api` and then `Acme/API`, the first gets `acme-api` and the second gets `Acme-API-2`.
####
@@ -228,6 +236,7 @@
set -u
export GIT_ALLOW_PROTOCOL=${GIT_ALLOW_PROTOCOL:-https:http:ssh}
IFS=':'
+ rc=0 # becomes 1 when a step fails; a non-zero exit makes the runner log it
# -c overrides beat repo-local settings, blocking session-written fsmonitor,
# hook-path, and gpg-program config from executing code with the hook's
# privileges. -c commit.gpgsign=false also leaves these rescue commits
@@ -238,12 +247,13 @@
g() { git -c core.fsmonitor=false -c core.hooksPath=/dev/null \
-c commit.gpgsign=false "$@"; }
for ws in $CLAUDE_RUNNER_WORKSPACE_PATHS; do
- cd "$ws" 2>/dev/null || continue
- [ -z "$(g status --porcelain 2>/dev/null)" ] && continue
- g add -A
- g commit -q -m "runner snapshot: $CLAUDE_RUNNER_SESSION_ID ($CLAUDE_RUNNER_EXIT_REASON)" || continue
- g push -q origin "HEAD:refs/heads/rescue/$CLAUDE_RUNNER_SESSION_ID" || true
+ cd "$ws" || { rc=1; continue; }
+ g add -A || rc=1
+ g diff-index --cached --quiet HEAD && continue # nothing to save
+ g commit -q -m "runner snapshot: $CLAUDE_RUNNER_SESSION_ID ($CLAUDE_RUNNER_EXIT_REASON)" || { rc=1; continue; }
+ g push -q origin "HEAD:refs/heads/rescue/$CLAUDE_RUNNER_SESSION_ID" || rc=1
done
+ exit "$rc"
The `GIT_ALLOW_PROTOCOL` line in the script limits git to HTTPS, HTTP, and SSH remotes. If the runner’s environment already sets a non-empty `GIT_ALLOW_PROTOCOL` list of its own, the script keeps that list. The hook pushes with whatever git credentials are available in its own environment on the runner host. Under the [no-credentials-in-the-image posture](</docs/en/self-hosted-environments-deploy#configure-git>), including when the built-in clone goes through the Anthropic git proxy, there are none, so mint a short-lived push credential inside the hook before pushing: exchange the session token the hook receives in `CLAUDE_CODE_SESSION_ACCESS_TOKEN` with your own token service, verifying it as [Verify session identity](</docs/en/self-hosted-environments-identity>) describes. Treat any credential your hook gives git as one a session can obtain, and mint it so that it can do no more than this push. Git in your hook reads configuration files that a session can write, and a credential helper or filter driver named in one of them runs with your hook’s privileges. Settings in those files can also change where a push goes, whatever remote you name. For the git settings the runner fixes in your hook and the ones it leaves to those files, see Git configuration inside lifecycle hooks.
--- a/self-hosted-environments-deploy.md
+++ b/self-hosted-environments-deploy.md
@@ -17,6 +17,7 @@
* **WithAnthropic-managed git**: with such a credential, Claude reaches GitHub directly instead of through Anthropic-managed git.
* **Without Anthropic-managed git** : a clone credential can stay in the image if you scope it as tightly as Ship git config in your image describes.
* **Keep the environment secret off session-running hosts** : the environment secret can register runners and pick up any session queued on the environment. On a fixed fleet it lives on every runner host, where any session’s code can read the secret file. Prefer [on-demand runners](</docs/en/self-hosted-environments-configuration#on-demand-runners>), where the secret stays on the orchestrator host, which never runs user code, and each runner receives a single-use work order that registers exactly one runner. On a fixed fleet, treat the environment-secret file as readable by every session and rotate the secret after any suspected session compromise.
+ * **After a suspected compromise** : have an [Owner](</docs/en/cloud-environments#organization-shared-environments>) create a new secret and revoke the old one from the environment’s **Configuration** tab, then roll out the new one. Anthropic refuses every orchestrator and runner on the old secret, on-demand runners from its work orders included. Your runners exit, interrupting their sessions.
* **Default-deny network egress** : restrict runner and session container outbound traffic at your own network boundary on every environment; Default-deny egress covers what to allow and why.
* **Least-privilege host IAM** : the compute identity attached to the runner host, such as an instance profile or node service account, should grant only what the runner itself needs. Sessions should obtain their own credentials through your wrapper script rather than inheriting the host’s.
* **Block the cloud metadata endpoint from sessions** : keeping sessions off the host identity requires blocking their access to the cloud metadata endpoint, and subnet-level egress policies don’t intercept link-local metadata traffic, so block it in the container itself:
@@ -198,7 +199,7 @@
* **Host credentials for host pushes** : the runner’s [`--push-outcome-on-release`](</docs/en/self-hosted-environments-reference#runner-cli-flags>) push and any push your [`post-session` hook](</docs/en/self-hosted-environments-configuration#post-session>) makes still use the runner host’s own git credentials and its network path to `github.com`. Keep those credentials out of the global git config, and see Ship git config in your image for ways to supply them.
* **Per-session decision** : Anthropic decides for each session on the runner whether to serve its git, and a session it doesn’t serve fails to start. When sessions fail to start on a runner with the git proxy covers the causes.
-With `--use-anthropic-git-proxy` set, the runner deletes and replaces the global git config of the user it runs as, and keeps no backup. It does this at startup and before each session. A login or credential helper you kept there is lost. Settings that `--configure-git` writes survive. Run the runner as a dedicated user or in a container, never as your own user.
+With `--use-anthropic-git-proxy` set, the runner deletes and replaces the global git config of the user it runs as, and keeps no backup. It does this at startup and before each session. A login or credential helper you kept there is lost. Settings that `--configure-git` writes survive. Run the runner as a dedicated user or in a container, never as your own user.The global git config is all three of `~/.gitconfig`, the file that `GIT_CONFIG_GLOBAL` names if you set it, and the whole `$XDG_CONFIG_HOME/git` directory, by default `~/.config/git`.
Keep git settings that aren’t secret, such as identity and `safe.directory`, in the system git configuration.
@@ -249,7 +250,7 @@
* **A line containing`remote: access denied by the git proxy`**: a session that Anthropic serves can still be refused, for example when organization policy denies git access for the session, or the session isn’t authorized for the repository. The runner’s log then shows a line containing `remote: access denied by the git proxy`, and the rest of that line says why.
* **`GitHub authentication required`** : this appears when the session’s creator has no working GitHub connection on claude.ai. The session’s clone fails, and the git error contains `GitHub authentication required. Please reconnect your GitHub account.` Ask that person to connect or reconnect GitHub in their claude.ai settings.
-After you fix the cause, start the failed sessions again.
+After you fix the cause, restart the runners that failed the sessions, then have each creator send a message in their session or an Owner select **Retry**.
####
@@ -271,7 +272,7 @@
Give the runner git credentials
-Provide credentials that work without a prompt for every git host the runners’ sessions use, github.com included. Any credential that was in the runner user’s global git config is gone, because the runner deleted that config while `--use-anthropic-git-proxy` was set. Ship credentials in your image or use a [`checkout` lifecycle hook](</docs/en/self-hosted-environments-configuration#checkout>).
+Provide credentials that work without a prompt for every git host the runners’ sessions use, github.com included. Any credential that was in the runner user’s global git config is gone, because the runner deleted that config while `--use-anthropic-git-proxy` was set. Ship credentials in your image or use a [`checkout` lifecycle hook](</docs/en/self-hosted-environments-configuration#checkout>).To keep credentials in the global git config instead, stop the runners first, because a runner started with the flag rewrites it before each session. Then delete `$XDG_CONFIG_HOME/git`, by default `~/.config/git`, and replace `~/.gitconfig`, or the file that `GIT_CONFIG_GLOBAL` names, with your own.
3
@@ -555,7 +556,7 @@
Kubernetes
-The runner serves `GET /healthz` on port 8080 by default, configurable with `--health-port`, so Kubernetes probes work with no extra setup. The endpoint returns `200` whenever the process is alive, so the probes below detect a dead process, not a stuck one; to catch a runner that stopped polling, alert on the `last_poll_age_seconds` series from [`/metrics`](</docs/en/self-hosted-environments-reference#prometheus-metrics>). The Deployment below mounts the environment secret from a Kubernetes Secret, points the liveness and readiness probes at `/healthz`, and sets a 90-second termination grace period. See Shutdown timing for why the grace period matters. The manifest sets no CPU or memory `resources` on the runner container. Add a block sized for the capacity you run, as Size CPU and memory for sessions describes.
+The runner serves `GET /healthz` on port 8080 by default, configurable with `--health-port`. After startup, the endpoint returns `200` whenever the process is alive, so the probes below detect a dead process, not a stuck one. To catch a runner that stopped polling, alert on the `last_poll_age_seconds` series from [`/metrics`](</docs/en/self-hosted-environments-reference#prometheus-metrics>). The Deployment below mounts the environment secret from a Kubernetes Secret, points the liveness and readiness probes at `/healthz`, and sets a 90-second termination grace period. See Shutdown timing for why the grace period matters. The manifest sets no CPU or memory `resources` on the runner container. Add a block sized for the capacity you run, as Size CPU and memory for sessions describes.
apiVersion: apps/v1
kind: Deployment
@@ -609,6 +610,8 @@
secret:
secretName: claude-runner-environment-secret
+If the pod’s events show the liveness probe failing during startup, raise its `initialDelaySeconds` or add a `startupProbe`. Nothing answers on the health port until the runner has registered and finished its startup checks. With the settings above, Kubernetes restarts a runner that isn’t serving within about 90 seconds.
+
The Deployment above lives in a `claude-runners` namespace. Create the namespace first:
kubectl create namespace claude-runners
@@ -992,6 +995,10 @@
* **If you started the session** : if the repository doesn’t exist, start a new session with the right repository. If the runner can’t reach the repository, ask the runner’s administrator to grant access, then start a new session.
* **Sessions take minutes to start or resume** : one cause is a fresh clone. On a fleet that starts each runner on an empty disk, with no [`checkout` hook](</docs/en/self-hosted-environments-configuration#checkout>), the runner clones the session’s repositories afresh before it starts Claude Code. A session that resumes on an empty disk waits for the same clone again. To skip the fresh clone, supply a pre-warmed checkout. If you already supply one, confirm that the runner uses it. Where the runner makes the clone itself and exits after one session, lower [`CLAUDE_RUNNER_FETCH_DEPTH`](</docs/en/self-hosted-environments-reference#environment-variable-only-settings>) from its default of 50 commits to fetch less history. If you use a hook, it runs in place of the runner’s clone, so look at what your hook does instead. Watch the `claude_code_self_hosted_runner_session_init_duration_seconds` [metric](</docs/en/self-hosted-environments-reference#prometheus-metrics>) to see how long starts take.
* **Turns fail with a 401** : when a turn ends with a 401 or 403 from the Anthropic API, the runner fetches a fresh [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/self-hosted-environments-configuration#wrapper-scripts>) from Anthropic and passes it to the session. The failed turn isn’t retried. This token is short-lived, and the runner rotates it over the session’s stdin. When a fetch fails, the runner logs an `inference_token refresh failed` line that says when it will retry, and it keeps retrying for as long as the session runs. If every call starts failing about 30 minutes into a session, a wrapper script has likely severed the session’s stdin, so token rotations can’t reach it; see [Keep stdin and file descriptor 3 attached](</docs/en/self-hosted-environments-configuration#keep-stdin-and-file-descriptor-3-attached>). Before v2.1.274, the runner stopped retrying a failed fetch after a few attempts and waited for the next scheduled one. A failed turn didn’t trigger a fetch, so every turn failed with a 401 until the next scheduled fetch.
+ * **A session shows`The server has refused to renew this session's access to the model`**: the session’s [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/self-hosted-environments-configuration#wrapper-scripts>) has expired, and the runner has received HTTP 400 in answer to its requests for a new token. The runner logs `the server has refused to renew the inference_token`. Turns in that session fail. The runner keeps requesting a new token for as long as the session’s process runs:
+ * **A request succeeds** : a session that showed the warning then shows `The server renewed this session's access to the model`
+ * **Turns keep failing** : the process eventually exits, and the session shows a failure such as `The session process exited with code 1`
+To keep working without waiting for a new token, start a new session. If a new session fails too, check whether a proxy or gateway of yours gave the HTTP 400 answer. If none did, contact your Anthropic account team with the first session’s ID.
* **A turn fails in claude.ai/code with`This model needs a newer version of Claude Code`**: the Claude Code version that your runners start sessions with is older than the session’s model requires, so the API [rejects the request](</docs/en/errors#claude-code-does-not-support-this-model>). Upgrade the runners to the version the message asks for, or a later one, as described in Pin the version. Until then, people can pick a different model in the session.
* **Pod is killed mid-drain** : raise `terminationGracePeriodSeconds` to at least the value the runner logs at startup. See Shutdown timing.
* **Runner logs a`[runner:log]` line ending `was paused or too slow`**: the runner kept running and needs no restart. Until the stdout or stderr stream named in the line was read again, the runner discarded all but that stream’s newest 256 KiB of lines. If you passed [`--log-file`](</docs/en/self-hosted-environments-reference#runner-cli-flags>), look there for the discarded lines.
--- a/self-hosted-environments-quickstart.md
+++ b/self-hosted-environments-quickstart.md
@@ -85,7 +85,7 @@
Create an environment
-Go to the [**Cloud environments** page](<https://claude.ai/admin-settings/cloud-environments>) in admin settings. Under **Self-hosted environments** , select **New** , name the environment, and select **Create**. On the wizard’s second step, select **Copy environment key** to copy the environment secret, which the admin UI labels an environment key. claude.ai shows the secret once, and you can’t retrieve it later; it expires 365 days after creation. The environment’s `ccpool_...` ID stays visible in its detail dialog; you’ll need it for the `aud` check in [token verification](</docs/en/self-hosted-environments-identity>) and for dispatching [test sessions from CI](</docs/en/self-hosted-environments-testing#run-the-test-loop>).If you lose the secret or need to rotate it, create a new secret from the environment’s **Configuration** tab, roll the new secret out to your runners, then revoke the old one. Runners holding a revoked secret fail their next authenticated poll and exit, logging `poll auth failed`, and your orchestrator restarts them with the new secret.
+Go to the [**Cloud environments** page](<https://claude.ai/admin-settings/cloud-environments>) in admin settings. Under **Self-hosted environments** , select **New** , name the environment, and select **Create**. On the wizard’s second step, select **Copy environment key** to copy the environment secret, which the admin UI labels an environment key. claude.ai shows the secret once, and you can’t retrieve it later; it expires 365 days after creation. The environment’s `ccpool_...` ID stays visible in its detail dialog; you’ll need it for the `aud` check in [token verification](</docs/en/self-hosted-environments-identity>) and for dispatching [test sessions from CI](</docs/en/self-hosted-environments-testing#run-the-test-loop>).If the secret may have leaked, follow [the deploy page’s steps for a suspected compromise](</docs/en/self-hosted-environments-deploy#after-a-suspected-compromise>), not the rotation below.If you lose the secret or plan to rotate it, create a new secret from the environment’s **Configuration** tab. Roll the new secret out to your runners, then revoke the old one. Runners holding a revoked secret fail their next authenticated poll and exit, logging `poll auth failed`, and your orchestrator restarts them with the new secret.
2
--- a/self-hosted-environments-reference.md
+++ b/self-hosted-environments-reference.md
@@ -153,7 +153,7 @@
Health endpoint
-The runner serves `GET /healthz` on the configured health port. The response is `200 OK` whenever the process is alive, whatever state the poll loop is in, so an HTTP probe on this endpoint detects a dead process only. The JSON body describes current state:
+The runner serves `GET /healthz` on the configured health port once it has registered and finished its startup checks. From then on, the response is `200 OK` whenever the process is alive, whatever state the poll loop is in, so an HTTP probe on this endpoint detects a dead process only. The JSON body describes current state:
{
"status": "ok",
--- a/server-managed-settings.md
+++ b/server-managed-settings.md
@@ -60,7 +60,7 @@
"allowManagedPermissionRulesOnly": true
}
-Hooks use the same format as in `settings.json`.This example runs an audit script after every file edit across the organization:
+Hooks use the same format as in `settings.json`.This example runs an audit script after `Edit` and `Write` tool calls across the organization:
{
"hooks": {
--- a/settings.md
+++ b/settings.md
@@ -58,7 +58,7 @@
Share settings with your team
-Commit `.claude/settings.json` so everyone who clones the repository gets the same permissions, hooks, and plugins. Each teammate can still override it for themselves in their own `.claude/settings.local.json`, so personal exceptions don’t need a commit. For a complete team file, see [a team’s shared settings](</docs/en/settings-example#a-teams-shared-settings>). Some of what you commit waits until each teammate [trusts the folder](</docs/en/permissions#project-allow-rules-and-workspace-trust>), and a few keys never take effect from a repository file; Troubleshoot a setting that doesn’t apply covers both.
+Commit `.claude/settings.json` so everyone who clones the repository gets the same permissions, hooks, and plugin settings. Each teammate can still override it for themselves in their own `.claude/settings.local.json`, so personal exceptions don’t need a commit. For a complete team file, see [a team’s shared settings](</docs/en/settings-example#a-teams-shared-settings>). Some of what you commit waits until each teammate [trusts the folder](</docs/en/permissions#project-allow-rules-and-workspace-trust>), and a few keys never take effect from a repository file; Troubleshoot a setting that doesn’t apply covers both.
###
@@ -342,6 +342,7 @@
[`isolatePeerMachines`](</docs/en/settings-reference#isolatepeermachines>)| `true` from any scope| Honored even when a managed source sets `false`
[`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>)| `true` from any scope| Honored even when a managed source sets `false`. Requires Claude Code v2.1.257 or later
[`permissions.blockWritesOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockwritesoutsideworkingdirectories>)| `true` from any scope| Honored even when a managed source sets `false`. Requires Claude Code v2.1.314 or later
+[`permissions.denyInsteadOfPrompting`](</docs/en/settings-reference#permissions-denyinsteadofprompting>)| `true` from `~/.claude/settings.json` or `--settings`| Honored even when a managed source sets `false`. Requires Claude Code v2.1.319 or later
[`autoMode.classifyAllShell`](</docs/en/settings-reference#automode-classifyallshell>)| `true` from `~/.claude/settings.json` or `--settings`| Honored even when a managed source sets `false`
[`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>)| `false` from `.claude/settings.json` or `.claude/settings.local.json`| Honored even when a managed source sets `true`; a project or local `true` is ignored
[`crossSessionInbound`](</docs/en/settings-reference#crosssessioninbound>)| A stricter value from `.claude/settings.json` or `.claude/settings.local.json`, on the `accept` < `hold` < `refuse` ladder| Honored over managed, `--settings`, and user values; a project or local value that isn’t stricter is ignored
Show diff (138 lines)
--- a/settings-reference.md
+++ b/settings-reference.md
@@ -141,6 +141,7 @@
`permissions.blockWritesOutsideWorkingDirectories`| Make the `Write`, `Edit`, and `NotebookEdit` tools refuse paths outside the [working directories](</docs/en/permissions#working-directories>) in every permission mode, apart from some of Claude Code’s own files| Permission settings| Any file
`permissions.defaultMode`| Set the default [permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) for new sessions| Permission settings| Any file
`permissions.deny`| Block listed [tool uses](</docs/en/permissions#permission-rule-syntax>), including reads of files that hold secrets| Permission settings| Any file
+`permissions.denyInsteadOfPrompting`| Deny tool calls that would wait on a [permission prompt](</docs/en/permissions#permission-system>), so a session nobody is watching keeps working| Permission settings| User or managed
`permissions.disableBypassPermissionsMode`| Prevent anyone from entering [bypassPermissions mode](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>)| Permission settings| Any file
`plansDirectory`| Choose where [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) writes plan files| Memory and context| Any file
`pluginConfigs`| Store the answers you gave a [plugin](</docs/en/plugins/overview>)’s configuration dialog| Plugins and skills| User or managed
@@ -980,7 +981,7 @@
Control which tools Claude can use without asking, which ones prompt, and which ones are blocked. Also set the default [permission mode](</docs/en/permission-modes>) for new sessions. Every `permissions.*` key below nests under this object.
* **Scope** : `Any file`
- * **Type** : object with `allow`, `ask`, `deny`, `additionalDirectories`, `blockReadsOutsideWorkingDirectories`, `blockWritesOutsideWorkingDirectories`, `defaultMode`, `disableBypassPermissionsMode`, and `disableAutoMode`
+ * **Type** : object with `allow`, `ask`, `deny`, `additionalDirectories`, `blockReadsOutsideWorkingDirectories`, `blockWritesOutsideWorkingDirectories`, `defaultMode`, `denyInsteadOfPrompting`, `disableBypassPermissionsMode`, and `disableAutoMode`
* **Default** : unset
This example approves `npm run` commands without asking, prompts before `git push`, blocks reads of `.env`, and starts sessions in `acceptEdits`:
@@ -1260,6 +1261,68 @@
}
Permission rules layer on top of every mode: `deny` rules block in every mode, including `bypassPermissions`. See [Permission modes](</docs/en/permission-modes>). In cloud sessions, Claude Code honors only `acceptEdits`, `plan`, `default`, and `auto` from this key. For conversations the VS Code extension starts, see [which setting the extension reads for the starting permission mode](</docs/en/permission-modes#switch-permission-modes>).
+
+###
+
+
+
+`permissions.denyInsteadOfPrompting`
+
+Set this to `true` to keep a session running when nobody is there to answer a permission prompt. Claude Code denies a tool call that would otherwise wait on a prompt, and the turn continues. Requires Claude Code v2.1.319 or later. A call goes ahead if an allow rule, your [permission mode](</docs/en/permission-modes>), or auto mode’s classifier approves it. To allow most calls that would otherwise prompt, answer from a [`PermissionRequest` hook](</docs/en/hooks#permissionrequest>).
+
+ * **Scope** : `User or managed`, and `--settings`. A repository can’t set it for you.
+ * **Type** : Boolean
+ * `true`: Claude Code denies calls that would otherwise prompt
+ * `false`: the same as unset; calls are still denied if another of these sources sets `true`
+ * **Default** : unset, so a call that needs approval prompts you
+
+In `~/.claude/settings.json`, this example starts sessions in auto mode and denies whatever would still fall back to a prompt:
+
+settings.json
+
+ {
+ "permissions": {
+ "defaultMode": "auto",
+ "denyInsteadOfPrompting": true
+ }
+ }
+
+The key applies in `-p` runs, interactive terminal sessions, the [VS Code extension](</docs/en/vs-code>), local sessions in the [Desktop app](</docs/en/desktop>), [subagents](</docs/en/sub-agents>), and [agent teams](</docs/en/agent-teams>). To deny what would prompt in a single [non-interactive](</docs/en/headless>) run instead, pass [`--permission-prompts none`](</docs/en/headless#turn-off-permission-prompts-in-unattended-runs>) with `-p`.
+
+####
+
+
+
+What else `denyInsteadOfPrompting` stops
+
+With the setting on, Claude Code also stops these requests for an answer:
+
+ * **Question and plan tools** : Claude Code leaves out [`AskUserQuestion`](</docs/en/tools-reference#askuserquestion-tool-behavior>), `EnterPlanMode`, and `ExitPlanMode`, so a session in plan mode can’t leave it on its own. A teammate in an agent team keeps `EnterPlanMode` and `ExitPlanMode`
+ * **MCP elicitation** : Claude Code cancels an [elicitation request](</docs/en/mcp#respond-to-mcp-elicitation-requests>) unless an [`Elicitation` hook](</docs/en/hooks#elicitation>) answers it
+ * **Permission hosts** : Claude Code doesn’t ask your [`canUseTool` callback](</docs/en/agent-sdk/user-input>) or [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>). To approve calls from code, answer from a `PermissionRequest` hook. Some calls are denied before any hook is asked, such as a [critical-path removal](</docs/en/permission-modes#critical-path-removals-in-each-permission-mode>) in `auto` mode that no ask rule covers.
+ * **Classifier billing notice** : where the [notice about billed classifier requests](</docs/en/auto-mode-classifier-billing#actions-denied-in-place-of-the-notice>) would open a dialog, Claude Code doesn’t show it and denies the actions that need those requests
+
+A session can still wait on the [workspace trust dialog](</docs/en/permissions#project-allow-rules-and-workspace-trust>) and on [project MCP server approval](</docs/en/mcp#project-server-approvals-and-workspace-trust>). Answer both before you leave the session running.
+
+####
+
+
+
+Messages from `denyInsteadOfPrompting`
+
+These messages report refused calls. They aren’t prompts, so nothing waits for your answer. The denial Claude reads can open with this text:
+
+ Permission for this tool use was denied. It requires approval, and this session has no approval surface
+
+In `stream-json` output, [the runs that emit a `permission_denied` message](</docs/en/agent-sdk/typescript#sdkpermissiondeniedmessage>) report this `decision_reason`:
+
+ no approval surface in this session; permission request denied automatically
+
+In auto mode with the setting on, the turn ends after 20 calls in a row that the classifier blocked or a [safety check refused](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>), and you see this message:
+
+ 20 actions were refused and no work went ahead in between, so Claude stopped.
+
+A `-p` run reports that turn as `error_during_execution`.
###
@@ -4814,11 +4877,11 @@
Each scope serves a different purpose:
* **User settings** : your personal plugin preferences
- * **Project settings** : plugins shared with everyone in the repository
+ * **Project settings** : plugins turned on for everyone in the repository. This doesn’t install them, so each user [installs them](</docs/en/plugins/org#require-plugins-per-repository>).
* **Local settings** : per-machine overrides, gitignored when Claude Code saves a setting there
* **Managed settings** : organization-wide policy. A plugin set to `false` here is blocked from installation at every scope and hidden from the marketplace
-Project settings take precedence over user settings, so setting a plugin to `false` in `~/.claude/settings.json` doesn’t disable a plugin that the project’s `.claude/settings.json` enables. To opt out of a project-enabled plugin on your machine, set it to `false` in `.claude/settings.local.json` instead. Plugins force-enabled by managed settings can’t be disabled this way, since managed settings override local settings. Enabling a plugin from an external source such as a GitHub repository or npm package in a project’s `.claude/settings.json` doesn’t install it for other people. On every path that loads plugins, Claude Code reports the plugin as not installed until each user [installs it themselves](</docs/en/plugins/org#require-plugins-per-repository>).
+Project settings take precedence over user settings, so setting a plugin to `false` in `~/.claude/settings.json` doesn’t disable a plugin that the project’s `.claude/settings.json` enables. To opt out of a project-enabled plugin on your machine, set it to `false` in `.claude/settings.local.json` instead. Plugins force-enabled by managed settings can’t be disabled this way, since managed settings override local settings.
###
@@ -4826,7 +4889,7 @@
`extraKnownMarketplaces`
-Register additional plugin marketplaces by name, so that people who open the repository, or everyone your managed settings reach, get the marketplace without adding it themselves. Claude Code registers each marketplace it doesn’t already know. Whether a plugin that `enabledPlugins` names from it installs depends on the plugin’s source and which file enables it; that entry has the rules.
+Register additional plugin marketplaces by name, so that people who open the repository, or everyone your managed settings reach, get the marketplace without adding it themselves. Claude Code registers each marketplace it doesn’t already know. Whether a plugin that `enabledPlugins` names from it installs depends on the plugin’s source and which file enables it; [Enabled in project settings but not installed](</docs/en/plugins/loading#enabled-in-project-settings-but-not-installed>) has the rules.
* **Scope** : `Any file`. Claude Code honors entries in a repository’s `.claude/settings.json` or `.claude/settings.local.json` only after you accept the workspace trust dialog for that folder; in a folder you haven’t trusted, including a `-p` run there, it ignores them without a message.
* **Type** : object mapping a marketplace name to an object with a `source` object and an optional `autoUpdate` Boolean
@@ -4954,7 +5017,7 @@
List the managed plugins whose [mods](</docs/en/plugins/mods/overview>) run before every mod a user installs, in the listed order. When you set this key in managed settings, name `sec-default@builtin` in the list to keep the built-in guard. In managed settings, Claude Code skips an id whose plugin doesn’t count as your organization’s. See [Install your organization’s mods and set the order](</docs/en/plugins/mods/admin#install-your-organizations-mods>) for those conditions and for how the two ordering keys work together.
- * **Scope** : `User or managed`. Claude Code reads the key from managed settings. It reads the key from user settings only on a machine with no managed settings, in a session whose credential isn’t a Team or Enterprise `/login`. It ignores the key in project and local settings and in a `--settings` file.
+ * **Scope** : `User or managed`. Claude Code reads the key from managed settings. It reads the key from user settings only on a machine with no managed settings or `managed-mcp.json` file, in a session whose credential isn’t a Team or Enterprise `/login`. It ignores the key in project and local settings and in a `--settings` file.
* **Type** : array of `plugin-name@marketplace-name` strings
* **Default** : unset
@@ -4978,7 +5041,7 @@
List the managed plugins whose [mods](</docs/en/plugins/mods/overview>) run after every mod a user installs, in the listed order. An id listed in both `prependPlugins` and `appendPlugins` is prepended. In managed settings, Claude Code skips an id whose plugin doesn’t [count as your organization’s](</docs/en/plugins/mods/admin#install-your-organizations-mods>).
- * **Scope** : `User or managed`. Claude Code reads the key from managed settings. It reads the key from user settings only on a machine with no managed settings, in a session whose credential isn’t a Team or Enterprise `/login`. It ignores the key in project and local settings and in a `--settings` file.
+ * **Scope** : `User or managed`. Claude Code reads the key from managed settings. It reads the key from user settings only on a machine with no managed settings or `managed-mcp.json` file, in a session whose credential isn’t a Team or Enterprise `/login`. It ignores the key in project and local settings and in a `--settings` file.
* **Type** : array of `plugin-name@marketplace-name` strings
* **Default** : unset
@@ -5268,7 +5331,7 @@
`crossSessionInbound`
-Choose what this session does with [messages arriving from your other Claude Code sessions](</docs/en/cross-session-messaging#control-inbound-messages>). When no value applies, Claude Code decides per message from the two sessions’ permission-mode classes. Requires Claude Code v2.1.224 or later.
+Choose what this session does with [messages arriving from your other Claude Code sessions](</docs/en/cross-session-messaging#control-inbound-messages>). When no value applies, Claude Code decides per message from the two sessions’ permission-mode classes.
* **Scope** : `Any file`. A project or local value applies only when it’s stricter than the value managed settings, the `--settings` flag, or user settings give.
* **Type** : string, one of:
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -522,7 +522,7 @@
Set `permissionMode` to choose the permission mode a subagent runs in. Use the modes’ config values, so Manual mode is `default`. If you leave it unset, the subagent inherits the main conversation’s [permission mode](</docs/en/permission-modes>). The main conversation’s permission mode decides whether Claude Code uses the value you set:
- * When the main conversation is in `bypassPermissions`, `acceptEdits`, or [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), the subagent runs in that same mode and Claude Code ignores the `permissionMode` you set. Under auto mode, the classifier evaluates the subagent’s tool calls with the main conversation’s block and allow rules. When the subagent finishes, the classifier also reviews its work and its final report before the report is delivered, as [How auto mode handles subagents](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) describes.
+ * When the main conversation is in `bypassPermissions`, `acceptEdits`, or [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), the subagent runs in that same mode and Claude Code ignores the `permissionMode` you set. Under auto mode, the classifier evaluates the subagent’s tool calls with the main conversation’s block and allow rules. When the subagent finishes, the classifier also reviews its work and its final report before the report is delivered, as [How auto mode handles subagents](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) describes. If a subagent asks for permission while the main conversation is in `bypassPermissions`, check whether its tool call is one of the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>).
* When the main conversation is in `plan` mode, the subagent stays in plan mode whichever `permissionMode` you set, unless it runs as an agent team teammate under the [agent teams rules](</docs/en/agent-teams#have-teammates-plan-before-implementing>). If you set `dontAsk`, the subagent also doesn’t prompt you: an action that plan mode would ask you to approve is denied instead.
* When the main conversation is in `default` or `dontAsk` mode, the subagent runs in the permission mode you set. It keeps the main conversation’s permission mode instead in these cases:
* You set `bypassPermissions`. The `bypassPermissions` exception requires Claude Code v2.1.267 or later.
--- a/terminal-config.md
+++ b/terminal-config.md
@@ -386,7 +386,7 @@
Recall a prompt that had pasted text
-Claude Code keeps the content behind each `[Pasted text #N]` placeholder under `~/.claude/paste-cache/`, so when you recall a prompt from [command history](</docs/en/interactive-mode#command-history>) and resubmit it, the full pasted content is sent again, including in a later session. Cache files older than [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) are deleted under the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>), so a recalled prompt can reference pasted text that no longer exists. When you submit such a prompt, Claude Code never sends the literal `[Pasted text #N]` string, and shows a notification naming the missing paste:
+Claude Code keeps the content behind each `[Pasted text #N]` placeholder under `~/.claude/paste-cache/`, so when you recall a prompt from [command history](</docs/en/interactive-mode#command-history>) and resubmit it, the full pasted content is sent again, including in a later session. Cache files older than [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) are deleted under the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>), so a recalled prompt can reference pasted text that no longer exists. When you submit such a prompt, Claude Code doesn’t send the literal `[Pasted text #N]` string, and shows a notification naming the missing paste:
* In a plain prompt with text remaining, Claude Code removes the placeholder and sends the remaining text.
* In a [shell mode](</docs/en/interactive-mode#shell-mode-with-prefix>) command or a `/` command, where the removal would change what runs, and in any prompt the removal leaves empty, Claude Code cancels the submission and keeps the original text in the input, with the placeholder still in it. Delete the placeholder or edit the command, then resubmit.
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -12,7 +12,7 @@
`CronDelete`| Cancels a session-scoped scheduled task by ID| No
`CronList`| Lists all session-scoped scheduled tasks| No
`Edit`| Makes targeted edits to specific files. See Edit tool behavior| Yes
-`EndConversation`| Ends the session, in rare cases of sustained abusive input or when you ask Claude to demonstrate the tool. See EndConversation tool behavior| No
+`EndConversation`| Ends the session, in rare cases of sustained abusive input or when you ask Claude to end the session and then confirm. See EndConversation tool behavior| No
`EnterPlanMode`| Switches to plan mode to design an approach before coding| No
`EnterWorktree`| Creates an isolated [git worktree](</docs/en/worktrees>) and switches into it, or switches into an existing worktree. See EnterWorktree tool behavior| Yes
`ExitPlanMode`| Presents a plan for approval and exits plan mode| Yes
@@ -282,8 +282,8 @@
The EndConversation tool ends the current session. Claude uses it only in two situations:
- * as a last resort against sustained abusive input, after attempts to redirect the conversation have failed and after a clear warning in an earlier message
- * when you explicitly ask to see the tool demonstrated and confirm that you want the session to end
+ * When you keep sending abusive messages after Claude gives a clear warning and fails to redirect the conversation
+ * When you explicitly ask Claude to end the session, then confirm when Claude asks whether you still want to proceed
General frustration, profanity, or a task going badly don’t qualify, and neither do requests for harmful content, which Claude declines instead of ending the session. Claude Code follows the same approach as claude.ai, which can [end a rare subset of chats](<https://www.anthropic.com/research/end-subset-conversations>). After Claude ends an interactive session, the session locks. New prompts and most commands return `Claude ended this conversation. Start a new session (or /clear) to continue.`, and only `/clear`, `/resume`, `/help`, `/exit`, and `/feedback` still run. Claude Code records the end in the session’s transcript, so resuming an ended session restores the lock; the session’s history isn’t deleted. Resuming an ended session in [non-interactive mode](</docs/en/headless>) with the `-p` flag errors and exits with code 1, so a script doesn’t read the ended run as a success. The tool never prompts for permission, and [PreToolUse hooks](</docs/en/hooks#pretooluse>) don’t run for it. While any other tool remains, you can’t block it either: [deny and ask rules](</docs/en/permissions#tool-specific-permission-rules>) naming `EndConversation` have no effect, and neither `--disallowedTools` nor a `--tools` list can remove it. The exemption is deliberate: the tool does nothing except end the conversation, never reading or modifying files or data, and a safeguard of this kind holds only if the session it applies to can’t turn it off. When your deny rules remove every other tool and also match `EndConversation`, as `"*"` does, Claude Code removes it too rather than leaving it as the only tool, unless an allow rule names `EndConversation` explicitly. A deny list that removes every other tool without matching `EndConversation` leaves it in place. [Subagents](</docs/en/sub-agents>) never get the tool. Background tasks that share the main conversation’s tool list see it, but calling it there ends nothing. The tool appears only when all of the following are true:
@@ -376,7 +376,7 @@
* Track output from any long-running script you point it at
* Connect to a WebSocket feed and report each message as it arrives
-For most watches, Claude writes a small script, runs it in the background, and receives each output line as it arrives. For a server that already pushes events, Claude can open a WebSocket instead of running a script. You keep working in the same session and Claude interjects when an event arrives. Every watch Claude starts has a deadline: 5 minutes by default, at most 30 minutes, and at most 10 minutes in a [non-interactive](</docs/en/headless>) run given a single prompt with `-p`. At the deadline the watch ends. Claude gets one notice, so it can start the watch again if it’s still needed. Stop a monitor by asking Claude to cancel it or by ending the session. When you stop a [subagent](</docs/en/sub-agents>) that started monitors, for example from `/tasks`, those monitors stop with it. When Monitor runs a command, it uses the same [permission rules as Bash](</docs/en/permissions#tool-specific-permission-rules>), so `allow` and `deny` patterns you have set for Bash apply here too. While [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is active, Claude Code sets aside allow rules that name `Monitor` itself, along with the other [broad allow rules it drops](</docs/en/permission-modes#how-the-classifier-evaluates-actions>), so the classifier reviews Monitor commands the same way it reviews Bash commands. The WebSocket source has its own approval prompt, which the classifier also decides in auto mode. Monitor needs a minimum version or Git Bash in these cases:
+For most watches, Claude writes a small script, runs it in the background, and receives each output line as it arrives. For a server that already pushes events, Claude can open a WebSocket instead of running a script. You keep working in the same session and Claude interjects when an event arrives. Every watch Claude starts has a deadline: 5 minutes by default, at most 30 minutes, and at most 10 minutes in a [non-interactive](</docs/en/headless>) run given a single prompt with `-p`. At the deadline the watch ends. Claude gets one notice, so it can start the watch again if it’s still needed. Stop a monitor by asking Claude to cancel it or by ending the session. When you stop a [subagent](</docs/en/sub-agents>) that started monitors, for example from `/tasks`, those monitors stop with it. When Monitor runs a command, it uses the same [permission rules as Bash](</docs/en/permissions#tool-specific-permission-rules>), so `allow` and `deny` patterns you have set for Bash apply here too. While [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is active, Claude Code sets aside allow rules that name `Monitor` itself, along with the other [broad allow rules it drops](</docs/en/permission-modes#how-the-classifier-evaluates-actions>), so the classifier reviews Monitor commands the same way it reviews Bash commands. Monitor needs a minimum version or Git Bash in these cases:
* **Minimum version** : on Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry, or with `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` set, Monitor requires Claude Code v2.1.310 or later. The requirement applies when [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) is off
* **Windows** : the tool is available only when [Git Bash](</docs/en/setup#set-up-on-windows>) is installed
@@ -403,7 +403,28 @@
`url`| Yes| The endpoint to connect to. Must be a `ws://` or `wss://` URL with no embedded credentials or whitespace, using ASCII characters only
`protocols`| No| WebSocket subprotocol names to offer during the handshake. Each entry must be a valid subprotocol token, and the list can’t contain duplicates
-The `timeout_ms` deadline applies to a WebSocket watch too: the watch ends at the deadline, and `TaskStop` cancels it early. Opening a WebSocket prompts for approval; in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) the classifier decides instead. The prompt doesn’t offer an option to skip future prompts for the same host. Claude Code denies URLs that point at a private, link-local, or cloud-metadata address, including hostnames that resolve to one. It also denies hosts in `sandbox.network.deniedDomains`, and when [`allowManagedDomainsOnly`](</docs/en/settings-reference#sandbox-network-allowmanageddomainsonly>) is set in managed settings, any host outside the managed allowlist.
+The `timeout_ms` deadline applies to a WebSocket watch too: the watch ends at the deadline, and `TaskStop` cancels it early. Without a `Monitor` allow rule, you’re prompted before Claude opens a WebSocket; in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) the classifier decides instead, unless an ask rule applies. The prompt doesn’t offer an option to skip future prompts for the same host.
+
+####
+
+
+
+Addresses and hosts denied to WebSocket watches
+
+Claude Code denies URLs that point at a private, link-local, or cloud-metadata address, including hostnames that your machine resolves to one. Behind a [proxy](</docs/en/network-config#proxy-configuration>), a watch can reach a private, link-local, or cloud-metadata address unless the proxy blocks it, because Claude Code doesn’t check the address the proxy finds. Claude Code also denies hosts in `sandbox.network.deniedDomains`, and when [`allowManagedDomainsOnly`](</docs/en/settings-reference#sandbox-network-allowmanageddomainsonly>) is set in managed settings, any host outside the managed allowlist. If a watch behind a proxy fails with `could not resolve <host>`, restart Claude Code v2.1.319 or later with [`CLAUDE_CODE_PROXY_RESOLVES_HOSTS`](</docs/en/env-vars#variables>) set to `1` so the proxy looks up the hostname.
+
+####
+
+
+
+Bash rules that deny or prompt for WebSocket watches
+
+If Claude Code refuses a `Monitor` call that opens a WebSocket, look for a [deny or ask rule](</docs/en/permissions#manage-permissions>) written `Bash` or `Bash(*)`. Do the same if it prompts for that call despite your `Monitor` allow rule. A rule on every Bash command also covers these WebSocket watches:
+
+ * **Deny rule** : if the rule is in place when the session starts, Claude doesn’t have the Monitor tool, so it can’t start the watch. If you add the rule during a session, Claude’s next `Monitor` call is refused. The refusal reads `Permission to use Monitor has been denied: it runs code as Bash does, and a rule denies Bash.`
+ * **Ask rule** : you’re asked to approve the watch. You can’t have an allow rule, a `PreToolUse` hook, `bypassPermissions` mode, or the auto mode classifier approve it for you. You can approve it from a [`PermissionRequest` hook](</docs/en/hooks#permissionrequest>). Where nobody can answer, such as in `dontAsk` mode, Claude Code denies the watch.
+
+To let these watches run, narrow the rule to the commands you mean, such as `Bash(rm *)`. The ask rule, and a deny rule you add during a session, cover these watches in Claude Code v2.1.319 or later.
##
@@ -610,8 +631,10 @@
* Non-interactive `-p` runs and [Agent SDK](</docs/en/agent-sdk/overview>) sessions, which have no screen to review the queue on
* [Cloud sessions](</docs/en/claude-code-on-the-web>), which can’t write to the queue on your machine
* Sessions on [Amazon Bedrock](</docs/en/amazon-bedrock>), [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>)
+ * Sessions that reach Claude through an [LLM gateway](</docs/en/llm-gateway>) with the gateway’s own key or token
* Sessions where you set [`CLAUDE_CODE_SEND_FEEDBACK=0`](</docs/en/env-vars>) or [`DISABLE_FEEDBACK_COMMAND=1`](</docs/en/env-vars>), set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` to any non-empty value, or turned off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>)
* Organizations that have turned off product feedback, [organizations with Zero Data Retention](</docs/en/zero-data-retention#features-disabled-under-zdr>), and organizations with the [HIPAA configuration](</docs/en/hipaa-setup>) applied
+ * Sessions where Claude Code has [stopped offering feedback after a refused report](</docs/en/errors#feedback-is-disabled-by-your-organizations-policy>)
##
--- a/troubleshoot.md
+++ b/troubleshoot.md
@@ -8,7 +8,7 @@
When a mod does nothing, check what Claude Code reads from the mod’s files, and the line it writes when it skips something. For the first, in your shell run [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) with the mod’s directory, as in `claude plugin validate ./first-mod`. It catches a misspelled event, a bad manifest, and a module Claude Code can’t read, without starting a session. When a module doesn’t load, a hook is skipped, or another mod refuses yours, Claude Code writes one line that names your mod. Where you read that line depends on the session:
- * **A session that hot-reloads a plugin directory** : a dim line in the transcript. That’s an interactive session you started with `--plugin-dir`, or one where you [enabled hot reloading](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) for mods Claude wrote.
+ * **A session that hot-reloads a plugin directory** : a dim line in the transcript. That’s an interactive session you started with `--plugin-dir`, or one where [hot reloading is on](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) for mods Claude wrote.
* **Any other interactive session, such as one that runs a mod you installed from a marketplace** : the debug log only. To get one, start the session with `claude --debug`.
* **A`claude -p` run with `--plugin-dir`**: stderr, in the default text output format. A refusal by another mod goes to the debug log only.
@@ -84,7 +84,7 @@
Messages from the built-in guard
-On a machine with managed settings, or in a session whose credential is a Team or Enterprise `/login`, the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) can refuse a mod or one of its answers. Each message names the option your organization’s administrator sets to change the rule.
+Where the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) loads, it can refuse a mod or one of its answers. Each message names the option your organization’s administrator sets to change the rule.
Message contains| What it means| Where it appears
---|---|---
--- a/typescript.md
+++ b/typescript.md
@@ -3591,7 +3591,13 @@
};
};
-Runs a background source and delivers each event to Claude so it can react without polling: `command` runs a script and emits one event per stdout line, and `ws` opens a WebSocket and emits one event per text frame. Provide exactly one of `command` or `ws`. The `ws` source requires Claude Code v2.1.195 or later. `timeout_ms` is the watch’s deadline in milliseconds. It defaults to 300000 and accepts values up to 3600000. The effective deadline is at most 1800000, which is 30 minutes, so a larger accepted value is shortened to that. At the deadline the watch ends and Claude receives one notice so it can start a new watch if it still needs one. The exported type marks `timeout_ms` as required because the schema fills in the default; a call that omits it validates. When Monitor runs a command, it follows the same permission rules as Bash; a WebSocket watch prompts for approval separately. See the [Monitor tool reference](</docs/en/tools-reference#monitor-tool>) for behavior and provider availability.
+Runs a background source and delivers each event to Claude so it can react without polling: `command` runs a script and emits one event per stdout line, and `ws` opens a WebSocket and emits one event per text frame. Provide exactly one of `command` or `ws`. The `ws` source requires Claude Code v2.1.195 or later. `timeout_ms` is the watch’s deadline in milliseconds:
+
+ * **Default and limits** : it defaults to 300000 and accepts values up to 3600000. The effective deadline is at most 1800000, which is 30 minutes, so a larger accepted value is shortened to that
+ * **At the deadline** : the watch ends and Claude receives one notice so it can start a new watch if it still needs one
+ * **Required in the type** : the exported type marks `timeout_ms` as required because the schema fills in the default; a call that omits it validates
+
+When Monitor runs a command, it follows the same permission rules as Bash. See the [Monitor tool reference](</docs/en/tools-reference#monitor-tool>) for WebSocket permissions, behavior, and provider availability.
###
--- a/workflows.md
+++ b/workflows.md
@@ -399,9 +399,10 @@
* **Completed** : returns its saved result. The first agent whose prompt differs from the previous run, because you edited the script or an earlier agent returned something different, runs again, and so does every agent after it, even ones that completed. Before v2.1.305, completed agents could also run again when you relaunched an unedited script whose `pipeline()` items or `parallel()` tasks ran more than one agent each. To stop those reruns for new runs, update Claude Code.
* **Still running when you stopped** : starts over. Stopping the whole run doesn’t count any agent as failed.
+ * **Failed at a usage limit on v2.1.318 or later**: runs again, and agents that completed return their saved results. If your script called another agent after the failure and that agent returned a result, every agent the script starts after the failed one also runs again.
* **Failed** : runs again, and so does every agent the script starts after it, even ones that completed. Stopping one agent alone, by selecting it in `/workflows` and pressing `x`, counts as failing.
-That last case means a failure in the middle of a fan-out reruns work that already finished. If a script starts A, B, C, and D in that order and B fails, relaunching returns A from cache and runs B, C, and D again. If you edit a script that started A, B, C, and D so that it starts A, C, B, and D, the second agent to start is now C, where the previous run started B. Relaunching returns A from cache and runs C, B, and D again.
+That last case means a **Failed** agent in the middle of a fan-out reruns work that already finished. If a script starts A, B, C, and D in that order and B is **Failed** , relaunching returns A from cache and runs B, C, and D again. If you edit a script that started A, B, C, and D so that it starts A, C, B, and D, the second agent to start is now C, where the previous run started B. Relaunching returns A from cache and runs C, B, and D again.
####
@@ -423,12 +424,17 @@
When a run hits your usage limit
-When an agent hits your claude.ai [usage limit](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>), the run pauses rather than failing that agent: the agents that hit the limit wait for the reset, and no new agents start. Shortly after the limit resets, the waiting agents run again and the run continues on its own. Requires Claude Code v2.1.271 or later; on earlier versions, the affected agents fail. While the run waits, its progress line in the task panel and the `/workflows` header show when the limit resets. The run pauses only when all of these hold; when one doesn’t, the affected agent fails instead:
-
- * The session is interactive and signed in with a claude.ai subscription. A run doesn’t pause in [non-interactive mode](</docs/en/headless>) with `claude -p` or the [Agent SDK](</docs/en/agent-sdk/overview>), in a [background session](</docs/en/agent-view>), or in a [Remote Control](</docs/en/remote-control>) or [agent team](</docs/en/agent-teams>) teammate session.
+When an agent hits your claude.ai [usage limit](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>), the run pauses rather than failing that agent. The agents that hit the limit wait for the reset, and no new agents start. Shortly after the limit resets, the waiting agents run again and the run continues on its own. Requires Claude Code v2.1.271 or later, or [v2.1.319 or later](</docs/en/desktop#claude-code-version-in-the-code-tab>) in the Desktop [Code tab](</docs/en/desktop>). On earlier versions, the affected agents fail. While the run waits, its progress line in the task panel and the `/workflows` header show when the limit resets. In the Code tab, the run shows a line such as `Paused at usage limit · continues after 3:45 PM if the app stays open`. Keep the app open. The run pauses only when all of these hold; when one doesn’t, the affected agent fails instead:
+
+ * The session is signed in with a claude.ai subscription without [usage-based billing](</docs/en/interactive-mode#start-a-wait-yourself>), and is one of these session types:
+ * An interactive terminal session. A run doesn’t pause in [non-interactive mode](</docs/en/headless>) with `claude -p` or the [Agent SDK](</docs/en/agent-sdk/overview>), in a [background session](</docs/en/agent-view>), or in a [Remote Control](</docs/en/remote-control>) or [agent team](</docs/en/agent-teams>) teammate session.
+ * A local session you started in the Code tab. A run doesn’t pause in an SSH, WSL, [Dispatch](</docs/en/desktop#sessions-from-dispatch>), or [scheduled task](</docs/en/desktop-scheduled-tasks>) session, in one started from Remote Control or through a [corporate launcher](</docs/en/corporate-launcher>), or while [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars#variables>) is set.
* [`autoContinueAtUsageLimit`](</docs/en/settings-reference#autocontinueatusagelimit>) is on, the same setting that lets the session itself [wait for a usage limit to reset](</docs/en/interactive-mode#wait-for-a-usage-limit-to-reset>). If you turn it off during a wait, the wait ends and the waiting agents fail.
+ * In the Code tab, the **Auto-continue when limits reset** checkbox on a [session-limit card](</docs/en/errors#youve-hit-your-session-limit>) is checked, as it is by default. If you uncheck it, runs in your Code tab sessions stop pausing, unless managed settings set `autoContinueAtUsageLimit` to `true`.
* The limit resets within 24 hours. A weekly limit can reset further out.
* The run hasn’t already waited twice. When it hits the limit a third time, the agent fails.
+
+To finish a run whose agents failed at the limit, ask Claude to relaunch the workflow after the limit resets.
###
--- a/worktrees.md
+++ b/worktrees.md
@@ -249,7 +249,7 @@
A worktree gets its own files and branch, but it shares the following with the main checkout:
- * **The repository’s`.git` directory**: git commands in a worktree write to the main repository’s shared `.git` directory, and [sandboxing](</docs/en/sandboxing#filesystem-isolation>) allows those writes, so commands such as `git commit` work from inside a worktree with the sandbox enabled.
+ * **The repository’s`.git` directory**: git commands in a worktree write to the main repository’s shared `.git` directory. With the [sandbox](</docs/en/sandboxing#filesystem-isolation>) enabled, commands such as `git commit` work in a session at the worktree’s root, which is where `--worktree` starts one. By default, they [fail with an `index.lock` error if you run `claude` in a subdirectory of the worktree](</docs/en/sandboxing#git-index-lock>).
* **Plugins** : plugins installed at [project scope](</docs/en/plugins/loading#find-where-a-plugin-is-enabled>) from the main checkout also load in worktrees of the same repository, so you don’t need to reinstall them per worktree.
* **Permission approvals** : choosing “Yes, and don’t ask again” for a Bash command in a worktree session saves the rule to the main checkout’s `.claude/settings.local.json`. The rule applies in the main checkout and in every other worktree of the repository, and it survives the worktree’s removal. On Windows and in the other cases where Claude Code [doesn’t use the repository root](</docs/en/settings#where-claude-code-looks-for-each-file>), the rule stays with that worktree. See [where approvals are saved](</docs/en/permissions#permission-system>).
* **Untracked skills, agents, and commands** : when the worktree checkout has no `.claude/skills` directory at its root, for example because your `.claude/skills` is gitignored, Claude Code loads the main checkout’s [project skills](</docs/en/skills#where-skills-live>) in the worktree session. In a worktree with its own `.claude/skills` directory, only that copy loads. The same read-through covers `.claude/agents` and `.claude/commands`. For skills, the read-through requires Claude Code v2.1.277 or later.
--- a/zero-data-retention.md
+++ b/zero-data-retention.md
@@ -43,12 +43,13 @@
What ZDR does not cover
-ZDR does not extend to the following, even for organizations with ZDR enabled. These features follow [standard data retention policies](</docs/en/data-usage#data-retention>):
+ZDR does not extend to the following, even for organizations with ZDR enabled. Except where a row says otherwise, these features follow [standard data retention policies](</docs/en/data-usage#data-retention>):
Feature| Details
---|---
Chat on claude.ai| Chat conversations through the Claude for Enterprise web interface are not covered by ZDR.
Cowork| Cowork sessions are not covered by ZDR.
+Artifacts| Artifacts in chat conversations and Cowork sessions are not covered by ZDR, and are kept until deleted unless your organization sets a retention period for them. Artifacts are not available in Claude Code with ZDR.
Claude Code Analytics| Does not store prompts or model responses, but collects productivity metadata such as account emails and usage statistics. Contribution metrics are not available for ZDR organizations; the [analytics dashboard](</docs/en/analytics>) shows usage metrics only.
User and seat management| Administrative data such as account emails and seat assignments is retained under standard policies.
Third-party integrations| Data processed by third-party tools, MCP servers, or other external integrations is not covered by ZDR. Review those services’ data handling practices independently.
@@ -66,7 +67,8 @@
[Cloud sessions](</docs/en/claude-code-on-the-web>), including those started from the [Desktop app](</docs/en/desktop#cloud-sessions>)| Requires server-side storage of session data, including conversation history with prompts and completions.
[Chat and Cowork unified](<https://support.claude.com/en/articles/17444462-set-up-and-manage-the-new-unified-claude-experience-for-your-enterprise-organization>)| Requires cloud sessions.
[Claude Tag](<https://claude.com/docs/claude-tag>)| Retains channel memory and session transcripts.
-[Artifacts](</docs/en/artifacts>)| Requires storing published page content on Anthropic-operated infrastructure.
+[Artifacts](</docs/en/artifacts>) in Claude Code| Requires storing published page content on Anthropic-operated infrastructure.
+[Claude Docs](<https://support.claude.com/en/articles/16923645-get-started-with-claude-docs>)| Requires storing document content on Anthropic-operated infrastructure.
Feedback submission (`/feedback`, `/bug`, `/share`)| Submitting feedback sends conversation data to Anthropic.
[Remote Control](</docs/en/remote-control>)| Stores the session transcript on Anthropic servers to sync the conversation across devices.