Changes on
73 changes detected
--- a/accessibility.md
+++ b/accessibility.md
@@ -14,7 +14,7 @@
The startup line `Screen reader mode is off: project settings can't turn it on` means the project asked for screen reader mode and nothing else turns it on. Claude Code ignores both the `axScreenReader` key and a `CLAUDE_AX_SCREEN_READER` value under `env` in the project’s `.claude/settings.json` and `.claude/settings.local.json`, whatever their value.
- * **To turn the mode on** : start Claude Code with `--ax-screen-reader`, set `CLAUDE_AX_SCREEN_READER` to `1` in your shell, or add `"axScreenReader": true` to your user [settings file](</docs/en/settings>) and restart Claude Code. You don’t need to change the project’s files. Once you turn the mode on, the confirmation line appears at startup instead.
+ * **To turn the mode on** : start Claude Code with `--ax-screen-reader`, set `CLAUDE_AX_SCREEN_READER` to `1` in your shell, or add `"axScreenReader": true` to your user [settings file](</docs/en/settings>) and restart Claude Code. Once you turn the mode on, the confirmation line appears at startup instead.
* **If you don’t use a screen reader** : you don’t need to do anything. To stop the line from appearing, add `"axScreenReader": false` to your user settings file, or remove the `axScreenReader` key and the `CLAUDE_AX_SCREEN_READER` variable from the project’s settings files.
## Turn off screen reader mode
--- a/advisor.md
+++ b/advisor.md
@@ -14,7 +14,7 @@
* **`advisorModel` setting**: configure a persistent default in your [settings file](</docs/en/settings>)
* **`--advisor` flag**: set the advisor for a single session at launch
-Each of these enables the advisor for sessions whose main model supports it. After the session starts, Claude Code shows an `Advisor Tool (experimental) is on and may use more tokens · /advisor` notification. To stop using the advisor, see Turn the advisor off. On some plans, Fable as the advisor also needs your one-time [consent to bill Fable usage to usage credits](</docs/en/model-config#fable-and-usage-credits>). For what happens before you have given that consent, see Fable advisor and usage credits.
+Each of these enables the advisor for sessions whose main model supports it. After the session starts, Claude Code shows an `Advisor Tool (experimental) is on and may use more tokens · /advisor` notification. To stop using the advisor, see Turn the advisor off. On some plans, Fable as the advisor also needs your [consent to bill Fable usage to usage credits](</docs/en/model-config#fable-and-usage-credits>). For what happens before you have given that consent, see Fable advisor and usage credits.
### Use the `/advisor` command
@@ -28,7 +28,7 @@
* Run `/advisor` with a model, such as `/advisor opus`, to set it.
* Run `/advisor off` to turn it off.
-Claude Code doesn’t invoke a saved advisor that an [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist in your settings excludes. To use the advisor, pick an allowed model with `/advisor`. Claude Code still saves an advisor that your current main model doesn’t support. That advisor activates after you switch to a compatible main model with [`/model`](</docs/en/model-config#setting-your-model>). If the API already refused the saved advisor in the current conversation, it stays off until `/clear` or `/compact`, even after you switch models. On some plans, Fable as the advisor also needs your one-time [consent to bill Fable usage to usage credits](</docs/en/model-config#fable-and-usage-credits>). For what `/advisor fable` does before you have given that consent, see Fable advisor and usage credits.
+Claude Code doesn’t invoke a saved advisor that an [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist in your settings excludes. To use the advisor, pick an allowed model with `/advisor`. Claude Code still saves an advisor that your current main model doesn’t support. That advisor activates after you switch to a compatible main model with [`/model`](</docs/en/model-config#setting-your-model>). If the API already refused the saved advisor in the current conversation, it stays off until `/clear` or `/compact`, even after you switch models.
### Set `advisorModel` in settings
@@ -78,7 +78,7 @@
### Fable advisor and usage credits
-On some plans, Fable usage bills to usage credits, and Fable as the advisor bills the same way. If your account requires the [one-time consent to bill Fable usage to usage credits](</docs/en/model-config#fable-and-usage-credits>), Claude Code asks for it when you select a Fable model with `/model` and doesn’t apply Fable as the advisor until you have accepted that consent. Before you have accepted it, Claude Code doesn’t save Fable as the advisor when you type `/advisor fable` or pick Fable in the `/advisor` picker. It points you to `/model fable` instead. With `claude --advisor fable`, Claude Code exits at launch with a message that points to `/model fable`. In a background session, it starts the session without the advisor instead of exiting. With Fable already saved as your `advisorModel`, Claude Code sends requests without the advisor. In an interactive session whose main model supports the advisor, it also shows a notification that points to `/model fable`. To accept the consent, run `/model fable` and choose to continue on Fable. Claude Code records the consent and [saves Fable as your selected model](</docs/en/model-config#default-model-setting>). Then select Fable as the advisor.
+On some plans, Fable usage bills to usage credits, and Fable as the advisor bills the same way. If your account requires the [consent to bill Fable usage to usage credits](</docs/en/model-config#fable-and-usage-credits>), accept it before you use Fable as the advisor. Before you have accepted it, Claude Code doesn’t save Fable as the advisor when you type `/advisor fable` or pick Fable in the `/advisor` picker. It points you to `/model fable` instead. With `claude --advisor fable`, Claude Code exits at launch with a message that points to `/model fable`. In a background session, it starts the session without the advisor instead of exiting. With Fable already saved as your `advisorModel`, Claude Code sends requests without the advisor. In an interactive session whose main model supports the advisor, it also shows a notification that points to `/model fable`. To accept the consent, run `/model fable` and choose to continue on Fable. Claude Code records the consent and [saves Fable as your selected model](</docs/en/model-config#default-model-setting>). Then select Fable as the advisor.
### Common model pairings
--- a/agent-view.md
+++ b/agent-view.md
@@ -278,6 +278,7 @@
`Esc`| Close the peek panel, clear the input, or exit. On Claude Code v2.1.323 or later, clearing a prompt takes two presses. When you opened agent view by backgrounding your session with `←`, the final `Esc` returns to that conversation instead of exiting. With [vim editor mode](</docs/en/interactive-mode#vim-editor-mode>) on, pressing `Esc` in the input switches from INSERT to NORMAL mode and keeps your text, as in the main prompt
`Ctrl+Y`| In the dispatch input, restore the text you last cleared, or removed with `Ctrl+K`, `Ctrl+U`, or `Ctrl+W`. When agent view exits, that text is gone
`Ctrl+C`| Clear the input; press twice to exit. While text on screen is selected, the press clears the selection instead, copying it first unless [selecting already copied it](</docs/en/settings-reference#copyonselect>)
+`Ctrl+D`| Delete the character after the cursor. On Claude Code v2.1.311 or later, press twice on an empty dispatch input to exit
`?`| Show shortcuts
The shortcuts that have an action in the [`Agents` context](</docs/en/keybindings#agents-actions>) follow your [`keybindings.json`](</docs/en/keybindings>). So does `Ctrl+G`, through the `Chat` context’s `chat:externalEditor` binding.
@@ -316,7 +317,7 @@
* Open `claude agents` in that directory.
* Open `claude agents` in a parent directory and mention a child repository with `@<repo>` in the prompt. Typing `@` lists these targets:
* Git repositories one level below the launch directory
- * The registered [git worktrees](</docs/en/worktrees>) of the repository you launched from that live inside its directory tree, such as the ones Claude creates under `.claude/worktrees/`, labeled with their checked-out branch. Worktrees added outside the repository, such as with `git worktree add ../feature`, aren’t listed
+ * The registered [git worktrees](</docs/en/worktrees>) of the repository you launched from that live inside its directory tree, such as the ones Claude creates under `.claude/worktrees/`, labeled with their checked-out branch
* Any directory that already has a session in the list
A directory whose name contains a space isn’t listed.
* From the shell, `cd` into the directory and run `claude --bg "<prompt>"`.
@@ -427,7 +428,7 @@
When you dispatch a background session from agent view or start one with `claude --bg`, the session starts in your working directory. Before editing files, Claude moves the session into an isolated [git worktree](</docs/en/worktrees>) under `.claude/worktrees/`, so parallel sessions can read the same checkout but each writes to its own. Once the session is in its worktree, Claude Code [enforces worktree isolation](</docs/en/worktrees#how-claude-code-enforces-isolation>) for the session and for any subagents it spawns. Claude skips the worktree when:
* You moved a session you already had open to the background with `←` or `/background`. That session keeps editing files where it was already working
- * The session is already inside a linked git worktree, whether Claude created it under `.claude/worktrees/` or you created it with `git worktree add` somewhere else
+ * The session is already inside a linked git worktree
* The file that Claude is editing is inside a linked git worktree, such as one that the session or its subagent created with `git worktree add`
* The working directory isn’t a git repository and no [`WorktreeCreate` hook](</docs/en/hooks#worktreecreate>) is configured
* The write is outside the working directory
--- a/amazon-bedrock.md
+++ b/amazon-bedrock.md
@@ -110,7 +110,7 @@
export AWS_BEARER_TOKEN_BEDROCK=your-bedrock-api-key
-When `AWS_BEARER_TOKEN_BEDROCK` is set, Claude Code authenticates with the key and doesn’t resolve the credential chain, even if other AWS credentials are present. [Learn more about Amazon Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>).
+When `AWS_BEARER_TOKEN_BEDROCK` is set, Claude Code authenticates with the key. [Learn more about Amazon Bedrock API keys](<https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/>).
#### Credential caching and resolution timeout
@@ -181,7 +181,7 @@
Pin specific model versions when deploying to multiple users. Without pinning, model aliases such as `sonnet` and `opus` resolve to Claude Code’s built-in default for Amazon Bedrock, which can lag the newest release and may not yet be available in your account. Claude Code falls back to an earlier or lower-tier model at startup when the default is unavailable, but pinning lets you control when your users move to a new model.
-Set these environment variables to specific Amazon Bedrock model IDs. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Amazon Bedrock resolves to Opus 5.5, and without `ANTHROPIC_DEFAULT_SONNET_MODEL`, the `sonnet` alias resolves to Sonnet 4.5. This example pins each alias to a specific version:
+Set these environment variables to specific Amazon Bedrock model IDs. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Amazon Bedrock resolves to Opus 5.5. Without `ANTHROPIC_DEFAULT_SONNET_MODEL`, the `sonnet` alias resolves to Sonnet 4.5, or to Sonnet 5 in a session that uses only Mantle. This example pins each alias to a specific version:
export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-8'
export ANTHROPIC_DEFAULT_SONNET_MODEL='us.anthropic.claude-sonnet-4-6'
@@ -199,14 +199,14 @@
Model type| Default model
---|---
Primary model| Opus 5.5, for example `us.anthropic.claude-opus-5-5` in a `us-*` region
-Small/fast model| Sonnet 4.5, for example `us.anthropic.claude-sonnet-4-5-20250929-v1:0` in a `us-*` region
-
-Before v2.1.280, the primary model on Amazon Bedrock defaulted to Opus 5 and the `opus` alias resolved to Opus 5 from v2.1.219. Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On Amazon Bedrock, Claude Code uses the default Sonnet model for background tasks because Haiku may not be enabled in every account or region. Two selections change which model carries them:
+Small/fast model| Sonnet 4.5 on the Invoke API, for example `us.anthropic.claude-sonnet-4-5-20250929-v1:0` in a `us-*` region
+
+Before v2.1.280, the primary model on Amazon Bedrock defaulted to Opus 5 and the `opus` alias resolved to Opus 5 from v2.1.219. Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On the Invoke API, Claude Code uses the default Sonnet model for background tasks because Haiku may not be enabled in every account or region. In a session that uses only Mantle, background tasks use the primary model. Two selections change which model carries them:
* When you select a primary model with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, background tasks use that model. When Claude Code starts the session on the model you set with [`ANTHROPIC_DEFAULT_MODEL`](</docs/en/model-config#set-a-default-model-for-new-sessions>), background tasks use that model too. Setting `ANTHROPIC_DEFAULT_OPUS_MODEL` without `ANTHROPIC_DEFAULT_SONNET_MODEL` also counts as a selection, because the built-in Sonnet model may not be enabled in an account that steers its own Opus.
* To use Haiku for background tasks, set `ANTHROPIC_DEFAULT_HAIKU_MODEL` to a model ID that is available in your account.
-Opus models have a higher per-token price than Sonnet models, so if you don’t pin a primary model, you’re billed at the Opus rate. To use Sonnet 4.5 as the primary model, set `ANTHROPIC_MODEL` to its full model ID. A deployment that steers the default with `ANTHROPIC_DEFAULT_SONNET_MODEL` and doesn’t set `ANTHROPIC_DEFAULT_OPUS_MODEL` keeps its steered Sonnet model as the default.
+Opus models have a higher per-token price than Sonnet models, so if you don’t pin a primary model, you’re billed at the Opus rate. To use Sonnet 4.5 as the primary model, set `ANTHROPIC_MODEL` to its full model ID. On the Invoke API, a deployment that steers the default with `ANTHROPIC_DEFAULT_SONNET_MODEL` and doesn’t set `ANTHROPIC_DEFAULT_OPUS_MODEL` keeps its steered Sonnet model as the default, unless [`enforceAvailableModels`](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) is on.
To customize models further, use one of these methods:
@@ -264,7 +264,7 @@
### When your organization enforces a model allowlist
-If you set [`enforceAvailableModels`](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) in managed settings, the startup model checks use only models your `availableModels` list permits. This applies on the Amazon Bedrock Invoke API and requires Claude Code v2.1.287 or later. A list without `enforceAvailableModels` doesn’t restrict these checks. The checks compare each entry with the inference profile ID they would send, including its region prefix, so write the list in those IDs. This example permits Opus 4.8 and Sonnet 4.5 for a deployment whose models resolve to `us.` profiles:
+To limit the startup model checks and their fallback to models your `availableModels` list permits, set [`enforceAvailableModels`](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) in managed settings. This applies on the Amazon Bedrock Invoke API and requires Claude Code v2.1.287 or later. The checks compare each entry with the inference profile ID they would send, including its region prefix, so write the list in those IDs. This example permits Opus 4.8 and Sonnet 4.5 for a deployment whose models resolve to `us.` profiles:
{
"availableModels": ["us.anthropic.claude-opus-4-8", "us.anthropic.claude-sonnet-4-5-20250929-v1:0"],
@@ -468,7 +468,7 @@
### Zero token counts in /context
-The `/context` command counts tokens for each tool group by sending the tool schemas to the Amazon Bedrock count-tokens API. On Claude Code versions before v2.1.196, Amazon Bedrock rejected that request because the schemas carried fields its count-tokens API doesn’t accept, so every tool group showed 0 tokens. Other rows in the breakdown, such as messages and memory files, aren’t affected. Update to v2.1.196 or later.
+The `/context` command counts tokens for each tool group by sending the tool schemas to the Amazon Bedrock count-tokens API. On Claude Code versions before v2.1.196, Amazon Bedrock rejected that request because the schemas carried fields its count-tokens API doesn’t accept, so every tool group showed 0 tokens. Update to v2.1.196 or later.
### Mantle endpoint errors
--- a/api.md
+++ b/api.md
@@ -332,7 +332,7 @@
`$.fs`| `read(path)`, `write(path, text)`, `exists(path)`, `stat(path)`, and `list(path)` work on files and directories
`$.process`| `run(['git', 'status'])` starts a command and resolves when it exits. `spawn` streams a long-running command’s output.
`$.http`| `fetch(url, init)` over `http` or `https`. It resolves to `{ status, ok, headers, text }` once the body is read.
-`$.store`| A JSON key-value store of your plugin’s own, kept between sessions
+`$.store`| A JSON key-value store of your plugin’s own, kept between local sessions on the same machine. For how long values last, locally and in Anthropic-hosted cloud sessions, see [Keep state](</docs/en/plugins/mods/interface#keep-state>).
`$.env`| `get` and `set` environment variables. Write the name as a string literal.
`$.settings`| `read()` resolves to all settings, merged into one object. With `{ source }` or `{ key }`, it resolves to one source’s settings or one key’s value instead.
`$.session`| `messages()` returns the transcript as a list of `{ role, text, toolUses }`. Also the working directory, model, and more. [`usage()`](</docs/en/plugins/mods/reference#mods-api-methods>) returns context window use and plan limits.
--- a/approvals-policy.md
+++ b/approvals-policy.md
@@ -281,7 +281,7 @@
Case| What happens
---|---
No rule covers a changed file| Nobody is asked to review that file. A protected file can still need a person. Claude doesn’t approve the pull request
-No rule covers any changed file| Normally no check appears. Where GitHub requires the check on the default branch, it normally ends neutral, with the title **Nothing ran, not blocking: no file is covered**. GitHub counts that as passing. With no root policy file, a pull request that changes no file under a directory’s policy file can get no check, so a required check waits
+No rule covers any changed file| Normally no check appears. If GitHub requires the check on the default branch, it normally ends neutral, with the title **Nothing ran, not blocking: no file is covered**. GitHub counts that as passing
Rules cover a changed file, and none applies| The check fails, with a title that starts **No rule applies to**
A file moves between a path that rules cover and one that they don’t| No check appears, and Claude comments that Approvals did not run. Where GitHub requires the check, the pull request waits
--- a/approvals-pull-requests.md
+++ b/approvals-pull-requests.md
@@ -27,6 +27,8 @@
**Waiting on human review from any person (1/2)**| Ask someone with write access to approve. The numbers are the approvals counted so far and the approvals that the policy asks for, and the author usually [counts as one](</docs/en/approvals-policy#whether-a-pull-request%E2%80%99s-author-counts>) already. In place of “any person”, the title can name the people or the team that a rule asks for, or name nobody
**Changes requested**| Have the reviewer who requested changes approve, or have a person dismiss their review
**Claude’s approval still stands; dismiss it**| [Dismiss Claude’s review](<https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/dismissing-a-pull-request-review>), or ask someone who may dismiss reviews on the branch. GitHub didn’t let Approvals dismiss it
+
+To see **Claude’s approval still stands; dismiss it** less often, ask a repository admin to turn on [**Dismiss stale pull request approvals when new commits are pushed**](</docs/en/approvals-github-rules#required-reviews-and-codeowners>). GitHub then dismisses everyone’s earlier approvals on most pushes, so people may have to [approve again](</docs/en/approvals-policy#earlier-approvals-after-a-new-push>).
### Approvals waits for Code Review or a classifier
--- a/artifacts.md
+++ b/artifacts.md
@@ -251,6 +251,60 @@
Claude Docs reaches Claude Code as a claude.ai [connector](</docs/en/mcp#use-mcp-servers-from-claude-ai>) rather than a command. When it’s connected, `/mcp` lists it as `claude.ai Claude Docs`. A request for a document meant for other people then goes to Claude Docs instead of an artifact page: a spec, a proposal, or a write-up of the plan you worked through in the session. Claude gives you the doc’s link when it’s drafted. A document that belongs in the codebase, such as a README, stays a file. To get a file for something Claude would otherwise put in Claude Docs, name the format, such as `.docx` or a Markdown file in the repository. To turn off only the `claude.ai Claude Docs` connector, see [Disable claude.ai connectors](</docs/en/mcp#disable-claude-ai-connectors>). Keep the connector on if you use the Sheets template, which needs it too.
+## Sync a design system from your repository
+
+[`/design-sync`](</docs/en/commands#all-commands>) publishes the components in a React design system’s repository to claude.ai as a [Design System artifact](<https://support.claude.com/en/articles/14604397>), so your designs use your real components. Run `/design-sync` at the Claude Code prompt in the repository, optionally with a hint such as the design system’s name:
+
+ /design-sync Acme DS
+
+If the repository has no earlier sync, Claude asks you to confirm a name, creates a new artifact, and gives you its link. A first-time sync verifies every component and can take a few hours on a large repository. The new artifact is private to you until you share it. To keep syncing to the same artifact:
+
+ * **Change the design system in the code** : the artifact’s page is read-only after a sync, so edit the code and run `/design-sync` again.
+ * **Commit`.design-sync/artifact.json`**: Claude records the artifact’s link in this file, so you and your teammates update the same artifact on later syncs.
+ * **Let teammates sync** : on Team and Enterprise plans, make them editors of the artifact so their syncs can publish to it.
+
+### Move a design system from standalone Claude Design
+
+If your repository synced to standalone Claude Design, the separate site at claude.ai/design, move the design system to an artifact. The site closes by December 14, 2026. If the design system has already moved, `/design-sync` follows it without asking about the move, so go to step 4.
+
+1
+
+Get the design system's link
+
+When `/design-sync` asks “Move this design system to Claude now?”, select **Move it to Claude**. Claude gives you the link to the design system’s page in standalone Claude Design and waits for you to say how the move went. To send this sync to standalone Claude Design and get the question again next time, select **Not now**.
+
+2
+
+Start the move
+
+If you own the design system, open the link and [start the move](<https://support.claude.com/en/articles/17440474-move-from-standalone-claude-design-to-claude>). If someone else owns it, send them the link. Ask them to tell you when the move finishes and to make you an editor of the artifact.
+
+3
+
+Sync to the moved design system
+
+After the move finishes, tell Claude it’s done or run `/design-sync` again.
+
+4
+
+Check the files and confirm
+
+You can’t undo this sync’s changes to the artifact. When Claude shows the artifact’s link and the files to replace or remove, decide whether you need the current versions of those files:
+
+ * **You don’t need them** : confirm.
+ * **You need them or aren’t sure** : decline, open the artifact’s link, and select **Duplicate** in the title menu to keep a backup. If **Duplicate** is unavailable, ask the owner to duplicate the artifact. Then run `/design-sync` again and confirm.
+
+### Check why `/design-sync` didn’t publish an artifact
+
+If `/design-sync` says it can’t publish, offers only to build locally, or uploads to standalone Claude Design when you didn’t choose that, check each of these requirements:
+
+ * Claude Code v2.1.329 or later, with [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) on
+ * A local session where artifacts are available for your plan and sign-in. [Cloud sessions](</docs/en/claude-code-on-the-web>) and sessions served by [`claude remote-control`](</docs/en/remote-control>) can’t sync to an artifact.
+ * On Team and Enterprise plans, **Design systems** turned on under [**Organization settings > Artifacts**](<https://claude.ai/admin-settings/artifacts>). It’s on by default on Team plans and off on Enterprise plans. If your organization uses custom roles, your role also needs the [**Design systems** capability](<https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_d830917488>). If either is missing, ask an Owner to turn on the setting or add the capability to your role.
+ * If the design system already has an artifact, permission to edit that artifact as the owner or an editor, and no public link to it. Ask the owner to make you an editor or remove the public link.
+
+If the design system has no artifact yet and your version or session misses one of the first two requirements, `/design-sync` uploads to standalone Claude Design at claude.ai/design. That site closes by December 14, 2026. After you fix what’s missing, start a new session and run `/design-sync` again.
+
## Page constraints
Each artifact is served under a strict Content Security Policy (CSP) that limits what the page can do.
--- a/authentication.md
+++ b/authentication.md
@@ -286,4 +286,4 @@
set CLAUDE_CODE_OAUTH_TOKEN=your-token
-This token authenticates with your Claude subscription and requires a Pro, Max, Ultra, Team, or Enterprise plan. It can only make model requests, so it can’t establish [Remote Control](</docs/en/remote-control>) sessions or fetch [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>). MCP servers you configure locally still work. [Bare mode](</docs/en/headless#start-faster-with-bare-mode>) does not read `CLAUDE_CODE_OAUTH_TOKEN`. If your script passes `--bare`, authenticate with `ANTHROPIC_API_KEY` or an `apiKeyHelper` instead.
+This token authenticates with your Claude subscription and requires a Pro, Max, Ultra, Team, or Enterprise plan. It can’t establish [Remote Control](</docs/en/remote-control>) sessions or fetch [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>). MCP servers you configure locally still work. [Bare mode](</docs/en/headless#start-faster-with-bare-mode>) does not read `CLAUDE_CODE_OAUTH_TOKEN`. If your script passes `--bare`, authenticate with `ANTHROPIC_API_KEY` or an `apiKeyHelper` instead.
--- a/auto-mode-classifier-billing.md
+++ b/auto-mode-classifier-billing.md
@@ -11,7 +11,7 @@
* **Enter** continues: the held action and the rest of the session use Claude Code’s own classifier requests, billed as token usage as before, and the notice doesn’t appear again in that session. When the notice named a gateway, acknowledging it keeps it from reappearing on this machine for 24 hours. When it didn’t, the notice returns the next time a session falls back.
* **Esc** or **Ctrl+C** cancels: the held action doesn’t run and the current turn stops, with the session still in auto mode. Nothing is remembered, so the notice appears again before the next checked action.
-To stop using auto mode instead, switch permission modes with `Shift+Tab` after you answer. Where the notice can’t wait for an answer, Claude Code reports the same text and the session continues in auto mode, unless a gateway acknowledgment on this machine in the last 24 hours has dismissed it. In [non-interactive mode](</docs/en/headless>) with `-p` it prints the text to stderr, and in `stream-json` output it emits a `system` warning message, which Agent SDK applications can read from the message stream.
+To stop using auto mode instead, switch permission modes with `Shift+Tab` after you answer. Your session continues in auto mode when the notice can’t wait for an answer, as in [non-interactive mode](</docs/en/headless>). With `-p`, look for the notice’s text on stderr. In `stream-json` output, look instead for a `system` warning message, which Agent SDK applications can read from the message stream. After you acknowledge a notice naming a gateway, Claude Code can skip the notice’s text on this machine for 24 hours.
## Make the session eligible
--- a/auto-mode-config.md
+++ b/auto-mode-config.md
@@ -115,7 +115,7 @@
}
}
-You don’t need to fill everything in at once. A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up.
+A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up.
## Generate environment entries with `/auto-mode-setup`
@@ -341,6 +341,7 @@
If a denial shows one of these names, the [server-side classifier](</docs/en/permission-modes#server-side-classifier-review>) blocked the call and gave a broad policy as its reason:
* `[Destructive or Unwanted Actions]`
+ * `[Sensitive Information Leakage]`
* `[Unauthorized Access]`
* `[Undermining Oversight]`
* `[Unsanctioned Communication]`
--- a/best-practices.md
+++ b/best-practices.md
@@ -473,7 +473,7 @@
Keep it to small files: it copies rather than links, so `node_modules` in there would mean a full copy per worktree. For large directories there’s the [`worktree.symlinkDirectories`](</docs/en/settings-reference#worktree-symlinkdirectories>) setting, or keep the install command in `CLAUDE.md` so Claude runs it whenever it starts in a new checkout. You rarely have to clean any of this up yourself:
- * When you exit an unnamed worktree session, Claude Code [removes a worktree it created with git](</docs/en/worktrees#clean-up-worktrees>) if there’s nothing in it. For a named session, or one with changes, it asks what to do.
+ * When you exit an unnamed worktree session, Claude Code [can remove a worktree it created with git](</docs/en/worktrees#clean-up-worktrees>) if `git status` is clean and there are no new commits. Otherwise, or if you named the session with [`-n` or `/rename`](</docs/en/sessions#name-your-sessions>), Claude Code asks first.
* Subagent and background-session worktrees that get left behind [can be removed automatically](</docs/en/worktrees#clean-up-subagent-and-background-session-worktrees>) once they’re older than `cleanupPeriodDays` and hold no work.
A `claude -p --worktree` run is one you clean up yourself, since it exits without asking. Remove those with `git worktree remove <path>`, and if git refuses because the worktree is locked, `git worktree unlock <path>` first.
--- a/checkpointing.md
+++ b/checkpointing.md
@@ -2,11 +2,11 @@
## How checkpoints work
-As you work with Claude, checkpointing automatically captures the state of your code before each prompt you send that starts a turn.
+A checkpoint is a restore point for the files Claude edits.
### Automatic tracking
-Claude Code tracks all changes made by its file editing tools:
+Claude Code tracks changes made by its file editing tools:
* Every prompt you send that starts a turn creates a new checkpoint
* Claude Code keeps file snapshots for the 100 most recent checkpoints in a session. Discarding an older checkpoint deletes the snapshot files that no remaining checkpoint references, except each file’s first snapshot.
@@ -28,7 +28,7 @@
* **Summarize up to here** : compress the conversation before this point into a summary, keeping later messages intact
* **Never mind** : return to the message list without making changes
-The two code restore options appear only when the selected checkpoint has tracked file changes to revert. If no file edits were captured after that point, the menu offers only **Restore conversation** , the summarize options, and **Never mind**. After restoring the conversation or choosing Summarize from here, the original prompt from the selected message is restored into the input field so you can re-send or edit it. Choosing Summarize up to here leaves you at the end of the conversation with the input empty. With either summarize option, a **Summarized conversation** marker appears in the conversation where the compressed messages were.
+The two code restore options appear only when the selected checkpoint has tracked file changes to revert. After restoring the conversation or choosing Summarize from here, the original prompt from the selected message is restored into the input field so you can re-send or edit it. Choosing Summarize up to here leaves you at the end of the conversation with the input empty. With either summarize option, a **Summarized conversation** marker appears in the conversation where the compressed messages were.
#### Rewound messages can return if you exit before your next prompt
@@ -66,9 +66,9 @@
* **Foreground forked skill** : a [skill with `context: fork`](</docs/en/skills#run-skills-in-a-subagent>) that runs in the foreground edits your working tree during your own turn, so rewinding restores its edits as usual. Set `background: false` to run a fork in the foreground; a few situations, [listed on the skills page](</docs/en/skills#run-skills-in-a-subagent>), run it there regardless of the setting.
* **Any other subagent** : rewinding restores only the files Claude had already edited in your conversation. The subagent’s edits to other files stay, so use version control, such as Git, to revert them. This includes a forked skill that runs in the background, the default, and a background [`/code-review --fix`](</docs/en/code-review-local>) run.
-### External changes not tracked
+### External changes can be lost
-Checkpointing only tracks files that have been edited within the current session. Manual changes you make to files outside of Claude Code and edits from other concurrent sessions are normally not captured, unless they happen to modify the same files as the current session.
+If Claude used its file editing tools on a file in your conversation, restoring code can discard changes you or another session made to that file after the selected checkpoint. Commit or copy the file yourself before you restore. Files that Claude’s file editing tools didn’t touch stay as they are.
### Messages sent mid-turn not checkpointed
--- a/chrome.md
+++ b/chrome.md
@@ -75,7 +75,7 @@
### Enable Chrome by default
-To connect Chrome without passing `--chrome` each time, run `/chrome` in a CLI session and select the option that turns Chrome on by default. In the [VS Code extension](</docs/en/vs-code#automate-browser-tasks-with-chrome>), type `/chrome` in the prompt box and turn on the **Enabled by default** switch. The CLI and VS Code share one setting, so turning it on in either place turns it on for both. With the setting on and Claude Code v2.1.287 or later, each VS Code session connects to your browser as it starts, so Claude can use it before you type `@browser`. On earlier versions, or with the setting off, a VS Code session connects when you type `@browser`. Claude Code starts normally when Chrome isn’t running.
+To connect Chrome without passing `--chrome` each time, run `/chrome` in a CLI session and select the option that turns Chrome on by default. In the [VS Code extension](</docs/en/vs-code#automate-browser-tasks-with-chrome>), type `/chrome` in the prompt box and turn on the **Enabled by default** switch. The CLI and VS Code share one setting. With the setting on and Claude Code v2.1.287 or later, each VS Code session connects to your browser as it starts, so Claude can use it before you type `@browser`. On earlier versions, or with the setting off, a VS Code session connects when you type `@browser`. Claude Code starts normally when Chrome isn’t running.
Enabling Chrome by default increases context usage since the browser tools and their instructions are always loaded. If you notice increased context consumption, turn the setting off and connect only when needed, with `--chrome` in the CLI or by typing [`@browser`](</docs/en/vs-code#automate-browser-tasks-with-chrome>) in the VS Code prompt box.
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
@@ -370,7 +370,7 @@
### Connect Claude Desktop
-[Claude Desktop](</docs/en/desktop>) connects to the same gateway through a different MDM key: set `bootstrapUrl` in Claude Desktop’s [managed configuration](<https://claude.com/docs/third-party/claude-desktop/configuration>) to `<listen.public_url>/user/bootstrap`, and opt the user’s policy in with a `desktop` key. [Claude Desktop overlay](</docs/en/claude-apps-gateway-config#claude-desktop-overlay>) covers both halves. Requires Claude Code v2.1.203 or later on the gateway server. Once connected, Claude Desktop sends model requests from every enabled tab through the gateway. Claude Desktop signs the developer in through the gateway’s identity provider with the same browser SSO step, then fetches its configuration from the gateway instead of from Anthropic. Model access and policy follow the same per-group rules as the CLI. A developer who uses both the CLI and Claude Desktop signs in to each separately; the gateway session isn’t shared between them.
+[Claude Desktop](</docs/en/desktop>) connects to the same gateway through a different MDM key: set `bootstrapUrl` in Claude Desktop’s [managed configuration](<https://claude.com/docs/third-party/claude-desktop/configuration>) to `<listen.public_url>/user/bootstrap`, and opt the user’s policy in with a `desktop` key. [Claude Desktop overlay](</docs/en/claude-apps-gateway-config#claude-desktop-overlay>) covers both halves. Requires Claude Code v2.1.203 or later on the gateway server. Once connected, Claude Desktop sends model requests from every enabled tab through the gateway. Claude Desktop signs the developer in through the gateway’s identity provider with the same browser SSO step, then fetches its configuration from the gateway instead of from Anthropic. Model access and policy follow the same per-group rules as the CLI. A developer who uses both the CLI and Claude Desktop signs in to each separately.
### CI pipelines and remote machines
@@ -385,7 +385,7 @@
* In the embedded sessions Claude Desktop launches, the CLI sends its exports to the configured `OTEL_EXPORTER_OTLP_ENDPOINT`. The CLI attaches the gateway session token to those exports only when that endpoint points at the gateway itself.
* With no destination configured for a signal, the gateway accepts and discards it.
* If you already collect Claude Code telemetry directly, add your collector as a `forward_to` destination, or name it in a policy to skip the relay.
- * **Credentials** : the gateway token is the session’s only credential. [Anthropic profiles](</docs/en/authentication#anthropic-profiles-and-federation-credentials>) and any earlier claude.ai login are ignored while signed in, so developers don’t need to log out of claude.ai first. For a configured `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` credential, or an API key saved by an earlier Claude Console login, see [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>).
+ * **Credentials** : the gateway token is the session’s only credential. [Anthropic profiles](</docs/en/authentication#anthropic-profiles-and-federation-credentials>) and any earlier claude.ai login are ignored while signed in. For a configured `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or `apiKeyHelper` credential, or an API key saved by an earlier Claude Console login, see [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>).
* **Managed settings** : locked keys can’t be overridden locally. The CLI applies the policy at startup and applies changes on each hourly poll, apart from the [changes that apply only at the next launch](</docs/en/server-managed-settings#fetch-and-caching-behavior>).
* **Startup with the gateway unreachable** : signed-in sessions exit at startup with an error after about 10 seconds rather than starting without their settings.
* **Startup after the gateway ends the session** : see [Enforce fail-closed startup](</docs/en/server-managed-settings#enforce-fail-closed-startup>) for the launches that open signed out of the gateway and the ones that exit when the gateway answers with a `401`.
--- a/claude-apps-gateway-deploy.md
+++ b/claude-apps-gateway-deploy.md
@@ -118,7 +118,7 @@
* `xff_unparseable`: the event also carries the `X-Forwarded-For` entry that couldn’t be read
* `client_ip_unknown`: the event carries no client IP, because the connection had no peer address while an `access_control` list was set
* `access.public_client` carries the client IP of the first request per process to arrive from a public address while `access_control.allow_cidrs` is empty. The gateway serves the request as usual; the event signals that the gateway may be reachable from the public internet. See the [`access_control` reference](</docs/en/claude-apps-gateway-config#http-tuning>) for what counts as public and for the recommended allow list.
- * `inference` records which upstream served the request and the response status
+ * `inference` records which upstream served the request, the response status, and any `upstream_request_id` or `upstream_cloud_request_id` to quote to the upstream’s support. The gateway server needs Claude Code v2.1.295 or later for `upstream_request_id` and v2.1.311 or later for `upstream_cloud_request_id`.
* `desktop_bootstrap.denied` records a rejected Claude Desktop bootstrap fetch with the reason (`not_configured`, `policy_not_opted_in`, or `no_policy_matched`) and the user’s identity
* `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
--- a/claude-code-features.md
+++ b/claude-code-features.md
@@ -1,4 +1,4 @@
-The Agent SDK is built on the same foundation as Claude Code, which means your SDK agents have access to the same filesystem-based features: project instructions (`CLAUDE.md` and rules), skills, hooks, and more. When you omit `settingSources`, `query()` reads the same filesystem settings as the Claude Code CLI: user, project, and local settings, CLAUDE.md files, and `.claude/` skills, agents, and commands. To run without these, pass `settingSources: []`, which limits the agent to what you configure programmatically. Managed policy settings and the global `~/.claude.json` config are read regardless of this option. For more information, see What settingSources does not control.
+The Agent SDK is built on the same foundation as Claude Code, which means your SDK agents have access to the same filesystem-based features: project instructions (`CLAUDE.md` and rules), skills, hooks, and more. When you omit `settingSources`, `query()` reads the same filesystem settings as the Claude Code CLI: user, project, and local settings, CLAUDE.md files, and `.claude/` skills, agents, and commands. To run without these, pass `settingSources: []`. Inputs such as managed policy settings and the global `~/.claude.json` config are still read. For more information, see What settingSources does not control.
## Control filesystem settings with settingSources
@@ -72,7 +72,7 @@
Managed policy settings| Endpoint-managed policy, such as an MDM plist, registry policy, or managed settings file, loads from the host. [Server-managed settings](</docs/en/server-managed-settings>) are fetched on an [eligible configuration](</docs/en/server-managed-settings#platform-availability>) when the session authenticates with a qualifying credential, such as an organization OAuth login, a directly configured API key, or a `user_oauth` [Anthropic profile](</docs/en/authentication#anthropic-profiles-and-federation-credentials>)| Endpoint policy: remove the managed settings file, plist, or registry policy from the host. Server-managed settings: an [Owner](</docs/en/server-managed-settings#access-control>) in your Claude organization controls them; you can’t disable them from the SDK
`~/.claude.json` global config| Always read| Relocate with `CLAUDE_CONFIG_DIR` in `env`
Auto memory at `~/.claude/projects/<project>/memory/`| Loaded into the system prompt at session start. The agent writes new memories there with the standard `Write` and `Edit` tools rather than a dedicated memory tool, so those tools must be enabled for the agent to save memories| Set `autoMemoryEnabled: false` in settings, or `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1` in `env`
-[claude.ai MCP connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>)| Loaded when the session authenticates with your claude.ai login. Not loaded when `CLAUDE_CODE_OAUTH_TOKEN` holds a token from [`claude setup-token`](</docs/en/authentication#generate-a-long-lived-token>), which can only make model requests. Passing `mcpServers: {}` does not suppress the connectors| Set `strictMcpConfig: true`, [`disableClaudeAiConnectors: true`](</docs/en/mcp#disable-claude-ai-connectors>) in settings, or `ENABLE_CLAUDEAI_MCP_SERVERS=false` in `env`
+[claude.ai MCP connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>)| Loaded when the session authenticates with your claude.ai login. Not loaded when `CLAUDE_CODE_OAUTH_TOKEN` holds a token from [`claude setup-token`](</docs/en/authentication#generate-a-long-lived-token>). Passing `mcpServers: {}` does not suppress the connectors| Set `strictMcpConfig: true`, [`disableClaudeAiConnectors: true`](</docs/en/mcp#disable-claude-ai-connectors>) in settings, or `ENABLE_CLAUDEAI_MCP_SERVERS=false` in `env`
[`sandbox.credentials`](</docs/en/sandboxing#protect-credentials>) `deny` entries and file `mask` entries in `~/.claude/settings.json`| When the [command sandbox](</docs/en/sandboxing>) runs, Claude Code applies the `deny` entries and keeps the `credentials.files` `mask` entries as restrictions even when `settingSources` excludes user settings. Claude Code uses these entries only to narrow what sandboxed commands can access| Remove the entries from `~/.claude/settings.json`
Do not rely on default `query()` options for multi-tenant isolation. Because the inputs above are read regardless of `settingSources`, an SDK process can pick up host-level configuration and per-directory memory. For multi-tenant deployments, run each tenant in its own filesystem and set `settingSources: []` plus `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1` in `env`. [Server-managed settings](</docs/en/server-managed-settings>) are fetched when the process authenticates with an organization credential; filesystem isolation does not remove them. See [Secure deployment](</docs/en/agent-sdk/secure-deployment>).
--- a/claude-code-on-the-web.md
+++ b/claude-code-on-the-web.md
@@ -57,7 +57,7 @@
These workflows require the [Claude Code CLI](</docs/en/quickstart>) signed in to the same claude.ai account. You can start new cloud sessions from your terminal, or pull cloud sessions into your terminal to continue locally. Cloud sessions persist even if you close your laptop, and you can monitor them from anywhere including the Claude mobile app.
-From the CLI, session handoff is one-way: you can pull cloud sessions into your terminal with `--teleport`, but you can’t push an existing terminal session to the cloud. The `--cloud` flag with a task description creates a new cloud session for your current repository; with `-p` and a session ID or claude.ai/code URL it instead [queues a message into that existing session](</docs/en/claude-code-on-the-web#send-follow-ups-from-the-cli>). The [Desktop app](</docs/en/desktop#continue-in-another-surface>) can send a local session in its Code tab to the cloud from its **Open in** menu.
+From the CLI, session handoff is one-way: you can pull cloud sessions into your terminal with `--teleport`, but you can’t push an existing terminal session to the cloud. The `--cloud` flag with a task description creates a new cloud session for your current repository. With `-p` and a session ID or claude.ai/code URL it instead [queues a message into that existing session](</docs/en/claude-code-on-the-web#send-follow-ups-from-the-cli>).To send a local session from the Code tab of the [Desktop app](</docs/en/desktop#continue-in-another-surface>) to the cloud, select **Continue in cloud** in the session menu.
### Start a cloud session from your terminal
--- a/claude-projects.md
+++ b/claude-projects.md
@@ -235,7 +235,7 @@
On the computer that has the folder the task needs, make it available through Remote Control in one of two ways. Both need Claude Code v2.1.280 or later on that computer.
- * **In the Claude desktop app** : open **Settings > Code** or **Settings > Claude Code** and turn on **Use this computer from your phone and claude.ai**. Add the folder to the list under that switch. Threads can run on this computer while the app is open.
+ * **In the Claude desktop app** : open **Settings > Code** or **Settings > Claude Code** and turn on **Let your phone and claude.ai start sessions here**. Add the folder to the list under that switch. Threads can run on this computer while the app is open.
* **In a terminal** : run `claude remote-control` in the folder and leave it running. In a git repository, add `--spawn worktree` to give each thread there its own [worktree](</docs/en/worktrees>) instead of the folder itself.
2
@@ -246,9 +246,9 @@
3
-Allow it on the card
-
-Claude answers with an **Allow Claude to work in a folder on your computer** card. Pick the folder if you connected several. Two threads working in one folder at the same time can overwrite each other’s changes. If the folder is a git repository, you can turn on **Worktree** in the folder’s options to give this thread its own worktree instead. Then click **Allow once**.
+Allow the folder if Claude asks
+
+For a folder outside **Folders Claude can use without asking** in **Project settings > Environment**, Claude answers with an **Allow Claude to work in a folder on your computer** card. If the card lists several folders, pick one.Two threads working in one folder at the same time can overwrite each other’s changes. If the folder is a git repository, you can turn on **Worktree** in the folder’s options to give this thread its own worktree instead. Then click **Allow once** on the card.
The thread runs in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), so Claude runs commands and edits files in that folder without asking you each time. If auto mode is unavailable or turned off in that computer’s Claude Code, the thread runs without it, and any permission prompt it raises waits for your answer in the thread, as Unblock a thread waiting on approval describes. To run the thread in another mode, start `claude remote-control` with [`--settings`](</docs/en/remote-control#start-a-remote-control-session>) and a file that sets [`disableAutoMode`](</docs/en/settings-reference#disableautomode>) to `"disable"`. Then [`permissions.defaultMode`](</docs/en/permission-modes#start-in-a-different-mode>), in that file or in that computer’s settings, can pick another mode, such as `default`, `plan`, or `dontAsk`. While the thread runs, a laptop icon in its header shows whether your computer is connected. Click it to see which folder the thread is using or to turn the connection off. The thread pauses while that computer is asleep, and stops if the desktop app or `claude remote-control` quits.
@@ -457,7 +457,7 @@
A thread running on your computer shows this when the Claude Code session there stopped responding, usually because the computer went to sleep or the desktop app or `claude remote-control` quit. Wake the computer. If the desktop app or `claude remote-control` is no longer running there, start it again:
- * **Desktop app** : reopen the app and confirm **Use this computer from your phone and claude.ai** is still on under **Settings > Code** or **Settings > Claude Code**
+ * **Desktop app** : reopen the app and confirm **Let your phone and claude.ai start sessions here** is still on under **Settings > Code** or **Settings > Claude Code**
* **Terminal** : run `claude remote-control` again in the same folder
### Other messages
--- a/cli-reference.md
+++ b/cli-reference.md
@@ -118,7 +118,7 @@
`--remote-control`, `--rc`| Start an interactive session with [Remote Control](</docs/en/remote-control#start-a-remote-control-session>) enabled so you can also control it from claude.ai or the Claude app. Optionally pass a name for the session| `claude --remote-control "My Project"`
`--remote-control-session-name-prefix <prefix>`| Prefix for auto-generated [Remote Control](</docs/en/remote-control>) session names when no explicit name is set. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. Set `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` for the same effect| `claude remote-control --remote-control-session-name-prefix dev-box`
`--replay-user-messages`| Re-emit user messages from stdin back on stdout for acknowledgment. Requires `--input-format stream-json` and `--output-format stream-json`| `claude -p --input-format stream-json --output-format stream-json --verbose --replay-user-messages`
-`--restricted`| Start in restricted mode. Use it when an evaluation harness drives `claude` on a shared machine and Claude Code must not run commands or read that machine’s user and project settings. Claude Code removes the built-in tools that run commands or code, and WebFetch, unless you name them individually in `--tools`, not through the `default` preset. It also confines the built-in file tools to the [working directories](</docs/en/permissions#working-directories>), loads only [managed settings](</docs/en/managed-settings>) and `--settings`, refuses [`bypassPermissions`](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>), and [refuses to create cloud sessions](</docs/en/errors#cloud-sessions-cannot-be-created-from-a-restricted-session>). Requires Claude Code v2.1.248 or later| `claude --restricted -p "query"`
+`--restricted`| Restricted mode for evaluation harnesses: removes WebFetch and built-in tools that run commands or code. Hooks, plugins, and MCP servers you pass with flags can still run commands. To keep a removed tool, name it individually in `--tools`. Confines built-in file tools to the [working directories](</docs/en/permissions#working-directories>) and some of Claude Code’s own files, loads only [managed settings](</docs/en/managed-settings>) and `--settings`, and refuses [`bypassPermissions`](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) and [new cloud sessions](</docs/en/errors#cloud-sessions-cannot-be-created-from-a-restricted-session>). Requires v2.1.248 or later| `claude --restricted -p "query"`
`--resume`, `-r`| Resume a specific session by ID or name, or show an interactive picker to choose a session. In place of an ID, you can pass the absolute path to a session’s `.jsonl` [transcript file](</docs/en/sessions#where-transcripts-are-stored>). The picker and name search include sessions that added this directory with `/add-dir`. When you pass a session ID, Claude Code searches the current project directory and its git worktrees, then every other project on this machine. Before v2.1.223, the ID search covered only the current project directory and its git worktrees. [Background sessions](</docs/en/agent-view>) appear in the picker marked with `bg`. Resuming one that is still running [opens that session](</docs/en/sessions#resume-a-running-background-session>) in this terminal through `claude attach`, and a prompt you pass on the command line goes to it as its next turn. Before v2.1.285, Claude Code refused and printed the `claude attach` command to run instead| `claude --resume auth-refactor`
`--safe-mode`| Start with all customizations disabled to troubleshoot a broken configuration: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto memory do not load. Authentication, model selection, built-in tools, and permissions work normally, which differs from [`--bare`](</docs/en/headless#start-faster-with-bare-mode>). Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Useful for checking whether a customization is what triggers [automatic model fallback](</docs/en/model-config#automatic-model-fallback>). Sets [`CLAUDE_CODE_SAFE_MODE`](</docs/en/env-vars>)| `claude --safe-mode`
`--session-id`| Use a specific session ID for the conversation (must be a valid UUID)| `claude --session-id "550e8400-e29b-41d4-a716-446655440000"`
--- a/code-intelligence.md
+++ b/code-intelligence.md
@@ -6,7 +6,7 @@
## Install a code intelligence plugin
-A code intelligence plugin tells Claude Code which command starts the language server and which file extensions it handles. It doesn’t include the language server. Install the language server binary first, then the plugin, then confirm the server starts.
+A code intelligence plugin tells Claude Code which command starts the language server and which file extensions it handles. Install the language server binary first, then the plugin, then confirm the server starts.
1
@@ -17,18 +17,18 @@
Language| Plugin| Binary
---|---|---
C/C++| [`clangd-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/clangd-lsp>)| `clangd`
-C#| [`csharp-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/csharp-lsp>)| `csharp-ls`
-Go| [`gopls-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp>)| `gopls`
-Java| [`jdtls-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/jdtls-lsp>)| `jdtls`
-Kotlin| [`kotlin-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/kotlin-lsp>)| `kotlin-lsp`
+C#| [`csharp-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/csharp-lsp>)| `csharp-ls`, a .NET tool
+Go| [`gopls-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp>)| `gopls`, installed with `go install`
+Java| [`jdtls-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/jdtls-lsp>)| `jdtls`, from Eclipse JDT.LS
+Kotlin| [`kotlin-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/kotlin-lsp>)| `kotlin-lsp`, from JetBrains’ Homebrew tap
Liquid| [`liquid-lsp`](<https://github.com/Shopify/liquid-skills/tree/main/plugins/liquid-lsp>)| `shopify`, from the Shopify CLI
-Lua| [`lua-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/lua-lsp>)| `lua-language-server`
-PHP| [`php-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/php-lsp>)| `intelephense`
-Python| [`pyright-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp>)| `pyright-langserver`
-Ruby| [`ruby-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/ruby-lsp>)| `ruby-lsp`
-Rust| [`rust-analyzer-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp>)| `rust-analyzer`
-Swift| [`swift-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/swift-lsp>)| `sourcekit-lsp`
-TypeScript and JavaScript| [`typescript-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp>)| `typescript-language-server`
+Lua| [`lua-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/lua-lsp>)| `lua-language-server`, from Homebrew, a Linux package manager or its releases page
+PHP| [`php-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/php-lsp>)| `intelephense`, installed with npm
+Python| [`pyright-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp>)| `pyright-langserver`, from the `pyright` package
+Ruby| [`ruby-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/ruby-lsp>)| `ruby-lsp`, a gem
+Rust| [`rust-analyzer-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp>)| `rust-analyzer`, a rustup component
+Swift| [`swift-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/swift-lsp>)| `sourcekit-lsp`, included with the Swift toolchain
+TypeScript and JavaScript| [`typescript-lsp`](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp>)| `typescript-language-server`, installed with npm
Anthropic maintains every plugin in the table except `liquid-lsp`, which Shopify maintains and the official marketplace lists.To find the command that installs the binary, follow the plugin’s link in the table to its README. For TypeScript, that command is `npm install -g typescript-language-server typescript`.After you install the binary, confirm it’s on the `PATH` of the shell you start `claude` from, for example with `which typescript-language-server`, or `Get-Command typescript-language-server` in PowerShell.
@@ -83,7 +83,7 @@
* **Yes, install** : Claude Code installs the plugin for your user account and prints `<plugin> installed · restart to apply`. Start a new session to load the server.
* **Not now** : the dialog closes, and a later session can offer the plugin again. Pressing **Esc** does the same.
- * **Never for this plugin** : the dialog stops appearing for that plugin and still appears for others.
+ * **Never for this plugin** : the dialog stops appearing for that plugin.
* **Disable all LSP recommendations** : the dialog stops appearing for every language.
If you don’t choose an option, Claude Code closes it after 30 seconds and counts that as ignored. The count is kept across sessions. After five ignored dialogs, Claude Code stops recommending plugins, the same as if you’d chosen **Disable all LSP recommendations**.
--- a/code-mode.md
+++ b/code-mode.md
@@ -88,11 +88,15 @@
Confirm that you want Code Mode
-Claude Code asks you to confirm before your first Code Mode session. Select **Yes, turn on Code Mode**. Claude Code restarts and shows this line near the top of the session:
+Claude Code asks you to confirm before your first Code Mode session. Select **Yes, turn on Code Mode**.This line near the top of the session means that Code Mode is on:
Code Mode (experimental) is on · this session can be resumed only with Code Mode on
-If you see a different line or none, see Code Mode doesn’t start.
+If you see this line instead, Code Mode is off in this session:
+
+ Code Mode (experimental) will be on after you quit and start Claude Code again the same way. This session uses the ordinary tools.
+
+To turn on Code Mode, exit Claude Code and start it again as you did in the previous step. Then look for the `is on` line.If you see a different line or none, see Code Mode doesn’t start.
4
--- a/code-review.md
+++ b/code-review.md
@@ -2,7 +2,7 @@
Code Review uses AI to review code and may miss bugs, security vulnerabilities, or other issues. A review with no findings doesn’t mean your code is error-free or secure.
-To turn on Code Review, an Owner of your Claude organization follows [Set up Code Review](</docs/en/code-review-setup>). Claude can also review code without this service. Run [`/code-review`](</docs/en/code-review-local>) in your Claude Code session on any plan, or compare all the options.
+To turn on Code Review, an Owner of your Claude organization follows [Set up Code Review](</docs/en/code-review-setup>). To get a review another way, run [`/code-review`](</docs/en/code-review-local>) in your Claude Code session on any plan, or compare all the options.
## Availability
@@ -40,7 +40,7 @@
## How reviews work
-By default, Code Review focuses on correctness: bugs that would break production, not formatting preferences or missing test coverage. To change what it flags, [add guidance files](</docs/en/code-review-customize>) to your repository. A review runs on Anthropic infrastructure in four stages:
+By default, Code Review focuses on correctness: bugs that would break production. To change what it flags, [add guidance files](</docs/en/code-review-customize>) to your repository. A review runs on Anthropic infrastructure in four stages:
1. **Find** : several agents examine the diff and the surrounding code in parallel.
2. **Verify** : a verification step checks the candidate findings against the code and filters out false positives.
@@ -53,7 +53,7 @@
* **A check run** : named **Claude Code Review** , with the findings listed in its [details](</docs/en/code-review-pull-requests#check-run-output>). The check run doesn’t conclude as a failure.
* **A note in place of findings** : posted when the check run’s title reads **Code review found no issues**
-Code Review chooses the Claude models that reviews run on, and its admin settings don’t offer a model choice. To make reviews more or less thorough, change the review level. After an Owner turns on Code Review, each repository has a setting for [when reviews run](</docs/en/code-review-setup#set-when-reviews-run>): once when a pull request opens, after every push, or only on request. Whichever it is, someone with write access to the repository can comment `@claude review` on a pull request to [start a review](</docs/en/code-review-pull-requests#comment-commands>).
+Code Review chooses the Claude models that reviews run on, and its admin settings don’t offer a model choice. To make reviews more or less thorough, change the review level. After turning on Code Review, an Owner can change each repository’s setting for [when reviews run](</docs/en/code-review-setup#set-when-reviews-run>). Whichever option is set, someone with write access to the repository can comment `@claude review` on a pull request to [start a review](</docs/en/code-review-pull-requests#comment-commands>).
### Review levels
@@ -75,7 +75,7 @@
### Who controls a review
- * **Who can start one** : where reviews run automatically, opening or pushing to a pull request starts a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). After some pushes, Code Review [keeps the earlier result](</docs/en/code-review-pull-requests#when-a-push-keeps-the-earlier-result>) instead. A [comment command](</docs/en/code-review-pull-requests#comment-commands>) starts one only when it comes from a person with write access to the repository.
+ * **Who can start one** : where reviews run automatically, opening or pushing to a pull request can start a review, [except on drafts and forks](</docs/en/code-review-pull-requests#review-drafts-and-pull-requests-from-forks>). After some pushes, Code Review [keeps the earlier result](</docs/en/code-review-pull-requests#when-a-push-keeps-the-earlier-result>) instead. Only a person with write access to the repository can start one with a [comment command](</docs/en/code-review-pull-requests#comment-commands>).
* **Which instructions it follows** : `REVIEW.md` from the base or default branch and [never from the pull request’s own changes](</docs/en/code-review-customize#which-branch-review-md-is-read-from>).
## Compare ways to get a review
@@ -86,7 +86,7 @@
---|---|---|---
Code Review| Pull request activity, as each repository is set, or an `@claude review` comment| Anthropic infrastructure| Organizations on a Team or Enterprise plan with GitHub repositories, once an Owner turns it on
[`/code-review`](</docs/en/code-review-local>)| You run the command on your branch| Your Claude Code session| Anyone, on any plan
-[Ultrareview](</docs/en/ultrareview>)| You start it from Claude Code| A cloud sandbox| Requires signing in with a claude.ai account. See [Ultrareview](</docs/en/ultrareview>) for where it isn’t available
+[Ultrareview](</docs/en/ultrareview>)| You start it from Claude Code| A cloud sandbox| Requires signing in with a claude.ai account. See [Ultrareview](</docs/en/ultrareview>) for availability
Claude in your own CI, with [GitHub Actions](</docs/en/github-actions>) or [GitLab CI/CD](</docs/en/gitlab-ci-cd>)| Your pipeline’s events, such as every pull request or merge request| Your own CI runners| Anyone with a Claude API key or cloud provider credentials, on GitHub or GitLab
Your own reviewer, as a [subagent](</docs/en/sub-agents>) or [skill](</docs/en/skills>)| You or Claude invoke it during a session| Wherever you run Claude Code| Anyone who writes one
--- a/code-review-customize.md
+++ b/code-review-customize.md
@@ -9,7 +9,7 @@
## Use CLAUDE.md for project-wide rules
-Code Review reads your repository’s `CLAUDE.md` files as project context. A change that violates one of their rules becomes a finding at whichever [severity level](</docs/en/code-review-pull-requests#severity-levels>) fits the issue. A review reads the `CLAUDE.md` at your repository root and the `CLAUDE.md` files in the parent directories of each changed file. A subdirectory’s `CLAUDE.md` is read when the pull request changes a file under that path.
+Put project-wide rules in your repository’s `CLAUDE.md` files, which Code Review reads as project context. When a change clearly breaks one of their rules, Code Review can flag it at whichever [severity level](</docs/en/code-review-pull-requests#severity-levels>) fits the issue. A review reads the `CLAUDE.md` at your repository root and the `CLAUDE.md` files in the parent directories of each changed file. A subdirectory’s `CLAUDE.md` is read when the pull request changes a file under that path.
## Use REVIEW.md for review-only rules
@@ -35,7 +35,7 @@
* **Generated code** : `generated`
* **Third-party code** : `vendor`, `third_party`, `third-party`, `thirdparty`, `node_modules`, `bower_components`, `external`, `extern`, `deps`, `godeps`, `pods`, `carthage`, `site-packages`, `contrib`
-Put checks for those subdirectories in the root `REVIEW.md`, or in a parent subdirectory’s `REVIEW.md` when neither that parent nor anything above it is on the list. The remaining subdirectory `REVIEW.md` files on the paths a pull request changes share a limit of 150,000 bytes, not counting the root file. If the [check run](</docs/en/code-review-pull-requests#check-run-output>) reports that some of them didn’t fit, shorten the files to fit that limit.
+Put checks for those subdirectories in the root `REVIEW.md`, or in a parent subdirectory’s `REVIEW.md` that Code Review reads. For the paths a pull request changes, keep the subdirectory `REVIEW.md` files within 150,000 bytes in total, apart from the root file. If the [check run](</docs/en/code-review-pull-requests#check-run-output>) reports that some of them didn’t fit, shorten the files.
### Example REVIEW.md
@@ -69,13 +69,13 @@
### Choose what to write in REVIEW.md
-`REVIEW.md` is freeform Markdown that changes what a review finds and reports. It doesn’t change the format of the review. Find the problem you’re seeing, then add an instruction like the one shown. The example uses the first four.
+Write `REVIEW.md` in freeform Markdown to change what a review finds and reports. It doesn’t change the format of the review. Find the problem you’re seeing, then add an instruction like the one shown. The example uses the first four.
* **The wrong things are marked Important** : redefine what 🔴 Important means for your repository. The default calibration targets production code, and a docs repository, a config repository, or a prototype might want a much narrower definition. State which classes of finding are Important and which are Nit at most. You can also escalate, for example treating any `CLAUDE.md` violation as Important.
* **Too many nits** : cap how many 🟡 Nit comments a single review posts. A cap like “report at most five nits” keeps reviews actionable.
* **Comments on generated files or on what CI already checks** : list paths and finding categories where Claude should skip findings. Common candidates are generated code, lockfiles, and vendored dependencies, along with anything your CI already enforces like linting or spellcheck. For paths that warrant some review but not full scrutiny, set a higher bar instead: “in `scripts/`, only report if near-certain and severe.”
* **A team rule isn’t being checked** : add rules you want flagged on every pull request, like “new API routes must have an integration test.”
- * **Findings that turn out to be wrong** : require evidence before a class of finding is posted. For example, “behavior claims need a `file:line` citation in the source, not an inference from naming” cuts false positives that would otherwise cost the author a round trip.
+ * **Findings that turn out to be wrong** : require evidence before a class of finding is posted. For example, write “behavior claims need a `file:line` citation in the source, not an inference from naming.”
Some of these instructions need the root file on a protected default branch. Keep `REVIEW.md` to instructions that change review behavior, and leave general project context in `CLAUDE.md`.
@@ -113,7 +113,7 @@
### Include a skill file
-To have reviews follow guidance you keep in a [skill](</docs/en/skills>), include the skill’s `SKILL.md` in your root `REVIEW.md`. Code Review doesn’t run skills. Add `@` and the path to `SKILL.md`, in the form `.claude/skills/<folder>/SKILL.md`, on a line of its own:
+To have reviews follow guidance you keep in a [skill](</docs/en/skills>), include the skill’s `SKILL.md` in your root `REVIEW.md`. Add `@` and the path to `SKILL.md`, in the form `.claude/skills/<folder>/SKILL.md`, on a line of its own:
# Review instructions
@@ -127,25 +127,25 @@
#### Write a skill line that Code Review includes
-Use a folder name without spaces. A line with a space in its path stays in `REVIEW.md` as plain text, and the check run doesn’t report it as a skipped include. If the `@` line for a skill breaks one of the rules below, Code Review doesn’t include the skill from that line:
+Use a folder name without spaces. A line with a space in its path stays in `REVIEW.md` as plain text, and the check run doesn’t report it as a skipped include. For Code Review to include the skill from an `@` line, follow these rules:
* **Path** : write the path as `.claude/skills/<folder>/SKILL.md` from the repository root, with the skill’s folder directly under `skills/`. Unlike a file name at the root, a path of this form that matches no file is skipped and counted.
- * **Source** : copy guidance from any other file under `.claude/`, or from a [bundled, personal, or plugin skill](</docs/en/skills#where-skills-live>), into a file beside `REVIEW.md`. You can’t include those directly.
- * **File** : commit `SKILL.md` as a regular text file. Code Review doesn’t follow a symbolic link, whether the link is the file or a folder in its path.
+ * **Source** : to use guidance from any other file under `.claude/`, or from a [bundled, personal, or plugin skill](</docs/en/skills#where-skills-live>), copy it into a file beside `REVIEW.md`
+ * **File** : commit `SKILL.md` as a regular text file. If the file or a folder in its path is a symbolic link, replace the link with a copy.
* **Size** : keep `SKILL.md` at 30,000 bytes or less, frontmatter included
- * **Count** : write at most eight skill lines. A repeated line counts again toward the eight.
+ * **Count** : write at most eight skill lines. If you repeat a line, it counts again toward the eight.
* **Blocks in`REVIEW.md`**: keep the `@` line out of code fences. Close every HTML comment and every `<pre>`, `<script>`, `<style>`, or `<textarea>` block above it.
When Code Review skips a skill line for breaking the File, Size, Count, or Blocks rule, the check run’s [message about skipped include lines](</docs/en/code-review-troubleshooting#the-check-run-mentions-review-md>) counts it. The message appears only when the review applies `REVIEW.md` from a protected branch.
#### Check what a review gets from a skill
-When the skill is included, a review gets the body of `SKILL.md` and nothing else from the skill, so check the skill against the list below.
+Check your skill against the list below, because a review gets only the body of `SKILL.md` from an included skill.
* **Frontmatter** : repeat in the body anything a review needs from the [frontmatter](</docs/en/skills#frontmatter-reference>), for example the conditions that `description` gives for using the skill
* **Injected commands** : write out what a [`!` command](</docs/en/skills#inject-dynamic-context>) would supply. Code Review doesn’t run the command, and replaces the whole line or block that holds it with a placeholder.
- * **Substitutions** : replace `$ARGUMENTS` and other [substitutions](</docs/en/skills#available-string-substitutions>) with fixed text, because a review passes no arguments and leaves them as written
- * **Supporting files** : copy what a review needs into `SKILL.md`, because Code Review doesn’t load scripts, linked files, or `@file` references
+ * **Substitutions** : replace `$ARGUMENTS` and other [substitutions](</docs/en/skills#available-string-substitutions>) with fixed text, because a review leaves them as written
+ * **Supporting files** : copy what a review needs from scripts, linked files, or `@file` references into `SKILL.md`
* **Exclusions and Nit caps** : write instructions that exclude findings or cap Nits in `REVIEW.md` or a file beside it, not in the skill. Code Review doesn’t accept a skill’s text as the reason for either.
* **Links to repository files** : state in words what a link or `@file` reference points to. The review sees the path as plain text or as a placeholder.
@@ -180,7 +180,7 @@
* **Default branch** : a classic branch protection rule or a ruleset
* **Any other branch** : a ruleset only
-A ruleset counts when it restricts updates or requires pull requests with at least one approval. If it requires pull requests, it must also dismiss that approval on a new push or require the approval to come after the last push.
+For a ruleset to count, set it to restrict updates or to require pull requests with at least one approval. If you choose pull requests, also set it to dismiss that approval on a new push or require the approval to come after the last push.
#### What a review reads for each branch setup
Show diff (131 lines)
--- a/code-review-pull-requests.md
+++ b/code-review-pull-requests.md
@@ -1,4 +1,4 @@
-Code Review is a managed service that an Owner in your Claude organization turns on for a set of GitHub repositories. Once it’s on, Claude reviews pull requests in those repositories. It posts its findings as inline comments, a summary in the review body, and a check run named **Claude Code Review**. An Owner controls [when reviews run](</docs/en/code-review-setup#set-when-reviews-run>) and [how thorough they are](</docs/en/code-review-setup#set-the-default-review-level>) for each repository. By itself, a review doesn’t approve or block your pull request, and the check run doesn’t conclude as a failure. Where a repository has a [Claude Approvals](</docs/en/approvals#keep-automatic-code-reviews>) policy file, the policy can use a review’s result to decide who has to approve. It can also change which pull requests get an automatic review.
+Code Review is a managed service that an Owner in your Claude organization turns on for a set of GitHub repositories. Once it’s on, Claude reviews pull requests in those repositories. It posts its findings as inline comments, a summary in the review body, and a check run named **Claude Code Review**. An Owner controls [when reviews run](</docs/en/code-review-setup#set-when-reviews-run>) and [how thorough they are](</docs/en/code-review-setup#set-the-default-review-level>) for each repository. By itself, a review doesn’t approve or block your pull request. If a repository has a [Claude Approvals](</docs/en/approvals#keep-automatic-code-reviews>) policy file, the policy can use a review’s result to decide who has to approve. It can also change which pull requests get an automatic review.
If your plan doesn’t include Code Review, you can still have Claude review your branch from a Claude Code session: see [Review locally with `/code-review`](</docs/en/code-review-local>).
@@ -9,31 +9,31 @@
Marker| Severity| Meaning
---|---|---
🔴| Important| A bug that should be fixed before merging
-🟡| Nit| A minor issue, worth fixing but not blocking
-🟣| Pre-existing| A bug that exists in the codebase but wasn’t introduced by this PR
+🟡| Nit| A minor issue worth fixing
+🟣| Pre-existing| A bug that was in the codebase before this PR
When the review recorded its reasoning, a finding has a collapsed **Why this was flagged** section. Expand it to read why Claude flagged the issue and how it verified the problem. To change what Claude flags in your repository or how it ranks severity, see [Customize Code Review](</docs/en/code-review-customize>).
## Respond to findings
-You can merge without responding to a finding, unless your repository’s own rules require it. If its branch protection [requires conversation resolution](<https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-conversation-resolution-before-merging>), resolve each finding’s thread before you merge. To clear a finding, resolve its thread or push a fix.
+To clear a finding, resolve its thread or push a fix.
- * **Dismiss it without a code change** : resolve the thread yourself on GitHub. Replying alone doesn’t dismiss a finding. If your pull request has a **Claude Approvals** check, that check [may not count your resolve](</docs/en/approvals-troubleshooting#approvals-doesn%E2%80%99t-pass-after-you-resolve-a-review-thread>).
+ * **Dismiss it** : resolve the thread yourself on GitHub. If your pull request has a **Claude Approvals** check, that check [may not count your resolve](</docs/en/approvals-troubleshooting#approvals-doesn%E2%80%99t-pass-after-you-resolve-a-review-thread>).
* **Fix the issue** : change the code and push. The next review of the pull request resolves its earlier thread when it judges the issue fixed, whether that review runs automatically on your push or you request it. Where [PR Steward](</docs/en/pr-steward#what-pr-steward-fixes>) works on the pull request, it can push its own fix for an Important finding, so pull the branch before you start.
- * **Explain or disagree** : reply to the comment. Claude doesn’t respond right away, and a reply doesn’t start a review. The next review of the pull request reads the replies on its earlier findings, and can resolve the thread or post one follow-up reply. If the same kind of finding keeps coming back, ask a maintainer to add a rule to [`REVIEW.md`](</docs/en/code-review-customize#choose-what-to-write-in-review-md>).
+ * **Explain or disagree** : reply to the comment. The thread stays open after you reply. The next review of the pull request reads the replies on its earlier findings, and can resolve the thread or post one follow-up reply. If the same kind of finding keeps coming back, ask a maintainer to add a rule to [`REVIEW.md`](</docs/en/code-review-customize#choose-what-to-write-in-review-md>).
-To get that next review without pushing, comment `@claude review` as a top-level pull request comment.
+To request a new review, comment `@claude review` as a top-level pull request comment. You can merge with findings still open, unless your repository’s own rules block the merge. If its branch protection [requires conversation resolution](<https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#require-conversation-resolution-before-merging>), resolve each finding’s thread before you merge.
## Check run output
-The **Details** link on the **Claude Code Review** check run opens the findings in one table sorted by severity, including any finding whose inline comment GitHub didn’t accept:
+Open the pull request’s **Checks** tab and select **Claude Code Review** to see the findings in one table sorted by severity, including any finding whose inline comment GitHub rejected:
Severity| File:Line| Issue
---|---|---
🔴 Important| `src/auth/session.ts:142`| Token refresh races with logout, leaving stale sessions active
🟡 Nit| `src/auth/session.ts:88`| `parseExpiry` silently returns 0 on malformed input
-A finding that has a line but wasn’t posted as an inline comment appears as an annotation in the **Files changed** tab, on the lines concerned. Important findings show in red, nits in yellow, and pre-existing bugs in gray. The check run concludes as neutral, or as skipped after some pushes that change no files and keep the earlier result. It never concludes as a failure, so a finished review doesn’t fail a required check. If you don’t see findings, or a review didn’t run, see [Troubleshoot Code Review](</docs/en/code-review-troubleshooting>).
+A finding that has a line but wasn’t posted as an inline comment appears as an annotation in the **Files changed** tab, on the lines concerned. Important findings show in red, nits in yellow, and pre-existing bugs in gray. The check run concludes as neutral, or as skipped after some pushes that keep the earlier result. GitHub counts both as passing for a required check. For missing findings or reviews, see [Troubleshoot Code Review](</docs/en/code-review-troubleshooting>).
### When a push keeps the earlier result
@@ -47,7 +47,7 @@
* The pull request still adds and removes the same lines, as after an empty commit, a clean merge of the base branch, or a clean rebase
* Nobody has resolved an Important finding’s thread since that review
-To get a review without a code change, comment `@claude review` or click **Re-run** on the check run.
+To get a new review anyway, comment `@claude review` or click **Re-run** on the check run.
### Read the result from a script
@@ -86,10 +86,10 @@
Have your script handle these cases in order:
- * **The title starts with`Code review not repeated`**: Code Review kept an earlier result whose Important findings are still open, and the check run has no severity line. Read the title before the counts, with `gh api repos/OWNER/REPO/check-runs/CHECK_RUN_ID --jq .output.title`. Fail the job if you want to gate the merge.
+ * **The title starts with`Code review not repeated`**: Code Review kept an earlier result whose Important findings are still open, and the check run omits the severity line. Read the title before the counts, with `gh api repos/OWNER/REPO/check-runs/CHECK_RUN_ID --jq .output.title`. Fail the job if you want to gate the merge.
* **The title ends with`no new changes`**: let the job pass without reading the counts
* **`normal` is above zero**: fail the job if you want to gate the merge. The `normal` key holds the count of Important findings, so Claude found at least one bug worth fixing before merge. To print only that count, add `| .normal` before the closing single quote.
- * **The line is missing** : the command prints an error that contains `no severity line` instead of counts, and exits with a non-zero status. Treat that as no verdict rather than as zero findings. A check run for a review that failed, timed out, was canceled, or was superseded by a newer one has no such line, and some completed reviews have none either.
+ * **The line is missing** : the command prints an error that contains `no severity line` instead of counts, and exits with a non-zero status. Treat that as no verdict rather than as zero findings.
## Request a review
@@ -97,8 +97,8 @@
* **Open it or mark it ready** : in a repository set to **Once after PR creation** or **After every push** , a review starts when you open or reopen the pull request, or mark a draft ready for review.
* **Comment a command** : post `@claude review` on the pull request.
- * **Push a commit** : a push starts a review in a repository set to **After every push** , or on a pull request you subscribed with `@claude review always`. If your pull request still adds and removes the same lines after the push, Code Review can keep the earlier result instead.
- * **Click Re-run** : after a review fails or times out on a pull request that isn’t from a fork, [run it again](</docs/en/code-review-troubleshooting#retrigger-a-failed-or-timed-out-review>) from the check run. On a pull request that isn’t from a fork, you can also click **Re-run** after a push that kept the earlier result.
+ * **Push a commit** : in a repository set to **After every push** , or on a pull request you subscribed with `@claude review always`, a review starts when you push. If your pull request still adds and removes the same lines after the push, Code Review can keep the earlier result instead.
+ * **Click Re-run** : after a review fails or times out, [run the review again](</docs/en/code-review-troubleshooting#retrigger-a-failed-or-timed-out-review>) from the check run. You can also click **Re-run** after a push that kept the earlier result. **Re-run** works only on pull requests from a branch in the same repository.
* **Wait for the automatic retry** : a review whose session was interrupted is retried once automatically. The [check run’s summary](</docs/en/code-review-troubleshooting#retrigger-a-failed-or-timed-out-review>) says when that’s happening.
### Comment commands
@@ -107,20 +107,20 @@
Command| What it does| When to use it
---|---|---
-`@claude review`| Starts a single review without subscribing the PR to future pushes| You want one review now, such as on a pull request in a repository set to **Manual** , or another review right away in the other modes
+`@claude review`| Starts a single review| You want one review now, such as on a pull request in a repository set to **Manual** , or another review right away in the other modes
`@claude review always`| Starts a review and subscribes the PR to push-triggered reviews going forward| You want subsequent pushes to start reviews, such as on a high-priority PR in a repository set to **Manual**
`@claude review once`| Same as `@claude review`: starts a single review without subscribing| The same cases as `@claude review`
`@claude review stop`| Ends the PR’s subscription to push-triggered reviews, without starting a review or canceling one that’s already running. Claude replies with a comment instead of a check run.| You subscribed a PR with `@claude review always` in a repository set to **Manual** or **Once after PR creation** , and no longer want each push to start a review
`@claude review off` or `@claude review pause`| Same as `@claude review stop`| The same cases as `@claude review stop`
-In a repository set to **After every push** , you can’t stop reviews with a comment, because pushes there start reviews with or without a subscription. To stop pushes from starting reviews on one pull request there, convert it to a draft. When you mark it ready for review again, a review starts. For any comment command to take effect, all of these conditions have to hold:
+For any comment command to take effect, meet all of these conditions:
* Post it as a new top-level pull request comment, not an inline comment on a diff line and not the body of a review. Editing an earlier comment doesn’t count.
* Put the whole command on one line at the start of the comment. Other text can follow it. If `always` or `stop` is misspelled or on a later line, Claude reads the comment as a plain `@claude review` and starts a single review. Capitalization doesn’t matter.
* You need write, maintain, or admin permission on the repository. Claude checks this with GitHub for each person who comments, and comments from bots don’t start reviews.
* The pull request must be open.
-When a command that starts a review is accepted, a **Claude Code Review** check run appears on the pull request with the title **Code review queued…**. The title changes to **Code review in progress…** when the review starts. Claude may also react to your comment with 👀, but that reaction can appear when no review starts, so look for the check run instead. If a review is already running on the pull request’s latest commit, a new request doesn’t start a second one.
+To confirm that Code Review accepted your review request, look for a **Claude Code Review** check run on the pull request with the title **Code review queued…**. The title changes to **Code review in progress…** when the review starts. If a review is already running on the pull request’s latest commit, wait for that review to finish before you request another. In a repository set to **After every push** , you keep getting reviews on pushes after you comment `@claude review stop`. To stop those reviews on one pull request, convert it to a draft. When you mark it ready for review again, a review starts.
Before a July 2026 update, `@claude review` subscribed the PR to push-triggered reviews. If you relied on that behavior, comment `@claude review always` instead.
@@ -131,20 +131,20 @@
* **Findings on code that hasn’t changed since the last review** : the sentence ends “outside the scope of this re-review and not posted”
* **Nits and pre-existing findings** : the sentence ends “found and not posted”
-To get a review that leaves none of these out, comment `@claude review`. It covers the whole pull request again.
+To get a review that reports these kinds of findings, comment `@claude review`. It covers the whole pull request again.
### Review drafts and pull requests from forks
Automatic reviews skip both of these, so request the review with a comment command:
- * **Draft pull requests** : a comment command runs on a draft, so you can request a review before you mark the pull request ready. Pushes to a draft don’t start reviews, even after `@claude review always`. The subscription takes effect once you mark the pull request ready.
- * **Pull requests from forks** : Claude doesn’t review a pull request from a fork automatically, regardless of the repository’s **Review runs** setting. To start one, comment `@claude review` on the pull request. The conditions for comment commands still apply, and the write access you need is to the base repository, not the fork.
+ * **Draft pull requests** : a comment command runs on a draft, so you can request a review before you mark the pull request ready. If you comment `@claude review always` on a draft, the subscription takes effect once you mark the pull request ready.
+ * **Pull requests from forks** : the conditions for comment commands still apply, and you need write access to the base repository
-On a pull request from a fork, `@claude review always` works too, but doesn’t subscribe the pull request to reviews on later pushes. Clicking **Re-run** on the check run doesn’t start a review there.
+On a pull request from a fork, comment `@claude review` for each review, even after `@claude review always`.
### Use Code Review alongside the Claude Code GitHub Action
-If the repository also runs the [Claude Code GitHub Action](</docs/en/github-actions>) in interactive mode with its default `@claude` trigger phrase, an `@claude review` comment starts the Action as well. To keep the two apart, set the Action’s `trigger_phrase` input to a different phrase.
+If the repository also runs the [Claude Code GitHub Action](</docs/en/github-actions>) in interactive mode with its default `@claude` trigger phrase, you start the Action as well when you comment `@claude review`. To keep the two apart, set the Action’s `trigger_phrase` input to a different phrase. Also replace each `@claude` in your workflow’s `if` condition with the new phrase, so that the Action starts on that phrase instead.
## Related resources
--- a/code-review-setup.md
+++ b/code-review-setup.md
@@ -134,7 +134,7 @@
To cover the organization, click **Edit** on its row, select a **Review runs** option, and confirm. The options are the three from Set when reviews run plus **Off**. After you confirm, these changes take effect:
- * **Coverage** : each repository is covered from its next pull request. If the Claude GitHub App was installed on selected repositories rather than all of them, Claude reviews those repositories; change the app’s repository access on GitHub to cover the rest.
+ * **Selected repositories** : if the Claude GitHub App was installed on selected repositories rather than all of them, Claude reviews those repositories; change the app’s repository access on GitHub to cover the rest.
* **Existing settings** : every repository in that GitHub organization takes the option you select, including repositories you had set individually. Setting the row again does the same. Repositories you turned off on their own rows stay off.
* **Individual changes afterward** : a repository you later set differently from its organization is marked **Custom** in the table.
* **Review level** : an organization row has no review level of its own.
--- a/commands.md
+++ b/commands.md
@@ -49,8 +49,8 @@
`/deep-research <question>`| **[Workflow](</docs/en/workflows#bundled-workflows>).** Fan out web searches on a question, fetch and cross-check sources, and synthesize a cited report
`/design [brief]`| **[Skill](</docs/en/skills#bundled-skills>).** Draft UI mockups, screen flows, landing pages, or posters as artboards on one canvas, published as a Claude Design [artifact](</docs/en/artifacts#draft-a-design-canvas>), for example `/design a settings screen for a mobile banking app`. You edit the artboards in a desktop browser, and your edits save automatically. You can export each artboard as PNG or PDF. Requires Claude Code v2.1.265 or later, a session where [artifacts are available](</docs/en/artifacts#availability>), and an account where the [Design template is available](</docs/en/artifacts#start-from-a-slides-design-or-docs-template>); if your organization has turned that template off, `/design` doesn’t draft designs. Available on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude Platform on AWS, artifacts aren’t available, so the command is unavailable there
`/design consent`, `/design revoke`| Grant Claude access to [Claude Design](<https://claude.ai/design>), or withdraw it. When a reply from Claude asks you to run `/design consent`, type it at the Claude Code prompt yourself
-`/design-login`| Authorize design-system access for `/design-sync` with your claude.ai account. Sign in with `/design-login` whenever `/design-sync` or `/design consent` tells you to. This sign-in is for the standalone Claude Design site at claude.ai/design, which closes by December 14, 2026; see [Migrate from standalone Claude Design to Claude](<https://support.claude.com/en/articles/17440474-migrate-from-standalone-claude-design-to-claude>)
-`/design-sync [hint]`| **[Skill](</docs/en/skills#bundled-skills>).** Convert your repo’s React design system and upload it to [Claude Design](<https://claude.ai/design>), so designs it produces use your real components. Optionally name the design system, for example `/design-sync Acme DS`. A first-time sync verifies every component and can take a few hours on a large repo. Available on the Anthropic API. It needs claude.ai, which the CLI doesn’t contact on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS, or through a [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>). The command is unavailable there. This command uploads to the standalone claude.ai/design site, which closes by December 14, 2026; see [Migrate from standalone Claude Design to Claude](<https://support.claude.com/en/articles/17440474-migrate-from-standalone-claude-design-to-claude>)
+`/design-login`| Authorize design-system access for `/design-sync` with your claude.ai account. Sign in with `/design-login` whenever `/design-sync` or `/design consent` tells you to. This sign-in is for the standalone Claude Design site at claude.ai/design, which closes by December 14, 2026; see [Move from standalone Claude Design to Claude](<https://support.claude.com/en/articles/17440474-move-from-standalone-claude-design-to-claude>)
+`/design-sync [hint]`| **[Skill](</docs/en/skills#bundled-skills>).** Publish your repo’s React design system to claude.ai as a [Design System artifact](</docs/en/artifacts#sync-a-design-system-from-your-repository>). Optionally name the design system, for example `/design-sync Acme DS`. Publishing an artifact requires Claude Code v2.1.329 or later and a session that [meets the requirements](</docs/en/artifacts#design-sync-requirements>). Otherwise, the sync stops or uploads to standalone claude.ai/design. The command is unavailable on [third-party providers](</docs/en/third-party-integrations>) and through a [Claude apps gateway](</docs/en/claude-apps-gateway#availability-and-limitations>)
`/desktop`| Continue the current session in the Claude Code Desktop app. Requires macOS or x64 Windows and a Claude subscription. Alias: `/app`
`/diff`| Review the changes in your working tree, including the edits Claude has made so far. See [Review changes with /diff](</docs/en/interactive-mode#review-changes-with-%2Fdiff>)
`/doctor [prompt-audit [path]]`| **[Skill](</docs/en/skills#bundled-skills>).** Run a setup checkup that diagnoses installation, settings, extension, and `CLAUDE.md` problems and proposes fixes that Claude applies after you confirm. For what the checkup covers, or to audit your instructions with `prompt-audit` instead, see [Check your setup with `/doctor`](</docs/en/skills#check-your-setup-with-/doctor>). The `prompt-audit` subcommand requires Claude Code v2.1.283 or later. Alias: `/checkup`
--- a/computer-use.md
+++ b/computer-use.md
@@ -40,7 +40,7 @@
Enable the server
-Select `computer-use` and choose **Enable**. The setting persists per project, so you only do this once for each project where you want computer use.
+Select `computer-use` and choose **Enable**. The setting persists per project.
3
--- a/cross-session-messaging.md
+++ b/cross-session-messaging.md
@@ -182,7 +182,7 @@
On macOS and Linux, Claude Code restricts the socket to your operating-system user. On native Windows, it instead requires each connection to authenticate first with a key that only your operating-system user can read. Either way, on a shared machine another user’s sessions can’t deliver to it. On macOS and Linux, Claude Code also refuses to create the socket in a directory it can’t accept, for example one that another user owns, and uses a private per-user directory, `/tmp/cc-socks-<uid>`, instead. When it can’t accept any directory, the session runs without an inbox: Claude Code shows a notice, `/status` shows `unavailable` and the reason in its `Peer address` row, and the [`--debug`](</docs/en/cli-reference#cli-flags>) log records the full refusal. Alongside the socket’s path, Claude Code exports a per-session token as [`CLAUDE_CODE_MESSAGING_TOKEN`](</docs/en/env-vars#variables>). A script posting to its own session’s socket can send `{"type":"auth","token":"<token>"}` as the first line of its connection, where `<token>` is the value of `CLAUDE_CODE_MESSAGING_TOKEN`. Whether Claude Code requires the line depends on the platform:
- * **macOS and Linux, including WSL 2** : the line is optional. Claude Code accepts a connection with or without it.
+ * **macOS and Linux, including WSL 2** : the line is optional.
* **Native Windows** : the line is required. Claude Code closes any connection whose first line isn’t a valid auth line and delivers nothing from that connection.
Open the connection only when the message you’re posting is ready. Claude Code closes a connection that hasn’t sent a complete line within 30 seconds, so capture a slow command’s output first and then open the connection to send it. Claude Code runs messages arriving on the socket through the same inbound controls as any other peer message, with one exception and one prerequisite:
--- a/desktop.md
+++ b/desktop.md
@@ -432,7 +432,7 @@
### Ask a side question without derailing the session
-A side chat lets you ask Claude a question about your session. Claude’s answers in a side chat aren’t added to the main conversation automatically. Use a side chat to understand a piece of code, check an assumption, or explore an idea. Press **Cmd+;** on macOS or **Ctrl+;** on Windows to open a side chat, or type `/btw` in the prompt box. The side chat can read everything in the main thread up to that point. When you’re done, close the side chat and return to the main session. Side chats are available in local, SSH, and WSL sessions.
+A side chat lets you ask Claude a question about your session. Claude’s answers in a side chat aren’t added to the main conversation automatically. Use a side chat to understand a piece of code, check an assumption, or explore an idea. Press **Cmd+;** on macOS or **Ctrl+;** on Windows to open a side chat, or type `/btw` in the prompt box. The side chat can read everything in the main thread up to that point. When you’re done, close the side chat and return to the main session. Side chats work in local, SSH, WSL, and cloud sessions.
### Watch background tasks
@@ -470,10 +470,10 @@
### Continue in another surface
-To continue a session somewhere else, open the session menu from the caret beside the session title or from the session’s row in the sidebar, then select **Open in** :
-
- * Select **Cloud** to continue the session as a [cloud session](</docs/en/claude-code-on-the-web>), with your conversation carried over as a summary. Before you confirm, the dialog states whether your files move too and whether this session is archived once the cloud one is ready. You can’t move a session that runs over SSH or in [WSL](</docs/en/desktop-wsl>) this way.
- * Select an installed editor or your file manager to open the session’s folder on disk there.
+To continue a session somewhere else, open the session menu from the caret beside the session title or from the session’s row in the sidebar:
+
+ * Select **Continue in cloud** to start a [cloud session](</docs/en/claude-code-on-the-web>) with your conversation carried over as a summary. Before you confirm, the dialog states whether your files move too and whether this session is archived once the cloud one is ready. You can’t move a session that runs over SSH or in [WSL](</docs/en/desktop-wsl>) this way.
+ * Select **Open in** , then an installed editor or your file manager, to open the session’s folder in that app
### Control which sessions appear on your other devices
--- a/desktop-scheduled-tasks.md
+++ b/desktop-scheduled-tasks.md
@@ -136,6 +136,8 @@
For tasks that need to run even when your computer is off, or that should trigger on an API call or GitHub event, create a [cloud scheduled task](</docs/en/routines>) instead.
+If a task’s model [requires usage credits](</docs/en/model-config#fable-and-usage-credits>) on your plan, Desktop can skip its runs, including **Run now**. To run the task again, open its detail page, then switch the model or choose to continue with usage credits.
+
### Find a run’s session
To open the session a run started, go to the task’s detail page and click that run’s row in the **History** list. The sidebar’s session list can show a **Scheduled** group as well, with one row per task. To open the session of a task’s latest run, click the task’s row in that group. To show the group, [check which layout you have](</docs/en/desktop#check-which-layout-you-have>):
@@ -143,7 +145,7 @@
* **Current layout** : open the [**Group and sort** menu](</docs/en/desktop#organize-and-find-sessions>), select **Show** , then select **Scheduled**. The group starts collapsed, so click its heading to expand it.
* **Earlier layout** : the group is in the session list with nothing to turn on
-In a run’s session, whichever way you reached it, you can see what Claude did, review changes, and respond to permission prompts. Claude can edit files, run commands, create commits, and open pull requests, the same as in a session you start yourself.
+In a run’s session, you can see what Claude did, review changes, and respond to permission prompts.
## Missed runs
@@ -158,7 +160,7 @@
In the **Code** tab, click **Scheduled** in the sidebar, then click a task in the list to open its detail page. From here you can:
* **Run now** : start the task immediately without waiting for the next scheduled time
- * **Status** : toggle between Active and Paused to pause or resume scheduled runs without deleting the task
+ * **Status** : toggle between Active and Paused to pause or resume scheduled runs
* **Edit** : change the instructions, schedule, folder, or other settings
* **Review history** : see every past run, including skipped runs. Hover a skipped entry to see why: your computer was asleep, the previous run was still in progress, or other scheduled tasks were already running. Click **Show more** to load older entries.
* **Review allowed permissions** : see and revoke saved tool approvals for this task from the **Always allowed** panel
--- a/env-vars.md
+++ b/env-vars.md
@@ -396,7 +396,7 @@
`CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE`| On Linux and WSL, set to a comma-separated list of the kinds of processes Claude Code [excludes from the tool memory cap](</docs/en/tools-reference#memory-limit-on-linux-and-wsl>), such as `mcp` or `lsp`. Set `none` to cap every kind, or `all-new` to cap only Bash, PowerShell, and Monitor tool commands. Claude Code keeps Bash, PowerShell, and Monitor tool commands under the cap whatever you list. Requires Claude Code v2.1.246 or later
`CLAUDE_CODE_TOOL_MEMORY_LIMIT`| On Linux and WSL, set to a size such as `4G` to [cap the memory that Bash and PowerShell tool commands can use](</docs/en/tools-reference#memory-limit-on-linux-and-wsl>), and Monitor tool commands on v2.1.246 or later. Write the size in plain digits, alone for a number of bytes or with a `K`, `M`, `G`, or `T` suffix. Set `0` or `off` to turn the cap off. Once the first process Claude Code starts has turned the cap on or off, a changed value takes effect the next time you launch `claude`. Requires Claude Code v2.1.233 or later
`CLAUDE_CODE_TRANSCRIPT_LOCAL_GC`| Set to `1` to limit how large the [transcript file](</docs/en/sessions#where-transcripts-are-stored>) of a long `-p` or Agent SDK session grows. After each compaction, once the file is larger than 5 MB, Claude Code removes the history from before that compaction. On v2.1.296 or later, the file stays as it is when removing that history would shrink it by less than 10%. Resuming the session restores the same conversation whether or not the file was trimmed. Set it in the environment you start Claude Code from, since a settings `env` block can’t turn it on. Requires Claude Code v2.1.287 or later
-`CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS`| Deadline in milliseconds before Claude Code cancels a dialog it forwards to a remote client such as a [Remote Control](</docs/en/remote-control>) or SDK host, or the approval dialog for a [held cross-session message](</docs/en/cross-session-messaging#control-inbound-messages>); permission prompts and `AskUserQuestion` questions use their own flows and aren’t governed by it. On Claude Code v2.1.236 or later, it also bounds the mid-session [Fable usage-credits consent prompt](</docs/en/model-config#fable-and-usage-credits>) in a session that may be running unattended. [Control inbound messages](</docs/en/cross-session-messaging#control-inbound-messages>) and [non-interactive sessions](</docs/en/cross-session-messaging#non-interactive-sessions>) cover the full held-message expiry rules, including the cases where the deadline doesn’t apply. Overrides the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) setting. `0` or a negative value disables the deadline. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>)
+`CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS`| Deadline in milliseconds for the dialogs that [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) covers. Overrides that setting. For held cross-session messages, see [Control inbound messages](</docs/en/cross-session-messaging#control-inbound-messages>) and [non-interactive sessions](</docs/en/cross-session-messaging#non-interactive-sessions>). `0` or a negative value disables the deadline. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>)
`CLAUDE_CODE_USE_ANTHROPIC_AWS`| Use [Claude Platform on AWS](</docs/en/claude-platform-on-aws>)
`CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD`| Use [Claude Models on Google Cloud (Anthropic managed)](</docs/en/claude-models-on-google-cloud-anthropic-managed>)
`CLAUDE_CODE_USE_BEDROCK`| Use [Amazon Bedrock](</docs/en/amazon-bedrock>)
@@ -554,12 +554,13 @@
* Run [`/restart`](</docs/en/commands>) on Pro, Max, and Ultra plans
* Run [`/ship` or `/steward`](</docs/en/ship-command>), except with Claude Code v2.1.331 or later on a third-party provider or in a Claude apps gateway session
* Run [`/claude-approvals`](</docs/en/commands>)
- * Sync the [skills](</docs/en/skills#where-synced-skills-load>) and [plugins](</docs/en/plugins/loading#synced-plugins>) enabled for your claude.ai account into your terminal sessions
+ * Automatically sync the [skills](</docs/en/skills#where-synced-skills-load>) and [plugins](</docs/en/plugins/loading#synced-plugins>) enabled for your claude.ai account into your terminal sessions
* Turn on the [You should know mod](</docs/en/interactive-mode#you-should-know-suggestions>)
* Use [the advisor tool](</docs/en/advisor#requirements>), except with Claude Code v2.1.300 or later on Claude Platform on AWS or [Claude Models on Google Cloud (Anthropic managed)](</docs/en/feature-availability#availability-by-model-provider>)
* Use [MCP tasks](</docs/en/mcp#requirements-for-mcp-tasks>) outside an interactive terminal session, or from a subagent
* Use [skills from MCP servers](</docs/en/mcp#use-skills-from-mcp-servers>)
* Have Claude read [another organization’s public artifact](</docs/en/artifacts#read-an-artifact-shared-with-you>)
+ * Publish a design system as an artifact with [`/design-sync`](</docs/en/artifacts#design-sync-requirements>)
* Get the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) by default for claude.ai and Console accounts on Windows with Git Bash installed; Claude Code routes shell commands through Git Bash unless you set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`. On Windows without Git Bash, the tool stays on
* Get [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>), which Claude Code turns on through a fetched flag
Show diff (124 lines)
--- a/errors.md
+++ b/errors.md
@@ -29,6 +29,7 @@
`Auto mode classifier transcript exceeded context window`| Server errors
`Agent aborted: auto mode classifier request refused by the safety safeguard`| Server errors
`The server-side auto mode classifier gave no verdict`| Server errors
+`Auto mode fell back to billed classifier requests`| [What else `denyInsteadOfPrompting` stops](</docs/en/settings-reference#what-else-denyinsteadofprompting-stops>)
`<tool> was not reviewed and did not run: the conversation is too long for auto mode's classifier`| Server errors
`Auto mode is unavailable — the server returned no safety verdict for the last 10 responses`| Server errors
`Agent terminated early due to an API error`| Server errors
@@ -37,6 +38,7 @@
`Usage credits ran out before the response was finished.`| [Add usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>)
`the prompt to confirm went unanswered · nothing was sent`, from v2.1.324| Usage limits
`Claude stopped here · send a message to be asked again`| Usage limits
+`Claude stopped here because <model> now requires usage credits`| Usage limits
`Server is temporarily limiting requests`| Usage limits
`Request rejected (429)`| Usage limits
`Credit balance is too low`| Usage limits
@@ -147,6 +149,7 @@
`Microsoft Foundry authentication failed`| Authentication
`Gateway refused the request`| Authentication
`Could not load AWS credentials` / `Could not load Google Cloud credentials`| Authentication
+`Could not load Azure credentials`| [Foundry credentials not loading](</docs/en/troubleshoot-install#bedrock-agent-platform-or-foundry-credentials-not-loading>)
`AWS default-chain credential resolve timed out`| Authentication
`Timed out after 60s waiting for AWS`| Authentication
`A request to AWS timed out. Check your network and proxy settings, then try again.`| Authentication
@@ -255,6 +258,7 @@
`Couldn't verify your organization's policy for cloud sessions`| Command-line errors
`Cloud sessions aren't available:` followed by why your organization’s policy couldn’t be loaded| Command-line errors
`Branch '<branch>' was not checked out`| [Teleport requirements](</docs/en/claude-code-on-the-web#teleport-requirements>)
+`Loaded from the session's last compaction, so the messages it summarized aren't here.`| [Continue a cloud session in your terminal](</docs/en/claude-code-on-the-web#from-cloud-to-terminal>)
`Cloud sessions aren't available with this Console sign-in. They need a claude.ai sign-in.`| [Unable to get organization UUID](</docs/en/claude-code-on-the-web#unable-to-get-organization-uuid>)
`Cloud sessions need a claude.ai sign-in`| [Unable to get organization UUID](</docs/en/claude-code-on-the-web#unable-to-get-organization-uuid>)
`Nothing was stashed: "<path>" is now a folder in place of a tracked file or link` / `are now folders in place of tracked files or links`| Command-line errors
@@ -390,6 +394,8 @@
`installed mods are off for now`| [Check whether mods can load](</docs/en/plugins/mods/troubleshoot#check-whether-mods-can-load>)
`the hooks worker was lost with <mod>'s <event> hook in flight`| Fix the named mod. For one cause, see [`it crashed the hooks worker`](</docs/en/plugins/mods/troubleshoot#it-crashed-the-hooks-worker>).
`dispatches in a row for fills by <mods>`| Change the named mods so they fill the prompt box at most eight times in a row.
+`changed a slash command's typed line`| [Change command arguments](</docs/en/plugins/mods/events#change-command-arguments>)
+`no prompt.submit in flight carries an attachment under that id`| Call `$.prompt.media` inside the `prompt.submit` hook whose `e.attachments` lists the `id` you pass. Look up `$.prompt.media` in [the types for your build](</docs/en/plugins/mods/create#get-the-types-for-your-build>).
`Error: No such tool available: <tool name>`| Tool errors
`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
@@ -446,7 +452,9 @@
`File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary`| Tool errors
`git is not installed on this Mac. To install it, run xcode-select --install, then try again.`| Tool errors
`Refusing to apply edits to <path>: a hook is configured for file edits in this session`| Tool errors
+`no longer leads where it did` / `Could not confirm that working directory "<cwd>" is the directory that this command was permission-checked in`| Ask Claude to try again.
`blocking because onFailure is "block"`| [Block the action when a hook fails](</docs/en/hooks#block-the-action-when-a-hook-fails>)
+`in one call, so a Write could lose`| Ask Claude to read the whole file in one Read call, or to use Edit.
`the source file is not valid UTF-8 text` / `the source file is not valid UTF-16 text`| Tool errors
`the source file has the replacement character U+FFFD`| Tool errors
`Not published: that file is on a network share`| Tool errors
@@ -538,6 +546,7 @@
`MCP server <name> is blocked by enterprise managed policy`| Configuration warnings
`"<name>" is a reserved MCP server name and was not loaded`| Configuration warnings
`Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.`| Configuration warnings
+`Your organization's policy could not be read, so this session cannot run a turn.`| Send the error to your administrator.
`Managed settings drop-in directory could not be read`| Configuration warnings
`Unable to read managed policy settings`| Configuration warnings
`Managed settings contain invalid entries, including PreToolUse/PermissionRequest hooks that are NOT loaded; fix or remove each entry:`| Configuration warnings
@@ -919,18 +928,20 @@
### The prompt to confirm went unanswered
-When the [Fable usage-credits consent prompt](</docs/en/model-config#fable-and-usage-credits>) closes with nobody answering it, Claude Code ends the turn with one of these messages:
+When you dismiss the mid-session [Fable usage-credits consent prompt](</docs/en/model-config#fable-and-usage-credits>) or it closes unanswered, Claude Code can end the turn with one of these messages:
Fable limit reached · continuing on Fable 5.1 uses usage credits, and the prompt to confirm went unanswered · nothing was sent · answer it where this session is running, or /model to change
Fable 5.1 now uses usage credits · the prompt to confirm went unanswered · nothing was sent · answer it where this session is running, or /model to change
-
-The messages name the session’s Fable model, so on Fable 5.2 they read `continuing on Fable 5.2` and `Fable 5.2 now uses usage credits`. With [Remote Control](</docs/en/remote-control>) connected, each message can instead end `Claude stopped here · send a message to be asked again, or switch models`. Before v2.1.257, the first message began `Fable 5 limit reached`. This happens in [Remote Control](</docs/en/remote-control>) sessions, [background sessions](</docs/en/agent-view>), [agent team](</docs/en/agent-teams>) teammate sessions, and sessions that another application hosts through the Agent SDK. For when Claude Code closes the prompt, see [Fable and usage credits](</docs/en/model-config#fable-and-usage-credits>). **What to do:**
-
- * Where the session runs, at the terminal or in the application hosting it, send another prompt and answer the consent prompt when it reappears. For a background session, attach to it from the [agents view](</docs/en/agent-view>) first. If the message says `Claude stopped here`, you can also reply from your connected device and answer the consent prompt there.
+ Claude stopped here because Fable 5.1 now requires usage credits.
+
+The messages name the session’s Fable model, so on Fable 5.2 you see text such as `continuing on Fable 5.2` and `Fable 5.2 now uses usage credits`. With [Remote Control](</docs/en/remote-control>) connected, the first two messages can instead end with `Claude stopped here · send a message to be asked again, or switch models`. Before v2.1.257, the first message began `Fable 5 limit reached`. For when Claude Code closes the prompt, see [Fable and usage credits](</docs/en/model-config#fable-and-usage-credits>). **What to do:**
+
+ * Where the session runs, at the terminal or in the application hosting it, send another prompt and answer the consent prompt when it reappears. For a background session, attach to it from the [agents view](</docs/en/agent-view>) first.
+ * With Remote Control connected to a terminal session, you can also reply from your device and answer the prompt if it appears there
* Run `/model` to switch to a model that doesn’t bill usage credits
* To give yourself more time, set [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) to a longer value or `"never"`
-Before v2.1.236, this message didn’t appear: while a Remote Control client was connected, Claude Code waited 60 seconds for an answer and then continued the turn on your default model.
+Before v2.1.236, these messages didn’t appear. While a Remote Control client was connected, Claude Code waited 60 seconds for an answer and then continued the turn on your default model.
### Server is temporarily limiting requests
@@ -2246,7 +2257,7 @@
* **Interactive CLI** : run `/model` to pick from models available to your account.
* **Non-interactive mode (`-p`)**: pass `--model` with a valid alias or ID, or set [`ANTHROPIC_MODEL`](</docs/en/env-vars>). The error text shows `Run --model` on this surface.
* **Agent SDK** : the error text omits the hint because the model is set programmatically. Set [`model` on `Options`](</docs/en/agent-sdk/typescript#options>) in TypeScript or [`ClaudeAgentOptions(model=...)`](</docs/en/agent-sdk/python#claudeagentoptions>) in Python, and handle the structured `model_not_found` error to surface your own retry or model picker.
- * Use an alias such as `sonnet` or `opus` instead of a full versioned ID. Aliases resolve to a maintained default so they don’t go stale. See [Model configuration](</docs/en/model-config>).
+ * On the Anthropic API, use an alias such as `sonnet` or `opus` instead of a full versioned ID. An alias resolves to a default model that can change over time. On a third-party provider, [pin a current model version](</docs/en/model-config#pin-models-for-third-party-deployments>).
* If the wrong model keeps coming back in the CLI, a stale ID is set somewhere. Check the places you can set a model in [priority order](</docs/en/model-config#setting-your-model>) and remove the stale value.
* Before v2.1.206, an expired claude.ai login that could no longer be refreshed failed every model with this error. Run `/login` on those versions.
* If [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>) points at an [LLM gateway](</docs/en/llm-gateway>) and every model fails this way, check that your gateway and its upstream accept [tool search](</docs/en/mcp#tool-search-through-a-gateway>) fields. By default, Claude Code sends `defer_loading` tool fields and `tool_reference` blocks, with the `anthropic-beta` header that enables them. Before v2.1.304, tool search was off behind a gateway unless you turned it on with `ENABLE_TOOL_SEARCH`.
@@ -2273,7 +2284,7 @@
On providers with provider-specific model IDs, the message may add a `Try '...' instead` suggestion that names your provider’s ID for a fallback model. **What to do:**
- * Run `/model` with no argument and pick from the models available to your account, or use a [model alias](</docs/en/model-config#model-aliases>) such as `sonnet`, which resolves to a maintained default
+ * Run `/model` with no argument and pick from the models available to your account, or on the Anthropic API use a [model alias](</docs/en/model-config#model-aliases>) such as `sonnet`
* If you typed a full ID, check it against your provider’s model catalog. A newly launched model can be available on the Anthropic API before your provider or region offers it.
* In the Agent SDK, `setModel()` fails with this message and the session keeps running on its previous model. In the TypeScript SDK, call [`supportedModels()`](</docs/en/agent-sdk/typescript#query-object>) to list the models you can switch to.
* Before v2.1.265, `/model` also rejected the `opusplan[1m]` alias spelling with this error. On those versions, update Claude Code, or set the model in [settings](</docs/en/model-config#setting-your-model>) or with `--model` instead.
@@ -3996,7 +4007,7 @@
### pkill pattern matches the Claude Code process
-A `pkill` command in a Bash tool call used a pattern, typically with `-f`, that matches the Claude Code process itself, so Claude Code refuses the command instead of letting it end the session. Claude Code tests the pattern with `pgrep` before running `pkill` and refuses when its own process ID is in the result. The check runs on Linux only; on macOS, `pkill` runs unmodified. Before v2.1.214, the command ran, and a matching pattern killed the Claude Code session mid-turn.
+Claude Code refused a `pkill` or `pkill -f` command in a Bash tool call because its pattern matches the Claude Code process itself. Claude Code refuses on Linux only, after testing the pattern with `pgrep` and finding its own process ID in the result. Before v2.1.214, the command ran on Linux, and a matching pattern killed the Claude Code session mid-turn.
pkill: refusing to run — this pattern matches the Claude CLI process (PID 12345). Narrow the pattern, or target your own children with `pkill -P $$ ...`.
@@ -4499,7 +4510,7 @@
This session was running agent 'code-reviewer', which is no longer available (no agent by that name in /home/you/project). Continuing with the default tools and system prompt — the agent's tool restrictions no longer apply. To restore it, re-create the agent, or resume with an explicit --agent <name>.
-The warning names only the directories Claude Code searched, and it appears in the resumed conversation whether you wake a [background session](</docs/en/agent-view>), run `/resume` or `claude --resume`, or resume in [non-interactive mode](</docs/en/headless>), where it also goes to stderr. Sessions using `--input-format stream-json` don’t show it, because the Agent SDK supplies agents after startup. Claude Code doesn’t save the fallback to the session, so the warning repeats on each resume until you act. The built-in `claude` agent doesn’t trigger the warning, since falling back to the default toolset changes nothing for it. Before v2.1.216, Claude Code silently continued as the default agent, and the lookup covered only the directory you resumed from, so a project-scoped agent was lost on any resume from another directory. **What to do:**
+The warning names only the directories Claude Code searched. Sessions using `--input-format stream-json` don’t show it, because the Agent SDK supplies agents after startup. Claude Code doesn’t save the fallback to the session, so the warning repeats on each resume until you act. The built-in `claude` agent doesn’t trigger the warning, since falling back to the default toolset changes nothing for it. Before v2.1.216, Claude Code silently continued as the default agent, and the lookup covered only the directory you resumed from, so a project-scoped agent was lost on any resume from another directory. **What to do:**
* Re-create the agent file at `.claude/agents/<name>.md` in the session’s project, or at `~/.claude/agents/<name>.md` for a personal agent, then resume again
* Or resume with `--agent <name>` naming an agent that does exist, to run the session as that agent instead
--- a/events.md
+++ b/events.md
@@ -218,11 +218,21 @@
return next({ ...e, context: [...(e.context ?? []), 'Current branch: ' + git.stdout.trim()] })
})
-When you send a prompt such as `open a PR for this change`, your message looks the same in the transcript, and Claude also reads a line such as `Current branch: feature/auth` after it. A prompt that doesn’t mention a pull request goes through unchanged, and `git` doesn’t run. To stop a prompt, return `{ drop: 'the reason' }` without calling `next`. The text goes back into the user’s prompt input, and they see `Prompt dropped by a hook:` followed by your reason, so address the reason to them. Don’t rely on `drop` to stop every prompt. For example, a prompt goes through in these cases:
-
- * **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.
- * **The prompt is the`/command` for a [skill with `context: fork`](</docs/en/skills#run-skills-in-a-subagent>)**: your hook doesn’t run. To stop the command, return `{ text: 'the reason' }` from a [`command.run`](</docs/en/plugins/mods/api#add-a-command>) hook without calling `next`.
+When you send a prompt such as `open a PR for this change`, your message looks the same in the transcript, and Claude also reads a line such as `Current branch: feature/auth` after it. A prompt that doesn’t mention a pull request goes through unchanged, and `git` doesn’t run.
+
+#### Stop a prompt
+
+To stop a prompt, return `{ drop: 'the reason' }` from your `prompt.submit` hook without calling `next`. The user gets the text back in the prompt input and sees `Prompt dropped by a hook:` followed by your reason. Some prompts still go through, for example:
+
+ * **Late drop** : if you return `drop` after `next(e)` has let the prompt through, the hook fails with a message that includes `a drop after its next() was answered`. Decide whether to drop before you call `next`.
+ * **Failed hook** : if your hook throws or times out before it calls `next`, Claude Code skips the hook. To stop the prompt instead, add a `.catch` handler.
+ * **Forked skill** : your hook doesn’t run for the `/command` of a [skill with `context: fork`](</docs/en/skills#run-skills-in-a-subagent>). To stop the command, return `{ text: 'the reason' }` from a [`command.run`](</docs/en/plugins/mods/api#add-a-command>) hook without calling `next`.
+
+#### Change command arguments
+
+To change a `/command`’s arguments, return `next({ ...e, args: newArgs })` from a [`command.run`](</docs/en/plugins/mods/api#add-a-command>) hook. Then, in any `prompt.submit` hook that rewrites `text`, skip the rewrite for commands, when `e.command` is set. `e.command` requires Claude Code v2.1.299 or later.
+
+#### Change system prompt, context, or skill text
[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>).
--- a/fullscreen.md
+++ b/fullscreen.md
@@ -1,8 +1,6 @@
Fullscreen rendering is a research preview. Whether you start in fullscreen or in the classic renderer depends on your setup. Run `/tui fullscreen` or `/tui default` to switch in your current conversation. Behavior may change based on feedback.
Fullscreen rendering is an alternative rendering path for the Claude Code CLI that eliminates flicker, keeps memory usage flat in long conversations, and adds mouse support. It draws the interface on the terminal’s alternate screen buffer, like `vim` or `htop`, and only renders messages that are currently visible. This reduces the amount of data sent to your terminal on each update. The difference is most noticeable in terminal emulators where rendering throughput is the bottleneck, such as the VS Code integrated terminal, tmux, and iTerm2. If your terminal scroll position jumps to the top while Claude is working, or the screen flashes as tool output streams in, this mode addresses those.
-
-The term fullscreen describes how Claude Code takes over the terminal’s drawing surface, the way `vim` does. It has nothing to do with maximizing your terminal window, and works at any window size.
## Enable fullscreen rendering
--- a/gitlab-ci-cd.md
+++ b/gitlab-ci-cd.md
@@ -20,7 +20,6 @@
* Claude API (SaaS)
* Amazon Bedrock (IAM-based access, cross-region options)
* Google Cloud’s Agent Platform (GCP-native, Workload Identity Federation)
- 3. **Sandboxed execution** : Each interaction runs in a container with strict network and filesystem rules. Claude Code enforces workspace-scoped permissions to constrain writes. Every change flows through an MR so reviewers see the diff and approvals still apply.
Pick regional endpoints to reduce latency and meet data-sovereignty requirements while using existing cloud agreements.
--- a/glossary.md
+++ b/glossary.md
@@ -57,7 +57,7 @@
### Checkpoint
-A restore point created at each prompt you send that starts a turn. Claude Code snapshots files before every edit so a checkpoint can revert them. Press `Esc` twice or run `/rewind` to restore code, conversation, or both to an earlier point, or to summarize part of the conversation from a selected message. Checkpoints are saved with the conversation, so a resumed session can still `/rewind` to them. Rewinding doesn’t undo a Bash command’s changes to a file unless Claude had already used its file editing tools on that file in your conversation. Learn more: [Checkpointing](</docs/en/checkpointing>)
+A restore point created at each prompt you send that starts a turn. Claude Code snapshots the files Claude edits so you can restore those files. Press `Esc` twice or run `/rewind` to restore code, conversation, or both to an earlier point, or to summarize part of the conversation from a selected message. Checkpoints are saved with the conversation, so a resumed session can still `/rewind` to them. Rewinding doesn’t undo a Bash command’s changes to a file unless Claude had already used its file editing tools on that file in your conversation. Learn more: [Checkpointing](</docs/en/checkpointing>)
### `.claude` directory
--- a/google-vertex-ai.md
+++ b/google-vertex-ai.md
@@ -123,7 +123,7 @@
Pin specific model versions when deploying to multiple users. Without pinning, model aliases such as `sonnet` and `opus` resolve to Claude Code’s built-in default for Google Cloud’s Agent Platform, which can lag the newest release and may not yet be enabled in your project. Claude Code falls back to an earlier or lower-tier model at startup when the default is unavailable, but pinning lets you control when your users move to a new model.
-Set these environment variables to specific Google Cloud’s Agent Platform model IDs. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Google Cloud’s Agent Platform resolves to Opus 5.5, and without `ANTHROPIC_DEFAULT_SONNET_MODEL`, the `sonnet` alias resolves to Sonnet 4.5. This example pins each alias to a specific version:
+Set these environment variables to specific Google Cloud’s Agent Platform model IDs. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Google Cloud’s Agent Platform resolves to Opus 5.5, and without `ANTHROPIC_DEFAULT_SONNET_MODEL`, the `sonnet` alias resolves to Sonnet 5.5. This example pins each alias to a specific version:
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'
export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-5'
@@ -134,14 +134,14 @@
Model type| Default value
---|---
Primary model| `claude-opus-5-5`
-Small/fast model| `claude-sonnet-4-5@20250929`
-
-Before v2.1.280, the primary model on Google Cloud’s Agent Platform defaulted to Opus 5 and the `opus` alias resolved to Opus 5 from v2.1.219. Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On Google Cloud’s Agent Platform, Claude Code uses the default Sonnet model for background tasks because Haiku may not be enabled in every project or region. Two selections change which model carries them:
+Small/fast model| `claude-sonnet-5-5`
+
+Before v2.1.280, the primary model on Google Cloud’s Agent Platform defaulted to Opus 5 and the `opus` alias resolved to Opus 5 from v2.1.219. Before v2.1.332, the `sonnet` alias and the small/fast model on Google Cloud’s Agent Platform were Sonnet 4.5. Background tasks such as session title generation use the small/fast model, normally a Haiku-class model. On Google Cloud’s Agent Platform, Claude Code uses the default Sonnet model for background tasks because Haiku may not be enabled in every project or region. Two selections change which model carries them:
* When you select a primary model with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, background tasks use that model. When Claude Code starts the session on the model you set with [`ANTHROPIC_DEFAULT_MODEL`](</docs/en/model-config#set-a-default-model-for-new-sessions>), background tasks use that model too. Setting `ANTHROPIC_DEFAULT_OPUS_MODEL` without `ANTHROPIC_DEFAULT_SONNET_MODEL` also counts as a selection, because the built-in Sonnet model may not be enabled in a project that steers its own Opus.
* To use Haiku for background tasks, set `ANTHROPIC_DEFAULT_HAIKU_MODEL` to a model ID that is available in your project.
-Opus models have a higher per-token price than Sonnet models, so if you don’t pin a primary model, you’re billed at the Opus rate. To use Sonnet 4.5 as the primary model, set `ANTHROPIC_MODEL` to its full model ID. A deployment that steers the default with `ANTHROPIC_DEFAULT_SONNET_MODEL` and doesn’t set `ANTHROPIC_DEFAULT_OPUS_MODEL` keeps its steered Sonnet model as the default.
+Opus models have a higher per-token price than Sonnet models, so if you don’t pin a primary model, you’re billed at the Opus rate. To use Sonnet 5 as the primary model, set `ANTHROPIC_MODEL` to its full model ID. A deployment that steers the default with `ANTHROPIC_DEFAULT_SONNET_MODEL` and doesn’t set `ANTHROPIC_DEFAULT_OPUS_MODEL` keeps its steered Sonnet model as the default, unless [`enforceAvailableModels`](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) is on.
To customize models further:
@@ -171,10 +171,10 @@
### When your organization enforces a model allowlist
-If you set [`enforceAvailableModels`](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) in managed settings, the startup model checks use only models your `availableModels` list permits. This requires Claude Code v2.1.287 or later. A list without `enforceAvailableModels` doesn’t restrict these checks. The checks compare each entry with the model ID they would send to Agent Platform, so write the list in those IDs. This example permits Opus 4.8 and Sonnet 4.5:
+To limit the startup model checks and their fallback to models your `availableModels` list permits, set [`enforceAvailableModels`](</docs/en/model-config#enforce-the-allowlist-for-the-default-model>) in managed settings. This requires Claude Code v2.1.287 or later. The checks compare each entry with the model ID they would send to Agent Platform, so write the list in those IDs. This example permits Opus 4.8 and Sonnet 4.6:
{
- "availableModels": ["claude-opus-4-8", "claude-sonnet-4-5@20250929"],
+ "availableModels": ["claude-opus-4-8", "claude-sonnet-4-6"],
"enforceAvailableModels": true
}
--- a/headless.md
+++ b/headless.md
@@ -34,7 +34,7 @@
[Custom agents](</docs/en/sub-agents#choose-the-subagent-scope>)| `--agents <file-or-json>`
A plugin| `--plugin-dir <path>`, `--plugin-url <url>`
-Hooks still don’t run in bare mode when you pass them with `--settings`, or in the [`hooks/hooks.json`](</docs/en/plugins/components#hooks>) or [`hooks` manifest key](</docs/en/plugins/manifest-reference#hooks>) of a plugin you load with a flag. Don’t use bare mode for a run that needs them. Bare mode also limits what happens while the session runs:
+Hooks still don’t run in bare mode when you pass them with `--settings`, or in the [`hooks/hooks.json`](</docs/en/plugins/components#hooks>) or [`hooks` manifest key](</docs/en/plugins/manifest-reference#hooks>) of a plugin you load with a flag. [Agent SDK hook callbacks](</docs/en/agent-sdk/hooks>) don’t run either. Don’t use bare mode for a run that needs these hooks. Bare mode also limits what happens while the session runs:
* **MCP servers** : only servers supplied on the command line connect, for example with `--mcp-config`. In an interactive session, Claude Code also skips the automatic IDE connection unless you pass `--ide`.
* **System reminders** : Claude receives your prompts and the tool results without the [system reminders](</docs/en/glossary#system-reminder>) Claude Code would add alongside them. For example, Claude isn’t told when a file it edited earlier changes on disk, and it doesn’t get the list of available skills, including skills from an `--add-dir` folder.
@@ -42,7 +42,7 @@
Before v2.1.286, these limits held only partly: an interactive `--bare` session connected the MCP servers that a normal session would, every `--bare` session sent system reminders, and background tasks stayed available.
-`--bare` is the recommended mode for scripted and SDK calls, and will become the default for `-p` in a future release.
+`--bare` is the recommended mode for scripted and SDK calls that don’t need hooks, and will become the default for `-p` in a future release.
### Background tasks at exit
@@ -205,7 +205,7 @@
Field| Type| Description
---|---|---
`plugins`| array| plugins that loaded successfully, each with `name` and `path`
-`plugin_errors`| array| plugin load-time errors, each with `plugin`, `type`, and `message`. Includes unsatisfied dependency versions and `--plugin-dir` load failures such as a missing path or invalid archive. A plugin that didn’t load is absent from `plugins`. The key is omitted when there are no errors
+`plugin_errors`| array| plugin load-time errors, each with `plugin`, `type`, and `message`. Includes unsatisfied dependency versions and `--plugin-dir` load failures such as a missing path or invalid archive. The key is omitted when there are no errors
When a `--plugin-dir` directory or archive itself fails to load, its `plugin_errors` entry includes the resolved absolute path as `path`. Use it to tell which of several `--plugin-dir` values failed. The `path` field requires Claude Code v2.1.283 or later. Use the MCP server fields the same way. When you pass [`--mcp-config`](</docs/en/cli-reference#cli-flags>) with `-p`, Claude Code waits for still-pending servers before running the first turn, up to the [`MCP_TIMEOUT`](</docs/en/env-vars>) startup timeout, 30 seconds by default. A remote server with a [cached tool list](</docs/en/agent-sdk/mcp#connection-timing>) skips the wait, shows `pending` in `system/init`, and connects on its first tool call. In a [self-hosted environment](</docs/en/self-hosted-environments-configuration#connection-timing>), a shorter wait applies instead. The wait requires Claude Code v2.1.221 or later. Claude Code validates each `--mcp-config` entry at startup and skips entries that fail validation, for example a `url` entry with no `type`. The run continues and exits cleanly, so check these fields to catch a server that never loaded:
--- a/hooks.md
+++ b/hooks.md
@@ -783,7 +783,7 @@
### Hook timeout
-Claude Code runs each callback with a timeout, which you set in seconds with the `timeout` field on its `HookMatcher`. When you don’t set one, Claude Code uses the event’s default: 600 seconds for most events, 30 seconds for `UserPromptSubmit`, `PreModelSwitch`, and `PostModelSwitch`, and 10 seconds for `MessageDisplay`. Claude Code runs `SessionEnd` callbacks during shutdown under the shorter [SessionEnd timeout budget](</docs/en/hooks#sessionend-input>), 1.5 seconds by default. When a callback exceeds its timeout, Claude Code cancels it and discards its output, and the session continues rather than hanging. What happens next depends on the event:
+Claude Code runs each callback with a timeout, which you set in seconds with the `timeout` field on its `HookMatcher`. When you don’t set one, Claude Code uses the event’s default: 600 seconds for most events, 30 seconds for `UserPromptSubmit`, `PreModelSwitch`, and `PostModelSwitch`, and 10 seconds for `MessageDisplay`. Claude Code runs `SessionEnd` callbacks during shutdown under the shorter [SessionEnd timeout budget](</docs/en/hooks#sessionend-input>), 1.5 seconds by default. When a callback exceeds its timeout, Claude Code cancels it and discards its output. On the events below, Claude Code then blocks the action or continues without the callback:
* `PreToolUse`: Claude Code blocks the tool call. If every other hook returned nothing or only an `allow` decision, the tool result tells Claude the hook didn’t respond before its timeout, and the turn continues. If another of your hooks already denied the call, its deny still reaches Claude: the tool result includes that hook’s reason, and the timeout text can follow it. Before v2.1.210, Claude Code reported the timeout to Claude as a user rejection, which made unattended sessions stop and wait for input.
* `PostToolUse` and `PostToolUseFailure`: Claude Code keeps the tool result and the turn continues.
@@ -792,7 +792,7 @@
* `SessionStart`: the timed-out callback counts as returning no output, and the session continues with the output of your other `SessionStart` hooks.
* `PreModelSwitch`: Claude Code blocks the model switch. A hook that doesn’t answer hasn’t approved the switch.
* `WorktreeCreate`: worktree creation fails with an error.
- * Other events, such as `Notification`, `PreCompact`, and `PostModelSwitch`: Claude Code logs the failure and continues. With `onFailure: "block"`, a timeout on `PreCompact` or `Elicitation` blocks the action.
+ * `Notification`, `PreCompact`, and `PostModelSwitch`: Claude Code logs the failure and continues. To block compaction when a `PreCompact` callback times out, set `onFailure: "block"`.
The first time a `Stop` or `SessionStart` callback times out in the main session, Claude Code also adds an [`SDKInformationalMessage`](</docs/en/agent-sdk/typescript#sdkinformationalmessage>) to the message stream saying the app driving the session didn’t respond. Later timeouts don’t repeat that message while your app stays unresponsive. If you interrupt the query while a callback is pending, Claude Code cancels the pending tool call. Before v2.1.208, the tool call could still proceed if you interrupted during a pending `PreToolUse` callback. If your callback needs more time, set a higher `timeout` on its `HookMatcher`. In TypeScript, use the `AbortSignal` from the third callback argument to handle cancellation gracefully when the timeout fires.
--- a/hooks-guide.md
+++ b/hooks-guide.md
@@ -749,7 +749,7 @@
## HTTP hooks
-Use `type: "http"` hooks to POST event data to an HTTP endpoint instead of running a shell command. The endpoint receives the same JSON that a command hook would receive on stdin, and returns results through the HTTP response body using the same JSON format. HTTP hooks are useful when you want a web server, cloud function, or external service to handle hook logic, such as a team’s shared audit service. The configuration below posts every successful tool call to a local logging service:
+Use `type: "http"` hooks to POST event data to an HTTP endpoint instead of running a shell command. The endpoint receives the same JSON that a command hook would receive on stdin, and returns results through the HTTP response body using the same JSON format. HTTP hooks are useful when you want a web server, cloud function, or external service to handle hook logic, such as a team’s shared audit service. The configuration below sends [`PostToolUse`](</docs/en/hooks#posttooluse>) events to an audit service, authenticating with a token from the `MY_TOKEN` environment variable:
{
"hooks": {
@@ -758,7 +758,7 @@
"hooks": [
{
"type": "http",
- "url": "http://localhost:8080/hooks/tool-use",
+ "url": "https://hooks.example.com/tool-use",
"headers": {
"Authorization": "Bearer $MY_TOKEN"
},
--- a/hosting.md
+++ b/hosting.md
@@ -219,6 +219,7 @@
* Set `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1` in `env`. [Auto memory](</docs/en/memory#auto-memory>) at `~/.claude/projects/<project>/memory/` loads into the system prompt regardless of `settingSources`. See [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) for the other inputs that load unconditionally.
* Point `CLAUDE_CONFIG_DIR` at a per-tenant directory so tenants do not share the `~/.claude.json` global config. When each config directory serves one working directory and you don’t pass a [`SessionStore`](</docs/en/agent-sdk/session-storage>), you can also set [`CLAUDE_CODE_PROJECT_DIR_NAME`](</docs/en/sessions#name-the-project-directory-yourself>) in `env` to keep the transcript paths under it short. Requires TypeScript Agent SDK v0.3.234 or later, or Python Agent SDK v0.2.140 or later.
* Use a per-tenant working directory. Pass `cwd` explicitly on every `query()` call.
+ * If you pass a `SessionStore`, give each tenant its own storage location, such as a separate key prefix in your adapter.
* Apply per-tenant egress rules at your proxy, such as distinct outbound IPs, credentials, or domain allowlists, so a compromised tenant cannot exfiltrate data via another tenant’s outbound policy.
The example below applies the settings, auto memory, config directory, and working directory options together. Construct `tenantDir` and `configDir` so each tenant gets a path no other tenant can read. In TypeScript, `env` replaces the subprocess environment, so spread `...process.env` to keep inherited variables like `PATH` and `ANTHROPIC_API_KEY`. In Python, `env` is merged on top of the inherited environment.
--- a/how-claude-code-works.md
+++ b/how-claude-code-works.md
@@ -64,7 +64,7 @@
## Work with sessions
-Claude Code saves your conversation locally as you work. Each message, tool use, and result is written to a plaintext JSONL file under `~/.claude/projects/`, which enables rewinding, resuming, and forking sessions. Before Claude makes code changes, it also snapshots the affected files so you can revert if needed. For paths, retention, and how to clear this data, see [application data in `~/.claude`](</docs/en/claude-directory#application-data>). **Sessions are independent.** Each new session starts with a fresh context window, without the conversation history from previous sessions. Claude can persist learnings across sessions using [auto memory](</docs/en/memory#auto-memory>), and you can add your own persistent instructions in [CLAUDE.md](</docs/en/memory>).
+Claude Code saves your conversation locally as you work. Each message, tool use, and result is written to a plaintext JSONL file under `~/.claude/projects/`, which enables rewinding, resuming, and forking sessions. Claude Code also snapshots the files Claude edits. For paths, retention, and how to clear this data, see [application data in `~/.claude`](</docs/en/claude-directory#application-data>). **Sessions are independent.** Each new session starts with a fresh context window, without the conversation history from previous sessions. Claude can persist learnings across sessions using [auto memory](</docs/en/memory#auto-memory>), and you can add your own persistent instructions in [CLAUDE.md](</docs/en/memory>).
### Work across branches
@@ -103,7 +103,7 @@
### Undo changes with checkpoints
-**File edits are reversible.** Before Claude edits a file, it snapshots the current contents. If something goes wrong, press `Esc` twice to rewind to a previous state, or ask Claude to undo. Checkpoints are separate from git and remain available when you resume a conversation. They only cover file changes, and a restore [skips symlinked and hard-linked files](</docs/en/checkpointing#symlinked-and-hard-linked-paths-not-restored>). Actions that affect remote systems (databases, APIs, deployments) can’t be checkpointed. You control those with your permission mode and permission rules.
+Claude Code snapshots the files Claude edits so you can restore those files. See [checkpoint limitations](</docs/en/checkpointing#limitations>). If something goes wrong, press `Esc` twice to rewind to a previous state, or ask Claude to undo. Checkpoints are separate from git and remain available when you resume a conversation. They only cover file changes, and a restore [skips symlinked and hard-linked files](</docs/en/checkpointing#symlinked-and-hard-linked-paths-not-restored>). Actions that affect remote systems (databases, APIs, deployments) can’t be checkpointed. You control those with your permission mode and permission rules.
### Control what Claude can do
--- a/interface.md
+++ b/interface.md
@@ -137,7 +137,7 @@
Each hook also does something the code doesn’t make plain:
- * **[`session.start`](</docs/en/plugins/mods/reference#session>)** also reads the saved count from `$.store`, a key-value store that persists between sessions.
+ * **[`session.start`](</docs/en/plugins/mods/reference#session>)** also reads the saved count from `$.store`, a key-value store that persists between sessions on your machine.
* **[`command.run`](</docs/en/plugins/mods/api#add-a-command>)** only tells Claude Code the pane exists. Opening a pane draws nothing by itself: Claude Code then fires `ui.render` to ask what goes in it.
* **`ui.render`** returns the element tree, a `Box` that holds other boxes, text, and buttons, and builds it again from `tab` and `count` each time it runs.
@@ -368,6 +368,8 @@
* **The`backdrop` fields**: `scene` is a [name](</docs/en/plugins/mods/reference#limits>) you choose for a backdrop your hook draws. For the other fields and `overrideColorScheme`, 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 theme for each session** : a mod that calls `$.theme.set` replaces the session’s backdrop, colors, message style, and sound, and a mod that calls `$.theme.clear()` removes them, whichever mod set them. Call `$.theme.clear()` only when the user asks for it.
+
+If a backdrop you draw with an [`Svg`](</docs/en/plugins/mods/reference#elements>) element is blank in the Desktop app, check its markup against the [backdrop `Svg` limits](</docs/en/plugins/mods/reference#limits>).
### Animate a backdrop with a shader
@@ -468,7 +470,7 @@
Try the backdrop
-Start a new local session in the Code tab by sending a message. The background turns dark blue. If it doesn’t, turn off any other mod that sets a theme and start a new session, because a session has one theme. If the background still doesn’t change, [find out why the mod does nothing](</docs/en/plugins/mods/troubleshoot#find-out-why-a-mod-does-nothing>).Move the pointer. A blue light follows it, and fades when you stop. If no light appears, see Fix a backdrop that shows only the `Svg`. Click the empty space beside the conversation, then move the pointer again. The light is now orange. If it’s still blue, answer any permission prompt or question from Claude, then click again quickly without dragging, away from messages and buttons.
+Start a new local session in the Code tab by sending a message. The background turns dark blue. If it doesn’t, turn off any other mod that sets a theme and start a new session, because a session has one theme. If the background still doesn’t change, [find out why the mod does nothing](</docs/en/plugins/mods/troubleshoot#find-out-why-a-mod-does-nothing>).Move the pointer. A blue light follows it, and fades when you stop. If no light appears, see Fix a backdrop that shows only the `Svg`.Click the empty space beside the conversation, then move the pointer again. The light is now orange. If it’s still blue, answer any permission prompt or question from Claude, then click once away from messages and buttons, without holding or dragging, and move the pointer.
To try a change, save `glow.ts` or `register.js`, and the mod reloads in the running session. If the change doesn’t show within a few seconds, send a message to load it. To turn the mod off, move `glow` out of `~/.claude/skills/` and start a new session. Follow these rules for pointer input, the shader, and the `Svg` when you build on the example:
@@ -1048,7 +1050,7 @@
* **Add a note** : type a line and press Enter. The line appears as a new row, and the field empties.
* **Delete a note** : press Tab until the note’s `x` button has the focus, then press Enter. The `x` is the button’s label and not a hotkey, so typing the letter doesn’t press it.
-Each change follows the same render cycle as `hello-tabs`: the callback changes `notes`, calls `redraw`, and saves the list to `$.store`. If your hook draws the pane again while the user is typing a note, the field keeps their text as long as the hook passes the same `value` each time. To replace their text with your own, pass a different `value`. The example saves the notes and doesn’t load them. To bring them back in the next session, read them in a `session.start` hook, the way `hello-tabs` reads `count`. These props make up the field’s line, `Note: Type a note and press Enter ⏎ add`:
+Each change follows the same render cycle as `hello-tabs`: the callback changes `notes`, calls `redraw`, and saves the list to `$.store`. If your hook draws the pane again while the user is typing a note, the field keeps their text as long as the hook passes the same `value` each time. To replace their text with your own, pass a different `value`. The example saves the notes and doesn’t load them. To bring them back in the next local session, read them in a `session.start` hook, the way `hello-tabs` reads `count`. These props make up the field’s line, `Note: Type a note and press Enter ⏎ add`:
Prop| In the example| What it is
---|---|---
@@ -1120,9 +1122,16 @@
---|---|---
A module-level variable| The module reloads, which happens every time you save a file during development| Values you can lose, as `tab` is in `hello-tabs`
`$.state`| The session ends, or the user runs `/clear`, `/resume`, or `/branch`| Values a drawing depends on that should survive a reload
-`$.store`| Your mod deletes it, or no session reads or writes the store for [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>). The store is a key-value store, saved as a JSON file of your plugin’s own under `~/.claude/plugins/store/`.| Settings, history, anything the user expects to find next time
-
-`$.store.get(key)` resolves to the value or `undefined`, and `$.store.set(key, value)` takes any JSON value.
+`$.store`| Your mod deletes it, or no session reads or writes the store for [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>). In an Anthropic-hosted cloud session, values can be missing sooner.| Settings, history, anything the user expects to find next time
+
+`$.store` is a key-value store, saved as a JSON file of your plugin’s own under `~/.claude/plugins/store/`. `$.store.get(key)` resolves to the value or `undefined`, and `$.store.set(key, value)` takes any JSON value.
+
+### Handle missing `$.store` values in cloud sessions
+
+In an Anthropic-hosted [cloud environment](</docs/en/cloud-environments>), Claude Code saves `$.store` on the session’s VM, so `$.store.get` resolves to `undefined` for a key your mod saved only on another machine or VM. Give each value a default, as in `(await $.store.get('count')) ?? 0`, to cover cases such as these:
+
+ * **A user starts a new cloud session** : it begins without the values that earlier local or cloud sessions saved
+ * **A user reopens a session after its VM was[reclaimed](</docs/en/claude-code-on-the-web#environment-expired>)**: it runs on a fresh VM, without the values it saved itself
### Keep a value in `$.state`
@@ -1216,7 +1225,7 @@
### Save from more than one session
-Every session on your machine that runs your mod shares one `$.store`. A `get` followed by a `set` isn’t atomic. When two sessions each read a value, change it, and write it back, they race, and the second write replaces the first. To make that less likely:
+Local sessions on your machine that run your mod share one `$.store`. A `get` followed by a `set` isn’t atomic. When two sessions each read a value, change it, and write it back, they race, and the second write replaces the first. To make that less likely:
* **Give each item its own key** : a `set` changes only its own key, so sessions that write different keys don’t overwrite each other
* **Read again right before you write** : for a value that several sessions change, `get` the key in the callback and build the new value from that, not from a copy you loaded at `session.start`. Another session’s write is still lost if it lands between your `get` and your `set`.
--- a/keybindings.md
+++ b/keybindings.md
@@ -625,7 +625,7 @@
* In vim NORMAL mode, `?` shows the help menu (vim behavior)
* In vim NORMAL mode, `/` opens history search, the same as Ctrl+R in standard mode
-In the `Other` row of a question Claude asks, Escape doesn’t cancel the question right away in vim mode. Except in [screen reader mode](</docs/en/accessibility>), the row starts in INSERT mode each time you focus it. When you press Escape in the `Other` row, the row switches to NORMAL mode or drops a half-typed vim command, and the question stays open. Press Escape again in NORMAL mode to cancel the question.
+In the `Other` row of a question Claude asks, Escape doesn’t cancel the question right away in vim mode. Except in [screen reader mode](</docs/en/accessibility>), the row starts in INSERT mode each time you focus it. When you press Escape in the `Other` row, the row switches to NORMAL mode or drops a half-typed vim command. Press Escape again in NORMAL mode to cancel the question.
### Cancel a question with one key press
--- a/managed-mcp.md
+++ b/managed-mcp.md
@@ -241,9 +241,11 @@
#### How `serverCommand` entries match
-A `serverCommand` entry holds the command and its arguments as one array, as in `{ "serverCommand": ["npx", "-y", "server"] }`. Claude Code compares that array with the command and arguments in the server’s configuration:
-
- * **Commands match exactly.** Every argument, in order. `["npx", "-y", "server"]` does not match `["npx", "server"]` or `["npx", "-y", "server", "--flag"]`.
+A `serverCommand` entry holds the command and its arguments as one array, as in `{ "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "."] }`. Claude Code compares that array with the command and arguments in the server’s configuration:
+
+ * **Commands match exactly.** Every argument, in order. The entry `["npx", "-y", "@modelcontextprotocol/server-filesystem", "."]` doesn’t match either of these commands:
+ * `["npx", "@modelcontextprotocol/server-filesystem", "."]`, which drops `-y`
+ * `["npx", "-y", "@modelcontextprotocol/server-filesystem", ".", "--flag"]`, which adds an argument
* **The`env` block isn’t compared.** `["node", "server.js"]` matches a server that runs that command with any `env` values. Some environment variables change what `node` loads at startup. To set the `env` values yourself, define the server in `managed-mcp.json`.
#### How `serverUrl` entries match
@@ -325,7 +327,7 @@
],
"deniedMcpServers": [
{ "serverName": "dangerous-server" },
- { "serverCommand": ["npx", "-y", "unapproved-package"] },
+ { "serverCommand": ["python", "/usr/local/bin/unapproved-server.py"] },
{ "serverUrl": "https://*.untrusted.example.com/*" }
]
}
@@ -356,13 +358,13 @@
{
"allowedMcpServers": [
- { "serverCommand": ["npx", "-y", "approved-package"] }
+ { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "."] }
]
}
Server| Result
---|---
-Stdio server with `["npx", "-y", "approved-package"]`| Allowed: matches command
+Stdio server with `["npx", "-y", "@modelcontextprotocol/server-filesystem", "."]`| Allowed: matches command
Stdio server with `["node", "server.js"]`| Blocked: doesn’t match command
HTTP server named `my-api`| Blocked: no name entries to match
@@ -371,13 +373,13 @@
{
"allowedMcpServers": [
{ "serverName": "github" },
- { "serverCommand": ["npx", "-y", "approved-package"] }
+ { "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "."] }
]
}
Server| Result
---|---
-Stdio server named `local-tool` with `["npx", "-y", "approved-package"]`| Allowed: matches command
+Stdio server named `local-tool` with `["npx", "-y", "@modelcontextprotocol/server-filesystem", "."]`| Allowed: matches command
Stdio server named `local-tool` with `["node", "server.js"]`| Blocked: command entries exist but doesn’t match
Stdio server named `github` with `["node", "server.js"]`| Blocked: stdio servers must match commands when command entries exist
HTTP server named `github`| Allowed: matches name
--- a/marketplace-reference.md
+++ b/marketplace-reference.md
@@ -210,7 +210,7 @@
An `npm` source takes these fields:
- * `package`: a registry package name such as `@your-org/formatter`, a name with a version appended such as `@your-org/formatter@2.0.0`, or an `https` link to the package’s tarball file
+ * `package`: a registry package name such as `@<SCOPE>/<NAME>`, a name with a version appended such as `@<SCOPE>/<NAME>@2.0.0`, or an `https` link to the package’s tarball file
* `version`: a version, a semver range, or a dist-tag, used when `package` is a package name with no version appended. Omit it to fetch `latest`
* `registry`: a registry URL for a package that isn’t on the default registry
@@ -226,7 +226,7 @@
"name": "formatter",
"source": {
"source": "npm",
- "package": "@your-org/formatter",
+ "package": "@<SCOPE>/<NAME>",
"version": "^2.0.0",
"registry": "https://npm.example.com"
}
--- a/mcp.md
+++ b/mcp.md
@@ -361,7 +361,7 @@
mcpServers: {
"api-server": {
command: "npx",
- args: ["-y", "@your-org/api-mcp-server"],
+ args: ["-y", "<MCP_SERVER_PACKAGE>"],
env: {
API_KEY: process.env.API_KEY
}
@@ -375,7 +375,7 @@
mcp_servers={
"api-server": {
"command": "npx",
- "args": ["-y", "@your-org/api-mcp-server"],
+ "args": ["-y", "<MCP_SERVER_PACKAGE>"],
"env": {"API_KEY": os.environ["API_KEY"]},
}
},
@@ -386,7 +386,7 @@
"mcpServers": {
"api-server": {
"command": "npx",
- "args": ["-y", "@your-org/api-mcp-server"],
+ "args": ["-y", "<MCP_SERVER_PACKAGE>"],
"env": {
"API_KEY": "${API_KEY}"
}
--- a/microsoft-foundry.md
+++ b/microsoft-foundry.md
@@ -84,7 +84,7 @@
Pin specific model versions for every deployment. Without pinning, model aliases such as `sonnet` and `opus` resolve to Claude Code’s built-in default for Microsoft Foundry. That default can lag the newest release and may not yet be available in your account.When your resource has no deployment for the default, Claude Code switches to an older model or the request fails. A switch shows a message that starts with `Switched to <fallback> because <model> is not available`. When you create Azure deployments, select a specific model version rather than “auto-update to latest.”
-Set the model variables to match the deployment names you created in step 1. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Microsoft Foundry resolves to Opus 4.6. Set it to the ID of a newer Opus model, such as Opus 4.8:
+Set the model variables to match the deployment names you created in step 1. Without `ANTHROPIC_DEFAULT_OPUS_MODEL`, the `opus` alias on Microsoft Foundry resolves to Opus 5.5. Before v2.1.332 it resolves to Opus 4.6. Set the variable to the ID of the Opus model you deployed, such as Opus 4.8:
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8'
export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-5'
Show diff (138 lines)
--- a/model-config.md
+++ b/model-config.md
@@ -36,8 +36,9 @@
Anthropic API| Opus 5.5| Sonnet 5.5| Haiku 5.5
[Claude Platform on AWS](</docs/en/claude-platform-on-aws>)| Opus 5.5| Sonnet 4.6| Haiku 4.5
[Claude Models on Google Cloud (Anthropic managed)](</docs/en/claude-models-on-google-cloud-anthropic-managed>)| Opus 5.5| Sonnet 5.5| Haiku 4.5
-Amazon Bedrock, Google Cloud’s Agent Platform| Opus 5.5| Sonnet 4.5| Haiku 4.5
-Microsoft Foundry| Opus 4.6| Sonnet 4.5| Haiku 4.5
+Amazon Bedrock| Opus 5.5| Sonnet 4.5| Haiku 4.5
+[Mantle](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) alone| Opus 5.5| Sonnet 5| Haiku 4.5
+Google Cloud’s Agent Platform, Microsoft Foundry| Opus 5.5| Sonnet 5.5| Haiku 4.5
Unless you set `ANTHROPIC_DEFAULT_FABLE_MODEL`, the `fable` alias resolves to Fable 5 in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions and to Fable 5.2 everywhere else. A gateway that isn’t configured to serve `claude-fable-5-2` rejects requests for that model. To use Fable 5.2 through a gateway that serves it, select it with `/model claude-fable-5-2`. Where `opus` or `sonnet` resolves to an older model, newer models are available by selecting the full model name explicitly or setting `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`. Earlier versions resolve these aliases to older models. For the version at which each alias changed, see Version history. Aliases point to the recommended version for your provider and update over time. To pin to a specific version, use the full model name, for example `claude-opus-5-5`, or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`.
@@ -71,16 +72,14 @@
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.
-
-After you choose to continue on Fable using usage credits, Claude Code doesn’t show the prompt again. In a session with [Remote Control](</docs/en/remote-control>) connected, a [background session](</docs/en/agent-view>), or an [agent team](</docs/en/agent-teams>) teammate’s session, nobody may be at the terminal, so Claude Code holds the mid-session consent prompt for the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default. If nobody has answered by the deadline, Claude Code ends the turn without sending the request and adds a notice to the transcript, which the Remote Control client also shows. Your model selection is unchanged, and Claude Code asks for consent again on your next message. What you can do while the prompt is waiting depends on the session:
-
- * With Remote Control connected or in a teammate’s session, press any key at the terminal to cancel the deadline, and Claude Code waits for your answer.
- * With Remote Control connected in an interactive terminal session, you can also answer on your connected device, and that answer lasts for that session. Requires Claude Code v2.1.323 or later.
- * In a background session, answer before the deadline.
- * If you send a new message from the remote client before anyone has typed at the terminal, Claude Code ends the turn the same way, and your new message starts the next turn. After someone types at the terminal, Claude Code keeps waiting for the answer and queues your new message behind it.
-
-In a session another application hosts through the [Agent SDK](</docs/en/agent-sdk/overview>), whether the prompt appears is up to that application. If it appears and nobody answers before the same [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, Claude Code ends the turn without sending the request. In [non-interactive mode](</docs/en/headless>) with the `-p` flag, and in an Agent SDK application that doesn’t show the prompt, Claude Code never asks for consent. When a Fable request there would bill to usage credits, Claude Code bills it without asking.
+ * Mid-session, Claude Code either [ends the turn](</docs/en/errors#the-prompt-to-confirm-went-unanswered>) or continues it on your default model.
+
+When you’re signed in with `/login` and continue on Fable at the terminal or in VS Code, Claude Code saves that choice for later sessions. With [Remote Control](</docs/en/remote-control>) connected in an interactive terminal session, you can also answer the mid-session prompt on your device, and that answer lasts for that session. Answering on your device requires Claude Code v2.1.323 or later. The mid-session prompt waits until you answer. It can instead close at the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, five minutes by default, in these sessions:
+
+ * **Remote Control connected, or a[split-pane teammate](</docs/en/agent-teams#choose-a-display-mode>)**: press the right arrow key at the terminal to cancel the deadline.
+ * **[Background session](</docs/en/agent-view>), or an [Agent SDK](</docs/en/agent-sdk/overview>) application such as VS Code**: answer before the deadline, even with Remote Control connected.
+
+If the deadline passes, Claude Code ends the turn without sending the request and keeps your model. The prompt returns with your next message on Fable. If you send a message while the prompt is open, the turn can end the same way. In [non-interactive mode](</docs/en/headless>) with the `-p` flag, and in an Agent SDK application that doesn’t show the prompt, Claude Code never asks for consent. When a Fable request there would bill to usage credits, Claude Code bills it without asking.
### Setting your model
@@ -103,7 +102,7 @@
* If model restrictions exclude the recorded model or it isn’t available to your account, and your admin hasn’t set an organization default model, the Default option resolves as if nothing were recorded.
* If you choose Default or `opusplan` in `/model`, the recorded choice doesn’t change.
-If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only and isn’t saved as your default. `/model` in that mode requires Claude Code v2.1.205 or later. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. To find out why a hook blocked a switch and what to do, see [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>). If a [managed plugin](</docs/en/settings-reference#enabledplugins>) or its hooks fail to load, you can still switch models. The plugin’s PreModelSwitch hooks don’t run, so a switch that one of them would have blocked can go ahead. Other PreModelSwitch hooks that loaded still run and can block it. If Claude Code before v2.1.323 refuses the switch with `so organization-managed PreModelSwitch hooks could not be checked`, update Claude Code. To see what failed, run `/plugin` in your session and open the [**Errors** tab](</docs/en/plugins/troubleshooting#failed-to-load-hooks-from-and-hooks-that-dont-fire>). If nothing is listed there, start a new session with `claude --debug` from your shell and switch to a different model, then read the [debug log](</docs/en/hooks#debug-hooks>). After you fix the plugin, or a [plugin update](</docs/en/plugins/install#keep-plugins-updated>) brings your admin’s fix to your machine, run `/reload-plugins` in your session to get its hooks running. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch:
+If you switch models with `/model`, the switch also reaches [subagents that inherit the main conversation’s model](</docs/en/sub-agents#choose-a-model>), because Claude Code resolves their model from the one your session is using when Claude starts them. Switch to Opus before Claude delegates research or test runs to one of them, and that work runs on Opus too. To keep a custom subagent on a smaller model, set `model` in its definition. If you set a model with `/model` in [non-interactive mode](</docs/en/headless>), with the `-p` flag, your choice applies to the current session only. `/model` in that mode requires Claude Code v2.1.205 or later. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. Prices in the `/model` picker appear when Claude Code talks to the Anthropic API, directly or through an [LLM gateway](</docs/en/llm-gateway>) that proxies it, and the price on a row is the price of the model that row selects. On [third-party providers](</docs/en/third-party-integrations>) such as Amazon Bedrock and on the [Claude apps gateway](</docs/en/claude-apps-gateway>), your provider or gateway determines what you pay, so picker rows show no price. The price is a display label only; it doesn’t affect which model a row selects or what your provider bills. Before v2.1.206, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) and gateway sessions showed Anthropic list prices, and a row could show the price of a different model than the one it selected. If you or your organization configure [PreModelSwitch hooks](</docs/en/hooks#premodelswitch>), they run before a requested switch applies and can block it or ask you to confirm. To find out why a hook blocked a switch and what to do, see [Model switch was blocked by a PreModelSwitch hook](</docs/en/errors#model-switch-was-blocked-by-a-premodelswitch-hook>). If a [managed plugin](</docs/en/settings-reference#enabledplugins>) or its hooks fail to load, you can still switch models. The plugin’s PreModelSwitch hooks don’t run, so a switch that one of them would have blocked can go ahead. Other PreModelSwitch hooks that loaded still run and can block it. If Claude Code before v2.1.323 refuses the switch with `so organization-managed PreModelSwitch hooks could not be checked`, update Claude Code. To see what failed, run `/plugin` in your session and open the [**Errors** tab](</docs/en/plugins/troubleshooting#failed-to-load-hooks-from-and-hooks-that-dont-fire>). If nothing is listed there, start a new session with `claude --debug` from your shell and switch to a different model, then read the [debug log](</docs/en/hooks#debug-hooks>). After you fix the plugin, or a [plugin update](</docs/en/plugins/install#keep-plugins-updated>) brings your admin’s fix to your machine, run `/reload-plugins` in your session to get its hooks running. When you switch models through the [Agent SDK](</docs/en/agent-sdk/overview>) `setModel()` method, through an app such as the [Desktop app](</docs/en/desktop>), or from a device connected through [Remote Control](</docs/en/remote-control>), Claude Code checks the value at the switch:
* **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.
@@ -186,7 +185,7 @@
* A version prefix such as `claude-sonnet-4-5`. It also matches later model IDs that extend it with another segment. For example, `claude-fable-5` permits Fable 5, Fable 5.1, and Fable 5.2, while `claude-fable-5-1` permits Fable 5.1 only
* A full model ID such as `claude-sonnet-4-5-20250929`
-To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model:
+A prefix-matched list that names `claude-sonnet-5` lets an unpinned `sonnet` run Sonnet 5.5, because that entry also matches the later version. This applies from v2.1.332 on Google Cloud’s Agent Platform and Microsoft Foundry. To block a model the list permits, or to make each model ID entry permit only the version it names, see Block specific models or versions. On platforms that embed Claude Code and set [`CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`](</docs/en/env-vars>), the host’s model configuration takes precedence over managed model settings, while a managed `availableModels` allowlist stays in force unless the host supplies its own; [Exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>) says which keys and variables the host overrides. When `availableModels` is set, the allowlist applies everywhere a user can specify a model:
* **Main session model** : `/model`, the `--model` flag, the `ANTHROPIC_MODEL` environment variable, the `model` setting, `ANTHROPIC_DEFAULT_MODEL`, and the model restored when resuming a session
* **Alias resolution** : the `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, `ANTHROPIC_DEFAULT_HAIKU_MODEL`, and `ANTHROPIC_DEFAULT_FABLE_MODEL` environment variables cannot redirect an allowed alias to a model outside the list
@@ -196,7 +195,7 @@
* **Advisor model** : the configured [`advisorModel`](</docs/en/advisor>) setting and the `--advisor` flag
* **Background agent model** : the model selected in the [dispatch picker](</docs/en/agent-view>)
-On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to its usual model when the allowlist permits that model. When the allowlist blocks that model, Claude Code substitutes the newest version of the family that the allowlist permits and shows a notice naming both the requested and substituted models. With `["sonnet", "claude-opus-4-6"]`, for example, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. Claude Code handles any other blocked selection according to where the model was set:
+On the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), a model family alias, `opus`, `sonnet`, `haiku`, or `fable`, resolves to its usual model when the allowlist permits that model. When the allowlist blocks that model, Claude Code substitutes the newest version of the family that the allowlist permits and shows a notice naming both the requested and substituted models. With `["sonnet", "claude-opus-4-6"]`, for example, both `/model opus` and `--model opus` select Claude Opus 4.6, the newest permitted Opus. Before v2.1.205, an alias whose newest released version was outside the list was rejected or replaced like any other blocked selection, even when the list permitted an older version. The substitution needs a permitted version to land on: when the allowlist permits no version of the alias’s family, the alias follows the rejection and replacement behavior below like any other blocked value. When a selection stays blocked, Claude Code handles it according to where the model was set:
* **`/model`** : Claude Code rejects the switch with an error
* **`--model` flag, `ANTHROPIC_MODEL`, or the `model` setting**: Claude Code replaces the value at startup with a warning naming both the requested and substituted models, and the session starts on the default model
@@ -210,9 +209,9 @@
Claude Code hides excluded models from the `/model` picker. Whether a model ID you list also gets a row of its own differs by provider:
* **Anthropic API,[Claude Platform on AWS](</docs/en/claude-platform-on-aws>), [Claude apps gateway](</docs/en/claude-apps-gateway>), or an [LLM gateway](</docs/en/llm-gateway>) set through `ANTHROPIC_BASE_URL`**: an Anthropic model ID you list that has no built-in picker row appears as its own labeled row. Claude Code adds such a row for Opus, Sonnet, and Haiku versions, such as an older version that the list pins. If you set `replaceBuiltInOptions` in a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, that row doesn’t appear. Before v2.1.199, such an ID was selectable only by typing `/model <id>`.
- * **Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry** : unless a model ID you list starts with `anthropic.`, Claude Code doesn’t add a row for it, whether it’s an Anthropic model ID or a provider-specific one. Mantle model IDs carry that prefix. To show a listed version that has no built-in row, also add it to a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, which accepts IDs in your provider’s format.
-
-Model changes that Claude Code makes on your behalf are checked the same way:
+ * **Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry** : unless a model ID you list starts with `anthropic.`, Claude Code doesn’t add a row for it. Mantle model IDs carry that prefix. To show a listed version that has no built-in row, also add it to a [`modelPicker`](</docs/en/settings-reference#modelpicker>) lineup, which accepts IDs in your provider’s format.
+
+When Claude Code changes models on your behalf, it avoids excluded models in most of these cases:
* **Fallback model chains** : entries outside the allowlist are dropped
* **Plan-mode upgrades** : on the Anthropic API and Claude Platform on AWS, an upgrade such as `opusplan` to an excluded model uses the newest permitted version of the upgrade family. On providers with provider-specific model IDs, and when no version is permitted, the upgrade is skipped and planning continues on the session’s model
@@ -358,7 +357,7 @@
* **Pro, Max, Ultra, Team, Enterprise, and Anthropic API** : defaults to Opus 5.5
* **Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), Amazon Bedrock, and Google Cloud’s Agent Platform** : defaults to Opus 5.5
- * **Microsoft Foundry** : defaults to Sonnet 4.5
+ * **Microsoft Foundry** : defaults to Sonnet 5.5
Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Ultra, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Ultra, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform. When an admin has set an organization default model, `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with `ANTHROPIC_DEFAULT_MODEL`, under the conditions listed in its section, or to the model recorded on your account. When nothing is recorded on your account, managed settings enforce the allowlist for the Default model, and the account-type default is not in `availableModels`, `default` resolves to the enforced Default instead of the account-type default above. When an organization default and enforcement both apply, the organization default replaces the account-type default first and enforcement then applies to it: an allowlisted organization default is kept, while one outside the list resolves to the enforced Default.
@@ -446,13 +445,13 @@
* Claude Code must recognize the current model as a fallback source. Fable models are recognized when the model ID contains `claude-fable-5`, matches the value of `ANTHROPIC_DEFAULT_FABLE_MODEL`, or is mapped with `modelOverrides`. Opus 5.5, Sonnet 5.5, and Opus 5 are recognized by their provider model ID or a `modelOverrides` mapping.
* An Opus target must resolve in your deployment, whichever model refused: set `ANTHROPIC_DEFAULT_OPUS_MODEL`, or keep an Opus 4.8 entry in the provider’s model list. Without one, fallback stays off for every source model, including Sonnet 5.5, and flagged requests end with a refusal.
- * The flagged category’s fallback model must resolve in your deployment. From a Fable model, Opus 5.5, or Opus 5, if you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, flagged requests re-run on that model for every category that has a fallback; a biology flag on Opus 5 still ends with a refusal. If you don’t set it, cybersecurity-flagged requests re-run on the Opus 4.8 entry, and biology-flagged requests from a Fable model or Opus 5.5 on an Opus 5 entry. From Sonnet 5.5, cybersecurity-flagged requests re-run on the model you set in `ANTHROPIC_DEFAULT_SONNET_MODEL`, or on a Sonnet 5 entry in the provider’s model list if you don’t set it.
+ * The flagged category’s fallback model must resolve in your deployment. If you set `ANTHROPIC_DEFAULT_OPUS_MODEL`, that model is the fallback for Fable models, Opus 5.5, and Opus 5 in each category that has a fallback model.
If either model can’t be identified, Claude Code doesn’t switch. The flagged request ends with a refusal message, and you can switch models with `/model` and retry. To make both models identifiable, set the pins for your source model:
- * **Fable models** : set `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable model ID so Claude Code recognizes it as a fallback source.
- * **Every source model** : set `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID to turn fallback on and give the flagged categories a target. A pin that names a model outside the Opus family, or the model that refused, leaves the refusal standing.
- * **Sonnet 5.5** : in addition to the Opus pin, set `ANTHROPIC_DEFAULT_SONNET_MODEL` or keep a Sonnet 5 entry in the provider’s model list to supply the model the request re-runs on. A Sonnet pin that names a model outside the Sonnet family, or Sonnet 5.5 itself, leaves the refusal standing.
+ * **Fable models** : set `ANTHROPIC_DEFAULT_FABLE_MODEL` to your Fable model ID, and set `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID.
+ * **Opus 5.5 or Opus 5** : start your session with the full model ID, and set `ANTHROPIC_DEFAULT_OPUS_MODEL` to another Opus model ID. If Claude Code recognizes that ID as a non-Opus model or the model that refused, the request ends with the refusal.
+ * **Sonnet 5.5** : start your session with the full model ID, and set `ANTHROPIC_DEFAULT_OPUS_MODEL` to an Opus model ID. Set `ANTHROPIC_DEFAULT_SONNET_MODEL` to the Sonnet model ID you want cybersecurity-flagged requests to re-run on. If Claude Code recognizes that ID as a non-Sonnet model or Sonnet 5.5, the request ends with the refusal.
The fallback model must also have a context window at least as large as the session’s, or Claude Code doesn’t switch and the flagged request ends with the same refusal. On these providers the source models run with the 1M context window by default. Pin a model that also does, such as Opus 4.8 in `ANTHROPIC_DEFAULT_OPUS_MODEL` or Sonnet 5 in `ANTHROPIC_DEFAULT_SONNET_MODEL`, by an ID Claude Code can match to that model.
@@ -755,7 +754,13 @@
On Amazon Bedrock and Google Cloud’s Agent Platform, a user who starts the session on a specific Sonnet or Opus version, for example with `--model`, `ANTHROPIC_MODEL`, or the `model` setting, pins that version as the session’s default for the matching alias: the startup check skips the built-in default it replaces and shows no fallback notice. Before v2.1.211, the check ran and could show a notice even when a session model was explicitly configured.
-Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.
+Set the model environment variables to specific version IDs as part of your initial setup. Pinning lets you control when your users move to a new model.On [Google Cloud’s Agent Platform](<https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude/sonnet-4-5>) and [Microsoft Foundry](<https://platform.claude.com/docs/en/about-claude/model-deprecations>), move off Sonnet 4.5 before it retires there on November 30, 2026:
+
+ * **On Claude Code before v2.1.332** : the `sonnet` alias resolves to Sonnet 4.5, and so does the default model on Microsoft Foundry. Set `ANTHROPIC_DEFAULT_SONNET_MODEL` to a newer model such as `claude-sonnet-5`, or on Microsoft Foundry to your deployment’s name. Set `ANTHROPIC_DEFAULT_OPUS_MODEL` too, or the default model on Agent Platform can become the Sonnet model you set.
+ * If an enforced `availableModels` list has `sonnet` and no Opus, put the newer model’s ID there in its place.
+ * **On any version** : replace Sonnet 4.5 wherever your configuration names it, such as `ANTHROPIC_MODEL`, `--model`, or `availableModels`.
+
+After that date, requests to Sonnet 4.5 on those platforms stop working, including background tasks.
Use the following environment variables with version-specific model IDs for your provider:
@@ -796,7 +801,7 @@
* **Recognized** : the exact ID of a model Claude Code knows, such as its Anthropic API ID or your provider’s or gateway’s form of it, with or without the `[1m]` suffix. Pin `us.anthropic.claude-sonnet-4-5-20250929-v1:0` and the row reads `Sonnet 4.5`.
* **Not recognized** : any other ID, such as an application inference profile ARN or a model version Claude Code doesn’t know, unless a `modelOverrides` entry maps a model to that ID. On Microsoft Foundry, deployment names are user-defined, so Claude Code never recognizes a pinned ID there, mapped or not, and the row shows the deployment name by default.
-When a row shows the model’s name, its default description includes the pinned ID so you can still see which ID is pinned. Claude Code may also not recognize which features a pinned model supports. You can set the display name and description yourself and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`.
+When a row shows the model’s name, its default description includes the pinned ID. Claude Code may also not recognize which features a pinned model supports. You can set the display name and description yourself and declare capabilities with companion environment variables for each pinned model. These variables take effect on third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](</docs/en/llm-gateway>). They have no effect when connecting directly to `api.anthropic.com`.
Environment variable| Description
---|---
@@ -856,6 +861,7 @@
Version| Change
---|---
+v2.1.332| `sonnet` resolves to Sonnet 5.5 on Google Cloud’s Agent Platform and Microsoft Foundry, and to Sonnet 5 on Mantle alone. `opus` and `default` on Foundry resolve to Opus 5.5 and Sonnet 5.5
v2.1.321| `fable` resolves to Fable 5.2, except in Claude apps gateway sessions
v2.1.321| `best` resolves to the same model as `opus`. Earlier versions use the model `fable` resolves to, where Fable is available
v2.1.293| `haiku` resolves to Haiku 5.5 on the Anthropic API
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -1162,7 +1162,7 @@
#### Hook plugin metrics event
-Logged when an official-marketplace plugin hook emits per-invocation metrics. Only plugins installed from an official Anthropic marketplace can emit these. Third-party marketplace plugins and user-configured hooks don’t emit to this event. Use this event to monitor plugin behavior such as finding rates, costs, and durations from your own observability stack. **Event Name** : `claude_code.hook_plugin_metrics` **Attributes** :
+Logged when an official-marketplace plugin hook emits per-invocation metrics. Only plugins installed from an official Anthropic marketplace can emit these. Use this event to monitor plugin behavior such as finding rates, costs, and durations from your own observability stack. **Event Name** : `claude_code.hook_plugin_metrics` **Attributes** :
* All standard attributes
* `event.name`: `"hook_plugin_metrics"`
--- a/org.md
+++ b/org.md
@@ -242,7 +242,8 @@
"source": { "source": "github", "repo": "anthropics/claude-plugins-official" }
},
"your-marketplace": {
- "source": { "source": "github", "repo": "your-org/your-marketplace" }
+ "source": { "source": "github", "repo": "your-org/your-marketplace" },
+ "autoUpdate": true
}
},
"enabledPlugins": {
@@ -294,7 +295,8 @@
{
"extraKnownMarketplaces": {
"stable-tools": {
- "source": { "source": "github", "repo": "your-org/stable-tools" }
+ "source": { "source": "github", "repo": "your-org/stable-tools" },
+ "autoUpdate": true
}
}
}
--- a/plugin-evals.md
+++ b/plugin-evals.md
@@ -177,7 +177,7 @@
Three settings change that exclusion:
* **Every grader excluded** : if every grader in a case is in the excluded set, they’re scored normally instead, since there would be nothing left to score.
- * **`arm: both`** : set `arm: both` on a grader to score it in both arms regardless, which is what you want for a “must not invoke the skill” check with `min: 0` and `max: 0`.
+ * **`arm: both`** : set `arm: both` on a grader to score it in both arms, which is what you want for a “must not invoke the skill” check with `min: 0` and `max: 0`.
* **`--ablation none`** : under `--ablation none` nothing is excluded, so the same suite can produce a different absolute score in the two modes.
### Use a different eval directory
--- a/python.md
+++ b/python.md
@@ -792,7 +792,7 @@
`stderr`| `Callable[[str], None] | None`| `None`| Callback function for stderr output from CLI
`can_use_tool`| `CanUseTool` ` | None`| `None`| Tool permission callback, invoked only when the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) falls through to a prompt. Not invoked for calls auto-approved by `allowed_tools`, allow rules, or `permission_mode`. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). See `CanUseTool` for details
`hooks`| `dict[HookEvent, list[HookMatcher]] | None`| `None`| Hook configurations for intercepting events
-`user`| `str | None`| `None`| On POSIX platforms, the OS user account the Claude Code subprocess runs as. Claude Code keeps the parent process’s environment, including `HOME`, and runs in `cwd`
+`user`| `str | None`| `None`| On POSIX platforms, the OS user account the Claude Code subprocess runs as. Claude Code keeps the parent process’s groups and environment, including `HOME`, and runs in `cwd`
`include_partial_messages`| `bool`| `False`| Include partial message streaming events. When enabled, `StreamEvent` messages are yielded
`include_hook_events`| `bool`| `False`| Include hook lifecycle events in the message stream as `HookEventMessage` objects
`forward_subagent_text`| `bool`| `False`| Forward subagent text and thinking blocks in the message stream. Without this option, Claude Code omits the text and thinking blocks of a subagent that runs in the [foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>). For nested subagents, skills with `context: fork`, and the Claude Code version each needs, see [Follow subagent messages](</docs/en/headless#follow-subagent-messages>). Requires Python Agent SDK 0.2.140 or later
@@ -2550,7 +2550,7 @@
"firstPage": int | None, # Optional document page number of the first extracted page
}
-**Output (type:`"file_unchanged"`):**
+**Output (type:`"file_unchanged"`), before Claude Code v2.1.317:**
{
"type": "file_unchanged", # The file is unchanged since Claude last read it in this session, so the content isn't repeated
--- a/reference.md
+++ b/reference.md
@@ -408,6 +408,9 @@
`$.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.pointer`](</docs/en/plugins/mods/interface#animate-a-backdrop-with-a-shader>) clicks| Two a second. The app drops the rest.
A [`Shader`](</docs/en/plugins/mods/interface#animate-a-backdrop-with-a-shader>)’s `values`| Eight numbers
+Nested tags in a [backdrop](</docs/en/plugins/mods/interface#put-a-backdrop-behind-the-conversation>) `Svg`’s `source` in the Desktop app| 128 levels, counting the root `<svg>`. Quote every attribute value, or tags that aren’t nested can count as levels. Past the limit, the `Svg` isn’t drawn.
+Elements in a backdrop `Svg`’s `source` in the Desktop app| 512 filter elements whose names start with `fe`, such as `<feOffset>` or `<feMergeNode>`, and 256 `<pattern>`, `<mask>`, `<clipPath>`, and `<marker>` elements combined. Past either limit, the `Svg` isn’t drawn.
+Deepest level of nested tags times a link count in a backdrop `Svg`’s `source` in the Desktop app| 4,096, counting the root `<svg>` as a level. The link count is the total of `<use>`, `<pattern>`, `<mask>`, `<clipPath>`, and `<marker>` elements, capped at the number of `id` attributes. Past the limit, the `Svg` isn’t drawn.
`$.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' }`.
--- a/relevance.md
+++ b/relevance.md
@@ -91,7 +91,7 @@
* `file`: matched case-insensitively against the manifest file’s path. The path is typically absolute, so anchor the pattern at the end rather than the start. Paths aren’t separator-normalized for this signal, so Windows paths use backslashes.
* `pattern`: matched case-sensitively against that file’s contents.
-The following example uses `manifestDeps` to suggest your plugin once Claude has read a `package.json` that depends on your SDK’s npm package, named `your-sdk` here.
+The following example uses `manifestDeps` to suggest your plugin once Claude has read a `package.json` that depends on your SDK’s npm package, named `<SDK_PACKAGE>` here.
{
"name": "your-plugin",
@@ -101,7 +101,7 @@
"manifestDeps": [
{
"file": "[/\\\\]package\\.json$",
- "pattern": "\"your-sdk\"\\s*:"
+ "pattern": "\"<SDK_PACKAGE>\"\\s*:"
}
]
}
--- a/remote-control.md
+++ b/remote-control.md
@@ -232,7 +232,7 @@
* **Day to day** : members with an enrolled device and a recent sign-in see no prompts. When the sign-in ages past 18 hours, the next Remote Control interaction shows a single Face ID, Touch ID, Windows Hello, or passkey prompt.
* **Unenrolled devices** : Remote Control sessions cannot be viewed or steered until the device is enrolled. Regular Claude chat on that device is unaffected.
* **No platform authenticator** : members on a machine without Face ID, Touch ID, or Windows Hello can use a hardware security key, or sign in again instead of stepping up.
- * **In the terminal** : the machine running Claude Code receives its own credential automatically when the developer signs in to the CLI. There is no separate enrollment step in the terminal.
+ * **In the terminal** : the machine running Claude Code receives its own credential automatically when the developer signs in to the CLI.
### Manage enrolled devices
@@ -298,7 +298,7 @@
* **Attachments that don’t download** : if a file you attach from your phone or browser can’t be downloaded to your machine, Claude still receives your message and the files that were downloaded. In place of the missing files, Claude Code adds a note such as `[1 of 3 attachments did not arrive]` to the message.
* **Presence heartbeats failing** : if an interactive session disconnects with `could not reach the Remote Control server for about 30 minutes`, run `/remote-control` to reconnect.
* **Forwarded dialogs expire** : Claude Code keeps permission prompts and `AskUserQuestion` questions open until you answer them. When Claude Code forwards another kind of dialog to the remote session, such as the model-choice prompt shown after a safety refusal, it waits five minutes by default, then closes the dialog and continues with the dialog’s no-action default. Set [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) to adjust or disable the deadline. Requires Claude Code v2.1.224 or later.
- * **Unanswered Fable usage-credits prompts end the turn** : if nobody answers the [Fable usage-credits consent prompt](</docs/en/model-config#fable-and-usage-credits>) by the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline, the turn ends and nothing is sent; see [The prompt to confirm went unanswered](</docs/en/errors#the-prompt-to-confirm-went-unanswered>). In an interactive session in a terminal, the prompt can also appear on your connected device, and you can answer it there. Requires Claude Code v2.1.323 or later.
+ * **Unanswered Fable usage-credits prompts can end the turn** : the [consent prompt](</docs/en/model-config#fable-and-usage-credits>) can close at the [`dialogExpiry`](</docs/en/settings-reference#dialogexpiry>) deadline. Claude Code then [ends the turn](</docs/en/errors#the-prompt-to-confirm-went-unanswered>) without sending the request. In an interactive session in a terminal, the prompt can also appear on your connected device, and you can answer it there. Requires Claude Code v2.1.323 or later.
* **Some commands are local-only** : commands that only run in the terminal interface, such as `/plugin` or `/resume`, work only from the local CLI, whether or not you pass an argument. `/claude-api` is also unavailable when you type it from mobile or web. Claude can still [load that skill on its own](</docs/en/skills#work-on-claude-api-projects>) there. The following work from mobile and web:
* Text-output commands: `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/usage-credits`, `/recap`, and `/reload-plugins`. `/usage-credits` replies in text, such as where to manage usage credits. `/reload-plugins` works only when the session runs in an interactive terminal; a session without one declines it.
* `/model`, `/effort`, `/fast`, `/color`, and `/rename`: pass the value as an argument, for example `/model sonnet` or `/effort high`. From mobile and web, `/model` and `/effort` take the argument in place of the terminal picker or slider.
@@ -361,7 +361,7 @@
### ”Remote Control requires a full-scope login token”
-You’re authenticated with a long-lived token from `claude setup-token` or the `CLAUDE_CODE_OAUTH_TOKEN` environment variable. These tokens can only make model requests, so they can’t establish Remote Control sessions. Run `claude auth login` to authenticate with a full-scope session token instead.
+You’re authenticated with a long-lived token from `claude setup-token` or the `CLAUDE_CODE_OAUTH_TOKEN` environment variable. These tokens can’t establish Remote Control sessions. Run `claude auth login` to authenticate with a full-scope session token instead.
### ”Unable to determine your organization for Remote Control eligibility”
@@ -459,7 +459,7 @@
### ”Your organization requires Trusted Devices for Remote Control, but this device is not enrolled”
-Your organization has Trusted Devices enabled and this machine has not enrolled yet. Run `/login` in Claude Code. Enrollment happens as part of sign-in, and there is no separate enrollment command.
+Your organization has Trusted Devices enabled and this machine has not enrolled yet. Run `/login` in Claude Code. Enrollment happens as part of sign-in.
### ”session expired for trusted-device check”
--- a/routines.md
+++ b/routines.md
@@ -51,7 +51,7 @@
* If a menu opens with **Create with Claude** and **Set up manually** , select **Set up manually** to open the dialog. **Create with Claude** lets you describe the task in a chat and have Claude create it instead.
* If a full page opens in place of the dialog, go to Full-page form.
-If **Repositories** and **Environment** are already showing when the dialog opens, see how that dialog differs. Otherwise, this dialog also creates scheduled tasks for claude.ai chat. To make yours what the dialog calls a Claude Code task, select a repository or add a GitHub event or API trigger in the steps that follow. That kind of task runs Claude Code in a cloud session.
+If **Repositories** and **Environment** are already showing when the dialog opens, see how that dialog differs.
2
@@ -81,7 +81,11 @@
Select repositories
-In the **Repository** row below **Trigger** , select one or more GitHub repositories for Claude to work in. If the row isn’t there, expand **Advanced settings** and find **Repository** on the **General** tab.Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes.
+In the **Repository** row below **Trigger** , select one or more GitHub repositories for Claude to work in. If the row isn’t there, expand **Advanced settings** and find **Repository** on the **General** tab.
+
+If the row says **Picking a repository makes this a Claude Code task** , select a repository so the task runs Claude Code in a [cloud session](</docs/en/claude-code-on-the-web>). If you skip the repository in that case and add only a schedule trigger, you create a scheduled task for claude.ai chat.
+
+Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes.
5
@@ -417,7 +421,7 @@
* **App** : in some accounts the sidebar entry and page title read **Routines** , the button reads **New routine** , and other labels say routine. To create a task there, see Full-page form.
* **Web address** : `claude.ai/code/routines`
- * **CLI** : the `/routines` alias for `/schedule`, the command’s description, and Claude’s replies while it sets up a task
+ * **CLI** : the `/routines` alias for `/schedule`
* **API** : the `/fire` endpoint path, its beta header, its response `type`, the `<routine-fire-payload>` tag, and the [Trigger a routine through the API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) reference page
* **Organization settings** : the **Scheduled tasks (Was Routines)** or **Routines** toggle
@@ -439,6 +443,10 @@
### Scheduled tasks are off for your organization
Cloud scheduled tasks are off for your organization, and you can’t change that from your local configuration. Ask your Team or Enterprise Owner whether they can turn on the **Scheduled tasks (Was Routines)** or **Routines** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>).
+
+### A scheduled task turned off with a usage credits notice
+
+If a task’s model [requires usage credits](</docs/en/model-config#fable-and-usage-credits>) on your plan, claude.ai can skip the next run and turn the task off. On the task’s detail page, turn the task back on to use usage credits, or change its model before you turn it on.
### Warnings under History
--- a/sandbox-environments.md
+++ b/sandbox-environments.md
@@ -100,7 +100,7 @@
## Dev containers
-A dev container runs Claude Code inside a Docker container that VS Code or a compatible editor manages, with your project mounted in. You can define your own with a `.devcontainer/` directory in your repository. The claude-code repository publishes an [example dev container](</docs/en/devcontainer>) with a default-deny iptables firewall as a starting point. Copy it into your repository and adjust the firewall allowlist, base image, and pinned Claude Code version to fit your environment. Because the firewall blocks unapproved egress, a configuration like this supports running Claude Code with `--dangerously-skip-permissions` for unattended work.
+A dev container runs Claude Code inside a Docker container that VS Code or a compatible editor manages, with your project mounted in. You can define your own with a `.devcontainer/` directory in your repository. The claude-code repository publishes an [example dev container](</docs/en/devcontainer>) with a default-deny iptables firewall as a starting point. Copy it into your repository and adjust the firewall allowlist, base image, and pinned Claude Code version to fit your environment.
## Custom container
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -135,7 +135,7 @@
## How session-scoped scheduled tasks run
-The scheduler checks every second for due tasks and enqueues them at low priority. A scheduled prompt fires between your turns, not while Claude is mid-response. If Claude is busy when a task comes due, the prompt waits until the current turn ends. All times are interpreted in your local timezone. A cron expression like `0 9 * * *` means 9am wherever you’re running Claude Code, not UTC.
+The scheduler checks every second for due tasks and enqueues them at low priority. A scheduled prompt fires between your turns, not while Claude is mid-response. If Claude is busy when a task comes due, the prompt waits until the current turn ends. All times are interpreted in your local timezone. A cron expression like `0 9 * * *` means 9am wherever you’re running Claude Code.
### Jitter
--- a/security-guidance.md
+++ b/security-guidance.md
@@ -1,4 +1,4 @@
-The security guidance plugin makes Claude review its own code changes for common vulnerabilities while it works and fix what it finds in the same session. The plugin catches issues such as injection, unsafe deserialization, and unsafe DOM APIs before the code reaches a pull request, reducing how much security review falls to human reviewers downstream. Once installed, the plugin runs automatically. There is nothing to invoke and no separate command to remember. The plugin is the in-session companion to [Code Review](</docs/en/code-review>), which runs on pull requests. This plugin reduces what reaches the PR. Code Review catches what does. For how the plugin layers with on-demand review and CI scanning, or to scan code you already have rather than changes Claude is writing, see How this fits with other security tools.
+The security guidance plugin makes Claude review its own code changes for common vulnerabilities while it works and fix what it finds in the same session. The plugin catches issues such as injection, unsafe deserialization, and unsafe DOM APIs before the code reaches a pull request, reducing how much security review falls to human reviewers downstream. Once installed, the plugin runs automatically. The plugin is the in-session companion to [Code Review](</docs/en/code-review>), which runs on pull requests. This plugin reduces what reaches the PR. Code Review catches what does. For how the plugin layers with on-demand review and CI scanning, or to scan code you already have rather than changes Claude is writing, see How this fits with other security tools.
## Prerequisites
--- a/self-hosted-environments-configuration.md
+++ b/self-hosted-environments-configuration.md
@@ -255,7 +255,7 @@
---|---
`CLAUDE_RUNNER_WORK_ORDER_FILE`| Path to a temp file containing the signed work-order JWT the new runner registers with. Deleted after the hook exits. Don’t log the file’s contents.
`CLAUDE_RUNNER_ORDER_ID`| Opaque idempotency key, unique per spawn request and safe for Kubernetes resource names. Use only the order ID as your provisioner’s dedup key.
-`CLAUDE_RUNNER_SESSION_ID`| The session this request is for, as the `session_...` ID in the session’s URL. It repeats on every re-request for the session, so use it for logging and routing, not as a dedup key. Empty for pre-warming requests, which boot a standby runner ahead of any specific session when [`--min-idle`](</docs/en/self-hosted-environments-reference#orchestrator-cli-flags>) is set, so don’t assume the variable is set.
+`CLAUDE_RUNNER_SESSION_ID`| The session this request is for, as the `session_...` ID in the session’s URL. It repeats on every re-request for the session, so use it for logging and routing, not as a dedup key. Empty for pre-warming requests, which boot a standby runner ahead of any specific session when [`--min-idle`](</docs/en/self-hosted-environments-reference#orchestrator-cli-flags>) is set.
`CLAUDE_RUNNER_SESSION_UUID`| The same session ID in canonical UUID form. Empty for pre-warming requests.
`CLAUDE_RUNNER_ATTEMPT`| A per-session counter to use for logging. It isn’t a retry count or a request count. `0` for pre-warming requests, though a request for a session can carry `0` too.
`CLAUDE_RUNNER_ORDER_SERVER_TIME`| Server time from the poll response’s HTTP `Date` header. When the hook verifies the work-order JWT’s `exp`, compare against this value instead of the local clock to tolerate skew. Empty when the gateway omitted the header.
@@ -673,7 +673,7 @@
### Replace an earlier copy of the Stop hook script
-Search your copy of `stop-hook-nudge.sh` for the text `checked out in the project directory`. If it’s missing, you have an earlier copy. Replace it now with the current script wherever you installed it, then restart the runners. Keep your Stop hook settings, except to raise `timeout` on a large checkout. After you replace the script, the prompt about unpushed commits no longer includes the branch name. If your earlier copy prompted Claude about uncommitted files in a submodule, that prompt stops. For how the current script treats submodules, see Submodules and the Stop hook.
+Search your copy of `stop-hook-nudge.sh` for the text `checked out in the project directory`. If the text is missing, replace that earlier copy now with the current script wherever you installed it, then restart the runners. Keep your Stop hook settings, except to raise `timeout` on a large checkout. If your checkouts have submodules, check how the current script treats them. Any prompt about uncommitted files in a submodule stops after you replace the script.
Hooks run outside the [Bash sandbox](</docs/en/sandboxing>), so the current script’s git calls skip some git features that can start a program named in the checkout’s git settings. They don’t skip them all. Don’t count on the sandbox alone, and isolate sessions as [Harden your deployment](</docs/en/self-hosted-environments-deploy#harden-your-deployment>) describes.
--- a/self-hosted-environments-quickstart.md
+++ b/self-hosted-environments-quickstart.md
@@ -38,7 +38,7 @@
### Run the guided setup
-The guided setup walks you through creating the environment in the admin UI, starts a local runner with the secret file you save, confirms that the runner registers, and writes a cheat sheet to `./runner-setup/CHEAT-SHEET.md`. Before you run it, confirm your sign-in and version:
+The guided setup walks you through creating the environment in the admin UI, starts a local runner, confirms that the runner registers, and writes a cheat sheet to `./runner-setup/CHEAT-SHEET.md`. Before you run it, confirm your sign-in and version:
* **Sign-in** : run it on a machine where you’ve signed in with `claude auth login` using an account that holds an Owner role. With only an API key or a third-party model provider, the session starts but its organization checks fail.
* **Version** : confirm the version check passed. On versions older than 2.1.224, the setup command starts a Claude session with the words as the prompt instead of the guided setup.
@@ -109,7 +109,7 @@
* **The session failed to start** : fix the cause, then start the runner again
* **Lost contact** : the log shows a `[runner:fatal]` line with `runner record gone server-side` or with `poll auth failed`. If the runner loses contact with Anthropic for a while, for example because the host sleeps, it can exit when it next reaches Anthropic.
-A finished turn doesn’t end your test session. After the first turn the session is still attached and the runner is still up, so you can send the session a follow-up message without restarting the runner first. For production, deploy the runner under an orchestrator that restarts it on exit and waits longer between restarts when the runner keeps exiting right after it starts. See [Deploy to production](</docs/en/self-hosted-environments-deploy>) and [When the runner exits](</docs/en/self-hosted-environments-deploy#when-the-runner-exits>).
+After the first turn the session is still attached and the runner is still up, so you can send the session a follow-up message without restarting the runner first. For production, deploy the runner under an orchestrator that restarts it on exit and waits longer between restarts when the runner keeps exiting right after it starts. See [Deploy to production](</docs/en/self-hosted-environments-deploy>) and [When the runner exits](</docs/en/self-hosted-environments-deploy#when-the-runner-exits>).
## Send a follow-up message to a running session
--- a/server-managed-settings.md
+++ b/server-managed-settings.md
@@ -180,7 +180,7 @@
Claude Code fetches settings from Anthropic’s servers at startup and polls for updates hourly during active sessions. A client signed in through a Claude apps gateway fetches its settings from the gateway and waits for that fetch before the session starts, so the fetch in the lists below doesn’t apply to it. Enforce fail-closed startup covers what happens when that fetch fails.
-On a Team or Enterprise claude.ai login stored on the machine, Anthropic can require your organization’s settings before a session starts. When it does, whatever the lists below say, a developer [can’t start a session](</docs/en/errors#couldnt-load-your-organizations-settings>) in cases such as these:
+On a Team or Enterprise claude.ai login saved by the CLI or the VS Code extension, Anthropic usually requires your organization’s settings before a session starts. This requirement takes precedence over the launch behavior below. When it applies, a developer [can’t start a session](</docs/en/errors#couldnt-load-your-organizations-settings>) in cases such as these:
* Their sign-in has expired, until they run `claude auth login`
* Claude Code has neither the settings nor a recent cached copy. Check that the machine can reach `api.anthropic.com`
@@ -191,7 +191,7 @@
* When a developer signs in at startup, such as on a first run or after `/logout`, Claude Code waits up to five seconds for the fetch before it opens the session. When the policy arrives in time, Claude Code enforces it from the first screen and shows your [`companyAnnouncements`](</docs/en/settings-reference#companyannouncements>) on it. When the payload needs security approval, Claude Code ends the wait and applies the payload once the developer approves
* In any other startup, and when that five-second wait runs out, Claude Code opens the session while the fetch continues, so a brief window passes before the settings load and the restrictions take effect
- * If the fetch fails, Claude Code continues without server-managed settings and warns in interactive sessions and in [Claude Desktop’s Code tab](</docs/en/desktop>) that no remote policy applies; endpoint-managed settings still apply. If a managed source sets `forceRemoteSettingsRefresh`, Claude Code exits instead
+ * If the fetch fails, a session that does start runs without server-managed settings, and endpoint-managed settings still apply. Claude Code warns in interactive sessions and in [Claude Desktop’s Code tab](</docs/en/desktop>) that no remote policy applies. If a managed source sets `forceRemoteSettingsRefresh`, Claude Code exits
**Subsequent launches with cached settings:**
@@ -204,7 +204,7 @@
* If a session’s provider isn’t on the cached [`allowedProviders`](</docs/en/settings-reference#allowedproviders>) list, Claude Code can wait for that fetch and check again before refusing. If the fetch fails, the session is refused
* Plan for cached settings to expire 24 hours after the last successful fetch
* If the startup fetch fails before cached settings expire, Claude Code warns in interactive sessions and in the Code tab that the cached policy is in effect
- * If the startup fetch fails after cached settings expire, the session starts without server-managed settings, and the warning says that no remote policy applies. To have Claude Code exit instead, set `forceRemoteSettingsRefresh`
+ * If the startup fetch fails after cached settings expire, a developer on a saved Team or Enterprise claude.ai login usually can’t start a session. A session that does start can run without server-managed settings, and then the warning says that no remote policy applies. To have Claude Code exit instead, set `forceRemoteSettingsRefresh`
* Until a fetch succeeds, the values withheld at startup stay withheld
Claude Code withholds several categories of variables in the cached `env` block until the server confirms the payload for the session. This keeps a cached proxy, certificate authority, endpoint, or credential value from redirecting, intercepting, or re-authenticating the settings fetch that confirms the payload. The hardening applies only to the server-fetched settings cache: [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) deployed through MDM or `managed-settings.json` are unaffected. The withheld categories include:
@@ -242,7 +242,7 @@
### Enforce fail-closed startup
-By default, if the remote settings fetch fails at startup, the CLI continues with the settings cached from the last successful fetch, unless they’ve expired. The values Claude Code withholds stay withheld until a fetch succeeds. With expired or no cached settings, the CLI continues without server-managed settings and still applies any [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) on the device. Anthropic can require the settings instead. To stop clients from starting on cached or absent server-managed settings, set `forceRemoteSettingsRefresh: true` in your managed settings. Clients signed in through a Claude apps gateway wait for the startup fetch whether or not you set this, and handle a failed fetch as follows:
+By default, if the remote settings fetch fails at startup, the CLI continues on unexpired cached settings, with exceptions. The values Claude Code withholds stay withheld until a fetch succeeds. If the fetch fails with expired or no cached settings, a developer on a saved Team or Enterprise claude.ai login usually can’t start a session. A session that does start can run without server-managed settings and still applies any [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) on the device. To stop clients from starting on cached or absent server-managed settings, set `forceRemoteSettingsRefresh: true` in your managed settings. Clients signed in through a Claude apps gateway wait for the startup fetch whether or not you set this, and handle a failed fetch as follows:
* If the gateway answers an attended interactive launch with a `401` and this setting is off, the gateway has ended that sign-in. Claude Code prints [`Cloud gateway session expired — run /login to reconnect.`](</docs/en/errors#cloud-gateway-session-expired>) and opens the session signed out of the gateway until the user runs `/login`.
* When the fetch fails in any other way, or in any other kind of launch except a `claude auth` subcommand, the client exits with an error.
@@ -336,7 +336,7 @@
User deletes the cached settings file| First-launch behavior occurs
User runs a modified Claude Code binary| A user who can run a modified client can bypass any client-side control
User runs an older Claude Code version| Versions that predate server-managed settings don’t fetch or apply them
-API is unavailable| Cached settings apply if available and not expired. Without them, Claude Code enforces no server-managed settings until the next successful fetch. Fetch and caching behavior lists the exceptions, including when Anthropic requires the settings. With `forceRemoteSettingsRefresh: true`, the CLI exits instead of continuing, except for `claude auth` subcommands. Clients signed in through a Claude apps gateway exit at startup without that setting, with the same `claude auth` exemption
+API is unavailable| Unexpired cached settings apply, with exceptions. With expired or missing cached settings, a session on a saved Team or Enterprise claude.ai login usually can’t start. A session that does start can run without server-managed settings until a fetch succeeds. With `forceRemoteSettingsRefresh: true` or a Claude apps gateway sign-in, the CLI exits at startup even with a cached copy, except for `claude auth` subcommands
User authenticates with a different organization| Settings are not delivered for accounts outside the managed organization, including a session that authenticates with a Console API key
User configures a third-party model provider| Server-managed settings are bypassed. This includes setting `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_MANTLE`, `CLAUDE_CODE_USE_VERTEX`, `CLAUDE_CODE_USE_FOUNDRY`, `CLAUDE_CODE_USE_ANTHROPIC_AWS`, or a non-default `ANTHROPIC_BASE_URL`
Network traffic is intercepted or redirected| Disabled TLS validation or intercepted traffic can alter the settings the client receives
--- a/session-storage.md
+++ b/session-storage.md
@@ -185,8 +185,15 @@
import { S3Client } from "@aws-sdk/client-s3";
import { S3SessionStore } from "./S3SessionStore"; // copied from examples/session-stores/s3
+ const bucket = process.env.TRANSCRIPT_BUCKET;
+ if (!bucket) {
+ throw new Error(
+ "Set the TRANSCRIPT_BUCKET environment variable to the name of an S3 bucket your AWS account owns"
+ );
+ }
+
const store = new S3SessionStore({
- bucket: "my-claude-sessions",
+ bucket,
prefix: "transcripts",
client: new S3Client({ region: "us-east-1" }),
});
--- a/settings-reference.md
+++ b/settings-reference.md
@@ -472,7 +472,7 @@
Cap the [effort level](</docs/en/model-config#adjust-effort-level>) a session can use, leaving lower levels available. Any higher level runs at the cap instead, including one from `/effort`, the `/model` picker, `--effort`, [`CLAUDE_CODE_EFFORT_LEVEL`](</docs/en/env-vars>), a skill’s or subagent’s `effort` frontmatter, or the model’s own default. Claude Code applies the cap itself before each request, so it holds on every provider, including Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. Requires Claude Code v2.1.267 or later.
- * **Scope** : `Any file`. Deploy it in managed settings to enforce it for an organization. When several scopes set a cap, the lowest applies, so a cap set in one scope can’t be raised from another
+ * **Scope** : `Any file`. Deploy it in managed settings to enforce it for an organization. When several scopes set a cap, the lowest applies
* **Type** : string, one of `"low"`, `"medium"`, `"high"`, `"xhigh"`, or `"max"`. A `"max"` value sets no cap
* **Default** : unset, so no cap applies
* **Per-model caps** : add `maxEffortLevel` to a model’s `modelSettings` entry. That entry replaces this key for the model only within the settings source that sets both, such as your user settings or one [managed source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). Set `"max"` there to exempt the model from that source’s cap; Claude Code still applies caps from other sources
@@ -2372,11 +2372,11 @@
### `fileCheckpointingEnabled`
-Have Claude Code snapshot files before each edit so [`/rewind`](</docs/en/checkpointing>) can restore them. Appears in `/config` as **Rewind code (checkpoints)** , and toggling it there writes this key to your user settings.
-
- * **Scope** : `Any file`
- * **Type** : Boolean
- * `true`: Claude Code snapshots files before each edit so `/rewind` can restore them
+Have Claude Code snapshot the files Claude edits so [`/rewind`](</docs/en/checkpointing>) can restore them. Appears in `/config` as **Rewind code (checkpoints)** , and toggling it there writes this key to your user settings.
+
+ * **Scope** : `Any file`
+ * **Type** : Boolean
+ * `true`: Claude Code snapshots the files Claude edits so `/rewind` can restore them
* `false`: Claude Code doesn’t snapshot files, so `/rewind` can’t restore them
* **Default** : `true`
* **Per-session overrides** : [`CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING`](</docs/en/env-vars>) turns checkpointing off for one session; whichever of the two turns it off, the other can’t turn it back on
@@ -2628,7 +2628,7 @@
### `dialogExpiry`
-Set the deadline for dialogs Claude Code [forwards to a remote client](</docs/en/remote-control#limitations>), such as a Remote Control or SDK host, and for the approval dialog for a [held cross-session message](</docs/en/cross-session-messaging#control-inbound-messages>). On Claude Code v2.1.236 or later, the same deadline bounds the mid-session [Fable usage-credits consent prompt](</docs/en/model-config#fable-and-usage-credits>) in a session that may have nobody at the terminal. When no answer arrives before the deadline, Claude Code cancels the dialog and continues with its no-action default. Requires Claude Code v2.1.224 or later.
+Set the deadline for dialogs Claude Code [forwards to a remote client](</docs/en/remote-control#limitations>), such as a Remote Control or SDK host, and for the approval dialog for a [held cross-session message](</docs/en/cross-session-messaging#control-inbound-messages>). Requires Claude Code v2.1.224 or later. On Claude Code v2.1.236 or later, the same deadline applies to the mid-session [Fable usage-credits consent prompt](</docs/en/model-config#fable-and-usage-credits>) in some sessions. When no answer arrives before the deadline, Claude Code cancels the dialog and continues with its no-action default, or ends the turn for the Fable prompt.
* **Scope** : `User or managed`
* **Type** : string, one of `"60s"`, `"5m"`, `"10m"`, or `"never"`, which disables the deadline
@@ -2913,7 +2913,7 @@
### `spinnerTipsOverride`
-Add your own tips to the spinner tips that Claude Code shows while Claude works, or replace the built-in tips with yours. Claude Code puts your tips in the same rotation as the built-in ones. If you set `spinnerTipsEnabled` to `false`, Claude Code hides all tips, yours included.
+Add your own tips to the spinner tips that Claude Code shows while Claude works, or replace the built-in tips with yours. Claude Code puts your tips in the same rotation as the built-in ones. If you set `spinnerTipsEnabled` to `false`, Claude Code hides all tips.
* **Scope** : `Any file`. Claude Code honors tip objects, `tipsFile`, `label`, and `excludeDefault` from user settings, the `--settings` flag, and managed settings; from project and local settings it reads plain string tips only.
* **Type** : object with `tips`, `tipsFile`, `label`, and `excludeDefault` fields, each optional
@@ -3042,7 +3042,7 @@
### `terminalTitleFromRename`
-Claude Code sets your terminal tab’s title. By default it uses a title it generates from the conversation, and once you give the session a [name](</docs/en/sessions#name-your-sessions>) with `/rename` or `--name`, the tab shows that name instead. Set this key to `false` to keep the generated title on the tab even after you name the session. The name itself still applies, so `/resume <name>` and the session picker find it.
+Claude Code sets your terminal tab’s title. By default it uses a title it generates from the conversation, and once you give the session a [name](</docs/en/sessions#name-your-sessions>) with `/rename` or `--name`, the tab shows that name instead. Set this key to `false` to keep the generated title on the tab after you name the session. The name itself still applies, so `/resume <name>` and the session picker find it.
* **Scope** : `Any file`
* **Type** : Boolean
@@ -4663,8 +4663,6 @@
* **Scope** : `Any file`. Claude Code also reads a value left in `~/.claude.json` by older versions.
* **Type** : Boolean
- * `true`: Claude can send a push notification to your phone when it decides one is worth sending
- * `false`: Claude doesn’t send those notifications
* **Default** : unset, so Claude Code uses the value saved to your account, or `false` if none is saved
settings.json
@@ -5414,7 +5412,7 @@
### `forceRemoteSettingsRefresh`
-Block CLI startup until Claude Code has freshly fetched [server-managed settings](</docs/en/server-managed-settings>). If the fetch fails, Claude Code exits instead of continuing with cached or no settings. Set it when your environment can’t accept even a brief window in which a session runs without its managed policy. When the key is unset, Claude Code doesn’t block startup on the fetch, though when the developer signs in at startup it waits up to five seconds for the fetch. [Anthropic can require the settings](</docs/en/server-managed-settings#fetch-and-caching-behavior>), which does block a start without them. A Cloud gateway session waits, and exits if the gateway can’t be reached.
+Block CLI startup until Claude Code has freshly fetched [server-managed settings](</docs/en/server-managed-settings>). If the fetch fails, Claude Code exits instead of continuing with cached or no settings. Set it when your environment can’t accept even a brief window in which a session runs without its managed policy. When the key is unset, Claude Code doesn’t block startup on the fetch, though when the developer signs in at startup it waits up to five seconds for the fetch. On a saved Team or Enterprise claude.ai login, [Anthropic usually requires the settings](</docs/en/server-managed-settings#fetch-and-caching-behavior>), and then a session with no recent cached copy can’t start until they load. A Cloud gateway session waits, and exits if the gateway can’t be reached.
* **Scope** : `Managed`. Claude Code honors a `true` from any admin-controlled managed source, even one that isn’t the highest-priority source.
* **Type** : Boolean
--- a/statusline.md
+++ b/statusline.md
@@ -358,7 +358,7 @@
`misses`| Requests that re-processed content the cache already held: more than 5% and at least 2,000 tokens of what the request could have read from cache, with no compaction or tool-result clearing to explain the shortfall in cache reads
`expected_rebuilds`| Cache rebuilds that followed a compaction or a clearing of old tool results
`hit_ratio`| Cache read tokens as a fraction of all input tokens this session, from 0 to 1. The denominator counts cache reads, cache writes, and uncached input. `null` while those counts are all zero
-`cache_write_tokens`| All tokens written to the cache this session, the first request’s initial write included
+`cache_write_tokens`| All tokens written to the cache this session
`miss_recache_tokens`| Tokens written to the cache by the requests counted as misses
`last_miss_at`| When the last miss happened, in epoch seconds. `null` while the session has no misses
`last_miss_cause`| What Claude Code identified as the likely cause of the last miss, described under Last miss cause. Requires Claude Code v2.1.260 or later
@@ -382,7 +382,7 @@
2. Make it executable: `chmod +x ~/.claude/statusline.sh`
3. Add the path to your settings
-The Bash examples use [`jq`](<https://jqlang.org/>) to parse JSON. Python and Node.js have built-in JSON parsing.
+The Bash examples use [`jq`](<https://jqlang.org/>) to parse JSON.
### Context window usage
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -284,7 +284,7 @@
#### Which model a nested subagent runs on
-By default, a nested subagent you define runs on the model of its parent, the subagent that spawned it. To run the nested subagent on another model, set its `model` field to that model. For example, suppose your main conversation runs on Opus and starts a reviewer subagent on Haiku. By default, these subagents run on Haiku, not Opus, when the reviewer spawns them:
+By default, a nested subagent you define runs on the model of its parent, the subagent that spawned it. To run the nested subagent on another model, set its `model` field to that model. For example, suppose your main conversation runs on Opus and starts a reviewer subagent on Haiku. By default, these subagents run on Haiku when the reviewer spawns them:
* A subagent with `model: inherit` or no `model` field
* The built-in Explore, Plan, and general-purpose subagents
@@ -712,7 +712,7 @@
claude --agent code-reviewer
-Unless the agent’s prompt is empty, a custom subagent’s system prompt replaces the default Claude Code system prompt entirely, the same way [`--system-prompt`](</docs/en/cli-reference>) does. `CLAUDE.md` files and project memory still load through the normal message flow, even when the agent’s definition sets `omitClaudeMd`. If you run the session with `-p` as a custom agent that has its own prompt, it also starts without the [git status snapshot](</docs/en/settings-reference#includegitinstructions>). The agent name appears as `@<name>` in the startup header so you can confirm it’s active. This works with built-in and custom subagents, and the choice persists when you resume the session: Claude Code restores the agent’s tool restrictions and model along with the conversation. If the agent no longer exists when you resume, the session continues with the default tools and shows a [warning naming the agent](</docs/en/errors#session-agent-no-longer-available>). For the system prompt in either case, see [System prompt flags in resumed conversations](</docs/en/cli-reference#system-prompt-flags-in-resumed-conversations>). For a plugin-provided subagent, you can pass only the agent name and Claude Code finds it:
+Unless the agent’s prompt is empty, a custom subagent’s system prompt replaces the default Claude Code system prompt entirely, the same way [`--system-prompt`](</docs/en/cli-reference>) does. `CLAUDE.md` files and project memory still load through the normal message flow, even when the agent’s definition sets `omitClaudeMd`. If you run the session with `-p` as a custom agent that has its own prompt, it also starts without the [git status snapshot](</docs/en/settings-reference#includegitinstructions>). The agent name appears as `@<name>` in the startup header so you can confirm it’s active. You can also pass a built-in subagent, such as `Explore`. For a plugin-provided subagent, you can pass only the agent name and Claude Code finds it:
claude --agent security-reviewer
@@ -781,7 +781,7 @@
A subagent whose run ends on an API error, such as a usage limit or a repeated server error, reports that failure back to Claude. What Claude receives depends on where the subagent ran:
* **Foreground** : if a rate limit, overload, or server error cuts off a subagent that already produced text output, the Agent tool returns that partial output with a note that the subagent was cut off and didn’t finish its task. A subagent that produced nothing, or whose only output was tool calls, fails with [`Agent terminated early due to an API error`](</docs/en/errors#agent-terminated-early-due-to-an-api-error>), followed by the error detail.
- * **Background** : the subagent is marked failed, and the message Claude receives when it ends names the API error and includes the subagent’s last output, so partial work isn’t lost.
+ * **Background** : the subagent is marked failed, and the message Claude receives when it ends names the API error and includes the subagent’s last output.
If a subagent’s report opens with the following line, the subagent finished on a fallback model:
@@ -902,7 +902,7 @@
Continue that code review and now analyze the authorization logic
[Claude resumes the subagent with full context from previous conversation]
-When Claude sends a completed subagent a message with the `SendMessage` tool, the subagent can resume in the background without a new `Agent` invocation. The same applies to a subagent that Claude stopped with the `TaskStop` tool, once its stopped run has exited. The resumed run keeps the tool set from where the subagent first ran and can keep reading the [prompt cache the original run warmed](</docs/en/prompt-caching#subagents-and-the-cache>). A subagent that has the `SendMessage` tool can send that message too. In an interactive session, the resumed agent then reports back to the subagent that resumed it, not to your main conversation. That subagent waits for the result before finishing its own work. When a subagent messages an agent it reports to, such as its own launcher, Claude Code resumes that agent without redirecting its results. A subagent you stopped yourself, with `x` in `/tasks` or an SDK `stop_task` request, doesn’t auto-resume. If Claude sends it a message, the message is refused and Claude is told the agent was cancelled. While that subagent’s row is still in the subagent panel, type into its transcript to resume it yourself. After that, a message from Claude can auto-resume it again. Resuming starts a new run of the agent under the same ID, so a subagent that had already failed or completed shows as running again in the task list and in the Agent SDK’s task events. `SendMessage` checks that a name still refers to the same agent it reached earlier in the conversation. If a newer agent has taken the name, such as a re-spawned background agent that reused it, Claude Code refuses the send rather than delivering it to the wrong agent, and the error reports which agent the name now reaches so Claude can retarget. To reach the earlier agent while it’s still running, Claude addresses it by the agent ID it received when it spawned that agent. The check is scoped to the current conversation and resets on `/clear`.
+When Claude sends a completed subagent a message with the `SendMessage` tool, the subagent can resume in the background without a new `Agent` invocation. The same applies to a subagent that Claude stopped with the `TaskStop` tool, once its stopped run has exited. The resumed run keeps the tool set from where the subagent first ran and can keep reading the [prompt cache the original run warmed](</docs/en/prompt-caching#subagents-and-the-cache>). A subagent that has the `SendMessage` tool can send that message too. In an interactive terminal session, the resumed agent then reports back to the subagent that resumed it. That subagent waits for the result before finishing its own work. When a subagent messages an agent it reports to, such as its own launcher, Claude Code resumes that agent without redirecting its results. A subagent you stopped yourself, with `x` in `/tasks` or an SDK `stop_task` request, doesn’t auto-resume. If Claude sends it a message, the message is refused and Claude is told the agent was cancelled. While that subagent’s row is still in the subagent panel, type into its transcript to resume it yourself. After that, a message from Claude can auto-resume it again. Resuming starts a new run of the agent under the same ID, so a subagent that had already failed or completed shows as running again in the task list and in the Agent SDK’s task events. `SendMessage` checks that a name still refers to the same agent it reached earlier in the conversation. If a newer agent has taken the name, such as a re-spawned background agent that reused it, Claude Code refuses the send rather than delivering it to the wrong agent, and the error reports which agent the name now reaches so Claude can retarget. To reach the earlier agent while it’s still running, Claude addresses it by the agent ID it received when it spawned that agent. The check is scoped to the current conversation and resets on `/clear`.
A subagent treats messages from the agent that launched it as normal task direction, including mid-task course corrections, and acts on them within its own permission settings. A message from an agent doesn’t count as your approval for a pending permission prompt.
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -130,7 +130,7 @@
### Timeout and output limits
-Each command runs under a timeout, and Claude manages it: when it wants longer than the default for a command, it passes the `timeout` parameter with that call. You never set a per-command timeout. Two [environment variables](</docs/en/env-vars>) control what Claude gets for a command that runs in the foreground:
+Each command runs under a timeout, and Claude manages it: when it wants longer than the default for a command, it passes the `timeout` parameter with that call. Two [environment variables](</docs/en/env-vars>) control what Claude gets for a command that runs in the foreground:
* `BASH_DEFAULT_TIMEOUT_MS` — the default when Claude passes no timeout; two minutes out of the box
* `BASH_MAX_TIMEOUT_MS` — with the default, sets the ceiling that caps whatever Claude requests: the effective ceiling is the larger of the two, ten minutes out of the box
@@ -207,7 +207,7 @@
## Edit tool behavior
-The Edit tool performs exact string replacement. It takes an `old_string` and a `new_string` and replaces the first with the second. It doesn’t use regex or fuzzy matching. These checks must pass for an edit to apply. Before any of them, a path matched by a [`Read` deny rule](</docs/en/permissions#tool-specific-permission-rules>) is refused, including creating a new file there.
+The Edit tool performs exact string replacement. It takes an `old_string` and a `new_string` and replaces the first with the second. These checks must pass for an edit to apply. Before any of them, a path matched by a [`Read` deny rule](</docs/en/permissions#tool-specific-permission-rules>) is refused, including creating a new file there.
* **Read-before-edit** : Claude reads the file in the current conversation before editing it, and a read cut short with a `PARTIAL view` notice doesn’t count. Claude Opus 4.6, Claude Haiku 4.5, and older models always require the read. Newer models can edit an unread file when reading it wouldn’t need a permission prompt and the Read tool is available.
* **Match** : `old_string` must appear in the file exactly as written. A single character of whitespace or indentation difference is enough to miss.
@@ -341,7 +341,7 @@
## NotebookEdit tool behavior
-NotebookEdit modifies a Jupyter notebook one cell at a time, targeting cells by their `cell_id`. It doesn’t perform string replacement across the notebook the way Edit does on plain files. Three edit modes control what happens to the target cell:
+NotebookEdit modifies a Jupyter notebook one cell at a time, targeting cells by their `cell_id`. Three edit modes control what happens to the target cell:
* `replace`: overwrite the cell’s source. This is the default.
* `insert`: add a new cell after the target. With no `cell_id`, the new cell goes at the start of the notebook. Requires `cell_type` set to `code` or `markdown`.
--- a/troubleshooting.md
+++ b/troubleshooting.md
@@ -127,7 +127,7 @@
That value is enough for a screenshot, and for a Read of a whole PDF up to Read’s 20 MB limit. If the error comes back, for example on an Edit of a very large file, set a higher value. Any change a tool already made stays in place, and the tool call whose message was too long may have made one. To pick up the work that stopped:
1. If you hold a `ClaudeSDKClient` open, call `disconnect()`. The client receives no more messages after this error, but Claude Code keeps running and can still make changes.
- 2. Start a new `query()` or `ClaudeSDKClient` with the larger limit and [`continue_conversation=True`](</docs/en/agent-sdk/sessions#continue-resume-and-fork>), which picks the most recent session in the working directory. To pick a specific session, set `resume` to `data["session_id"]` from the init [`SystemMessage`](</docs/en/agent-sdk/python#systemmessage>).
+ 2. Start a new `query()` or `ClaudeSDKClient` with the larger limit, and set `resume` to `data["session_id"]` from the init [`SystemMessage`](</docs/en/agent-sdk/python#systemmessage>). In an app that serves several users, keep each user’s session ID and resume with it, and start a new session for a user whose ID you didn’t keep. If your app runs one conversation at a time and you didn’t keep the ID, set [`continue_conversation=True`](</docs/en/agent-sdk/sessions#continue-resume-and-fork>) instead to resume the most recent session in the working directory.
## Streaming input
Show diff (167 lines)
--- a/typescript.md
+++ b/typescript.md
@@ -85,7 +85,7 @@
#### Returns
-Returns a `Promise<``WarmQuery``>` that resolves once the subprocess has spawned and completed its initialize handshake. Of the `hook_progress` messages a `SessionStart` or `Setup` hook emits before the handshake completes, you get only the newest, which carries all of the hook’s output so far. `startup()` holds that message, the hook’s `hook_started` message, and anything else the subprocess emits before the handshake completes. The held messages reach you once you call `.query()` on the `WarmQuery` and iterate the result.
+Returns a `Promise<``WarmQuery``>` that resolves once the subprocess has spawned and completed its initialize handshake. If the promise rejects, check the error for an untyped `startupFailureReason` property holding a `startup_failure_reason` value. `startupFailureReason` requires Agent SDK v0.3.312 or later. Of the `hook_progress` messages a `SessionStart` or `Setup` hook emits before the handshake completes, you get only the newest, which carries all of the hook’s output so far. `startup()` holds that message, the hook’s `hook_started` message, and anything else the subprocess emits before the handshake completes. The held messages reach you once you call `.query()` on the `WarmQuery` and iterate the result.
#### Example
@@ -976,9 +976,10 @@
absPath: string;
truncated?: boolean;
encoding?: 'base64';
- };
-
-`contents` holds the file text, or base64 data when you requested `encoding: 'base64'`; the response’s `encoding` field is set to `'base64'` in that case. `absPath` is the resolved absolute path. `truncated` is set when the file was longer than the `maxBytes` cap and the contents were cut at that limit.
+ lossy?: boolean;
+ };
+
+`contents` holds the file text, or base64 data when you requested `encoding: 'base64'`; the response’s `encoding` field is set to `'base64'` in that case. `absPath` is the resolved absolute path. `truncated` is set when the file was longer than the `maxBytes` cap and the contents were cut at that limit. When `lossy` is `true`, the bytes read weren’t all valid UTF-8, so read the file again with `encoding: 'base64'`. `lossy` requires Claude Code v2.1.317 or later.
#### What `readFile()` can read
@@ -1479,6 +1480,7 @@
| SDKModelRefusalNoFallbackMessage
| SDKMirrorErrorMessage
| SDKInformationalMessage
+ | SDKSessionWritesLostMessage
| SDKConversationResetMessage;
Three messages in this union report control-request progress and model refusals. Each has `type: "system"`, so tell them apart by the `subtype` listed with each one:
@@ -1804,6 +1806,7 @@
| "worktree_unverified"
| "cli_version_too_old"
| "bypass_root"
+ | "initialize_not_first"
| "org_config_required_unavailable"
| "org_config_refused"
| "sandbox_required_unavailable"
@@ -1831,6 +1834,7 @@
`worktree_unverified`| The session’s worktree couldn’t be verified right now, and retrying may succeed
`cli_version_too_old`| This Claude Code version is below the minimum Anthropic requires
`bypass_root`| Bypass permissions mode was requested while running as root
+`initialize_not_first`| The first line on Claude Code’s stdin wasn’t the expected `initialize` control request. In a wrapper script that starts Claude Code, pass stdin through unchanged. Requires Claude Code v2.1.317 or later
`org_config_required_unavailable`| The session needs the organization’s policies and managed settings before it can start, and they couldn’t be loaded, for example because of a network failure or an Anthropic server error. Requires Agent SDK v0.3.293 or later
`org_config_refused`| Anthropic refused to provide the organization’s policies and managed settings for this sign-in, for example because the sign-in expired or was revoked, or the organization doesn’t allow Claude Code for this account. Requires Agent SDK v0.3.293 or later
`sandbox_required_unavailable`| `failIfUnavailable` is on and the sandbox can’t start. The text in `errors` ends with `Set sandbox.failIfUnavailable=false to allow unsandboxed execution.` Requires Agent SDK v0.3.314 or later
@@ -1887,6 +1891,7 @@
---|---
`interrupt_receipt_v1`| `interrupt()` resolves with an `SDKControlInterruptResponse` receipt listing the messages that were pending when the interrupt arrived
`interrupt_cancel_queued_v1`| The `interrupt` control request honors `cancel_queued: true`, cancelling the messages the receipt would otherwise list under `still_queued` and listing them under `cancelled` instead. See `SDKControlInterruptResponse`. Requires Claude Code v2.1.219 or later
+`ask_user_question_unanswered_v1`| Your application can mark a skipped `AskUserQuestion` question with `unanswered`. Claude Code advertises this capability in v2.1.312 or later
`sdk_mcp_manifests`| The `initialize` control request accepts `sdkMcpServerManifests`, MCP handshake results captured from your in-process [SDK MCP servers](</docs/en/agent-sdk/custom-tools>). Claude Code advertises this capability in v2.1.286 or later
`sdk_mcp_tools_list_changed`| A `tools/list_changed` notification from an [SDK MCP server](</docs/en/agent-sdk/custom-tools>) makes Claude Code list that server’s tools again, so a tool the server adds mid-session reaches Claude. Claude Code advertises this capability in v2.1.286 or later
@@ -1958,6 +1963,20 @@
type: "system";
subtype: "worker_shutting_down";
reason: string;
+ uuid: UUID;
+ session_id: string;
+ };
+
+### `SDKSessionWritesLostMessage`
+
+Claude Code couldn’t save changes to `~/.claude.json` or part of a session transcript because the disk or disk quota was full. Check `lost` for what wasn’t saved. The value `global_config` means `~/.claude.json`. [Free up space](</docs/en/errors#could-not-save-because-the-disk-is-full>) before the next run. Requires Claude Code v2.1.317 or later.
+
+ type SDKSessionWritesLostMessage = {
+ type: "system";
+ subtype: "session_writes_lost";
+ error_code: "ENOSPC" | "EDQUOT";
+ lost: ("transcript" | "global_config")[];
+ transcript_session_ids?: string[]; // the sessions whose transcripts lost lines
uuid: UUID;
session_id: string;
};
@@ -2984,7 +3003,16 @@
metadata?: { source?: string };
};
-Asks the user clarifying questions during execution. See [Handle approvals and user input](</docs/en/agent-sdk/user-input#handle-clarifying-questions>) for usage details.
+Asks the user clarifying questions during execution. See [Handle approvals and user input](</docs/en/agent-sdk/user-input#handle-clarifying-questions>) for usage details. When a user skips a question, describe the skip in `answers`, which Claude reads. To tell a skip from an answer in `tool_use_result`, also set `unanswered` on that question’s entry in `updatedInput.annotations`. Set `unanswered` only when `SDKSystemMessage.capabilities` lists `ask_user_question_unanswered_v1`. This `canUseTool` return value sets `answers` and `unanswered`:
+
+ return {
+ behavior: "allow",
+ updatedInput: {
+ questions: input.questions,
+ answers: { "Which database should I use?": "The user skipped this question" },
+ annotations: { "Which database should I use?": { unanswered: "skipped" } }
+ }
+ };
### Bash
@@ -3668,11 +3696,11 @@
}>;
answers: Record<string, string>;
response?: string;
- annotations?: Record<string, { preview?: string; notes?: string }>;
+ annotations?: Record<string, { preview?: string; notes?: string; unanswered?: "skipped" | "replied_in_chat" | "dismissed" }>;
afkTimeoutMs?: number;
};
-Returns the questions asked and the user’s answers. `response` is set when the user typed a freeform reply instead of answering the structured questions; when present, Claude receives “The user responded: …” instead of the per-question answer list.
+Returns the questions asked and the user’s answers. `response` is set when the user typed a freeform reply instead of answering the structured questions; when present, Claude receives “The user responded: …” instead of the per-question answer list. When your app sets `unanswered`, use `skipped` if the user skipped the question, `replied_in_chat` if they sent a chat message instead, or `dismissed` if they closed the question.
### Bash
@@ -3825,17 +3853,27 @@
mediaType: "image/jpeg" | "image/png" | "image/gif" | "image/webp";
error?: string;
}[];
- }
- | {
- type: "file_unchanged";
- file: {
- filePath: string;
- };
- /** Set when the dedup matched a startup-seeded entry (CLAUDE.md / nested memory) rather than a prior Read tool_result. */
- source?: "seeded";
};
-Returns file contents in a format appropriate to the file type. Discriminated on the `type` field.
+Returns file contents in a format appropriate to the file type. Discriminated on the `type` field. Agent SDK v0.3.317 removes `"file_unchanged"` from `FileReadOutput`, so code that checks for it stops compiling. Match your fix to the Claude Code version that produced your Read results:
+
+ * **Only v2.1.317 or later** : delete the check.
+ * **An earlier version, saved results included** : declare the removed type and cast the Read call’s `tool_use_result`.
+
+For an earlier version, pass this function the user message that carries the Read result, then check the `type` of what it returns:
+
+ import type { SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
+ import type { FileReadOutput } from "@anthropic-ai/claude-agent-sdk/sdk-tools";
+
+ type FileUnchanged = {
+ type: "file_unchanged";
+ file: { filePath: string };
+ source?: "seeded";
+ };
+
+ function readResult(message: SDKUserMessage) {
+ return message.tool_use_result as FileReadOutput | FileUnchanged;
+ }
### Write
@@ -4703,6 +4741,8 @@
thinkingTokens?: number;
cacheReadInputTokens: number;
cacheCreationInputTokens: number;
+ cacheCreationEphemeral5mInputTokens?: number;
+ cacheCreationEphemeral1hInputTokens?: number;
webSearchRequests: number;
costUSD: number;
contextWindow: number;
@@ -4713,6 +4753,10 @@
};
`thinkingTokens` counts the thinking tokens this model generated. `outputTokens` already includes them, so don’t add the two together. The field is absent until a turn runs on a Claude Code version that records it, so a resumed session that began on an earlier version reports a partial count. `thinkingTokens` requires Agent SDK v0.3.257 or later. The `canonicalModel` and `provider` fields require Claude Code v2.1.218 or later. `canonicalModel` is the canonical model ID that the pricing lookup uses; it can differ from the raw model string that keys the entry, for example when that string is a provider-specific ID or an alias. `provider` names the API backend that served the model, such as `firstParty`, `bedrock`, `vertex`, `foundry`, `anthropicAws`, `mantle`, or `gateway`. `costBasis` names the price table that priced the model’s latest request: `list` for list price, `managed` for a [`modelPricing`](</docs/en/settings-reference#modelpricing>) table, or `unknown` when neither matched the model ID. The field requires Claude Code v2.1.246 or later.
+
+#### Cache-write token fields
+
+`cacheCreationEphemeral5mInputTokens` and `cacheCreationEphemeral1hInputTokens` count cache-write tokens with 5-minute and 1-hour lifetimes. For the cache-write total, use `cacheCreationInputTokens`, which already includes the 5-minute and 1-hour counts and can exceed their sum. The 5-minute and 1-hour fields require Agent SDK v0.3.311 or later.
### `ConfigScope`
--- a/vs-code.md
+++ b/vs-code.md
@@ -759,7 +759,7 @@
`mcp__ide__getDiagnostics`| Returns language-server diagnostics: the errors and warnings in VS Code’s Problems panel. Optionally scoped to one file.| Yes
`mcp__ide__executeCode`| Runs Python code in the active Jupyter notebook’s kernel. See confirmation flow below.| No
-**Diagnostics in the chat panel.** In the chat panel, with Claude Code v2.1.285 or later, Claude reads VS Code’s Problems panel through a separate built-in server named `claude-vscode`. Claude can ask it for the current errors and warnings in one file, or in every file VS Code has diagnostics for. Hooks and permission rules see the chat panel’s diagnostics tool as `mcp__claude-vscode__getDiagnostics`. To cover diagnostics in both the CLI and the chat panel, name both `mcp__ide__getDiagnostics` and `mcp__claude-vscode__getDiagnostics` in your hook or rule. This `settings.json` example denies both tools:
+**Diagnostics in the chat panel.** In the chat panel, with Claude Code v2.1.285 or later, Claude reads VS Code’s Problems panel through a separate built-in server named `claude-vscode`. Claude can ask it for the current errors and warnings in one file, or in every file VS Code has diagnostics for. Hooks and permission rules see the chat panel’s diagnostics tool as `mcp__claude-vscode__getDiagnostics`. To cover diagnostics in both the CLI and the chat panel, name both `mcp__ide__getDiagnostics` and `mcp__claude-vscode__getDiagnostics` in your hook or rule. This `settings.json` example blocks both tools by name with [deny rules](</docs/en/permissions#mcp>):
{
"permissions": {
@@ -770,7 +770,7 @@
}
}
-A `Read` deny rule covers neither tool, so block them by name with a [deny rule](</docs/en/permissions#mcp>) as the example does. **Jupyter execution always asks first.** `mcp__ide__executeCode` can’t run anything silently. Each call goes through these steps:
+**Jupyter execution always asks first.** `mcp__ide__executeCode` can’t run anything silently. Each call goes through these steps:
1. The code is inserted as a new cell at the end of the active notebook.
2. VS Code scrolls the cell into view.
--- a/worktrees.md
+++ b/worktrees.md
@@ -44,7 +44,7 @@
## Clean up worktrees
-When you exit an interactive worktree session, Claude checks the worktree for work that removal would delete: changed or untracked files, uncommitted work inside checked-out submodules, and new commits. These rules apply to worktrees Claude created with git. For a worktree your [WorktreeCreate hook](</docs/en/hooks#worktreecreate>) created, see [WorktreeRemove](</docs/en/hooks#worktreeremove>) instead.
+When you exit an interactive session in a worktree Claude created with git, Claude checks for work: changed or untracked files, uncommitted work inside checked-out submodules, and new commits. Your gitignored files, such as `.env`, don’t count, so you can lose them at exit. Copy out files you need before exiting. For a worktree your [WorktreeCreate hook](</docs/en/hooks#worktreecreate>) created, see [WorktreeRemove](</docs/en/hooks#worktreeremove>).
* **Claude Code finds another session in the worktree** : the worktree and branch stay even if you choose removal. Follow the `Worktree kept at` message
* **The worktree is clean** : for an unnamed session, Claude removes the worktree and its branch automatically. A [named](</docs/en/sessions#name-your-sessions>) session prompts you first so you can keep the worktree for later
@@ -60,7 +60,7 @@
### Resume without `--worktree`
-When you resume a session that ended isolated in its worktree without exiting it, Claude Code returns the session there and keeps it isolated. This holds for interactive resumes, for `--continue` and `--resume` in [non-interactive mode](</docs/en/headless>) with `-p`, and for the Agent SDK. Back inside the worktree, Claude can leave with the [`ExitWorktree`](</docs/en/tools-reference>) tool when the session has that tool. Before returning the session to its worktree, Claude Code verifies that the worktree is still a checkout separate from the main one, and declines to re-enter a worktree that fails the check. For a git worktree, the check reads its git metadata. A worktree without git metadata, such as one a `WorktreeCreate` hook created, can pass the check; the cases Claude Code still refuses are listed with their recoveries under Claude Code refuses to use a worktree. For the messages and how to recover from each, see The session resumes outside its worktree. Where you launch from, and how you resume, change what Claude Code re-enters:
+When you resume a session that ended isolated in its worktree and that you didn’t exit, Claude Code returns the session to that worktree and keeps it isolated. This holds for interactive resumes, for `--continue` and `--resume` in [non-interactive mode](</docs/en/headless>) with `-p`, and for the Agent SDK. Back inside the worktree, Claude can leave with the [`ExitWorktree`](</docs/en/tools-reference>) tool when the session has that tool. Before returning the session to its worktree, Claude Code verifies that the worktree is still a checkout separate from the main one, and declines to re-enter a worktree that fails the check. For a git worktree, the check reads its git metadata. A worktree without git metadata, such as one a `WorktreeCreate` hook created, can pass the check; the cases Claude Code still refuses are listed with their recoveries under Claude Code refuses to use a worktree. For the messages and how to recover from each, see The session resumes outside its worktree. Where you launch from, and how you resume, change what Claude Code re-enters:
* **Launch directory** : resume with `--resume` from the main checkout or another directory of the repository. Claude Code re-enters a worktree it created with git under `.claude/worktrees/` even when you launch from inside it. When you launch from inside any other worktree, Claude Code re-enters it only if it can vouch for it from there: a worktree that is its own repository, one without git metadata, or a launch from a subdirectory of a worktree you created with `git worktree add` declines, so launch those from the main checkout.
* **`--continue`** : Claude Code picks the most recent session recorded under the directory you launch from.
@@ -97,15 +97,20 @@
Apply the requested refactor across every affected file, then run the tests
and report the results.
-When a subagent finishes, Claude Code keeps the worktree if git shows changed files, untracked files, or new commits there. Otherwise, Claude Code can remove the worktree right away. A kept worktree stays on disk until the periodic sweep can remove it without losing work. For a worktree your [WorktreeCreate hook](</docs/en/hooks#worktreecreate>) created, see [WorktreeRemove](</docs/en/hooks#worktreeremove>) instead. Subagent worktrees use the same base branch as `--worktree`, so they branch from your repository’s default branch unless `worktree.baseRef` is set to `"head"`. A subagent in its own worktree takes the instruction files it [starts with](</docs/en/sub-agents#what-loads-at-startup>) from your main conversation, not from its worktree. When that worktree is in the default location under `.claude/worktrees/`, the subagent also doesn’t load the `CLAUDE.md` file or `.claude/rules/` directory at the worktree’s root as it reads files there, even if those differ on the worktree’s branch.
+If your [WorktreeCreate hook](</docs/en/hooks#worktreecreate>) created the subagent’s worktree, see [WorktreeRemove](</docs/en/hooks#worktreeremove>). Otherwise, Claude Code checks the worktree with git when the subagent finishes:
+
+ * **Changed files, untracked files, or new commits** : the worktree stays until it qualifies for the periodic sweep.
+ * **A clean`git status` and no new commits**: Claude Code can remove the worktree right away.
+
+Subagent worktrees use the same base branch as `--worktree`, so they branch from your repository’s default branch unless `worktree.baseRef` is set to `"head"`. A subagent in its own worktree takes the instruction files it [starts with](</docs/en/sub-agents#what-loads-at-startup>) from your main conversation, not from its worktree. When that worktree is in the default location under `.claude/worktrees/`, the subagent also doesn’t load the `CLAUDE.md` file or `.claude/rules/` directory at the worktree’s root as it reads files there, even if those differ on the worktree’s branch.
### Clean up subagent and background-session worktrees
Claude Code runs a periodic sweep that removes worktrees that Claude created for subagents and [background sessions](</docs/en/agent-view#how-file-edits-are-isolated>) once they are older than your [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) setting, following the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>). When you [background](</docs/en/agent-view#send-the-session-to-the-background>) a `--worktree` session, its worktree becomes a background-session worktree that the sweep can remove. The sweep leaves a worktree in place in cases such as these:
- * The worktree still holds work: changed or untracked files, or unpushed commits.
+ * The worktree still holds work: changed or untracked files, or unpushed commits. Your gitignored files don’t count, so copy out any you need.
* A checked-out submodule in the worktree holds changed or untracked files, or Claude Code can’t inspect the worktree’s submodules. This check requires Claude Code v2.1.274 or later.
- * One of the four cases that also block worktree creation applies: Claude Code can’t determine which filter drivers the repository config defines, or finds a setting there it can’t switch off.
+ * One of the git config errors that block worktree creation applies.
* The worktree belongs to a `--worktree` session you haven’t backgrounded, whatever its age.
* You created the worktree with `git worktree add` outside `.claude/worktrees/`.
@@ -119,7 +124,7 @@
### Choose the base branch
-New worktrees branch from the repository’s default branch, so most sessions don’t need this setting. Set `worktree.baseRef` in [settings](</docs/en/settings-reference#worktree>) to branch from your current work instead. The setting accepts two values:
+New worktrees branch from the repository’s default branch. Set `worktree.baseRef` in [settings](</docs/en/settings-reference#worktree>) to branch from your current work instead. The setting accepts two values:
* `"fresh"` (default): branch from the repository’s default branch on the remote, usually `main`, so the worktree starts from a clean tree matching the remote.
* `"head"`: branch from your current local `HEAD`, so the worktree carries your unpushed commits and feature-branch state. Use this when isolating subagents that need to operate on in-progress work. Inside a worktree, `"head"` resolves to that worktree’s `HEAD`, not the main checkout’s.
@@ -261,7 +266,7 @@
### Git LFS files are pointer files in a worktree Claude Code created
-If you set up [Git LFS](<https://git-lfs.com>) with `git lfs install --local`, a worktree that Claude Code creates contains LFS pointer files instead of the real files. The `--local` flag writes the LFS filter into the repository’s own `.git/config` rather than your global git config. A plain `git lfs install` writes to your global config and isn’t affected. The same applies to any other [filter driver](<https://git-scm.com/docs/gitattributes>) defined in the repository’s own config. Claude Code skips the repository’s own filter drivers when it creates a worktree because a filter driver is a shell command, and anything that can write to the repository, including Claude, could have put one there. Before v2.1.247, Claude Code ran those drivers during worktree creation. To get the real files, run `git lfs pull` inside the worktree. In four rare cases, Claude Code creates no worktree at all: it can’t tell which filter drivers the repository’s config defines, or it finds a setting there it can’t switch off. Match the error to its fix:
+If you set up [Git LFS](<https://git-lfs.com>) with `git lfs install --local`, a worktree that Claude Code creates contains LFS pointer files instead of the real files. The `--local` flag writes the LFS filter into the repository’s own `.git/config` rather than your global git config. A plain `git lfs install` writes to your global config and isn’t affected. The same applies to any other [filter driver](<https://git-scm.com/docs/gitattributes>) defined in the repository’s own config. Claude Code skips the repository’s own filter drivers when it creates a worktree because a filter driver is a shell command, and anything that can write to the repository, including Claude, could have put one there. Before v2.1.247, Claude Code ran those drivers during worktree creation. To get the real files, run `git lfs pull` inside the worktree. If worktree creation fails with one of these errors, match the error to its fix:
* **`Could not read the repository git config to neutralize filter drivers`** : Claude Code couldn’t read the repository’s `.git/config`, for example because of its permissions. Fix that and retry.
* **`The repository git config defines a filter driver whose name cannot be neutralized (contains "=" or a newline)`** : rename or remove that filter driver in `.git/config` and retry.