Changes on
77 changes detected
--- a/admin.md
+++ b/admin.md
@@ -317,7 +317,7 @@
On v2.1.323 or later, a `ui.focus` hook needs a wider matcher to receive other mods’ `$.ui.focus` calls. See [Hook other mods’ drawings and controls](</docs/en/plugins/mods/events#hook-other-mods-drawings-and-controls>).
-This policy mod refuses any user’s mod whose own code calls `$.process.run` or `$.process.spawn`. It also keeps an audit log, writing each tool call and each file a mod writes to the debug log. Because it runs first, the log records what was requested, before any user’s mod changes it. Save it as `acme-guard/hooks/register.js`:
+This policy mod stops any user’s mod whose own code calls `$.process.run` or `$.process.spawn`, and lets the rest of the user’s plugin load. It also keeps an audit log, writing each tool call and each file a mod writes to the debug log. Because it runs first, the log records what was requested, before any user’s mod changes it. Save it as `acme-guard/hooks/register.js`:
acme-guard/hooks/register.js
@@ -330,7 +330,9 @@
// Keep the calls in that mod's code that are on the blocked list
const blocked = e.uses.calls.filter((call) => BLOCKED_CALLS.includes(call))
if (e.tier === 'user' && blocked.length > 0) {
- // Returning refuse keeps the mod from loading, and the text is the reason
+ // v2.1.326 or later: leave out the hooks module and load the rest of the plugin
+ if (e.provides) return next({ ...e, provides: { ...e.provides, modules: [] } })
+ // Earlier versions: refuse leaves out the hooks module, and the text is the reason
return { refuse: 'Acme policy: mods may not call ' + blocked.join(', ') }
}
// Let every other mod load
@@ -352,20 +354,25 @@
The file registers three hooks:
- * **`plugin.register`** : decides whether another mod loads. It refuses a user’s mod that calls a blocked method and passes every other mod on.
+ * **`plugin.register`** : decides whether another mod loads. It stops a user’s mod that calls a blocked method and passes every other mod on.
* **`tool.call`** : writes a line such as `audit tool.call Bash` to the debug log for each tool call, and changes nothing
* **`fs.write`** : writes a line such as `audit fs.write by reader "/tmp/notes.md"` for each `$.fs.write` call another mod makes, and changes nothing. The mod’s name comes first and the path is quoted, so a path that a mod picks can’t pass for another field of the line.
-The `plugin.register` hook reads two fields of the event:
+The `plugin.register` hook reads three fields of the event:
* **`e.tier`** : where the mod would run, one of `prepend`, `user`, `append`, or `builtin`. Every mod a person installs is `user`.
* **`e.uses.calls`** : the mods API methods the mod calls, each written `namespace.method` such as `process.run`, without the `$.` that `claude plugin validate` prints
-
-When a user installs a mod that calls `$.process.run`, the mod doesn’t load, and their debug log has a line that ends with `refused by acme-guard:` and your reason. The refusal also reaches the transcript in a [session that hot-reloads a plugin directory](</docs/en/plugins/mods/troubleshoot#find-out-why-a-mod-does-nothing>). To block a call without refusing the whole mod, return `{ deny: 'your reason' }` from a hook on that call’s name, after you [check who made the call](</docs/en/plugins/mods/reference#mods-api-calls>). To send the audit lines somewhere other than the debug log, call `$.http.fetch` from the same hooks. A session can run without your mod. If the worker thread that runs installed mods [crashes three times](</docs/en/plugins/mods/troubleshoot#mods-that-run-in-the-hooks-worker-are-off-for-this-session>), Claude Code unloads every mod that isn’t built in, including yours, until the user runs `/reload-plugins` or starts a new session. And a user who starts Claude Code with `--safe-mode` runs without installed mods, yours included. [Create a mod](</docs/en/plugins/mods/create>) covers the files a mod needs. [Test a policy mod](</docs/en/plugins/mods/test#test-a-mod-that-judges-other-mods>) has a test file for this policy mod.
+ * **`e.provides`** : the plugin’s parts by kind, such as `modules`. To load everything but the [hooks module](</docs/en/plugins/mods/create#write-a-mod-yourself>), pass `next` the event with `provides.modules` emptied. Requires Claude Code v2.1.326 or later.
+
+When a user installs a mod that calls `$.process.run`, the mod doesn’t load, and their debug log has a line that includes `hooks module left out by acme-guard`. The line also reaches the transcript in a [session that hot-reloads a plugin directory](</docs/en/plugins/mods/troubleshoot#find-out-why-a-mod-does-nothing>). Before v2.1.326, look for `refused by acme-guard:` and your reason instead.
+
+When you return `{ refuse }` on v2.1.326 or later, the whole plugin stays out, including its MCP servers and the hooks in its `hooks/hooks.json`. If you wrote a policy mod for an earlier version, add the example’s `if (e.provides)` line ahead of each refusal that should stop only the mod. For a `.catch` handler, see Refuse mods when your check fails.
+
+To block a call without refusing the whole mod, return `{ deny: 'your reason' }` from a hook on that call’s name, after you [check who made the call](</docs/en/plugins/mods/reference#mods-api-calls>). To send the audit lines somewhere other than the debug log, call `$.http.fetch` from the same hooks. A session can run without your mod. If the worker thread that runs installed mods [crashes three times](</docs/en/plugins/mods/troubleshoot#mods-that-run-in-the-hooks-worker-are-off-for-this-session>), Claude Code unloads every mod that isn’t built in, including yours, until the user runs `/reload-plugins` or starts a new session. And a user who starts Claude Code with `--safe-mode` runs without installed mods, yours included. [Create a mod](</docs/en/plugins/mods/create>) covers the files a mod needs. [Test a policy mod](</docs/en/plugins/mods/test#test-a-mod-that-judges-other-mods>) has a test file for this policy mod.
#### Refuse mods when your check fails
-If your `plugin.register` hook throws or exceeds its time limit, Claude Code skips the hook, so the check fails open and the mod it was checking loads. To fail closed and refuse users’ mods, move the check into a named function and add a `.catch` handler that returns the refusal. This version of the file shows the `plugin.register` hook only, so keep the two audit hooks from the first version in `register`:
+If your `plugin.register` hook throws or exceeds its time limit, Claude Code skips the hook, so the check fails open and the mod it was checking loads. To fail closed when the check throws, move it into a named function and add a `.catch` handler. This version of the file shows the `plugin.register` hook only, so keep the two audit hooks from the first version in `register`:
acme-guard/hooks/register.js
@@ -375,22 +382,24 @@
async function checkMod($, e, next) {
const blocked = e.uses.calls.filter((call) => BLOCKED_CALLS.includes(call))
if (e.tier === 'user' && blocked.length > 0) {
+ if (e.provides) return next({ ...e, provides: { ...e.provides, modules: [] } })
return { refuse: 'Acme policy: mods may not call ' + blocked.join(', ') }
}
return next(e)
}
export function register(on) {
- // The handler runs only when checkMod throws or exceeds its time limit
+ // The handler runs when checkMod throws
on('plugin.register', checkMod).catch(async ($, e, next) => {
// Let your organization's mods and built-in mods load
if (e.tier !== 'user') return next(e)
- // Refuse the user's mod that couldn't be checked
+ // Stop the unchecked mod, not its whole plugin
+ if (e.provides && !next.called) return next({ ...e, provides: { ...e.provides, modules: [] } })
return { refuse: 'Acme policy check failed, so this mod was not loaded' }
})
}
-With the handler in place, a mod that was being checked when the check threw or timed out doesn’t load, and the refusal line carries the second reason, as in `refused by acme-guard: Acme policy check failed, so this mod was not loaded`. The handler passes every mod outside the `user` tier to `next(e)`, so a failed check doesn’t stop the mods your organization lists. [Handle a hook that fails](</docs/en/plugins/mods/events#handle-a-hook-that-fails>) covers `.catch` for other events.
+With the handler in place, a user’s mod doesn’t load when the check throws. If the check throws after it calls `next`, the handler falls back to `refuse`. Don’t rely on the handler for a check that exceeds its time limit. The handler passes every mod outside the `user` tier to `next(e)`, so a failed check doesn’t stop the mods your organization lists. [Handle a hook that fails](</docs/en/plugins/mods/events#handle-a-hook-that-fails>) covers `.catch` for other events.
## Next steps
--- a/admin-setup.md
+++ b/admin-setup.md
@@ -83,7 +83,7 @@
If your members sign in through claude.ai or the Anthropic API and you’re on a Claude Enterprise plan, you can also govern models from your organization’s admin settings without deploying anything:
* [Organization model restrictions](</docs/en/model-config#organization-model-restrictions>): disable individual models. Enforced server-side.
- * [Organization default model](</docs/en/model-config#organization-default-model>): set which model new sessions start on. Members can still switch models. To return them to your default at launch, turn on the override that section describes. To limit which models they can pick, use [organization model restrictions](</docs/en/model-config#organization-model-restrictions>).
+ * [Organization default model](</docs/en/model-config#organization-default-model>): set which model new sessions start on. Members can still switch models. To return them to your default, turn on the override that section describes. To limit which models they can pick, use [organization model restrictions](</docs/en/model-config#organization-model-restrictions>).
* [Organization effort limits](</docs/en/model-config#organization-effort-limits>): cap effort levels per role. Enforced server-side.
None of these controls reach sessions on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On those providers, use managed settings instead: `availableModels` for restrictions, `model` for a default, and [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) for an effort cap. [Cloud sessions](</docs/en/claude-code-on-the-web>) have their own admin surfaces on claude.ai:
--- a/agent-loop.md
+++ b/agent-loop.md
@@ -285,6 +285,7 @@
* A single-shot `query()` call yields the final result message, then raises an error that includes the failure text, such as `Reached maximum number of turns`. The raise is intentional. Wrap the loop in a try block if your code needs to continue past it. The underlying Claude Code process also exits with a nonzero code.
* A streaming input session stays alive, and you can keep sending messages, except after a session crash, which emits a final `error_during_execution` result and exits the process.
+ * In TypeScript, the loop over `query()` in a streaming input session throws when the last response ends in an error result. Wrap the loop in a try block if your code needs to continue past it.
The result also includes a `stop_reason` field (`string | null` in TypeScript, `str | None` in Python) indicating why the model stopped generating on its final turn. Common values are `end_turn` (model finished normally), `max_tokens` (hit the output token limit), and `refusal` (the model declined the request). On error results that the loop produced, `stop_reason` carries the value from the last assistant response before the loop ended; the result Claude Code synthesizes after a session crash carries `null`. To detect refusals, check `stop_reason === "refusal"` (TypeScript) or `stop_reason == "refusal"` (Python). See [`SDKResultMessage`](</docs/en/agent-sdk/typescript#sdkresultmessage>) (TypeScript) or [`ResultMessage`](</docs/en/agent-sdk/python#resultmessage>) (Python) for the full type.
--- a/agent-view.md
+++ b/agent-view.md
@@ -187,7 +187,7 @@
#### Switch sessions without leaving the terminal
-In a session running in the foreground, one you started in the terminal rather than attached to from agent view, pressing `←` on an empty prompt backgrounds it and opens agent view with that row selected, so you can switch sessions without leaving the terminal. The same single press detaches an attached session. If you press `←` right after you delete the last of the prompt’s text or move through prompt history, Claude Code asks you to confirm: the first press shows `Press ← again to open agents`, or `Press ← again to go back to agents` in an attached session, and the second press switches. When `←` backgrounds a foreground session, agent view shows `Your conversation moved to the background` above the list, with that session’s row already selected. From there:
+In a session running in the foreground, one you started in the terminal rather than attached to from agent view, pressing `←` on an empty prompt backgrounds it and opens agent view with that row selected, so you can switch sessions without leaving the terminal. The same single press detaches an attached session. If you press `←` right after you delete the last of the prompt’s text or move through prompt history, Claude Code asks you to confirm: the first press shows `Press ← again to open agents`, or `Press ← again to go back to agents` in an attached session, and the second press switches. After you background a session with `←`:
* Press `Enter` to reopen the conversation.
* Press `Esc` to undo the switch and return to the conversation. If `Esc` shows `Still starting — try again in a moment`, the background session isn’t ready yet, so press `Esc` again in a moment.
--- a/amazon-bedrock.md
+++ b/amazon-bedrock.md
@@ -359,7 +359,7 @@
export ANTHROPIC_BEDROCK_SERVICE_TIER=priority
-Claude Code sends this as the `X-Amzn-Bedrock-Service-Tier` header on every [Invoke API](<https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html>) request from a session that has the variable, except its model access checks. Setting it has no effect on requests to the Mantle endpoint or through a [Claude apps gateway](</docs/en/claude-apps-gateway>). Tier availability varies by model and region. Reserved capacity uses a [provisioned throughput](<https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html>) ARN as the model ID instead of this setting. To cover [background sessions](</docs/en/agent-view#settings-and-provider>) you start from a terminal, set `ANTHROPIC_BEDROCK_SERVICE_TIER` in the [`env`](</docs/en/settings-reference#env>) block of your settings. Those sessions get the value you export only when the shell that started the [supervisor](</docs/en/agent-view#the-supervisor-process>) exported it.
+Claude Code sends this as the `X-Amzn-Bedrock-Service-Tier` header on every [Invoke API](<https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html>) request from a session that has the variable, except its model access checks. Setting it has no effect on requests to the Mantle endpoint or through a [Claude apps gateway](</docs/en/claude-apps-gateway>). Tier availability varies by model and region. To cover [background sessions](</docs/en/agent-view#settings-and-provider>) you start from a terminal, set `ANTHROPIC_BEDROCK_SERVICE_TIER` in the [`env`](</docs/en/settings-reference#env>) block of your settings. Those sessions get the value you export only when the shell that started the [supervisor](</docs/en/agent-view#the-supervisor-process>) exported it.
## AWS Guardrails
--- a/analytics.md
+++ b/analytics.md
@@ -61,11 +61,10 @@
These metrics are deliberately conservative and represent an underestimate of Claude Code’s actual impact. Only lines and PRs where there is high confidence in Claude Code’s involvement are counted.
-The dashboard displays these summary metrics at the top:
+The dashboard displays these summary metrics:
- * **PRs with CC** : total count of merged pull requests that contain at least one line of code written with Claude Code
- * **Lines of code with CC** : total lines of code across all merged PRs that were written with Claude Code assistance. Only “effective lines” are counted: lines with more than 3 characters after normalization, excluding empty lines and lines with only brackets or trivial punctuation.
- * **PRs with Claude Code (%)** : percentage of all merged PRs that contain Claude Code-assisted code
+ * **PRs with Claude Code** : merged pull requests that contain at least one line of code written with Claude Code. One card shows the count, and one shows the share of all merged PRs
+ * **LOC with Claude Code** : total lines of code (LOC) across all merged PRs that were written with Claude Code assistance. Only “effective lines” are counted: lines with more than 3 characters after normalization.
* **Suggestion accept rate** : percentage of times users accept Claude Code’s code editing suggestions, including Edit, Write, and NotebookEdit tool usage
* **Lines of code accepted** : total lines of code that Claude Code’s Edit and Write tools added or removed in accepted edits. This excludes rejected suggestions, and lines deleted later don’t reduce the total.
@@ -73,30 +72,13 @@
The dashboard includes several charts to visualize trends over time.
-#### Track adoption
-
-The Adoption chart shows daily usage trends:
-
- * **users** : daily active users
- * **sessions** : number of active Claude Code sessions per day
-
#### Measure PRs per user
-This chart displays individual developer activity over time:
-
- * **PRs per user** : total number of PRs merged per day divided by daily active users
- * **users** : daily active users
-
-Use this to understand how individual productivity changes as Claude Code adoption increases.
+**Total PRs per user** is the number of PRs merged per day divided by daily active users. Use this to understand how individual productivity changes as Claude Code adoption increases.
#### View pull requests breakdown
-The Pull requests chart shows a daily breakdown of merged PRs:
-
- * **PRs with CC** : pull requests containing Claude Code-assisted code
- * **PRs without CC** : pull requests without Claude Code-assisted code
-
-Toggle to **Lines of code** view to see the same breakdown by lines of code rather than PR count.
+The **PRs with Claude Code** chart compares each day’s merged PRs with Claude Code to **All PRs**. Toggle to **Lines of code** view to see the same breakdown by lines of code rather than PR count.
#### Find top contributors
@@ -150,7 +132,7 @@
#### Monitor adoption
-Track the Adoption chart and user counts to identify:
+Track the **Users** and **Sessions** charts to identify:
* Active users who can share best practices
* Overall adoption trends across your organization
@@ -161,7 +143,7 @@
Contribution metrics help answer “Is this tool worth the investment?” with data from your own codebase:
* Track changes in PRs per user over time as adoption increases
- * Compare PRs and lines of code shipped with vs. without Claude Code
+ * Compare PRs and lines of code shipped with Claude Code to all PRs and lines of code
* Use alongside [DORA metrics](<https://dora.dev/>), sprint velocity, or other engineering KPIs to understand changes from adopting Claude Code
#### Identify power users
--- a/artifacts.md
+++ b/artifacts.md
@@ -142,7 +142,7 @@
Claude also stops replying on its own to an artifact after it handles 60 sent comments or thread activations on that artifact within an hour. You see `Comments are waiting on Artifact: <name>` once, and Claude picks up again as that hour’s comments age out. Run `/tasks` to see the artifacts your session is watching. `/tasks` groups the watches Claude Code started on its own under the **System tasks** row. Press `Enter` on that row to list them. A watch you asked Claude to start appears under **Monitors**. You can stop Claude from replying on its own in any of these ways:
- * **Press Ctrl+C once at an idle prompt** : Claude pauses replying on every artifact your session is watching. Replies start again after you send your next message.
+ * **Press Ctrl+C once at an idle, empty prompt** : Claude pauses replying on every artifact your session is watching. Replies start again after you send your next message.
* **Stop the task in`/tasks`**: Claude stops replying on that artifact until you ask it to resume replies there. Publishing the artifact again doesn’t start replies again, and the stop still applies when you resume the session later.
* **Press`Ctrl+X Ctrl+K` twice within 3 seconds**: the chord that [stops every running background subagent](</docs/en/interactive-mode#general-controls>) also stops Claude from replying on every artifact for the rest of the session. Asking Claude to resume replies doesn’t undo this stop.
@@ -170,7 +170,7 @@
When a connector-backed page renders but its live sections stay empty for a viewer in your organization, work through these causes:
- * **The viewer hasn’t connected the connector** : connectors are per-account, so each viewer needs their own connection to every connector the page calls. They can add one under [**Customize > Connectors**](<https://claude.ai/customize/connectors>) on claude.ai, then reload the page.
+ * **The viewer hasn’t connected the connector** : connectors are per-account, so each viewer needs their own connection to every connector the page calls. They can add one at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>), then reload the page.
* **The viewer declined the permission ask** : a denial lasts for the rest of that page load. Reloading the page brings the permission ask back.
* **Connector calls are turned off for the organization** : an Owner controls the **Enable artifact connectors** toggle in admin settings.
* **The page calls tool names the connector doesn’t expose** : the affected sections stay empty for everyone, including you. This can happen when a page names the individual tools behind a gateway-style connector that exposes only a few tools of its own. Ask Claude to fix the tool names the page calls and publish it again. When Claude publishes the page and that connector’s tools are available in your session, Claude Code checks the tool names the page declares against them, warns Claude about names that don’t match, and refuses the publish when none do. Before v2.1.265, it published the page without checking them.
@@ -229,19 +229,17 @@
Claude treats your design system as higher precedence than its own choices, and your prompt as higher precedence than both. The heading and format above are an example; any clear list of colors, fonts, and spacing works. For typography, Claude can load a typeface from Google Fonts, the one external font source an artifact page can load from. Claude inlines any other typeface as a `@font-face` data URI and gives every typeface a fallback stack, so the page still renders if a font doesn’t load. To use a specific typeface, name it in your prompt or your design system.
-## Start from a Slides, Design, or Docs template
-
-Instead of building a page from scratch, Claude can start an artifact from one of the templates on your claude.ai account: [Claude Slides](<https://support.claude.com/en/articles/17153992-what-are-artifacts-and-how-do-i-use-them#h_11d5a9a5fa>) for a presentation, [Claude Design](<https://support.claude.com/en/articles/14604416-get-started-with-claude-design>) for a visual design, or [Claude Docs](<https://support.claude.com/en/articles/16923645-get-started-with-claude-docs>) for a document other people will read and edit. Each opens in its own editor on claude.ai, where you and your teammates change it directly or ask Claude to, and export it to formats such as PowerPoint, PDF, or Word. To start from a template, describe what you want, such as “turn the migration notes into a deck for Thursday’s review” or “write this plan up as a doc for the team”. Claude picks the matching template, fills it from your request and from what the session already has, and gives you the link. For a deck or a design you can also run `/slides` or `/design` with a brief.
-
-Templates are in beta. They’re on by default on Pro, Max, Ultra, and Team plans. On Enterprise plans, an Owner [turns each template on](<https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans>) under **Organization settings > Artifacts**. If your organization has the Slides template turned off, `/slides` doesn’t appear; if it has the Design template turned off, `/design` doesn’t draft designs. Both commands require Claude Code v2.1.265 or later and a session where artifacts are available.
-
-### Make a slide deck
-
-Run `/slides` with a brief that says what the deck covers and who it’s for:
-
- /slides a quarterly review of the platform team's reliability work, for the engineering all-hands
-
-Claude creates a Claude Slides artifact and gives you the link. Open it in a desktop browser to edit or present the deck. If you run `/slides` without a brief, Claude asks what the deck should be about before creating anything.
+## Start an artifact from a template
+
+The [artifact templates](<https://support.claude.com/en/articles/17153992-what-are-artifacts-and-how-do-i-use-them#h_11d5a9a5fa>) on your claude.ai account also work from Claude Code. For example, use the [Claude Design](<https://support.claude.com/en/articles/14604416-get-started-with-claude-design>) template for a visual design, or the [Claude Docs](<https://support.claude.com/en/articles/16923645-get-started-with-claude-docs>) template for a document other people will read and edit. Your account can include others, such as Sheets, Whiteboards, or Data. To see which ones your session has, ask Claude to list the artifact templates available to you. To use a template from Claude Code, you need:
+
+ * A session where artifacts are available
+ * On Team and Enterprise plans, the template turned on for your organization. If it’s off, ask an Owner to [turn the template on](<https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_6e06d8f1a8>) under **Organization settings > Artifacts** on claude.ai.
+ * On Enterprise plans with custom roles, a role that [includes the template](<https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_d830917488>)
+ * For the Docs and Sheets templates, the Claude Docs connector, which Claude uses to write the content of both. If you [turned the connector off](</docs/en/mcp#disable-claude-ai-connectors>), turn it back on first.
+ * Claude Code v2.1.265 or later, if you start the Design template with its `/design` command
+
+To start from a template, name it or describe what you want, such as “write this plan up as a doc for the team” or “make a shared task spreadsheet”. Claude picks the matching template, fills it from your request and from what the session already has, and gives you the link. To get a file instead, name the format, such as `.csv`. To edit the artifact yourself, open the link, which goes to that template’s editor on claude.ai. You can also keep asking Claude for changes from your session. For export formats, see [View and export](<https://support.claude.com/en/articles/17153992-what-are-artifacts-and-how-do-i-use-them#h_1403132eb8>).
### Draft a design canvas
@@ -253,7 +251,7 @@
### Write a document with Claude Docs
-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>).
+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.
## Page constraints
--- a/authentication.md
+++ b/authentication.md
@@ -86,7 +86,7 @@
You can add users through either method:
- * Bulk invite users from the Console’s Members page at [platform.claude.com/settings/members](<https://platform.claude.com/settings/members>): click **Invite**
+ * Bulk invite users from the Console’s Members page at [platform.claude.com/settings/members](<https://platform.claude.com/settings/members>): click **Invite to organization**
* [Set up SSO](<https://support.claude.com/en/articles/13132885-setting-up-single-sign-on-sso>)
3
--- a/auto-mode-config.md
+++ b/auto-mode-config.md
@@ -178,7 +178,7 @@
Each is an array of prose descriptions, read as natural-language rules. For tool-pattern-based hard blocks that run before the classifier, use [`permissions.deny`](</docs/en/permissions>).
-In a [Code Mode](</docs/en/code-mode#permission-checks>) session, the classifier applies `hard_deny` and `soft_deny` when it reviews Claude’s code, and not to each tool call the code makes. `permissions.deny` rules apply to each call.
+In a [Code Mode](</docs/en/code-mode#permission-checks>) session, the classifier applies `hard_deny` and `soft_deny` to each piece of code as a whole, before the code runs. To block a specific tool call that the code makes, use a `permissions.deny` rule.
Inside the classifier, precedence works in four tiers:
Show diff (390 lines)
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,387 @@
This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Longer releases are grouped by type of change, with long lists of improvements and bug fixes collapsed. Run `claude --version` to check your installed version.
+
+2.1.326
+
+November 16, 2026
+
+**Added**
+
+ * Added support for turning on Code Mode while agent teams are enabled; if you already turned it on, sessions with teams on now start in Code Mode
+ * Added a startup warning when an `--allowedTools`, `--disallowedTools` or `--tools` value has an entry that doesn’t look like a complete rule
+ * Added a message explaining why MCP servers stop loading when an administrator adds `managed-mcp.json` during a session
+ * Added a row to `/status` that says when your provider or an environment variable such as `DISABLE_TELEMETRY` turns features off
+ * Added a note in `/plugin` and `claude plugin list` when a malformed `plugin.json` field such as `author` or `homepage` is ignored
+ * Added Ctrl+O to show hidden startup notices
+ * Added a hint in the empty prompt that says what to do after a request fails
+ * Added an `esc to stop` footer hint in a subagent’s view where Esc would stop it
+ * Added `OTEL_RESOURCE_INCLUDE_HOST` to include `host.name` and `host.id` in OpenTelemetry resource attributes (off by default)
+ * Added `overflowX="scroll"` on a mod’s `Box`, and `maxLines` and `wrap="clip"` on its `Text`
+ * [VSCode] Added a `claudeCode.promptSuggestions` setting that turns prompt suggestions off
+
+**Changed**
+
+ * Changed edits in a session’s mods folder to ask more often, and sandboxed commands to write to fewer folders; if every edit asks, remove any link there to an unreadable or network path
+ * Changed terminal and VS Code sessions in organizations with the Claude Code + Cowork HIPAA configuration to start in auto mode by default; `disableAutoMode` turns it off
+ * Changed terminal and VS Code sessions with no mode set to start in auto mode, not Manual mode, when your organization’s policy hasn’t loaded
+ * Changed a `managed-mcp.json` added mid-session so it may apply at the next check; restart open sessions for it to apply in full
+ * Changed Code Mode’s `$` shell helper to refuse some values with an error; nothing runs
+ * Changed auto mode to stop some shell commands that ran before
+ * Changed some Bash commands on macOS that ran before to ask or be refused
+ * Changed a hook’s `"decision": "block"` to hold in more cases, so a hook that always prints one may start blocking calls
+ * Changed sessions that start in auto by default to take a server-managed `defaultMode` once settings load, or Manual if settings fail with no stored copy and policy fails or requires it
+ * Changed auto mode for organizations with the Claude Code + Cowork HIPAA configuration: on a direct Anthropic API connection, the server-side classifier now checks actions, as for other organizations
+ * Changed the Bash sandbox to keep its state in some cases during a session, until you run `/sandbox` or `/cd`; Bash may ask first
+ * Changed sandboxed commands on macOS, Linux and WSL to no longer write to some sensitive home folders by default; some can be allowed with `sandbox.filesystem.allowWrite` in user or managed settings
+ * Changed the Bash sandbox to set aside unexpected entries in a repository’s `.git` folder after a command
+ * Changed the Bash sandbox on Linux and WSL to create some missing `--add-dir` folders before each sandboxed command, so commands that create them can fail, skip, or land inside them
+ * Changed commands that a permission hook or SDK host rewrites while approving to stay in the sandbox if the original was checked as sandboxed; the approver can add `dangerouslyDisableSandbox: true`
+ * Changed `claude mcp serve` to ignore `sandbox.excludedCommands`
+ * Changed `/rewind` on macOS, Linux and WSL to leave some files untouched and report them as skipped when the sandbox is on
+ * Changed the Bash sandbox to ask before some lines that set environment variables when auto-allow is off; unattended runs can refuse them
+ * Changed Claude’s file tools to refuse writes to Claude Code’s sign-in files, such as `.credentials.json`
+ * Changed the Bash permission check to ask before more commands reach Claude Code’s sign-in files
+ * Changed some file tools to refuse some device and process files
+ * Changed some `cp` and `mv` commands to ask first
+ * Changed some tool calls in bypass permissions mode to ask for approval, or be denied where no one can be asked
+ * Changed the Bash permission check to ask about some commands with very long values it can’t finish checking, or to refuse them where a deny rule may apply or no one can answer
+ * Changed subagents isolated in a worktree to refuse, in any repository, some git commands in Bash that can rewrite branches shared with your checkout; sessions are not affected
+ * Changed `ExitWorktree` to refuse removing a worktree while a background subagent or shell command may still be running in it, unless Claude passes `discard_changes`
+ * Changed the computer use macOS permissions panel to ignore j and k; the arrow keys and Ctrl+P/Ctrl+N still move the selection
+ * Changed the PowerShell tool to ask before some more commands; unattended runs refuse them unless an allow rule, auto mode or bypass permissions mode allows them
+ * Changed the PowerShell tool to ask about some more commands, even in bypass permissions mode, and to refuse some of them
+ * Changed some malformed PowerShell commands to be denied
+ * Changed some PowerShell tool commands that define a function named like a built-in command to be refused, so Claude can rename it
+ * Changed auto mode to ignore some wildcard shell allow rules, such as ones that name no program or that start with `$HOME`, so the safety check decides those commands
+ * Changed auto mode to judge wildcard allow rules whose program is a Windows backslash path, so those calls can be blocked; exact rules keep their allow; we plan to restore rules that start with `.\`
+ * Changed a managed `autoMode.environment` list without `"$defaults"` to replace every built-in entry in Claude Desktop and Agent SDK apps too; add `"$defaults"` or copy the sensitive-target ones
+ * Changed `--add-dir` and `/add-dir` in local terminal sessions to show the trust prompt for a folder you have not trusted yet; `claude --bg` refuses such a folder
+ * Changed self-hosted runners under `--trust-workspace false` to ignore more repository settings; set such values in user or managed settings
+ * Changed how permission answers over Remote Control and on self-hosted runners save “always allow” choices
+ * Changed enabled plugins that were refused for a malformed `plugin.json` display field: they now load, with their hooks and MCP servers; administrators should check the plugins they deploy
+ * Changed how `allowedHttpHookUrls` and `httpHookAllowedEnvVars` apply to hooks from managed settings
+ * Changed HTTP hooks to ignore `Content-Length` and `Transfer-Encoding` in their `headers` setting; the request’s length comes from its body
+ * Changed plugin uninstall to also delete the files extracted from the plugin’s MCP bundles (`.mcpb`, `.dxt`), unless another plugin uses the same bundle
+ * Changed some worktree sessions to skip some plugin settings; a notice names what was skipped
+ * Changed `/plugin` uninstall, remove and switch questions to lists answered with the arrow keys and Enter, or Esc to cancel; `y`, `n` and `u` no longer answer them
+ * Changed automatic compaction in plan mode to use the model answering you, such as Opus with `opusplan`, so it can cost more
+ * Changed Cowork cloud sessions to hold an organization’s OpenTelemetry export until the first turn; a session that gets no message now sends nothing, so `claude_code.session.count` can fall
+ * Changed Claude’s messages to a session on another machine to be refused when your session uses an API key, auth token, profile or workload identity beside a saved claude.ai login
+ * Changed `--bare` sessions on an unapproved API key: moving one to the background is now refused in most setups, and `claude --bare --bg` exits with an error if the background service lacks the key
+ * Changed “Continue automatically at usage limit” to stop with a notice, sending nothing, when your login changes or ends during the wait
+ * Remote Control: Changed how it connects through a proxy: requests now use a CONNECT tunnel, so a proxy that refuses CONNECT stops Remote Control with an error
+ * Remote Control: Changed the session debug logs written under `--verbose` to go to `~/.claude/child-logs/`
+ * Self-hosted runner: Changed Linux and macOS sessions with no `gh` to get a built-in `gh api` by default, via Anthropic, which adds their GitHub sign-in, if any; `--use-anthropic-gh false` turns it off
+ * Changed agent view so that quitting with Ctrl+C twice, Ctrl+D twice or `/exit` after pressing `←` in an empty conversation ends that session, instead of leaving it running for 5 minutes
+ * Changed `--await-initialize` to be refused with `--bg` or `--worktree --tmux`, which never read the initialize request, instead of starting without the fields it carries
+ * Changed worktree creation, `/teleport` and IDE checkouts to run git with a stricter `PATH`; a git filter or helper may need its full path
+ * Changed the card for approving a subagent’s plan to two choices, “Yes, and switch to default (ask each time) for this session” and “No”, chosen with the arrow keys and Enter (typed text moves to No)
+ * Changed the `/claude-api` skill to build agents on Managed Agents by default, unless you want to host the agent loop yourself
+ * Changed `/usage` in fullscreen mode to show plan limit bars before session cost for subscribers; `/cost` still starts with cost
+ * Changed the wording of some messages that `claude` subcommands print; JSON output is unchanged
+ * Changed first-run setup to preselect the “Auto (match terminal)” theme instead of Dark mode
+ * Changed fullscreen `/cd` to refuse “Yes” while its trust prompt doesn’t fit, with a line saying to make the window taller
+ * Removed the tmux notice that said the mouse wheel needs `set -g mouse on` in fullscreen; the wheel scrolls without it
+ * Removed the spinner tip that suggested `/clear` 30 minutes into a running turn
+ * [VSCode] Changed a running command’s live output in the chat to look like the command card’s OUT row
+ * [VSCode] Changed the text of extension errors in event listeners, views and activation to stay out of the editor’s own error telemetry
+
+Show 59 improvements
+
+ * Improved Bash permission checks: some commands now ask first, or are refused where no one can answer
+ * Improved permission checks in Code Mode; more sandboxed commands now ask or are refused
+ * Improved the messages shown when Code Mode can’t be turned on, so they say what you can do
+ * Improved Bash sandbox protections on macOS, Linux and WSL
+ * Improved Claude’s sandbox instructions on Linux to explain that a server is reachable only from the command that started it
+ * Improved how secrets are masked in push notifications from Remote Control and cloud sessions
+ * Improved `/logout` and `claude auth logout` in the terminal to retry revoking the login, and to say where to revoke it if the server doesn’t confirm
+ * Improved Remote Control: replies from `claude remote-control`, Claude Desktop and VS Code sessions now stream to your phone or browser as they are written
+ * Improved typing, streaming and resize responsiveness, especially in long sessions
+ * Improved response time after reading or editing files, most noticeably on Windows
+ * Improved idle CPU use: an idle session now wakes the machine less often
+ * Improved CPU use when more than 20 subagents are running: token counts of background agents whose transcript isn’t open now update every 5 seconds
+ * Windows: Improved the speed of a session’s first Bash command by about a second
+ * Improved response time of the first message after `/compact` in git repositories
+ * Improved response time in Claude Desktop for messages queued while Claude finishes a reply
+ * Improved time to first response in Claude Desktop’s new sessions: the first turn no longer waits up to 500 ms for local MCP servers whose tools load on demand
+ * Improved how a PreToolUse hook’s `updatedInput` is kept when more than one hook answers a tool call; the rewrite now runs in more cases
+ * Improved the error when a PreToolUse hook exits 127, saying its check may not have run
+ * Improved hook failures, blocks and timeouts in the transcript: failures are now red instead of grey, a hook that stops Claude is yellow, and the reason is shown under them
+ * Improved the folder trust prompt, at launch and in `/cd`, to name the project settings files Claude Code will load; at launch it also marks files that run commands
+ * Improved the folder trust prompt to say why Claude Code exited
+ * Improved the message in non-interactive runs and background agents when a permission check fails with an error, so it names the cause
+ * Improved Claude in Chrome permission requests from a terminal session over Remote Control: on claude.ai they now name the site Claude wants to act on, also when it is already allowed
+ * Improved MCP tool errors in cloud sessions: when a call through the session’s proxy is cut off after it was sent, Claude is told that the outcome is unknown
+ * Improved `/update-config` in the terminal to use about 13,000 tokens of context instead of 93,000, and a rejected settings edit to quote only the changed settings
+ * Improved Program Status Protocol (OSC 7501) reports: background commands, monitors and MCP tasks are listed, and a session waiting on them shows as working instead of done
+ * Improved Monitor: when a watch expires with no events and its command wrote to stderr, Claude is now told so and told which file holds the output
+ * Improved Claude in Chrome: a long `browser_batch` call now has 150 seconds to answer, up from 90, so fewer finished results are lost
+ * Improved `/doctor` to share findings as it works instead of staying silent until the full report
+ * Improved the error for a settings or `.mcp.json` file with broken JSON: it now gives the line and column
+ * Improved commands that are off for your provider, sign-in or an environment variable such as `DISABLE_TELEMETRY` to say why instead of “Unknown command”
+ * Improved the `CERT_SIGNATURE_FAILURE` connection error to name a possible cause after a CA renewal and what IT can change
+ * Improved the message shown when a team’s pooled group budget is used up: it now says when the budget resets
+ * Improved the error shown when the API refuses a Console sign-in: it now says to run `/login` instead of pointing to an admin setting
+ * Improved sign-in prompts: pasting a verification code or a web address now says what to do instead, and the prompt stays so you can paste the right code (anthropics/claude-code#97)
+ * Improved the `/login` screen: the code goes in a proper text field, a rejected code says why under it, and pasting in a short window scrolls the field into view
+ * Improved `/design-login`, `/install-github-app` and MCP sign-in screens to match `/login`; the first two now mask the pasted code
+ * Improved the Claude apps gateway sign-in screens: the sign-in address is a link and `c` copies it
+ * Improved `/plugin` Discover and marketplace lists: they fit short windows with the cursor and key hints on screen, and Home, End, PgUp, PgDn, the mouse wheel and clicks now work
+ * Improved `/plugin` Marketplaces and Add marketplace: a compact list, a clearer remove confirmation, a clear text field and shorter errors when adding fails
+ * Improved `/plugin` Installed tab: Home, End, PgUp, PgDn and clicks now work, and hidden rows are counted
+ * Improved `/plugin` Errors and Stats tabs: long errors no longer fill the screen, uninstalling from an error asks first, and long skill names no longer break the table
+ * Improved `claude plugin`, `mcp`, `update`, `doctor` and `auth logout` output on a terminal to mark success, failure and warnings the same way (piped output keeps its old form)
+ * Improved wording across the terminal: `/plugin`, `/mcp`, sign-in, setup, settings, the agent view, `/teleport`, Remote Control, update messages, spinner tips, `/powerup` and `claude --help`
+ * Improved key hints in many dialogs and the `?` lists: they show the keys that work, in one order and wording, and fit narrow windows; deeper screens in `/hooks` and `/permissions` say Esc goes back
+ * Improved text fields in `/add-dir`, `/export`, `/permissions`, `/feedback`, `/install-github-app` and Bedrock and Vertex setup: one look, long text wraps, and a refused value can be corrected in place
+ * Improved dialogs, panels and the transcript: errors, warnings and confirmations in many dialogs start with ✘, ⚠ or ✔, and loading lines, status rows, counts and durations look and read more alike
+ * Improved long menus such as `/permissions`, `/resume` and `/model` to say how many rows are above and below, and the `/` and `@` menus to count hidden rows outside fullscreen and screen reader mode
+ * Improved list navigation: more lists wrap at both ends, checkbox lists in slash commands take Home and End, and `/permissions` says when a search finds nothing
+ * Improved the pickers in agent view to take Home, End and paging
+ * Improved agent view and the agent rows under the prompt to mark the selected row with the same pointer and color as other lists
+ * Improved the footer after Ctrl+C stops background agents: it now offers `↓ to resume subagent` while a stopped subagent is listed
+ * Improved fullscreen mode: the prompt’s borders now show how many lines of a long prompt are out of view
+ * Improved `/autocompact` and `/scroll-speed` with a slider that shows every value, takes Home, End and (in fullscreen) clicks, and fits narrow terminals
+ * Improved on/off settings to read `on` / `off` in `/config`, `/memory` and auto mode setup
+ * Improved the send-now hint under queued messages: it now says “Queued” and no longer looks like part of your message
+ * Improved terminal setup to list every change before making it
+ * Improved alignment and spacing in `/btw`, `/help`, `/scroll-speed`, the settings error dialog and dialogs that suggest a plugin or setting
+ * [VSCode] Improved Edit and Write speed: no wait for new problems on files that are not open in a tab when the editor has been reporting none for such files
+
+Show 233 bug fixes
+
+ * Fixed `cp` of a file being refused when only its source was covered by an `Edit` deny rule
+ * Fixed Bash commands that delete or overwrite files (`find -delete`, `cat a > b`, `sort -o`) being summed up in the transcript as a search or a read
+ * Fixed a misleading “Dangerous rm operation” warning in the Bash permission prompt on some commands with no rm that Claude Code can’t read reliably
+ * Fixed background sessions losing the LLM gateway your shell exported after a crash, after a reopen from another folder, or when the background service lacks it: they now stop before any model request
+ * Fixed the background service ending your own processes, such as an SSH login, when a process number on its list had been reused by another user’s process
+ * Fixed rules added in `/permissions` or at a main-conversation tool prompt, and `/add-dir` folders, looking saved when the settings file couldn’t be written; the terminal now warns and names it
+ * Fixed a failed MCP `headersHelper`, or one not run in an untrusted folder, making other sessions start without that server, for most servers with no stored OAuth refresh token
+ * Fixed managed settings with certain key names stopping Claude Code from starting or affecting other managed files
+ * Fixed settings files with values nested thousands of levels deep crashing Claude Code or applying only some of the time; values past 64 levels are now dropped with a warning
+ * Fixed a settings file saved with an error mid-session being skipped silently; a warning now names the file
+ * Fixed the subagent model set in managed settings not applying in Claude Desktop’s Code tab; it now overrides your own, as in a terminal, unless those settings also pick a provider or gateway
+ * Fixed sandboxed commands failing to start on Linux when the home or config directory is reached through a symlink into `/net` and sandbox settings deny reads of it
+ * Fixed empty placeholder files, including `.git/config.lock`, sometimes being left in the project on Linux when Claude Code was stopped during a sandboxed command
+ * Fixed Up then Enter answering Yes at the folder trust prompt shown under an already trusted parent folder
+ * Fixed an extra Enter at the end of setup accepting the offer to make auto mode the default
+ * Fixed a message typed over the startup auto mode offer being lost, and its Enter accepting the offer
+ * Fixed a note typed on a permission prompt being sent to Claude after Tab had hidden it
+ * Fixed PreToolUse hooks in managed settings leaving no OpenTelemetry `tool_decision` event or `permission_denials` entry when they refused a direct tool call
+ * Fixed letters typed over `/sandbox` or a delete question in `/permissions` moving the selection
+ * Fixed resumed sessions losing recent turns after a crash when the previous turn ended with an empty reply
+ * Fixed resumed sessions losing earlier conversation history when Claude Code ran low on memory
+ * Fixed a re-sent file overwriting Claude’s changed copy in Remote Control and cloud sessions on Linux with no feature flags loaded: the copy moves to a `.kept-` folder, or the new file isn’t saved
+ * Fixed a background session being killed and its request lost when you opened, stopped or removed the older session whose conversation it had resumed
+ * Fixed `claude purge` hiding its prompts when stdout is redirected, where one unseen Enter could delete a project’s data; they now show on the terminal
+ * Fixed the spend limit menu removing the monthly limit without asking when Backspace and Enter were pressed as it opened
+ * Fixed `/rewind` restoring only some files after running `/branch` twice while a slow backup copy was still running
+ * Fixed `/rewind` saying “No code changes” when a shell command changed files it can’t restore; a turn whose changes weren’t tracked now reads “Code changes unknown”
+ * Fixed `/rewind`: Esc now cancels its summary, its list shows more than one past prompt in fullscreen, and a long prompt no longer hides its warning about losing later file changes
+ * Fixed Ctrl+C or Ctrl+D twice in `/skills` quitting Claude Code and dropping changes; it now saves and closes the panel
+ * Fixed the usage limit menu erasing your draft and opening while you were typing
+ * Fixed pasted text and images being dropped when ↑ recalls a draft cleared with Esc Esc
+ * Fixed an edited typed answer to Claude’s question sending the old text when you moved on without pressing Enter
+ * Fixed going back to a question you answered from its list putting the cursor on the first option, where Enter replaced your answer
+ * Fixed `/feedback` and `/bug` sending the report when you typed a space on the confirmation screen, and losing the typed report after Ctrl+O or Ctrl+Z
+ * Fixed a prompt typed after `--add-dir`, `--allowedTools` or another list option being dropped without a message
+ * Fixed `/plan <description>` ignoring the description when plan mode was already on
+ * Fixed valid PDFs being dropped from the conversation after the API rejected a different PDF read in the same batch
+ * Fixed a session ending after a single failed memory allocation while drawing the screen
+ * Fixed compaction on Bedrock, Vertex and Foundry, and with telemetry turned off, sometimes replying to one of your messages instead of summarizing, or leaving Claude’s last reply out of the summary
+ * Fixed image-heavy sessions on Vertex AI getting stuck on a 400 error about the request size exceeding a 30 MB limit, instead of compacting and retrying
+ * Fixed an error when `max_tokens` exceeded the model’s limit: Claude Code now retries the request with the maximum the Anthropic API reports
+ * Fixed `grep` in the Bash tool silently skipping some text files
+ * Fixed a crashed Node or Python hook showing only the first line of its stack trace; the error is now shown, and Ctrl+O shows up to 10,000 characters of the output
+ * Fixed `/goal clear` or a new `/goal` not sticking when typed while Stop hooks were running and background work was still in progress
+ * Fixed the automatic session recap being sent after a reply billed to usage credits; `/recap` still works
+ * Fixed auto mode staying on its local classifier, which counts toward usage, because of a stale saved value, such as one from an older Claude Code
+ * Fixed “Sign in with your Console account” in `/login` replacing your Claude subscription login when the browser sign-in used your Claude plan instead of a Console organization
+ * Fixed `/login` ending on “Login successful” while an approved `ANTHROPIC_API_KEY` was still used; it now says requests still use the key
+ * Fixed “Not logged in” staying after turning on the API key in `/config`; “Not logged in”, `/login` and `/status` now name an unused `ANTHROPIC_API_KEY`
+ * Fixed `claude auth logout` leaving credentials behind, and token refresh failing, when only a Console profile’s credentials are on a drive that rejects folder timestamps
+ * Fixed a past conversation resumed from agent view being sent on the background service’s sign-in when the service doesn’t have the terminal’s API key or token
+ * Fixed model requests failing on a one-off authentication error (401) in Claude Desktop’s Code tab: they are now sent once more first
+ * Fixed `forceLoginOrgUUID` and `forceRemoteSettingsRefresh` startup errors telling you to sign in again when a network block page (HTTP 403) was the cause
+ * Fixed `claude auth login` not showing a pasted sign-in code, so a wrong paste couldn’t be seen or corrected before Enter
+ * Fixed `/login` and `claude setup-token` showing nothing after you submit a pasted code; they now show “Finishing sign-in…”
+ * Fixed Esc doing nothing while the first-run sign-in waits for the browser or a pasted code; it now goes back one screen
+ * Fixed `/logout` in fullscreen mode exiting without leaving the logged-out message on screen
+ * Fixed the shell prompt being drawn over the last screen after quitting with Ctrl+C or Ctrl+D at a sign-in or first-run step
+ * Fixed Ctrl+C twice doing nothing on the first-run theme choice, and freezing the terminal on setup screens or a background session at its startup question
+ * Fixed your OFF answer to the updated terms being replaced when keys were typed while it was saving, at startup and in `/privacy-settings`
+ * Fixed the `/privacy-settings` toggle sometimes saving the opposite of what the screen showed on a quick double press, changing your setting on keys pressed after Esc, and not saying when a save failed
+ * Fixed `/privacy-settings` saving your choice on the wrong account after signing in to a different account in another terminal
+ * Fixed `/privacy-settings` saying “set to true” when you picked OFF right after ON
+ * Fixed skills and slash commands failing to load in Code Mode under auto mode when an inline `!` command needs approval; Claude is now asked to run it
+ * Fixed background subagents started in Code Mode failing when they preload a skill with an inline `!` command
+ * Fixed mods being unable to use Bash, Read and other tools through `$.tool.call` and `$.tool.check` in Code Mode
+ * Fixed parallel MCP tool calls reading another call’s saved result when two long results arrived in the same millisecond (anthropics/claude-code#105138)
+ * Fixed tool search sometimes loading another MCP server’s tool when asked for a tool by its exact name; you may be asked again for that tool
+ * Fixed MCP prompts disappearing when two servers have nearly identical names
+ * Fixed a tool call to an MCP server that an SDK host had just removed reconnecting to it, or reporting that it needs authentication
+ * Fixed Claude not being told that a remote MCP server’s question was declined when the server then failed the tool call
+ * Fixed MCP tools with a root `anyOf` or `oneOf` showing Claude only the first branch’s form of an argument; text such as `42` can now arrive as a number where another branch takes one
+ * Fixed Claude not being told when an approved MCP resource tool was unavailable after a cloud session’s worker was replaced
+ * Fixed `/mcp` not showing why a local (stdio) MCP server failed to start
+ * Fixed Esc doing nothing while an MCP server reconnects: Esc, or Ctrl+C pressed twice, now closes the wait and the reconnect continues in the background
+ * Fixed Enable in `/mcp` showing no progress for a slow server, and a second Enter disabling it again
+ * Fixed `claude mcp add-json` answering most mistakes with “Invalid configuration: : Invalid input”; it now says what to change
+ * Fixed the Ctrl+C hint on a background MCP task’s question saying “cancel” when the second press leaves the question to answer later
+ * Fixed pressing `c` to copy an MCP sign-in URL leaving a stray `c` in the paste field
+ * Fixed Tab and Shift+Tab not moving between fields in an MCP server’s input form, and a required field there keeping its tick after being emptied
+ * Remote Control: Fixed a session disconnecting mid-reply when the server was briefly unavailable
+ * Remote Control: Fixed the QR code in `/remote-control` being cut off in short terminal windows such as 80×24
+ * Remote Control: Fixed terminal sessions showing as idle on your phone while background subagents were still running; Stop on your phone or the web now ends them together with the turn
+ * Fixed Remote Control showing a session as running while it waited on a prompt that can only be answered in the terminal, and as idle when turned on while a tool was running
+ * Fixed a reply in a remote session running again after a restart when Stop had been pressed while Claude Code was restarting
+ * Fixed Stop in cloud and self-hosted runner sessions sometimes waiting for slow MCP servers to connect before taking effect
+ * Fixed files Claude sends from cloud and Remote Control sessions failing at once when a proxy answers an upload with its own HTTP 502, 504 or 520 to 524; the upload now gets a second try
+ * Fixed claude.ai chats and Cowork tasks sometimes not sending a file after you chose “Send it” at the check for secret keys
+ * Fixed claude.ai chats and Cowork tasks asking about a plugin file only because it holds a Word, Excel or other zip-type file; such files are now read for secret keys first
+ * Fixed `claude self-hosted-runner` asking for new tokens nonstop when a refreshed token was already due, such as when the machine’s clock runs ahead
+ * Fixed `/autofix-pr` reporting a run as cancelled when its cloud session could not be stopped; it now links the session so you can stop it
+ * Fixed `/teleport` hiding a session from its list in narrow terminals
+ * Fixed artifact publishing refusing files in a background session’s temporary folder
+ * Fixed subagents whose `disallowedTools` lists `Artifact` still being offered artifact tools in some cloud sessions
+ * Fixed Claude calling a just-published artifact private when people with access to its folder can open it
+ * Fixed the terminal not showing an artifact’s link after Claude publishes or updates it
+ * Fixed the main conversation of a terminal session waiting in silence for a background subagent that another subagent had messaged: it’s now told which agent the subagent reports to
+ * Fixed background agents being told you refused their tool call when a session ended by Ctrl+C twice at the exit dialog, or after an interface crash
+ * Fixed Up and Esc moving the main conversation’s queued messages into the prompt box of a subagent or teammate you are viewing
+ * Fixed the agent rows under the prompt showing an agent as busy after its turn ended: the row now says what it is waiting on, and `/tasks` names the subagent behind each background command
+ * Fixed stopped and failed agents looking like running ones in the agent rows under the prompt, or showing “Done” when run in parallel, and a stopped agent’s last command still showing “Running…”
+ * Fixed an opened background agent showing a normal spinner while its requests were being retried
+ * Fixed the “background agents launched” line stopping at two when Claude starts three or more agents in one reply
+ * Fixed every earlier turn’s “done” line showing “1 shell still running” while a background task ran
+ * Fixed subagent tool counts in auto mode including the call that delivers the agent’s final report
+ * Fixed the welcome header outside fullscreen mode showing the session’s model while viewing a subagent or teammate that runs on a different model
+ * Fixed images pasted while viewing a background agent arriving as the text `[Image #1]`
+ * Fixed long background agent and background command results wrapping under the bullet instead of lining up with their text
+ * Fixed `claude --worktree` showing nothing while a slow worktree is set up
+ * Fixed the worktree exit dialog counting a new folder as one uncommitted file
+ * Fixed workflow resume telling Claude every finished agent would be reused after a call failed; Claude is now told how many results were reused and where reuse stopped
+ * Fixed a hang on malformed glob patterns in settings, plugin marketplace entries and Grep file filters
+ * Fixed plugin and marketplace requests waiting forever when `ALL_PROXY` is the only proxy set and the proxy never answers; they now fail after 25 seconds
+ * Fixed the `/` menu, `/skills` and `/plugin` repeating rows and losing the cursor when two skills or commands in one place share a name
+ * Fixed search in `/resume`, `/plugin`, `/permissions` and `/config` ignoring IME input, dictation and fast typing
+ * Fixed the cursor disappearing after clearing a search on the `/plugin` Installed tab
+ * Fixed a mod’s `Text` with `wrap="truncate-end"` losing rows on the terminal when it holds a line feed
+ * Fixed `/model` showing your saved model as “Default (recommended)”: Default now names your plan’s default model, and choosing it in the terminal switches you back to that default
+ * Fixed a first skill, command or agent created during a session not being found right away
+ * Fixed `/clear --help` and other built-in commands running at an idle prompt instead of showing usage; added `/help <command>`
+ * Fixed a half-written reply sitting frozen with no spinner while Claude Code retried after a mid-response server error
+ * Fixed the API retry notice sitting at “Retrying in 0s” during the next attempt, now “retrying…”, and the “will retry in” countdown freezing when a reply stalled or with Reduce motion on
+ * Fixed the transcript dropping a few rows, or the prompt jumping up, as a reply started streaming
+ * Fixed a line of a long list or code block going missing from scrollback, and text jumping a row, while a response streams
+ * Fixed a long queued message hiding Claude’s reply while it streams, and erasing it from scrollback in the classic renderer
+ * Fixed fullscreen text jumping when a reply finishes while you’re scrolled up or after answering an Edit or Write prompt, and losing your place or jumping turns when resizing
+ * Fixed the fullscreen transcript going blank when searching or jumping far back, and freezing partway through a fast scroll, in long sessions
+ * Fixed the pinned prompt in fullscreen showing an older question while a reply streams, and being copied with the reply when you drag a selection past the top
+ * Fixed the screen going blank and dropping keys after picking a model in `/model`, and `/model <alias>` and `/effort <level>` briefly hiding the prompt and dropping letters typed right after
+ * Fixed the screen scrambling after `/tui default` in a long conversation, or when the `tui` setting changed in another window (anthropics/claude-code#94879)
+ * Fixed the screen freezing for seconds when showing long newly created files in the permission prompt and the Ctrl+O transcript
+ * Fixed some very long Bash or PowerShell commands freezing the session for seconds
+ * Fixed Shift+Enter or Option+Enter pressed right after a paste sending the prompt instead of adding a new line
+ * Fixed Up, Down, End and mouse clicks putting the cursor on the wrong row of a prompt that wraps
+ * Fixed undo (Ctrl+_) losing the last words typed when pressed after deleting a line or word
+ * Fixed code or a diff pasted into a prompt losing its indentation in the transcript, and a pasted diff’s added lines showing as removed
+ * Fixed `[Image #N]` landing in the middle of a word when typing right after pasting, and a pasted image not being sent after deleting its placeholder and pasting it back with Ctrl+Y
+ * Fixed asterisks disappearing from your own prompts in the transcript, such as `src/**/*.ts` or `2*3*4`
+ * Fixed `claude -p` showing nothing in the terminal while it retried an overloaded or failing API request, or when it failed with its text output redirected or captured
+ * Fixed Windows paths in Claude’s responses losing the backslash before folders like `.claude` or `_build`
+ * Fixed bold text showing as raw `**` in Japanese, Chinese and Korean replies when it starts or ends with punctuation
+ * Fixed `/memory` opening a read-only file with no warning that changes may not save
+ * Fixed Claude editing `~/.claude/keybindings.json`, which has no effect in Claude Desktop, when asked to change a shortcut there
+ * Fixed Claude saying that an administrator can turn on Claude in Chrome when your organization’s policy disables it, in apps that provide its tools such as Claude Desktop’s Code tab
+ * Fixed the suggested next prompt sometimes being a bare tag, such as `<signal type="empty" />`
+ * Fixed long command output ending mid-line in the expanded view with no sign it was cut; it now names the saved file
+ * Fixed collapsed tool lines reading “Ran” or “Called” while still asking permission, and “Running…” or “Reading…” again when a panel opened after a call was stopped or refused
+ * Fixed failed, blocked or refused commands looking like passing ones in a collapsed tool line: it now shows ”· 1 failed” or says they did not run
+ * Fixed the “done” line showing after a turn that failed or was refused at a permission prompt
+ * Fixed failed or refused skill and agent calls still showing “Initializing…”
+ * Fixed `/btw` showing only a lead-in such as “Let me check that file.” with no notice when the model tried to use a tool (anthropics/claude-code#90314)
+ * Fixed long `/btw` answers looking finished and ignoring PgUp, PgDn, Home, End and the mouse wheel
+ * Fixed `/resume` search saying “No sessions match” for older sessions that exist, and a typed number opening a session instead of searching
+ * Fixed pressing Ctrl+R again in fullscreen prompt search not moving to the next older match
+ * Fixed Tab not completing file names without a slash in shell mode (`!`), and completed paths with spaces or shell characters not being quoted
+ * Fixed a rebound `chat:submit` key doing nothing while the slash command or @ file menu was open
+ * Fixed holding Esc over typed text opening Rewind after the text was cleared
+ * Fixed Esc over typed text cancelling a pending `/loop`
+ * Fixed “Esc again to clear” staying on screen after a second Esc would no longer clear the prompt
+ * Fixed typing landing in the wrong place in a question’s note after going back to it or editing it in an external editor
+ * Fixed the “paste again to expand” hint hiding the mode and “esc to interrupt” after a paste was sent or deleted
+ * Fixed “paste again to expand” hiding the middle of a paste longer than 10,000 characters in fullscreen mode, and a prompt collapsing while you type past that length
+ * Fixed the arrow keys and `q` not working in a pager that `claude --help` is piped to, as in `claude --help | less`
+ * Fixed Claude Desktop’s Code tab blaming the internet connection when a certificate’s signature couldn’t be verified
+ * Fixed Web Search showing nothing while its request was being retried
+ * Fixed desktop notifications not being sent inside tmux (with `allow-passthrough` on), or to iTerm2 over SSH, on the default setting
+ * Fixed `/copy` and `/export` saying “copied to clipboard” over SSH when the terminal may not have copied anything
+ * Fixed `/usage-credits` saying “Request sent to your admin” when the request was refused; people who have billing access themselves are now pointed to the usage settings page
+ * Fixed the transcript share question for Pro and Max users staying open after the next message, `/clear` or `/resume`
+ * Fixed an upgrade hint appearing under an old usage limit message after the limit had reset
+ * Fixed the effort level notice reappearing after every permission prompt or dialog, and the usage limit warning and other notices not appearing while the context warning showed
+ * Fixed `/tui default` saying it had switched back to the classic renderer when a setting kept fullscreen on; after a `/tui` that can’t switch, Claude Code now says what keeps the renderer
+ * Fixed a new account’s first session using a different renderer from later ones
+ * Fixed Reduce motion and Show tips in `/config` applying only to the current folder
+ * Fixed typing and spinners redrawing the whole pane in tmux 3.7
+ * Fixed Option+T typing † instead of toggling thinking over SSH from iTerm2 when Option isn’t set as Meta
+ * Fixed `/terminal-setup` not naming the tmux settings that Shift+Enter needs, and promising Shift+Enter in Windows Terminal before 1.25, where it sends the prompt
+ * Fixed Program Status Protocol (OSC 7501) terminals showing a finished turn after idle compaction, or no status for background sessions opened with `claude agents`, `claude attach` or `--resume`
+ * Fixed terminals that support the Program Status Protocol (OSC 7501) not seeing Claude Code as waiting on you while the folder trust prompt is open (anthropics/claude-code#105801)
+ * Fixed the terminal progress bar showing Claude as working while it waited for your answer or was suspended with Ctrl+Z, and disappearing in Ghostty after 15 seconds while Claude was still working
+ * Fixed fullscreen giving no sign that a permission prompt or question was waiting while you were scrolled up
+ * Fixed the fullscreen tool group headline naming a finished or queued call instead of the running one
+ * Fixed finished tool groups in fullscreen counting a search or listing also as a shell command, and the tool timer there counting time at a permission prompt or queued behind another command
+ * Fixed a multi-line shell command filling the screen in fullscreen while it runs
+ * Fixed `!` shell commands showing no output for their first three seconds
+ * Fixed a running command showing no output or timer when its collapsed row was clicked open in fullscreen mode
+ * Fixed the jump-to-bottom pill disappearing in fullscreen while more of the reply was still below
+ * Fixed the prompt disappearing in short fullscreen windows while a survey or notice showed above it
+ * Fixed the custom status line disappearing and the screen jumping on Ctrl+C, in `!` shell mode and while pasting an image
+ * Fixed a custom status line keeping its old width, folder and session name after a terminal resize, `/cd` or `/rename` (anthropics/claude-code#107291)
+ * Fixed “esc to interrupt” missing beside a custom status line and showing while Esc would go to a panel or footer item
+ * Fixed mouse escape codes being typed into the shell after exiting fullscreen mode
+ * Fixed the Ctrl+Z message printing over the prompt box outside fullscreen
+ * Fixed `claude logs` painting over and mixing with what was already in the terminal
+ * Fixed the spinner tip flashing back and the screen bouncing as a reply finished
+ * Fixed the “Reading 1 file…” line blinking out and the prompt jumping when a tool call finished streaming
+ * Fixed the `claude --resume` session preview being garbled and not scrolling in fullscreen mode
+ * Fixed Esc not leaving the “Connect to your IDE automatically?” question in `/ide`, where Ctrl+C twice quit Claude Code
+ * Fixed first-run terminal setup saying nothing about what it changed or could not set up
+ * Fixed `/status` showing installation warnings twice
+ * Fixed the footer’s PR badge showing the previous branch’s pull request after switching branches
+ * Fixed the “Pushed to” summary naming the fetched branch when a command fetched or pulled first, and “Merged PR” or “Closed PR” showing when `gh` refused the action and the exit code was hidden
+ * Fixed URLs that wrap over several lines not being clickable in terminals with link support that Claude Code doesn’t recognize, and labeled links in the Rex terminal
+ * Fixed the Ctrl+O transcript hinting Ctrl+B to background a command in fullscreen, where it pages up, and showing no sign that Claude is still working
+ * Fixed the Ctrl+R search, the model picker, plan approval, question previews, background shell output and `/plugin` install choices being cut off in short fullscreen windows
+ * Fixed the `/context` grid, API errors such as “Credit balance too low”, “Waiting for API response” and retry notices, “esc to interrupt” and “Interrupted” being cut off or jumbled in narrow terminals
+ * Fixed wide tables breaking apart in plans and subagent prompts, cutting short words in half beside a long cell, and showing stray words and blank rows when drawn as label and value lists
+ * Fixed code keywords, added diff lines, the slow-reply spinner and “thinking” being hard to read in some themes and terminals
+ * Fixed code in diffs and file previews being invisible when the theme and the terminal background differ
+ * Fixed the unused part of `/usage` bars looking full in the light and ANSI themes
+ * Fixed the `/effort` slider ignoring mouse clicks in fullscreen mode
+ * Fixed text being drawn out of place after skin-tone or joined emoji, symbols such as ✌ and ☝, and Hindi, Tamil and other Indic vowel signs in terminals that draw them wider
+ * Fixed joined emoji pushing rows out of place in GNU screen
+ * Fixed the last item of JSON lists and right-aligned numbers losing their indent in command and tool output
+ * Fixed diffs numbering “No newline at end of file” as a line of code, which shifted the line numbers after it
+ * Fixed long single-line messages showing “(0 lines hidden)” instead of how much text is hidden
+ * Fixed notebook edits showing no tool row when Claude left out the cell type or deleted a cell, and showing `@undefined` when inserting a cell at the top
+ * Fixed the “Switch model?” and “Change effort level?” questions showing no key hints
+ * Fixed the `?` shortcuts list running its columns together in narrow terminals and being cut off at the bottom in short fullscreen windows
+ * Fixed leftover hint text in screen reader mode on macOS and Linux after closing the `/permissions` search when the rule list was taller than the terminal
+ * [VSCode] Fixed “Rewind code to here” in a forked conversation sometimes undoing one turn too many and deleting files created in that turn
+ * [VSCode] Fixed the Sandbox dialog creating empty files and folders in the home directory and the project’s `.git` folder while the sandbox is off
+ * [VSCode] Fixed the saved sign-in being lost on some networks
+ * [VSCode] Fixed sign-in ending when a verification code, a web address or a code from another sign-in attempt is pasted; the panel now says what to paste instead
+ * [VSCode] Fixed the sign-in screen showing briefly each time a panel or window opened while signed in to Console without an API key
+ * [VSCode] Fixed the usage-limit banner’s “Request more” button for Team and Enterprise members coming back after each press without sending anything, after you signed in again during a session
+ * [VSCode] Fixed `/ide` in a second Claude Code session silently losing the editor connection back to the first session; the newest connection now wins and the displaced session shows how to switch back
+ * [VSCode] Fixed saved memories not being listed in the Memory dialog, or RAM use growing without end, when the memory folder held symlink loops, and a hang when it held a named pipe
+ * [VSCode] Fixed a running command’s live output stopping after one failed read
+ * [VSCode] Fixed “Open in Terminal” showing only the shell’s error when `claude` could not be started: in bash, zsh, fish and Git Bash, a notice now explains why and links to the install guide
+ * [VSCode] Fixed the panel showing no “Open artifact” link after Claude publishes an artifact
+ * [VSCode] Fixed the prompt suggestion hiding the “attach selected text” hint while the chat panel is unfocused
+ * [VSCode] Fixed buttons with no visible border in the high-contrast themes, and the dark welcome art on the sign-in screen in Light High Contrast
2.1.325
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
@@ -404,7 +404,7 @@
Feature| Status| Notes
---|---|---
-Inference forwarding (Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, Microsoft Foundry, Anthropic)| Available| With per-upstream model translation and failover. The Amazon Bedrock upstream uses the `bedrock-runtime` endpoint and the AWS default credential chain. The [Amazon Bedrock Mantle upstream](</docs/en/claude-apps-gateway-config#amazon-bedrock-mantle-endpoint>) requires Claude Code v2.1.283 or later on the gateway server, and the [Claude Platform on AWS upstream](</docs/en/claude-apps-gateway-config#claude-platform-on-aws>) requires v2.1.198 or later.
+Inference forwarding to Amazon Bedrock, Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), Google Cloud’s Agent Platform, Microsoft Foundry, and the Anthropic API| Available| With per-upstream model translation and failover. The Amazon Bedrock upstream uses the `bedrock-runtime` endpoint and the AWS default credential chain. The [Amazon Bedrock Mantle upstream](</docs/en/claude-apps-gateway-config#amazon-bedrock-mantle-endpoint>) requires Claude Code v2.1.283 or later on the gateway server, and the [Claude Platform on AWS upstream](</docs/en/claude-apps-gateway-config#claude-platform-on-aws>) requires v2.1.198 or later. Before you add the [Claude Models on Google Cloud (Anthropic managed) upstream](</docs/en/claude-apps-gateway-config#claude-models-on-google-cloud-anthropic-managed>), upgrade the gateway server to v2.1.307 or later.
1M token context window| Available| Fable models, Sonnet 5 and later, and Opus 4.7 and later run with the 1M window by default; see [Extended context](</docs/en/model-config#extended-context>). The 1M default for the Fable and Opus models requires Claude Code v2.1.287 or later on the developer machine
Model access and managed settings by IdP group| Available| Model access is enforced server-side; managed settings are delivered per IdP group and applied by the CLI at the [managed settings tier](</docs/en/settings#settings-precedence>)
Claude Desktop| Available with opt-in| Opt a policy in with a [`desktop` key](</docs/en/claude-apps-gateway-config#claude-desktop-overlay>). Requires Claude Code v2.1.203 or later on the gateway server.
--- a/claude-apps-gateway-config.md
+++ b/claude-apps-gateway-config.md
@@ -8,7 +8,7 @@
* `oidc`: your identity provider (IdP), including issuer, client, claim mapping, and who may sign in
* `session`: the bearer tokens the gateway mints, with secret and lifetime
* `store`: PostgreSQL, for device grants and rate-limit counters
- * `upstreams`: where inference goes, whether Anthropic, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry
+ * `upstreams`: where inference goes, whether Anthropic, Amazon Bedrock, Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), Google Cloud’s Agent Platform, or Microsoft Foundry
**Optional sections:**
@@ -149,7 +149,7 @@
---|---|---
`provider: anthropic` upstreams, Workload Identity Federation token exchange, `telemetry.forward_to` exports| Resolved and checked locally, then `CONNECT` to the checked IP address through the proxy. A telemetry collector listed in `NO_PROXY` is reached directly instead| Hostname handed to the proxy
IdP discovery, JWKS, token, and userinfo| Direct unless `oidc.use_proxy: true`, then `CONNECT` to the checked IP address| Hostname handed to the proxy, unless `oidc.use_proxy: false` keeps an internal IdP direct
-Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry upstreams; Google group lookups| Hostname handed to the proxy| Unchanged
+Amazon Bedrock, Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), Google Cloud’s Agent Platform, and Microsoft Foundry upstreams; Google group lookups| Hostname handed to the proxy| Unchanged
Proxy-only egress stays off unless the gateway’s environment meets all three of these conditions:
@@ -491,6 +491,20 @@
`base_url`| No| Override the derived endpoint
Because the platform resolves first-party model IDs, the built-in catalog routes to it with no `models:` block. When you curate a `models:` list, key the entry `anthropicAws:` with the first-party ID.
+
+#### Claude Models on Google Cloud (Anthropic managed)
+
+Claude Models on Google Cloud (Anthropic managed) is the Anthropic-operated Claude API, reached through your Google Cloud project. To send model requests to it, add an upstream with the `anthropicGoogleCloud` provider. Before you add the upstream, upgrade your gateway replicas to Claude Code v2.1.307 or later and [set up the service in a Google Cloud project](<https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/anthropic-managed#set-up-your-account>). Grant `roles/claude.user` on that project to the identity that the gateway’s Google credentials resolve to.
+
+ upstreams:
+ - provider: anthropicGoogleCloud
+ project_id: example-prod
+ workspace_id: wrkspc_01ABCDEFGHIJKLMN
+ auth: {} # Google credentials, not an API key; {} uses Application Default Credentials
+ # OR the path to a service account key file:
+ # auth: { service_account_json: /secrets/sa.json }
+
+Both `project_id` and `workspace_id` are required: `project_id` is the ID of the project where you set up the service, and you can [find the `wrkspc_` ID](<https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/anthropic-managed#find-your-workspace-id>) in the Claude Console.
#### Google Cloud Agent Platform
--- a/claude-apps-gateway-deploy.md
+++ b/claude-apps-gateway-deploy.md
@@ -34,7 +34,7 @@
* **Multiple gateways** : each is a separate deployment with its own config, and the CLI stores trust and credentials per gateway hostname, so teams can use different gateways without conflict. To serve multiple OIDC issuers, run separate instances.
* **Serverless** : Cloud Run works if you set `min-instances: 1` to avoid cold OIDC discovery. Lambda and Cloud Functions don’t work, because the gateway is a long-running HTTP server.
-Every production topology here puts an L7 proxy, such as an Ingress, Cloud Run’s front end, or an ALB, in front of plain-HTTP replicas. Set [`listen.trusted_proxies`](</docs/en/claude-apps-gateway-config#listen>) to the proxy’s source ranges so the gateway reads client IPs from `X-Forwarded-For`. The gateway honors the header only when the TCP peer is trusted. The [Google Cloud](</docs/en/claude-apps-gateway-on-gcp>) and [AWS](</docs/en/claude-apps-gateway-on-aws>) worked examples have concrete values per topology. Without trusted proxies, every request appears to come from the proxy’s IP, which collapses per-IP rate limits into one shared bucket and records the proxy’s IP in audit events. Don’t redirect requests to the gateway’s device-authorization and token endpoints, for example with an HTTP-to-HTTPS or host-canonicalization rewrite at the ingress. Claude Code doesn’t follow redirects on those requests, so an ingress rule that redirects them breaks sign-in and token refresh. Give the proxy any idle timeout longer than the gateway’s keepalive interval, which depends on the upstream:
+Every production topology here puts an L7 proxy, such as an Ingress, Cloud Run’s front end, or an ALB, in front of plain-HTTP replicas. Set [`listen.trusted_proxies`](</docs/en/claude-apps-gateway-config#listen>) to the proxy’s source ranges so the gateway reads client IPs from `X-Forwarded-For`. The gateway honors the header only when the TCP peer is trusted. The [Google Cloud](</docs/en/claude-apps-gateway-on-gcp>) and [AWS](</docs/en/claude-apps-gateway-on-aws>) worked examples have concrete values per topology. Without trusted proxies, every request appears to come from the proxy’s IP, which collapses per-IP rate limits into one shared bucket and records the proxy’s IP in audit events. Don’t redirect requests bound for the gateway’s device-authorization and token endpoints, for example with an HTTP-to-HTTPS or host-canonicalization rewrite at the ingress. Claude Code doesn’t follow redirects on those requests, so an ingress rule that redirects them breaks sign-in and token refresh. Give the proxy any idle timeout longer than the gateway’s keepalive interval, which depends on the upstream:
* On every upstream except `provider: anthropic`, the gateway writes an SSE `ping` once a stream has been silent for about 15 seconds.
* On `provider: anthropic`, the gateway passes the response through unchanged, including the Anthropic API’s own pings.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -60,7 +60,7 @@
`commands/*.md`| Project and global| ✓| Single-file prompts; same mechanism as skills| [Skills](</docs/en/skills>)
`output-styles/*.md`| Project and global| ✓| Custom instruction sets that adjust how Claude works| [Output styles](</docs/en/output-styles>)
`agents/*.md`| Project and global| ✓| Subagent definitions with their own prompt and tools| [Subagents](</docs/en/sub-agents>)
-`workflows/*.js`| Project and global| ✓| Dynamic workflow scripts written by Claude and saved from `/workflows`; each file becomes a `/<name>` command| [Dynamic workflows](</docs/en/workflows>)
+`workflows/*.js`| Project and global| ✓| Dynamic workflow scripts written by Claude and saved from `/workflows`; each saved workflow runs as a `/<name>` command| [Dynamic workflows](</docs/en/workflows>)
`agent-memory/<name>/`| Project and global| ✓| Persistent memory for subagents| [Persistent memory](</docs/en/sub-agents#enable-persistent-memory>)
`~/.claude.json`| Global only| | App state, account details, UI toggles, personal MCP servers. If it’s missing, Claude Code creates it when you start a session or run a subcommand such as `claude auth status`, but not for `--version` or `--help`.| [Global config](</docs/en/settings-reference#global-config-settings>)
`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
--- a/claude-projects.md
+++ b/claude-projects.md
@@ -240,22 +240,20 @@
2
-Ask for the task with Work locally
-
-In the project conversation, choose **Work locally** from the **+** menu beside the message box, which tags your message **Local** , and write what you want done. Saying in the message that the task should run on your computer works too.
+Ask for the task
+
+In the project conversation, choose **Work locally** from the **+** menu, or **Work in a local folder** in the desktop app, and write what you want done. Saying in the message that the task should run on your computer works too.If **Work locally** is greyed out with a note about trusted devices, [**Require trusted devices**](</docs/en/remote-control#trusted-devices>) is on for your account and this project can’t run a thread on your computer. To work in that folder, run Claude Code on that computer directly.
3
Allow it on the card
-Claude answers with an **Allow Claude to work in a folder on your device** card. Pick the folder if you connected several. Two threads working in one folder at the same time can overwrite each other’s changes, so 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**.
+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**.
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>). 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. 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.
* **To get the thread going again** : see Lost contact with your folder
* **To keep the computer from sleeping on its own** : in the desktop app, turn on **Keep this computer awake for Remote Control** in **Settings > Code** or **Settings > Claude Code**
-
-A project can’t run a thread on your computer while [**Require trusted devices**](</docs/en/remote-control#trusted-devices>) is on for your account.
## Give a project standing context
--- a/cli-reference.md
+++ b/cli-reference.md
@@ -111,7 +111,7 @@
`--plugin-url`| Fetch a plugin `.zip` archive from a URL for this session only. Repeat the flag for multiple plugins, or pass space-separated URLs in a single quoted value| `claude --plugin-url https://example.com/plugin.zip`
`--print`, `-p`| Print response without interactive mode (see [Agent SDK documentation](</docs/en/agent-sdk/overview>) for programmatic usage details). For `--resume` on a background session that is still running, see [Resume a running background session](</docs/en/sessions#resume-a-running-background-session>)| `claude -p "query"`
`--prompt-suggestions`| Emit a `prompt_suggestion` message with a predicted next user prompt after each turn that generates one; very short conversations can produce none. Requires `--print`, `--output-format stream-json`, and `--verbose`. See [Prompt suggestions](</docs/en/interactive-mode#prompt-suggestions>)| `claude -p --prompt-suggestions --output-format stream-json --verbose "query"`
-`--ref <branch>`| With `--environment`, base the new session’s checkout on a named ref instead of local `HEAD`| `claude -p "Run the smoke test" --environment ccpool_abc123 --ref main`
+`--ref <branch>`| With `--environment`, base the new session’s checkout on a named ref. Requires Claude Code v2.1.224 or later| `claude -p "Run the smoke test" --environment ccpool_abc123 --ref main`
`--remote`| Deprecated alias for `--cloud`, including the existing-session form| `claude --remote "Fix the login bug"`
`--remote-control`, `--rc`| Start an interactive session with [Remote Control](</docs/en/remote-control#start-a-remote-control-session>) enabled so you can also control it from claude.ai or the Claude app. Optionally pass a name for the session| `claude --remote-control "My Project"`
`--remote-control-session-name-prefix <prefix>`| Prefix for auto-generated [Remote Control](</docs/en/remote-control>) session names when no explicit name is set. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. Set `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` for the same effect| `claude remote-control --remote-control-session-name-prefix dev-box`
--- a/cloud-environments.md
+++ b/cloud-environments.md
@@ -84,7 +84,7 @@
#### Add a secret
-You add secrets one at a time. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), then continue from step 2 in its **Network secrets** section. If you’re on a Team or Enterprise plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form.
+You add secrets one at a time. To change a secret’s hosts or value, delete it and add it again. To add a secret to a shared environment, open it for editing from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>), select its **Network secrets** row, then continue from step 2. If you’re on a Team or Enterprise plan and don’t hold an organization admin role, follow step 1 on your own environment, then fill in the shorter form.
1
@@ -96,7 +96,7 @@
Add the secret
-Select **Add secret** , labeled **Add** in admin settings, and fill in the form. Keep the default **Secret type** , **Bearer** , for an API key that travels in a request header, and fill in these fields:
+Select **Add secret** and fill in the form. Keep the default **Secret type** , **Bearer** , for an API key that travels in a request header, and fill in these fields:
* **Allowed websites** : the API’s hosts, such as `api.example.com`. A leading `*.` matches every subdomain
* **Custom headers** : one row for the header that carries the key. The row already has `Authorization` as the **Header name** and `Bearer` as the **Prefix** ; paste the key itself as the **Value**. For a header like `X-Api-Key` that takes the bare value, change the name and clear the prefix
@@ -166,7 +166,7 @@
## Network access
-Each environment sets one network access level, which controls the outbound connections its sessions can make. A new environment starts at **Limited** with **Allow package managers** checked, so its sessions reach package registries and other allowlisted domains. To change an environment’s network access, open it for editing and use the **Network access** selector in the dialog. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). Personal environments don’t have a separate page in your claude.ai account settings. When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session.
+Each environment sets one network access level, which controls the outbound connections its sessions can make. A new environment starts at **Limited** with **Allow package managers** checked, so its sessions reach package registries and other allowlisted domains. To change an environment’s network access, open it for editing and use the **Network access** selector in the dialog. A shared environment opens read-only there, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. The control that opens the selector appears on the app surfaces listed under The Default environment and in the [cloud scheduled task editor](</docs/en/routines#environments-and-network-access>). When you change an Anthropic-hosted environment’s network access, its existing sessions follow the new setting within about a minute, for requests that go through the session’s network allowlist. You don’t need to start a new session.
MCP connectors you enable on a session or scheduled task work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). Turn off any connector you don’t need to limit which tools Claude can reach.
@@ -250,7 +250,7 @@
Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in the repo. See Add personal preferences without committing to the repo
Your user `~/.claude/skills/`, `~/.claude/agents/`, `~/.claude/commands/`| No| Live on your machine, not in the repo. Commit them to the repo’s `.claude/` directory instead. Cloud sessions automatically load [skills you enable on claude.ai](</docs/en/skills#skills-in-cowork-and-cloud-sessions>)
Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json` on your machine
-MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| Those write to `~/.claude.json` on your machine, not the repo. Add the server with `claude mcp add --scope project`, which writes the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it
+MCP servers you added with `claude mcp add` at the default local scope or the user scope| No| At those scopes, the command writes to `~/.claude.json` on your machine. Run `claude mcp add --scope project` from the repository root to write the repo’s [`.mcp.json`](</docs/en/mcp#project-scope>), and commit that file. A session with one repository loads it
Transport variables in your repo’s `.claude/settings.json` `env` block, such as `NODE_EXTRA_CA_CERTS` and the [mTLS client certificate variables](</docs/en/network-config#mtls-authentication>)| No| The hosting environment manages the session’s API connection, so Claude Code ignores these keys and notes each ignored key in the session’s debug log
API keys and tokens for services Claude calls| In an Anthropic-hosted environment, as network secrets| You add the key once on the environment and the agent proxy attaches it to requests for the hosts you list. A key the agent proxy can’t attach stays in an environment variable
Interactive auth like AWS SSO| No| Not supported. SSO requires browser-based login that can’t run in a cloud session
--- a/code-mode.md
+++ b/code-mode.md
@@ -35,14 +35,15 @@
## Requirements
* **Version** : Claude Code v2.1.323 or later, on either [release channel](</docs/en/setup#configure-release-channel>). An older version starts without Code Mode, with or without the reason `it isn't open to your account yet`
- * **Account** : a Claude subscription or Console account. You can’t use Code Mode through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry
+ * **Account** : a Claude subscription or Console account. You can’t use Code Mode through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, Microsoft Foundry, or [Claude Models on Google Cloud (Anthropic managed)](</docs/en/claude-models-on-google-cloud-anthropic-managed>)
* **Organization** : your organization doesn’t use the [HIPAA configuration](</docs/en/hipaa-setup>) or [zero data retention](</docs/en/zero-data-retention>)
* **Model** : Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2
* **Surface** : an interactive `claude` session in a terminal. Code Mode doesn’t work with `-p`, the Agent SDK, the VS Code panel, the Desktop app, or cloud sessions
+ * **Agent teams** : to use Code Mode with [agent teams](</docs/en/agent-teams>) on, you need v2.1.326 or later. Teammates run in Code Mode in the default [in-process display mode](</docs/en/agent-teams#choose-a-display-mode>), and start without it in split panes
* **Installation** : the [native build](</docs/en/setup>) of Claude Code
* **Windows** : [Git for Windows](<https://git-scm.com/downloads/win>) is installed
-You also can’t start Code Mode with some settings on, such as an API key helper, agent teams, OpenTelemetry export, or `DISABLE_TELEMETRY`. For the fix for each, see Code Mode doesn’t start.
+You also can’t start Code Mode with some settings on, such as an API key helper, OpenTelemetry export, or `DISABLE_TELEMETRY`. For the fix for each, see Code Mode doesn’t start.
## Try Code Mode
@@ -125,16 +126,16 @@
## Permissions and long-running code
-Your permission mode decides how Claude’s code is checked and whether you can talk to Claude while the code runs.
+Your permission mode decides how the code that Claude writes is checked and whether you can talk to Claude while the code runs.
### Permission checks
-Each tool call that Claude’s code makes goes through your `deny` and `ask` [permission rules](</docs/en/permissions>) and your [`PreToolUse` hooks](</docs/en/hooks#pretooluse>). You don’t need to change a rule or matcher for a tool such as `Bash`. Beyond rules and hooks, a classifier reviews the code in auto mode, and you answer prompts in the modes that ask:
+When Claude runs code, each tool call in it goes through your `deny` and `ask` [permission rules](</docs/en/permissions>) and your [`PreToolUse` hooks](</docs/en/hooks#pretooluse>) under the tool’s usual name, such as `Bash`. Beyond rules and hooks, a classifier reviews the code in auto mode, and you answer prompts in the modes that ask:
* **[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier reviews each piece of code before it runs, not each tool call. It doesn’t see values computed at run time, such as a path taken from search output, so keep rules or hooks for calls you must control. You can still be prompted when new code starts while earlier code runs
* **Other[permission modes](</docs/en/permission-modes>)**: the code starts without a review, and you’re prompted for each tool call that would prompt you in that mode
-To check the code itself, write a `PreToolUse` hook that matches `REPL`, the tool that runs Claude’s code, and read the JavaScript from `tool_input.code`.
+If you have a `PreToolUse` hook that allows or blocks shell commands, make it check each part of a command, as [Bash rules do](</docs/en/permissions#compound-commands>). In Code Mode, a `git push` in a folder named `app` can reach your hook as `cd 'app' && git push`. To check the code itself, write a `PreToolUse` hook that matches `REPL`, the tool that runs the code, and read the JavaScript from `tool_input.code`.
Bash rules match command text, so Claude can run a denied command [in a form the rule doesn’t match](</docs/en/permissions#bash-rule-limits>), with or without Code Mode. For limits that don’t depend on command text, see [sandboxing](</docs/en/sandboxing>).
@@ -159,15 +160,16 @@
Reason includes| What to do
---|---
-`it isn't open to your account yet`| If your version is older than v2.1.323, update. Otherwise, check your network connection and start again. If the reason stays, try again another day
-`it only works with the Anthropic API`| Remove the settings that route requests through a cloud provider, a gateway, or a custom `ANTHROPIC_BASE_URL`
+`it isn't open to your account in this version` or `it isn't open to your account yet`| If your version is older than v2.1.323, update. Otherwise, check your network connection and start again. If the reason stays, try again another day
+`it only works directly with the Anthropic API` or `it only works with the Anthropic API`| Remove the settings that route requests through a cloud provider, a gateway, or a custom `ANTHROPIC_BASE_URL`
`it doesn't work with an API key helper`| Remove `apiKeyHelper`, `ANTHROPIC_AUTH_TOKEN`, and any `Authorization` or `X-Api-Key` header in `ANTHROPIC_CUSTOM_HEADERS`. Then sign in or set `ANTHROPIC_API_KEY`
`it only works with Opus 5.5, Sonnet 5.5 and later models`| Start with a supported model, for example with `--model opus`. Haiku 5.5 and Fable 5.2 also work
-`it doesn't work in background jobs`| Start in the foreground, without `--remote-control`
+`it doesn't work in background jobs`| Start in the foreground, without `--remote-control`. If the reason shows in a teammate’s split pane, use the [in-process display mode](</docs/en/agent-teams#choose-a-display-mode>) to run teammates in Code Mode
`it needs settings that Claude Code downloads from Anthropic`| Unset the variable that [turns off feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as `DISABLE_TELEMETRY`
`OpenTelemetry is on`| Unset `CLAUDE_CODE_ENABLE_TELEMETRY` and `ENABLE_BETA_TRACING_DETAILED` if you can work without [OpenTelemetry export](</docs/en/monitoring-usage>)
+`it doesn't yet work with the plugin`| In a session, run `/plugin` and disable each plugin that the reason names. If your organization turned one on, ask your administrator to turn it off
`it doesn't yet work with an installed mod`| Turn off the [mod](</docs/en/plugins/mods/overview>) that checks tool calls
-`it can't be used together with agent teams yet`| Unset `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS`
+`it can't be used together with agent teams yet`| To keep agent teams on, [update Claude Code](</docs/en/setup#update-claude-code>) to v2.1.326 or later. To stay on your version, unset `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS`
`this launch's tool options`| Start without `--restricted`, add `REPL` to `--tools`, and remove `REPL` from `--disallowedTools` and your `deny` rules
`couldn't save your answer`| Make `~/.claude.json` writable
`your organization's settings don't allow it`| Ask your administrator about the managed setting
@@ -186,14 +188,14 @@
If Claude reports a refused tool call, ask it for the error text. These errors mean that a `PreToolUse` hook didn’t give a decision, which refuses the call even when [`onFailure`](</docs/en/hooks#block-the-action-when-a-hook-fails>) is unset:
- * **`the hook failed`** : on a call from Claude’s code, your hook couldn’t start, was killed, exited with 126, 127, or a code above 128, or returned an HTTP error or invalid output. Fix the hook
- * **`the hook did not finish`** : your hook timed out on a call from Claude’s code, or on any other tool call once Claude has run code in the session. Raise the hook’s [`timeout`](</docs/en/hooks#common-fields>)
+ * **`the hook failed`** : on a call from code, your hook couldn’t start, was killed, exited with 126, 127, or a code above 128, or returned an HTTP error or invalid output. Fix the hook
+ * **`the hook did not finish`** : your hook timed out on a call from code, or on any other tool call once Claude has run code in the session. Raise the hook’s [`timeout`](</docs/en/hooks#common-fields>)
To let calls go ahead when a `command` or `http` hook fails or times out, set `"onFailure": "continue"` on it. If a `command` hook exits with an ordinary code such as 1, the call goes ahead unless you set `"onFailure": "block"`.
### Code output withheld by a hook
-If Claude reports a hook’s block reason where you expected output from Claude’s code, check your [`UserPromptSubmit`](</docs/en/hooks#userpromptsubmit>) hooks. When code can run in the background, `command`, `http`, and `mcp_tool` hooks on that event also run on code output. To let the output through, change the hook so that it doesn’t block when `source` in its input is `poll_event`.
+If Claude reports a hook’s block reason where you expected output from code, check your [`UserPromptSubmit`](</docs/en/hooks#userpromptsubmit>) hooks. When code can run in the background, `command`, `http`, and `mcp_tool` hooks on that event also run on code output. To let the output through, change the hook so that it doesn’t block when `source` in its input is `poll_event`.
## Related resources
--- a/code-review-costs.md
+++ b/code-review-costs.md
@@ -49,9 +49,9 @@
Section| What it shows
---|---
-PRs reviewed| Daily count of pull requests reviewed over the selected time range
+PRs reviewed by Code Review| Daily count of pull requests reviewed over the selected time range
Code Review cost| Code Review spend so far this month
-Feedback| Count of review comments that were auto-resolved because a developer addressed the issue
+Code Review feedback| Count of review comments that were auto-resolved because a developer addressed the issue
Code Review findings| Daily count of [findings by severity level](</docs/en/code-review-pull-requests#severity-levels>), from reviews Claude posted over the selected time range
Repository breakdown| Per-repo counts of PRs reviewed, comments resolved, and review runs, with estimated cost and a per-PR view
--- a/commands.md
+++ b/commands.md
@@ -113,9 +113,9 @@
`/simplify [target]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the changed code for cleanup opportunities and apply the fixes. Four review [agents](</docs/en/sub-agents>) run in parallel, covering reuse of existing helpers, simplification, efficiency, and whether the change is at the right level of abstraction. The review doesn’t look for correctness bugs. Use `/code-review` to find bugs. Pass a path or PR reference to review a specific target
`/skill-doctor`| Show what each of your [skills](</docs/en/skills>) costs in context and how often it gets used, so you can [find skills to turn off](</docs/en/skills#find-unused-skills>). Requires Claude Code v2.1.252 or later and [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>)
`/skills`| List available [skills](</docs/en/skills>). Type to filter the list by name, description, or source. Press `t` to sort by token count, `Space` or `Enter` to [cycle a skill’s visibility to Claude and the `/` menu](</docs/en/skills#override-skill-visibility-from-settings>), and `Esc` to save and close. You can’t cycle plugin skills, skills whose frontmatter sets `disable-model-invocation: true`, or skills with a `skillOverrides` entry in managed settings or the `--settings` flag
-`/slides [brief]`| **[Skill](</docs/en/skills#bundled-skills>).** Make a new presentation as a Claude Slides [artifact](</docs/en/artifacts#make-a-slide-deck>) filled from your brief, for example `/slides a quarterly review of the platform team`. Requires Claude Code v2.1.265 or later, a session where [artifacts are available](</docs/en/artifacts#availability>), and an account where the [Slides template is available](</docs/en/artifacts#start-from-a-slides-design-or-docs-template>); otherwise the command doesn’t appear. 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
+`/slides [brief]`| **[Skill](</docs/en/skills#bundled-skills>).** Make a new presentation as a [Claude Slides](<https://support.claude.com/en/articles/17153992-what-are-artifacts-and-how-do-i-use-them#h_11d5a9a5fa>) artifact filled from your brief, for example `/slides a quarterly review of the platform team`. Requires Claude Code v2.1.265 or later, a session where [artifacts are available](</docs/en/artifacts#availability>), and an account where the [Slides template is available](</docs/en/artifacts#start-from-a-slides-design-or-docs-template>); otherwise the command doesn’t appear. 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
`/stats`| Alias for `/usage`. Opens on the Stats tab
-`/status`| Open the Settings interface on the Status tab, showing version, model, account, and connectivity. A `Session kind` row reads `background job · attached` or `background job · unattended` in a [background session](</docs/en/agent-view>), depending on whether a terminal is attached, and `interactive` in any other session. Before v2.1.221, `/status` didn’t show this row. Works while Claude is responding
+`/status`| Open the Settings interface on the Status tab, showing version, model, account, and connectivity. A `Session kind` row reads `background job · attached` or `background job · unattended` in a [background session](</docs/en/agent-view>), depending on whether a terminal is attached, and `interactive` in any other session. Works while Claude is responding
`/statusline`| Configure Claude Code’s [status line](</docs/en/statusline>). Describe what you want, or run without arguments to auto-configure from your shell prompt
`/stickers`| Check Claude Code sticker availability
`/stop`| Stop the [background session](</docs/en/agent-view>) you’re attached to, or the one you send it to as a [peek reply](</docs/en/agent-view#peek-and-reply>); the transcript and any worktree are kept. To detach without stopping, use `/exit` or press `←`
--- a/configuration.md
+++ b/configuration.md
@@ -116,10 +116,11 @@
## Limit turns and spend
-Cap turns and spend with `maxTurns` / `max_turns` and `maxBudgetUsd` / `max_budget_usd`. Both caps are off when unset. When a session hits a cap, the run ends with a result message whose subtype names the cap, `error_max_turns` or `error_max_budget_usd`. What happens next differs by input mode:
+Cap turns and spend with `maxTurns` / `max_turns` and `maxBudgetUsd` / `max_budget_usd`. Both caps are off when unset. When a session hits a cap, the run ends with a result message. The result’s subtype is `error_max_turns` for the turn cap and `error_max_budget_usd` for the spend cap. Single-shot and streaming input handle a cap result differently:
* **Single-shot`query()`**: the SDK yields the cap result and then raises, so wrap the loop in a try block to continue past the error
- * **Streaming input** : the session stays alive past a cap result, and the max-turns count starts over for each queued message. The budget total accumulates across messages, and once spend reaches the cap, later messages in the same conversation end with the same budget result. A [`/clear`](</docs/en/agent-sdk/cost-tracking>) starts the budget over
+ * **Streaming input** : the session stays alive past a cap result, and the max-turns count starts over for each queued message. The budget total accumulates across messages, and once spend reaches the cap, later messages in the same conversation end with the same budget result. A [`/clear`](</docs/en/agent-sdk/cost-tracking>) starts the budget over.
+ * **Streaming input in TypeScript** : the loop throws when the last response ends in an error result, such as `error_max_turns`. Wrap the loop in a try block to continue past it.
The two caps treat `0` differently:
--- a/context-window.md
+++ b/context-window.md
@@ -2,12 +2,47 @@
## What the timeline shows
-The session walks through a realistic flow with representative token counts:
-
* **Before you type anything** : CLAUDE.md, auto memory, MCP tool names, and skill descriptions all load into context. [AGENTS.md files](</docs/en/memory#agents-md>) can load in place of CLAUDE.md. Your own setup may add more here, like an [output style](</docs/en/output-styles>) or text from [`--append-system-prompt`](</docs/en/cli-reference>).
* **As Claude works** : each file read adds to context, [path-scoped rules](</docs/en/memory#path-specific-rules>) load automatically alongside matching files, and a [PostToolUse hook](</docs/en/hooks-guide>) fires after each edit.
* **The follow-up prompt** : a [subagent](</docs/en/sub-agents>) handles the research in its own separate context window, so the large file reads stay out of yours. Only the summary and a small metadata trailer come back.
- * **At the end of the walkthrough** : you run `/compact`, which replaces the conversation with a structured summary. Most startup content reloads automatically; the table below shows what happens to each mechanism.
+ * **At the end of the session** : you run `/compact`, which replaces the conversation with a structured summary. Most startup content reloads automatically. See what survives compaction for what reloads and what gets summarized.
+
+Token counts for each step
+
+Compare how many tokens each step adds in the timeline’s example session. The counts are illustrative and vary with your CLAUDE.md size, MCP servers, and file lengths. For real numbers, check your own session.
+
+Phase| What enters context| Example tokens
+---|---|---
+Before you type| System prompt| 4,200
+Before you type| Auto memory (`MEMORY.md`)| 680
+Before you type| Environment info| 280
+Before you type| MCP tool names| 120
+Before you type| Skill descriptions| 450
+Before you type| `~/.claude/CLAUDE.md`| 320
+Before you type| Project CLAUDE.md| 1,800
+First prompt| Your prompt| 45
+As Claude works| Read `src/api/auth.ts`| 2,400
+As Claude works| Read `src/lib/tokens.ts`| 1,100
+As Claude works| Rule `api-conventions.md`| 380
+As Claude works| Read `middleware.ts`| 1,800
+As Claude works| Read `auth.test.ts`| 1,600
+As Claude works| Rule `testing.md`| 290
+As Claude works| Search for `refreshToken`| 600
+As Claude works| Claude’s analysis| 800
+As Claude works| Edit `auth.ts`| 400
+As Claude works| Prettier hook output| 120
+As Claude works| Edit `auth.test.ts`| 600
+As Claude works| Prettier hook output| 100
+As Claude works| `npm test` output| 1,200
+As Claude works| Claude’s summary of its changes| 400
+Follow-up prompt| Your follow-up prompt| 40
+Follow-up prompt| Claude’s call to the subagent| 80
+Follow-up prompt| Subagent’s summary| 420
+Follow-up prompt| Claude’s response| 1,200
+End of the session| `!git status` and its output| 180
+End of the session| `/commit-push` skill body| 620
+
+Before `/compact`, 22,225 tokens are in use. The subagent uses another 9,890 tokens in its own context window.After `/compact`, 17,095 tokens are in use: the “Before you type” rows, a 1,725-token conversation summary, the four files read under “As Claude works”, and the `/commit-push` skill body.
## What survives compaction
--- a/cost-tracking.md
+++ b/cost-tracking.md
@@ -65,7 +65,7 @@
`total_cost_usd`| Included. Counts subagent requests alongside the top-level loop
`modelUsage` / `model_usage`| Included. Counts subagent requests alongside the top-level loop, broken down by model
-In [single message input mode](</docs/en/agent-sdk/streaming-vs-single-mode#single-message-input>), when background subagents are still running at the end of the final turn, Claude Code waits for them, up to the cap described in [background tasks at exit](</docs/en/headless#background-tasks-at-exit>), before emitting the result. The result’s `total_cost_usd`, `duration_api_ms`, and `modelUsage`, or `model_usage` in Python, include the work done during that wait. The following examples iterate over the message stream from a `query()` call and print the total cost when the `result` message arrives:
+In [single message input mode](</docs/en/agent-sdk/streaming-vs-single-mode#choose-single-shot-or-streaming-input>), Claude Code waits for background subagents still running at the end of the final turn before emitting the result. The wait lasts up to the cap described in [background tasks at exit](</docs/en/headless#background-tasks-at-exit>). The result’s `total_cost_usd`, `duration_api_ms`, and `modelUsage`, or `model_usage` in Python, include the work done during that wait. The following examples iterate over the message stream from a `query()` call and print the total cost when the `result` message arrives:
TypeScript
--- a/costs.md
+++ b/costs.md
@@ -6,7 +6,7 @@
The Session block in `/usage` shows API token usage and is intended for API users. Claude Pro, Max, and Ultra subscribers have usage included in their subscription, so the session cost figure isn’t relevant for billing purposes. Subscribers see plan usage bars, activity stats, and a usage breakdown on the same screen.
-The Session block at the top of `/usage` shows detailed token usage statistics for your current session. Claude Code computes the dollar figure locally from token counts at list price, unless a [`modelPricing`](</docs/en/settings-reference#modelpricing>) table is in effect. An administrator sets one in your organization’s managed settings so the figure uses your contracted rates, and while a table is in effect the `Total cost` line carries the note `at your organization's configured rates`. The figure is an estimate, so for authoritative billing see Manage costs for your organization.
+Run `/usage` at the Claude Code prompt and look under the **Session** heading for your current session’s token usage. Claude Code computes the dollar figure locally from token counts at list price, unless a [`modelPricing`](</docs/en/settings-reference#modelpricing>) table is in effect. An administrator sets one in your organization’s managed settings so the figure uses your contracted rates, and while a table is in effect the `Total cost` line carries the note `at your organization's configured rates`. The figure is an estimate, so for authoritative billing see Manage costs for your organization.
Total cost: $0.55
Total duration (API): 6m 20s
Show diff (632 lines)
--- a/create.md
+++ b/create.md
@@ -1,325 +1,330 @@
-A plugin is a directory of skills, agents, hooks, and MCP servers, plus a `plugin.json` file, called the manifest, that names the plugin. Claude Code loads the directory as one unit, so you can share it with teammates, install it in several projects, or publish it to a marketplace. This page is for people writing their own plugins.
-
-These cases are covered on other pages:
-
- * **Installing someone else’s plugin** : see [Install plugins](</docs/en/plugins/install>)
- * **Not sure you need a plugin** : see [Decide whether you need a plugin](</docs/en/plugins/overview#decide-whether-you-need-a-plugin>) on the overview
- * **Your plugin’s users are on claude.ai or in Cowork** : the same folder installs there with a different subset of components. See [Plugin structure and testing](<https://claude.com/docs/plugins/build>) and the [component support table](<https://claude.com/docs/plugins/platform-support#compare-component-support-by-app>)
-
-Start from the section that matches what you already have:
-
- * **Nothing yet** : follow Create your first plugin, then Develop without a marketplace and Test and debug.
- * **Files under`.claude/` already**: do the first-plugin walkthrough once to learn the layout, then follow Convert an existing `.claude/` setup.
-
-## Decide when to use a plugin
-
-Skills, agents, hooks, and MCP servers all work standalone in your project or home directory. Keep that standalone setup while it serves one project or only you. Make a plugin when you want to share the setup with teammates, install it in several projects, or publish versioned releases. When you move standalone skills, agents, hooks, and MCP config into a plugin, their location and names change:
-
- * **Where the files go** : under the plugin’s own directory, called the plugin root, as `skills/`, `agents/`, `hooks/hooks.json`, and `.mcp.json`.
- * **How they’re named** : plugin skills and agents get the plugin name as a prefix, such as `/my-plugin:hello`, so two plugins can each provide a `hello` skill without colliding.
-
-To move an existing setup into a plugin, see Convert an existing `.claude/` setup.
-
-## Create your first plugin
-
-In this walkthrough, you create a plugin whose only component is one skill, a greeting, and run it with `--plugin-dir`, which loads a plugin for one session without installing it. A plugin can hold any mix of [components](</docs/en/plugins/components>), such as skills, agents, hooks, and MCP servers, and none is required; one skill is the smallest example that shows the layout. You need Claude Code [installed and signed in](</docs/en/quickstart#step-1-install-claude-code>). Open a terminal in the directory where you want to keep the plugin, such as `~/projects`, and run the commands in these steps from it. You can keep a plugin anywhere, because you pass its path to Claude Code when you start a session.
+A mod is a Claude Code [plugin](</docs/en/plugins/overview>) with an entry file, called the hooks module: a JavaScript or TypeScript file whose functions Claude Code calls when events happen. To make one:
+
+ * **Ask Claude to write it** : describe what you want in a Claude Code session
+ * **Write it yourself** : follow the tutorial to learn how a mod’s code works. You don’t need Node.js, a bundler, or a build step, because Claude Code loads `.js` and `.ts` files directly.
+
+If you haven’t decided whether a mod is the right tool, read the [comparison on the overview](</docs/en/plugins/mods/overview#compare-mods-settings-hooks-skills-and-mcp-servers>) first.
+
+Use Claude Code v2.1.287 or later. In your shell, run `claude --version` to check. To see whether mods can load for you, see [Check whether mods can load](</docs/en/plugins/mods/troubleshoot#check-whether-mods-can-load>).
+
+## Ask Claude for a mod
+
+Describe the mod you want in an interactive Claude Code session, and Claude writes it. Claude works from a built-in [skill](</docs/en/skills>) named `plugin-authoring`, which tells it where to write the mod, which events and methods your version has, and how the mod gets loaded. Claude can load the skill when you ask for a mod, or you can load it yourself by running `/plugin-authoring` at the Claude Code prompt. In `auto` and `bypassPermissions` [permission modes](</docs/en/permission-modes>), Claude Code can load the mod without asking you. To be asked first, start a new session in `default` or `acceptEdits` mode, or [switch](</docs/en/permission-modes#switch-permission-modes>) to either mode before you ask for the session’s first mod. In some sessions, the mod can’t load.
1
+Describe the mod
+
+Ask for the mod in your own words, for example `make a mod that shows the current git branch above the prompt`. Claude writes the mod in a directory of its own in the session’s mods folder, which is `~/.claude/dev-mods/` followed by the session’s ID. A mod’s full path looks like `~/.claude/dev-mods/3f2a9c1e-5b7d-4e8a-9c21-6d0f4b8a7e13/git-branch/`.
+
+In the `default` and `acceptEdits` [permission modes](</docs/en/permission-modes>), Claude Code asks you to approve each of the mod’s files before Claude creates it, because the mods folder is a [protected path](</docs/en/permission-modes#protected-paths>). Approve each file as it comes up.
+
+2
+
+Approve the mod
+
+When Claude saves the first file, Claude Code asks whether to enable hot reloading for the session. Hot reloading runs the mods Claude writes in this session and picks up each later change. You don’t see this question in a session that loads new mods without asking or can’t load them.Choose one of these answers:
+
+ * **Turn them on** : the mods in the session’s mods folder load when the turn ends, and reload at the end of each turn that changes them. Your answer lasts for the session, including after you resume it.
+ * **Not now** : nothing loads for now. The files stay where Claude wrote them, and the mods load the next time that session starts. To keep a mod from ever loading, delete its directory.
+
+3
+
+Check that the mod loaded
+
+Run `/plugin` at the Claude Code prompt and press Tab until the **Installed** tab is selected. It lists the mod, and you can turn it off there.
+
+4
+
+Try the mod
+
+Use what you asked for. For the example prompt, the current branch name appears above the prompt box. If the mod doesn’t do what you wanted, tell Claude what to change. The mod reloads at the end of each turn that changes its files, so you can try the change as soon as Claude finishes.If a transcript line that starts with the mod’s name says the [change didn’t load](</docs/en/plugins/mods/troubleshoot#this-mods-change-didnt-load>), paste that line into your next message when you ask Claude for a fix. Claude doesn’t see the line unless you paste it.
+
+### Use the mod in other sessions
+
+A mod Claude wrote loads only in the session that made it, and Claude Code deletes that session’s mods folder once it’s older than [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>). To keep the mod, copy its directory out of the mods folder to a place of your own, such as `~/mods/git-branch`. Then choose how to load it:
+
+ * **In a session you start** : in your shell, run `claude --plugin-dir ~/mods/git-branch`
+ * **For other people** : add it to a marketplace so they can install it
+
+### Sessions that load a mod without asking
+
+Claude Code can enable hot reloading without asking in `auto` and `bypassPermissions` modes, and the mods load when the turn ends. When you resume a session, interactively or with `claude -p`, the mods already in its mods folder can load without asking. To keep a mod from loading when you resume, delete its directory.
+
+### Sessions where a mod Claude writes can’t load
+
+A mod Claude writes doesn’t load in these cases, and Claude Code doesn’t ask to load it:
+
+ * **Nobody is there to approve** : the session is in [`dontAsk` mode](</docs/en/permission-modes>), or it’s the `claude -p` run that writes the mod, in `default` or `acceptEdits` mode, which can’t show you the hot reloading question.
+ * **An interactive session where the workspace isn’t trusted** : you haven’t accepted the trust prompt for the directory
+ * **Mods are disabled** : you started with `--safe-mode` or `--bare`, you set `disableAllHooks`, or your organization’s [managed settings block it](</docs/en/plugins/mods/admin#choose-how-much-to-allow>)
+
+## Write a mod yourself
+
+In this tutorial you build a mod named `first-mod` that counts the tool calls Claude makes, shows the count beside the spinner while Claude works, and adds a `/tally` command that prints it. You then read the type declarations Claude Code writes beside your mod and run `claude plugin validate`. Together they show you the events and methods your version offers and what Claude Code reads from your code. This recording shows the finished mod. The spinner counts tool calls, `/tally` prints the count, and an edit to the code takes effect while the session runs:
+
+You write three files:
+
+ first-mod/
+ ├── .claude-plugin/
+ │ └── plugin.json
+ └── hooks/
+ ├── hooks.json
+ └── register.js
+
+ * **`plugin.json`** : the plugin’s [manifest](</docs/en/plugins/manifest-reference>)
+ * **`hooks.json`** : [points to your code file](</docs/en/plugins/mods/reference#files>)
+ * **`register.js`** : your code, called the hooks module
+
+1
+
Create the plugin directory
-Create the plugin directory, with a `.claude-plugin/` folder inside it to hold the manifest:
-
- mkdir -p my-first-plugin/.claude-plugin
+Create the two directories that hold the files:
+
+ * Bash or Zsh
+
+ * PowerShell
+
+ mkdir -p first-mod/.claude-plugin first-mod/hooks
+
+ New-Item -ItemType Directory -Force first-mod\.claude-plugin, first-mod\hooks
2
Write the manifest
-The [manifest](</docs/en/plugins/manifest-reference>) is a JSON file named `plugin.json` that tells Claude Code the plugin’s name and describes it. Save this one as `my-first-plugin/.claude-plugin/plugin.json`:
-
-my-first-plugin/.claude-plugin/plugin.json
+A mod is a plugin, and a mod needs a [manifest](</docs/en/plugins/manifest-reference>). This mod’s manifest has no special fields. Save this as `first-mod/.claude-plugin/plugin.json`:
+
+first-mod/.claude-plugin/plugin.json
{
- "name": "my-first-plugin",
- "description": "A greeting plugin to learn the basics",
- "version": "1.0.0",
- "author": {
- "name": "Your Name"
- }
+ "name": "first-mod",
+ "version": "0.1.0",
+ "description": "Counts Claude's tool calls, shows the count beside the spinner, and adds a /tally command",
+ "author": { "name": "Your Name" }
}
-The four fields do this:
-
- * **`name`** : required. It identifies the plugin and becomes the prefix on every skill and agent the plugin provides. Don’t put spaces in it.
- * **`description`** : the text users see for the plugin in `/plugin`.
- * **`version`** : optional. Setting it keeps users on that version until you change it; [Release a new version](</docs/en/plugins/host-marketplace#release-a-new-version>) says when to set or omit it.
- * **`author`** : who to credit. `name` is required inside it; `email` and `url` are optional.
-
-Other fields are on the [manifest reference](</docs/en/plugins/manifest-reference#fields>).Only `plugin.json` goes inside `.claude-plugin/`. The skill you add next goes directly under `my-first-plugin/`, next to that folder.
-
3
-Add a skill
-
-This plugin’s one component is a skill. Each skill is a directory under `skills/` that contains a `SKILL.md` file. Create the skill’s directory:
-
- mkdir -p my-first-plugin/skills/hello
-
-Then create `my-first-plugin/skills/hello/SKILL.md` with this content:
-
-my-first-plugin/skills/hello/SKILL.md
-
- ---
- name: hello
- description: Greet the user with a friendly message
- disable-model-invocation: true
- ---
-
- Greet the user warmly and ask how you can help them today.
-
-The `disable-model-invocation: true` line means Claude doesn’t run the skill on its own. Remove that line from a skill you want Claude to run on its own. The skill’s command combines the plugin name and the skill’s name, so you run this one as `/my-first-plugin:hello`. For the other frontmatter fields, see the [skill frontmatter reference](</docs/en/skills#frontmatter-reference>).
+Tell Claude Code where your code is
+
+When Claude Code loads a plugin, it reads the plugin’s `hooks/hooks.json`. The `modules` key in that file gives the path to your code, and having it is what makes the plugin a mod. List one path, relative to `hooks.json`. Here it points to `register.js`, which you write in the next step.Save this as `first-mod/hooks/hooks.json`:
+
+first-mod/hooks/hooks.json
+
+ {
+ "description": "The first-mod hooks module",
+ "modules": ["./register.js"]
+ }
4
-Validate the plugin
-
-Check the manifest and the skill’s frontmatter before you run anything:
-
- claude plugin validate ./my-first-plugin
-
-The command prints the manifest path it checked and `✔ Validation passed`. If it prints `✘ Validation failed` instead, each line above that result line names the field to fix. Look up each message under [`claude plugin validate` reports errors](</docs/en/plugins/troubleshooting#claude-plugin-validate-reports-errors>).
+Write the code
+
+This file is the mod’s code, called the hooks module. When the mod loads, Claude Code calls the `register` function the file exports and passes it a function named [`on`](</docs/en/plugins/mods/reference#the-hook-function>). Each call to `on` registers an event handler, called a hook, for the event it names.Save this as `first-mod/hooks/register.js`:
+
+first-mod/hooks/register.js
+
+ // The count, shared by the hooks below
+ let calls = 0
+
+ // Claude Code calls this once when the mod loads
+ export function register(on) {
+ // Runs when the session starts, before your first prompt
+ on('session.start', async ($, e, next) => {
+ // Add the /tally command
+ await $.command.register({
+ name: 'tally',
+ description: 'Show how many tool calls Claude has made',
+ })
+ // Let the session start as usual
+ return next(e)
+ })
+
+ // Runs each time Claude is about to use a tool
+ on('tool.call', async ($, e, next) => {
+ calls += 1
+ // Ask Claude Code to draw the interface again, so the new count shows
+ $.ui.invalidate('ui.render')
+ // Let the tool run as usual
+ return next(e)
+ })
+
+ // Runs when you type /tally, and only then, because of the matcher
+ on('command.run', { command: 'tally' }, async () => {
+ // The text to print in the transcript
+ return { text: 'Claude has made ' + calls + ' tool calls since this mod loaded' }
+ })
+
+ // Runs each time Claude Code draws the spinner
+ on('ui.render', { component: 'Spinner' }, async ($, e, next) => {
+ // Keep Claude Code's spinner, with the count added after its word
+ return next({ ...e, props: { ...e.props, suffix: ' · tool calls: ' + calls + '…' } })
+ })
+ }
+
+The file keeps a count in `calls` and registers four hooks:
+
+ * **[`session.start`](</docs/en/plugins/mods/reference#session>)** runs when the session starts, before your first prompt, and again each time the mod reloads. It adds the `/tally` command to Claude Code.
+ * **[`tool.call`](</docs/en/plugins/mods/reference#tools>)** runs each time Claude is about to use a tool. It adds one to `calls` and asks Claude Code to draw the interface again.
+ * **[`command.run`](</docs/en/plugins/mods/reference#commands-and-configuration>)** runs when you type `/tally`. It returns the text to print.
+ * **[`ui.render`](</docs/en/plugins/mods/reference#interface>)** runs each time Claude Code draws the spinner. It adds the count after the spinner’s word.
+
+How the example mod works explains the three arguments each hook takes and what each one returns.
5
-Run Claude Code with the plugin
-
-Start a session with the plugin loaded:
-
- claude --plugin-dir ./my-first-plugin
-
-Once Claude Code starts, run the skill:
-
- /my-first-plugin:hello
-
-Claude replies with a greeting.
-
-The plugin loads only in sessions you start with `--plugin-dir`. To keep working on it without the flag, or to test a `.zip` build, see Develop without a marketplace. To have Claude scaffold and check a larger plugin with you, [install](</docs/en/plugins/install#install-a-plugin>) Anthropic’s `plugin-dev` plugin from the `claude-plugins-official` marketplace, which adds skills and agents for writing components such as skills, hooks, and MCP servers and for validating the finished plugin. Once it’s installed, run `/plugin-dev:create-plugin` followed by a description of the plugin you want, and Claude walks you through designing, creating, and validating it.
-
-### Share your plugin
-
-A plugin you built with Create your first plugin exists only on your machine. When it’s ready for other people, there are three ways to get it to them:
-
- * **Send it to a few people directly** : give them the plugin’s directory or a `.zip` of it, and nothing needs to be published. See [Share a plugin without a marketplace](</docs/en/plugins/publish#share-a-plugin-without-a-marketplace>).
- * **List it in your own marketplace** : teammates add your marketplace once and install the plugin by name, and they receive your updates. See [Publish through your own marketplace](</docs/en/plugins/publish#publish-through-your-own-marketplace>).
- * **Submit it to Anthropic’s directory** : after it passes review, people can add it on claude.ai and in Cowork, and it reaches Claude Code through their account. See [Submit to Anthropic’s directory](</docs/en/plugins/publish#submit-to-anthropics-directory>).
-
-### Plugin layout
-
-Each kind of [component](</docs/en/plugins/components>), such as skills, agents, hooks, and MCP servers, goes in a fixed directory under the plugin root, which is the directory you pass to `--plugin-dir`. Add only the directories you use. To click through a complete plugin directory and read what each file does, open the [plugin explorer](</docs/en/plugins/components#explore-the-plugin-directory>). The table lists the directories most plugins start with, and the [full layout](</docs/en/plugins/manifest-reference#standard-layout>) lists the rest.
-
-Location| Contents
+Load the mod
+
+Start Claude Code with the `--plugin-dir` flag, which loads a plugin directory for one session without installing it:
+
+ claude --plugin-dir ./first-mod
+
+6
+
+Try the mod
+
+Ask Claude to do something that takes a few tool calls, such as `list the files here and read the README`. While Claude works, the spinner’s word is followed by a count that rises, as in `Thinking · tool calls: 2…`. When Claude finishes, type `/tally` and press Enter. The transcript shows `first-mod: Claude has made 2 tool calls since this mod loaded`, with your own count. Claude Code puts the plugin’s name in front of the command’s text.To check the command without an interactive session, run it in non-interactive mode:
+
+ claude -p "/tally" --plugin-dir ./first-mod
+
+ first-mod: Claude has made 0 tool calls since this mod loaded
+
+If `/tally` isn’t in the command list, the module didn’t load. See [Find out why a mod does nothing](</docs/en/plugins/mods/troubleshoot#find-out-why-a-mod-does-nothing>).
+
+7
+
+Change the code while the session runs
+
+Leave the session open. In `register.js`, change `' · tool calls: '` to `' · tools used: '` in the `ui.render` hook and save. The highlighted line is the one that changes:
+
+first-mod/hooks/register.js
+
+ // Runs each time Claude Code draws the spinner
+ on('ui.render', { component: 'Spinner' }, async ($, e, next) => {
+ // Keep Claude Code's spinner, with the count added after its word
+ return next({ ...e, props: { ...e.props, suffix: ' · tools used: ' + calls + '…' } })
+ })
+
+A line in the transcript says `first-mod` reloaded and lists its hooks, and the next spinner uses the new text, as in `Thinking · tools used: 1…`.
+
+### How the example mod works
+
+Each function you pass to `on` is a hook, which is an event handler. Claude Code passes every hook the same three arguments:
+
+ * **The mods API** , named `$`: every method a mod can call to reach outside itself, in [namespaces](</docs/en/plugins/mods/reference#mods-api-methods>) such as `$.ui` and `$.command`
+ * **The event** , named `e`: the [event’s input](</docs/en/plugins/mods/reference#events>) as plain data, such as a tool call’s name and arguments
+ * **The next handler** , named [`next`](</docs/en/plugins/mods/events#how-a-hook-handles-an-event>): a function that passes the event on to the other mods and then to Claude Code’s own behavior, and returns the result
+
+The hooks in `first-mod` handle their events in these ways:
+
+ * **Observe** : the `session.start` hook registers the command, and the `tool.call` hook counts the call and asks for a redraw. Both return `next(e)`, so the session starts and the tool runs as usual.
+ * **Answer** : the `command.run` hook returns its own result and never calls `next`. The second argument to `on`, `{ command: 'tally' }`, is a filter, called a [matcher](</docs/en/plugins/mods/events#filter-which-events-a-hook-handles>), so the hook runs only for `/tally`.
+ * **Rewrite** : the `ui.render` hook calls `next` with a copy of `e` whose `suffix` holds the count, so Claude Code draws its usual spinner with your text after the word
+
+Claude Code watches a directory loaded with `--plugin-dir` and hot-reloads the hooks module when a file in it changes. Each reload runs `register` again, so `calls` resets to `0` and `/tally` starts counting again. To keep a value across reloads, see [Keep state](</docs/en/plugins/mods/interface#keep-state>).
+
+## Keep working on a mod
+
+Once a mod loads, you can have Claude change it, check your code against the type definitions for your version, list the events and calls Claude Code finds in it, and test it.
+
+### Change a mod with Claude
+
+To change a mod you already have, start the session with `--plugin-dir` pointed at the mod’s directory, so that what Claude writes loads in the same session:
+
+ claude --plugin-dir ./first-mod
+
+Then ask for the change, for example `add a /tally-reset command to this mod that sets the tally back to zero`. Claude edits the hooks module, runs `claude plugin validate`, and fixes what it reports. A directory you load with `--plugin-dir` is a [protected path](</docs/en/permission-modes#protected-paths>), so in `default` and `acceptEdits` modes you’re asked to approve each of Claude’s edits to the mod. The protected paths table gives the result for the other permission modes. Files Claude saves during its turn reload when the turn ends, so you can try `/tally-reset` as soon as Claude finishes.
+
+### Get type definitions for your version
+
+When Claude Code loads a mod from `--plugin-dir` in an interactive session, or a mod Claude wrote for you, it writes TypeScript declaration files into the mod’s `.claude-plugin/types/` directory. They describe the exact events, mods API methods, and elements in the Claude Code version you’re running, so your editor can autocomplete and type-check your hooks. The directory holds these files:
+
+Path| What it declares
---|---
-`.claude-plugin/plugin.json`| The manifest. When you load a plugin with `--plugin-dir` and it has no manifest, Claude Code names the plugin after its directory
-`skills/`| One `<name>/SKILL.md` directory per skill
-`commands/`| Flat Markdown files, the older form of skills. Use `skills/` for new plugins
-`agents/`| One Markdown file per subagent
-`hooks/hooks.json`| Hook configuration: a top-level `"hooks"` key whose value has the same shape as `hooks` in a settings file
-`.mcp.json`| MCP server definitions
-
-Only `plugin.json` goes inside `.claude-plugin/`. Components saved there don’t load.The plugin root is the plugin’s own directory, not `~/.claude/` itself. A `.mcp.json` saved at `~/.claude/.mcp.json` doesn’t load.
-
-## Develop without a marketplace
-
-You don’t need a [marketplace](</docs/en/plugins/overview#get-plugins-from-a-marketplace>) to run a plugin you’re writing. Load it directly from disk or a URL instead:
-
- * `--plugin-dir`: loads a directory or `.zip` archive for one session.
- * `--plugin-url`: fetches a `.zip` archive from a URL for one session.
- * `claude plugin init`: scaffolds a plugin under `~/.claude/skills/` that loads across sessions.
-
-If two plugins loaded in different ways share a name, see [Name conflicts](</docs/en/plugins/loading#name-conflicts>) for which one Claude Code keeps.
-
-### Load a plugin for one session
-
-You can load a plugin for a single session in three ways:
-
- * From a directory or `.zip` archive on disk with `--plugin-dir`
- * From a URL with `--plugin-url`
- * From an environment variable when you can’t add a flag
-
-When you edit the plugin’s files during the session, run `/reload-plugins` to load the changes.
-
-#### Load a plugin from a directory or `.zip`
-
-When you start `claude` from your shell, pass `--plugin-dir` with the plugin’s root directory or a `.zip` archive of it. Repeat the flag to load several plugins:
-
- claude --plugin-dir ./my-first-plugin --plugin-dir ./other-plugin.zip
-
-#### Load a folder of plugins
-
-To load several plugins from one place, pass a folder that holds them, such as `--plugin-dir ./plugins`. Loading a folder of plugins requires Claude Code v2.1.265 or later. If the folder has no `.claude-plugin/` directory and no plugin components at its top level, Claude Code treats it as a folder of plugins. Each immediate subfolder that has a `.claude-plugin/plugin.json` manifest then loads as a separate plugin. Everything else in the folder is skipped without an error, including a subfolder that has no manifest. If a plugin in the folder doesn’t load, check that its subfolder has a `.claude-plugin/plugin.json`. You can also pass a folder that keeps a `.claude-plugin/marketplace.json` beside its plugin folders. As long as that `.claude-plugin/` directory holds no `plugin.json`, the plugin folders still load. Nothing is installed or enabled from the marketplace file, because Claude Code doesn’t read it. Loading plugins from such a folder requires Claude Code v2.1.281 or later. In an interactive session, you can also add and remove plugins in the folder after startup:
-
- * A subfolder you add loads as a new plugin once its manifest exists.
- * When you remove a subfolder, its plugin unloads.
-
-A message appears in the session for each of these changes. If loading or unloading a plugin mid-conversation would [invalidate the prompt cache](</docs/en/prompt-caching#enabling-or-disabling-a-plugin>), the change is held instead, and the message tells you to run `/reload-plugins` to apply it.
-
-#### Load a plugin from a URL
-
-When you start `claude` from your shell, pass `--plugin-url` with the address of a `.zip` archive, such as a build artifact your CI publishes:
-
- claude --plugin-url https://example.com/my-first-plugin.zip
-
-Claude Code downloads the archive at startup. To load several, repeat the flag or pass the URLs space-separated in one quoted argument. Point the flag only at archives you control or trust. If Claude Code can’t fetch the archive, or the archive is invalid, it starts without the plugin and records a plugin load error that you can review in the `/plugin` manager’s **Errors** tab.
-
-#### Load plugins from an environment variable
-
-To load plugins in a session where you can’t add the `--plugin-dir` flag, list their absolute paths in the [`CLAUDE_CODE_PLUGIN_DIRS`](</docs/en/env-vars#variables>) environment variable instead. Claude Code loads each path as it loads a `--plugin-dir` path. These plugins load in addition to any you pass with `--plugin-dir`. [Project and local settings can’t set this variable](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). `CLAUDE_CODE_PLUGIN_DIRS` requires Claude Code v2.1.280 or later. Managed settings can turn off `--plugin-dir` and `CLAUDE_CODE_PLUGIN_DIRS`. See [Flags that load a plugin for one session](</docs/en/plugins/cli-reference#flags-that-load-a-plugin-for-one-session>). To test a plugin together with a plugin it depends on, see [Test a plugin and its dependency locally](</docs/en/plugins/dependencies#test-a-plugin-and-its-dependency-locally>).
-
-### Make a plugin load in every session
-
-Your personal skills directory is `~/.claude/skills/`, and a folder there that contains a `.claude-plugin/plugin.json` is a skills-directory plugin. Unless your administrator has [blocked skills-directory plugins](</docs/en/plugins/loading#skills-directory-plugins-blocked-by-managed-settings>), Claude Code loads each one when a session starts, with no flag and no install step. `claude plugin init` scaffolds one for you.
-
-#### Scaffold the plugin with `claude plugin init`
-
-`claude plugin init` writes a starter plugin under `~/.claude/skills/`. Scaffold one from your shell:
-
- claude plugin init my-tool
-
-The command creates `~/.claude/skills/my-tool/` with a `.claude-plugin/plugin.json` and a root `SKILL.md`. It prints `✔ Created plugin "my-tool" at ~/.claude/skills/my-tool` followed by `It will auto-load next session as my-tool@skills-dir. Run /reload-plugins to load it now.` Pass `--with skills` to have `claude plugin init` scaffold a skill under `skills/` for you. The other `--with` values are on the [plugin commands reference](</docs/en/plugins/cli-reference#plugin-init>).
-
-#### Name the plugin’s skills
-
-The root skill at `~/.claude/skills/my-tool/SKILL.md` is also a personal skill, so you invoke it as `/my-tool`, not `/my-tool:my-tool`. Skills you add under `skills/` inside the plugin get the plugin-name prefix, such as `/my-tool:example`.
-
-#### Stop loading the plugin
-
-To stop loading a scaffolded plugin, delete its directory, or run `claude plugin disable my-tool@skills-dir` in your shell with the `my-tool@skills-dir` name that `claude plugin init` printed. In the ID `my-tool@skills-dir`, `skills-dir` stands where a marketplace name would, because the plugin loads from your skills directory rather than from a marketplace.
-
-#### Share the plugin through a repository
-
-`claude plugin init` writes the plugin to your personal skills directory at `~/.claude/skills/`, which all your projects on this machine share. To make a plugin load for everyone in one repository, create the same layout yourself at `<project>/.claude/skills/<name>/`, including its `.claude-plugin/plugin.json`. See [Plugins shared through a repository](</docs/en/plugins/loading#plugins-shared-through-a-repository>) for the conditions under which Claude Code loads it.
-
-## Test and debug
-
-When a change to your plugin doesn’t show up, work through these checks in order. Each one tells you what Claude Code did with the plugin:
-
- 1. In your shell, run `claude plugin validate <path>`. It checks the manifest and the frontmatter of every skill, agent, and command file, and exits `0` on `Validation passed`. Add `--strict` to fail on warnings too. Exit codes and directory handling are on the [plugin commands reference](</docs/en/plugins/cli-reference#plugin-validate>).
- 2. In the running session, run `/reload-plugins` to apply edits you made on disk. It prints one `Reloaded:` line with counts. Then confirm a skill loaded by typing its `/plugin-name:skill` command, or by finding the plugin in the `/plugin` **Installed** tab.
- 3. In the same session, run `/plugin`. The **Installed** tab lists your plugin and, in the plugin’s details, the components Claude Code found. The **Errors** tab lists what failed to load and why, such as a path in your manifest that doesn’t exist.
- 4. Back in your shell, run `claude plugin list`. It prints session-only and skills-directory plugins in their own sections with `Status: ✔ loaded` or the load error. To include the plugin you’re developing, pass `--plugin-dir` with its path before `plugin list`.
- 5. If your plugin is in a skills directory and `claude plugin list` doesn’t print it, with no error there or in `/plugin`, see [Skills-directory plugins blocked by managed settings](</docs/en/plugins/loading#skills-directory-plugins-blocked-by-managed-settings>).
-
-To check an MCP server, run `/mcp` in the session to see the server’s status. When the server is healthy, `/mcp` lists it as connected. If it isn’t, see [MCP servers that don’t start](</docs/en/plugins/troubleshooting#invalid-mcp-server-config-for-and-mcp-servers-that-dont-start>). To check a hook, turn on debug logging as [Debug hooks](</docs/en/hooks#debug-hooks>) describes and trigger the event it matches. For example, ask Claude to edit a file to trigger a `PostToolUse` hook. Then read the debug log. The next sections cover the failures you’re most likely to hit while developing, and the [troubleshooting page](</docs/en/plugins/troubleshooting#build-a-plugin>) has the full entry for each.
-
-### A component path isn’t found
-
-The **Errors** tab of `/plugin` shows `<component> path not found: <path>`, for example `commands path not found`. A component path in your manifest, such as `commands`, `skills`, `agents`, or `hooks`, points at nothing. Fix the path or create the directory, then run `/reload-plugins` in the session. See [`commands path not found`](</docs/en/plugins/troubleshooting#commands-path-not-found>).
-
-### `--plugin-dir` at a marketplace root doesn’t load the plugins under `plugins/`
-
-`--plugin-dir` takes the plugin’s root directory, the one that contains `.claude-plugin/plugin.json` and the component directories such as `skills/`. If you point it at a marketplace root instead, Claude Code doesn’t read `marketplace.json`, so a plugin under `plugins/` doesn’t load, and you see no error. Point the flag at one plugin’s folder, or add the marketplace. See [the troubleshooting entry](</docs/en/plugins/troubleshooting#plugin-dir-loads-a-plugin-with-no-components>).
-
-### The plugin loads but its skills are missing
-
-The `skills/` directory is inside `.claude-plugin/`, or a `skills` entry in the manifest points at a file. Move `skills/` to the plugin root, point each `skills` entry at a directory that contains `SKILL.md`, and run `/reload-plugins` in the session. See [Plugin loads but its skills are missing](</docs/en/plugins/troubleshooting#plugin-loads-but-its-skills-are-missing>).
-
-### The `userConfig` dialog never appears
-
-The dialog for your plugin’s [`userConfig`](</docs/en/plugins/components#user-configuration>) options is part of installing through `/plugin` in a session. Loading with `--plugin-dir` doesn’t show it, and neither does `claude plugin install` in the shell. With the plugin loaded, run `/plugin configure <plugin-name>` in the session to open it. See [The `userConfig` dialog never appears](</docs/en/plugins/troubleshooting#the-userconfig-dialog-never-appears>).
-
-### Check that the plugin changes Claude’s behavior
-
-A plugin that loads without errors can still fail to steer Claude the way you intend. `claude plugin eval`, which you run in your shell, runs your test cases with and without the plugin and scores the difference. See [Test plugins with evals](</docs/en/plugin-evals>), starting with [Create your first eval suite](</docs/en/plugin-evals#create-your-first-eval-suite>).
-
-## Convert an existing `.claude/` setup
-
-If you already have skills, agents, or hooks under a project’s `.claude/` directory, you can move them into a plugin without rewriting them. Run the commands in these steps from the project root, which is the directory that contains `.claude/`, because the `cp` paths are relative to it.
-
-1
-
-Create the plugin structure
-
-Create the plugin directory and its `.claude-plugin/` folder alongside `.claude/`. You can move the plugin anywhere afterwards.
-
- mkdir -p my-plugin/.claude-plugin
-
-Create `my-plugin/.claude-plugin/plugin.json`:
-
-my-plugin/.claude-plugin/plugin.json
-
- {
- "name": "my-plugin",
- "description": "Migrated from standalone configuration",
- "version": "1.0.0"
- }
-
-2
-
-Copy your existing files
-
-Copy each configuration directory you have to the plugin root, and skip the command for any directory you don’t have.
-
- cp -r .claude/commands my-plugin/
-
- cp -r .claude/agents my-plugin/
-
- cp -r .claude/skills my-plugin/
-
-Run `ls -a my-plugin` to confirm that each directory you copied appears next to `.claude-plugin`.
-
-3
-
-Move your hooks
-
-If you have hooks in `.claude/settings.json` or `.claude/settings.local.json`, create a hooks directory:
-
- mkdir -p my-plugin/hooks
-
-Create `my-plugin/hooks/hooks.json` and copy the `hooks` object from your settings file into it. The format is the same.This example shows the shape with one hook that runs a linter on each file Claude writes or edits. Replace the example with your own `hooks` object.
-
-my-plugin/hooks/hooks.json
-
- {
- "hooks": {
- "PostToolUse": [
- {
- "matcher": "Write|Edit",
- "hooks": [{ "type": "command", "command": "f=$(jq -r '.tool_input.file_path') && npm run lint:fix -- \"$f\"" }]
- }
- ]
- }
- }
-
-4
-
-Test the migrated plugin
-
-Load the plugin for a session:
-
- claude --plugin-dir ./my-plugin
-
-Check each component under its new name:
-
- * **Skills** : run `/my-plugin:deploy` for a skill that was `/deploy`.
- * **Subagents** : ask Claude to use the `my-plugin:reviewer` agent for an agent that was `reviewer`.
- * **Hooks** : trigger the event each hook matches.
-
-If something is missing, work through Test and debug.
-
-While the originals are still under `.claude/`, they stay loaded alongside the plugin’s copies:
-
- * **Skills and agents** : the two sets don’t collide, because the plugin’s skills and agents carry the `my-plugin:` prefix. `/deploy` and `/my-plugin:deploy` both work, and Claude sees `reviewer` and `my-plugin:reviewer` as two subagents.
- * **Hooks** : hooks have no prefix, so a hook that is in both your settings file and `hooks/hooks.json` runs twice each time its event fires.
-
-After you’ve confirmed the plugin works, delete the originals from `.claude/` and remove the `hooks` object from your settings file.
+`claude-code/index.d.ts`| Every event and its input and result, every mods API namespace and method, and the elements each surface can draw
+`claude-code-tools/index.d.ts`| The built-in tools’ inputs and results, so that checking `e.tool === 'Bash'` narrows `e`
+`claude-code-mcp/index.d.ts`| The inputs of the MCP tools that were connected the last time you saved a file in the mod
+`index.d.ts` in a directory named for a plugin| What that plugin adds to the mods API. There’s one directory for each plugin your `plugin.json` lists under `dependencies`.
+`tsconfig.json`| Compiler options that fit a hooks module
+
+If your mod has no `tsconfig.json` of its own, Claude Code adds one at the mod’s root that extends the generated one, so your editor and `tsc -p ./first-mod` type-check the mod without more setup. The events and methods can change between releases, so trust these files over any page, this one included, when they disagree. `claude-code/index.d.ts` is the fullest reference for your build, with a comment and an example for every mods API method. To look something up, search the file for its name, such as `'tool.call'`.
+
+### Check what Claude Code reads from your mod
+
+To see your mod the way Claude Code sees it, without running your code or starting a session, use `claude plugin validate`. It checks the manifest and runs the same static analysis on the hooks module’s source that Claude Code runs when it loads a mod. In your shell, run it on the mod’s directory:
+
+ claude plugin validate ./first-mod
+
+For `first-mod`, the output includes these lines.
+
+ ❯ ./register.js hooks: session.start, tool.call, command.run{command=tally}, ui.render{component=Spinner}
+ ❯ ./register.js calls: $.command.register, $.ui.invalidate
+
+ ✔ Validation passed
+
+Check the `hooks:` line for the events your module hooks, each with its filter in braces, and `calls:` for every mods API method it calls. If your module reads or sets environment variables, look for `env reads:` and `env writes:` lines too, and `state reads:` and `state writes:` if it uses [`$.state`](</docs/en/plugins/mods/interface#keep-state>). You also see one line for each hook that can refuse an action, such as `gating hook without .catch: tool.call`, which says whether that hook has a [`.catch` handler](</docs/en/plugins/mods/events#handle-a-hook-that-fails>). If an event you meant to handle is missing from the `hooks:` lines, Claude Code won’t call that hook either. The usual cause is a misspelled event name, which the command reports as an error such as `"tool.calls" is not an event`. Follow these rules so that static analysis can find every hook and call:
+
+ * Write each mods API call in full: `$`, the namespace, then the method, as in `$.store.get('notes')`. You can pass `$` to a function declared at the top level of the same file, and for a function of yours named `loadNotes`, the `calls:` line then reads `$.store.get (via loadNotes)`. Passing `$` to a method, a function defined inside the hook, or a function you import from another of your files fails validation. The `read` and `update` functions that [`$.state`](</docs/en/plugins/mods/interface#keep-state>) uses are the imports that can take it. Don’t assign `$` or one of its namespaces to a variable, destructure it, or index it with a computed name. `const ui = $.ui` fails with `$.ui is used as a value`.
+ * Write the event name in each `on` call as a string literal, such as `'tool.call'`. A variable, or a loop over a list of names, fails with `the event name passed to on() is not a string literal`.
+ * Inside `register`, don’t declare a second variable or parameter named `on`. Validation fails with `"on" is declared again (shadowed)`.
+ * Import only from files inside the plugin directory, by relative path. The one bare import allowed is `claude-code`, for types and a few helpers.
+ * Use `import` declarations at the top of the file, as in `import { name } from './file.js'`. A dynamic `import()` fails with `a dynamic import(); a hooks module imports its own files with an import declaration`.
+ * Write every file as an ES module, with `import` and not `require`. The [reference](</docs/en/plugins/mods/reference#files>) lists the file extensions Claude Code loads.
+
+### Test the mod
+
+You can write automated tests for a mod and run them from your shell with `claude plugin test`, with no session, sign-in, or network. A test fires the events your hooks handle and checks what the hooks did. This test fires two tool calls, runs `/tally`, and checks that the reply counts both. Save it as `first-mod/tests/first-mod.test.ts`:
+
+first-mod/tests/first-mod.test.ts
+
+ import { expect, test } from 'claude-code/testing'
+
+ test('/tally reports the tool calls the mod has seen', async ($, on) => {
+ // Answer each tool call in Claude Code's place, so no tool runs
+ on('tool.call', () => ({ result: 'ok' }))
+
+ // Fire two tool calls, which the mod's tool.call hook counts
+ await $.tool.call({ tool: 'Bash', command: 'ls' })
+ await $.tool.call({ tool: 'Read', file_path: 'README.md' })
+
+ // Run /tally and check the text its hook returns
+ const answer = await $.command.run({ command: 'tally', args: '' })
+ expect(answer.text).toBe('Claude has made 2 tool calls since this mod loaded')
+ })
+
+In your shell, run the tests from the `first-mod` directory:
+
+ claude plugin test
+
+The output names each test and whether it passed, with timings that vary from run to run:
+
+ tests/first-mod.test.ts:
+ (pass) /tally reports the tool calls the mod has seen [22.87ms]
+
+ 1 pass
+ 0 fail
+ Ran 1 test across 1 file. [0.19s]
+
+[Test a mod](</docs/en/plugins/mods/test>) covers stubbing a model call or the store, and testing timers and drawings.
+
+## Share your mod
+
+A mod is a plugin, so you version it in the manifest and people install and update it with the `/plugin` commands. How you share it depends on who it’s for:
+
+ * **A few people** : send them the plugin’s directory or a `.zip` of it. See [Share a plugin without a marketplace](</docs/en/plugins/publish#share-a-plugin-without-a-marketplace>)
+ * **Your team** : list it in [your own marketplace](</docs/en/plugins/publish#publish-through-your-own-marketplace>), such as a private repository with one directory for each plugin. To add that marketplace for everyone who works in a repository, [register it in the repository’s settings](</docs/en/plugins/host-marketplace#register-the-marketplace-for-everyone-in-a-repository>)
+ * **Your whole organization** : an administrator can [install your organization’s mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>) through managed settings
+ * **Anyone** : make your marketplace’s repository public, or [submit the plugin to Anthropic’s directory](</docs/en/plugins/publish#submit-to-anthropics-directory>)
+
+Before you do, check the plugin’s `name`: `claude plugin validate` fails a name that [looks like one of Anthropic’s own](</docs/en/plugins/manifest-reference#name>), such as one that starts with `claude-`. The events and methods can change between releases, so your README is the place to say which Claude Code version you tested with. Keep developing against the directory with `--plugin-dir`, not against an installed copy. Claude Code caches an installed plugin by version, so your edits don’t reach the installed copy until you increment the version and install again.
## Next steps
- * [Plugin components](</docs/en/plugins/components>): add agents, hooks, MCP servers, LSP servers, and user configuration to your plugin
- * [Test plugins with evals](</docs/en/plugin-evals>): write eval cases and run them with `claude plugin eval` to check how reliably the plugin guides Claude’s behavior
- * [Publish a plugin](</docs/en/plugins/publish>): version it, put it in a marketplace, and submit it for review
- * [Plugin structure and testing](<https://claude.com/docs/plugins/build>): the same plugin folder installs on claude.ai and in Cowork. Some components are Claude Code-only, and the [component support table](<https://claude.com/docs/plugins/platform-support#compare-component-support-by-app>) lists which load on each surface
- * [Plugin manifest reference](</docs/en/plugins/manifest-reference>): every `plugin.json` field, path rule, and directory
- * [Skills](</docs/en/skills>): write the skills your plugin provides
- * [Anthropic’s plugins in the claude-plugins-official repository](<https://github.com/anthropics/claude-plugins-official/tree/main/plugins>): complete worked examples of the layout on this page, such as `feature-dev` and `code-review`
+ * [Draw in the interface](</docs/en/plugins/mods/interface>): open a pane, draw above the prompt, and add buttons and text fields
+ * [React to events](</docs/en/plugins/mods/events>): hook tool calls, prompts, and turns
+ * [Use the mods API](</docs/en/plugins/mods/api>): add commands and tools, call a model, and run work on a timer
+ * [Test a mod](</docs/en/plugins/mods/test>): stub what Claude Code would answer, and test timers and drawings
+ * [Troubleshoot a mod](</docs/en/plugins/mods/troubleshoot>): the reasons a mod does nothing, and the debug log
+ * [Read the source of built-in mods](</docs/en/plugins/mods/overview#read-the-source-of-built-in-mods>): complete plugins, each with its hooks module and tests
--- a/desktop.md
+++ b/desktop.md
@@ -164,7 +164,7 @@
To have Claude review your changes before you commit, enter `/code-review` in the prompt box. The findings arrive in the conversation when the review completes. In local, SSH, and [WSL](</docs/en/desktop-wsl>) sessions, the findings appear as a **Code review** card, grouped by file. Use the card to act on them:
- * Click **Walk through in diff** to open the diff view and step through the findings one at a time. A finding in the current diff appears at its line, where you can click **Fix this one** or dismiss it.
+ * Click **Walk through in Changes** to open the diff view and step through the findings one at a time. A finding in the current diff appears at its line, where you can click **Fix this one** or dismiss it.
* Click **Apply fixes** to ask Claude to fix the findings that are still open.
In any session, you can also ask Claude in the prompt box to fix what the review found. For what `/code-review` looks for and the arguments it takes, see [Review locally with `/code-review`](</docs/en/code-review-local>).
@@ -514,18 +514,22 @@
## Extend Claude Code
-Connect external services, add reusable workflows, customize Claude’s behavior, and configure preview servers. To manage connectors, skills, and plugins in one place, click **Customize** in the sidebar. [Cowork](<https://claude.com/product/cowork>) in the Desktop app sources its skills, plugins, and connectors from this Customize configuration, which syncs through your claude.ai account, not from the CLI’s `~/.claude` directory. Claude Code also loads the skills and plugins enabled for your claude.ai account in terminal sessions where you sign in with the same account. See [Skills synced from claude.ai](</docs/en/skills#how-synced-skills-behave>) and [Plugins synced from claude.ai](</docs/en/plugins/loading#synced-plugins>).
+Connect external services, add reusable workflows, customize Claude’s behavior, and configure preview servers. To manage connectors, skills, and plugins in one place, click **Customize** or **Plugins** in the sidebar. [Cowork](<https://claude.com/product/cowork>) in the Desktop app sources its skills, plugins, and connectors from this configuration, which syncs through your claude.ai account, not from the CLI’s `~/.claude` directory. Claude Code also loads the skills and plugins enabled for your claude.ai account in terminal sessions where you sign in with the same account. See [Skills synced from claude.ai](</docs/en/skills#how-synced-skills-behave>) and [Plugins synced from claude.ai](</docs/en/plugins/loading#synced-plugins>).
### Connect external tools
-Connectors are [MCP servers](</docs/en/mcp>) with a graphical setup flow. Click **+** next to the prompt box, before or during the session, to add connectors in a local or SSH session with a Claude account. Select **Add connectors** to open the connector directory. If the menu shows **Connectors** instead, select it, then **Browse connectors**.
+Connectors are [MCP servers](</docs/en/mcp>) with a graphical setup flow. Click **+** next to the prompt box, before or during the session, to add connectors in a local or SSH session with a Claude account. Open the connector directory from the entry the menu shows:
+
+ * **Add connectors** : select it
+ * **Connectors** : select it, then **Browse connectors**
+ * **Neither entry** : click **Plugins** in the sidebar, where the directory lists connectors and plugins together
These cases are covered on other pages:
* **Connectors is grayed out in a WSL session** : see [If the terminal or connectors are unavailable](</docs/en/desktop-wsl#check-for-the-terminal-and-connectors>)
* **Cloud sessions** : see [How connectors reach Claude Code](</docs/en/mcp#how-connectors-reach-claude-code>)
-Once connected, Claude can read your calendar, send messages, create issues, and interact with your tools directly. You can ask Claude what connectors are configured in your session. To manage or disconnect connectors, click **Customize** in the sidebar and open **Connectors**. For integrations not listed in Connectors, add MCP servers manually via [settings files](</docs/en/mcp#installing-mcp-servers>). You can also [create custom connectors](<https://support.claude.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp>).
+Once connected, Claude can read your calendar, send messages, create issues, and interact with your tools directly. You can ask Claude what connectors are configured in your session. To manage or disconnect connectors, click **Customize** in the sidebar and open **Connectors**. If the sidebar shows **Plugins** instead, click it and look under **Your plugins**. For integrations not in the connector directory, add MCP servers manually via [settings files](</docs/en/mcp#installing-mcp-servers>). You can also [create custom connectors](<https://support.claude.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp>).
### Use skills
@@ -533,7 +537,12 @@
### Install plugins
-[Plugins](</docs/en/plugins/overview>) are reusable packages that add skills, agents, hooks, MCP servers, and LSP configurations to Claude Code. You can install plugins from the desktop app without using the terminal. In a local session or an SSH session, click **+** next to the prompt box and select **Add plugins** to open the plugin browser. If the menu shows **Plugins** instead, select it, then **Browse plugins** , or **Manage plugins** to enable, disable, or uninstall plugins. You can scope plugins to your user account, a specific project, or local-only. If your organization manages plugins centrally, those plugins are available in desktop sessions the same way they are in the CLI, except the ones the desktop app [withholds under `disableSideloadFlags`](</docs/en/settings-reference#disablesideloadflags>). The plugin browser is not available in cloud sessions, and plugins you install from the desktop app aren’t available for cloud sessions. A cloud session also doesn’t install plugins that the repository’s `.claude/settings.json` declares, as [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>) explains. Plugins aren’t available in WSL sessions. For the full plugin reference including creating your own plugins, see [plugins](</docs/en/plugins/overview>).
+[Plugins](</docs/en/plugins/overview>) are reusable packages that add skills, agents, hooks, MCP servers, and LSP configurations to Claude Code. You can install plugins from the desktop app without using the terminal. In a local session or an SSH session, click **+** next to the prompt box. Open the plugin browser from the entry the menu shows:
+
+ * **Add plugins** : select it
+ * **Plugins** : select it, then **Browse plugins**. If that’s missing, select **Manage plugins**.
+
+To enable, disable, or uninstall plugins when the **+** menu shows **Plugins** , select **Plugins > Manage plugins**. In a local session, you can also click **Customize** or **Plugins** in the sidebar. You can scope plugins to your user account, a specific project, or local-only. If your organization manages plugins centrally, those plugins are available in desktop sessions the same way they are in the CLI, except the ones the desktop app [withholds under `disableSideloadFlags`](</docs/en/settings-reference#disablesideloadflags>). The plugin browser is not available in cloud sessions, and plugins you install from the desktop app aren’t available for cloud sessions. A cloud session also doesn’t install plugins that the repository’s `.claude/settings.json` declares, as [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>) explains. Plugins aren’t available in WSL sessions. For the full plugin reference including creating your own plugins, see [plugins](</docs/en/plugins/overview>).
### Configure preview servers
--- a/desktop-ios-simulator.md
+++ b/desktop-ios-simulator.md
@@ -10,6 +10,7 @@
* A Mac, since Apple’s iOS Simulator runs only on macOS
* [Xcode](<https://developer.apple.com/xcode/>) with the iOS platform installed, which provides the simulator devices. If Xcode lists no simulators yet, see The simulator pane says no simulators were found
* Xcode 26.x or Xcode 27 is recommended, and the pane works with either. If you have more than one Xcode installed, see Choose which Xcode the simulator pane uses
+ * To test on an iPhone Duo, you need Xcode 27.1 or later. See Test your app on an iPhone Duo for what else you need.
On this page, “device” refers to a simulated iPhone or iPad, one of the same simulator devices you manage in Xcode under **Window → Devices and Simulators** , not physical hardware.
@@ -104,6 +105,26 @@
Claude tells you when either applies.
+## Test your app on an iPhone Duo
+
+You can test your app on an iPhone Duo simulator in the simulator pane and fold the device into each of its poses: closed, half open, and open. To test on one, you need:
+
+ * Claude Desktop v4.29.0 or later, which is newer than the v1.24012.0 that the simulator pane itself requires. To update, open **Claude > Check for Updates…**, then restart the app.
+ * Xcode 27.1 or later with its iOS simulator runtime, which includes the iPhone Duo simulator. For Xcode 27.1, that runtime is iOS 27.1. If it’s missing, [download it from Xcode’s Components settings](<https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components>). If you have more than one Xcode installed, select Xcode 27.1 or later.
+
+To open an iPhone Duo in the pane, name it in your request or switch the pane to it yourself. If the device menu doesn’t list an iPhone Duo yet, select **Add simulator…** at the end of the list of devices and choose an iPhone Duo device type. For example, to have Claude check one screen of your app in each pose:
+
+ Run the app on the iPhone Duo simulator and check the settings screen closed, half open, and open.
+
+### Fold an iPhone Duo
+
+ * **Fold it yourself** : click one of the three pose buttons next to the rotate button. Hold the pointer over one to see its name: **Closed** , **Half open** , or **Open**. For an angle between those poses, move the pointer over the pose buttons, then drag the slider that appears above them.
+ * **Ask Claude to fold it** : ask for one of the three poses, or for a half-open hinge angle from 1 to 179 degrees.
+
+### Expect a prompt to export Xcode agent skills
+
+Before a layout check on an iPhone Duo, Claude may ask whether to export Xcode’s agent skills to your [personal skills folder](</docs/en/skills#where-skills-live>). These skills come with Xcode to guide coding agents, and once they’re in that folder, Claude Code loads them in your other projects too. They include a skill for getting your app’s layout ready for the iPhone Duo.
+
## Limitations
Claude drives simulated devices only and can’t control a physical iPhone or iPad. To test on one, run the app on it from Xcode yourself, then describe what you see or attach a screenshot to the conversation for Claude to work from.
--- a/desktop-scheduled-tasks.md
+++ b/desktop-scheduled-tasks.md
@@ -140,7 +140,7 @@
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>):
- * **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. **Show** lists **Scheduled** when at least one of your tasks is **Active** , the **Status** a task’s detail page shows. If it isn’t listed, use the **History** list, which works whether or not the group shows.
+ * **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.
--- a/env-vars.md
+++ b/env-vars.md
@@ -291,7 +291,7 @@
`CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS`| How many [subagents](</docs/en/sub-agents#concurrent-subagent-limit>) can be running in one session before the Agent tool refuses to spawn another (default: 20). Accepts a positive whole number in plain digits; anything else is ignored, so the variable can adjust the cap but can’t disable it. Requires Claude Code v2.1.217 or later
`CLAUDE_CODE_MAX_CONTEXT_TOKENS`| Override the context window size Claude Code assumes for the active model. As of v2.1.193, how it applies depends on how Claude Code resolves the model ID; see [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>). Use this when routing to a model through `ANTHROPIC_BASE_URL` whose context window does not match the built-in size for its name
`CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH`| Maximum length in characters of MCP tool descriptions and MCP server instructions that Claude Code sends to the model. The value you set replaces both [default limits](</docs/en/mcp#for-mcp-server-authors>): 4096, and 16384 for the description of a tool that Claude loads through tool search. Accepts a positive whole number in plain digits. Anything else is ignored and the defaults apply. Requires Claude Code v2.1.280 or later
-`CLAUDE_CODE_MAX_OUTPUT_TOKENS`| Set the maximum number of output tokens for most requests. Defaults and caps vary by model; see [max output tokens](<https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison>). Claude Code lowers a value above a model’s cap to the cap. For a model ID Claude Code can’t resolve to a model it knows, the default is 32000 and the cap is 128000. Increasing this value reduces the effective context window available before [auto-compaction](</docs/en/costs#reduce-token-usage>) triggers
+`CLAUDE_CODE_MAX_OUTPUT_TOKENS`| Set the maximum number of output tokens for most requests. Defaults and caps vary by model; see [max output tokens](<https://platform.claude.com/docs/en/about-claude/models/overview#latest-models-comparison>). Claude Code lowers a value above a model’s cap to the cap. For a model ID Claude Code [can’t resolve to a model it knows](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>), the default is 32000 and the cap is 128000
`CLAUDE_CODE_MAX_RETRIES`| Override the number of times to retry failed API requests (default: 10). Retrying can stop earlier on `529` overloaded errors. For example, with an API key on an Opus model, it stops at the third `529` and shows [Repeated 529 Overloaded errors](</docs/en/errors#api-error-repeated-529-overloaded-errors>). If you set a [fallback model](</docs/en/settings-reference#fallbackmodel>), Claude Code switches to that model rather than showing the error. Capped at 15 as of v2.1.186; as of v2.1.199, `CLAUDE_CODE_RETRY_WATCHDOG` raises the default and removes the cap. For unattended sessions that need to wait through longer outages, set `CLAUDE_CODE_RETRY_WATCHDOG` instead
`CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION`| Removed in v2.1.224 and now a no-op. Previously capped the total number of [subagents](</docs/en/sub-agents>) Claude could spawn with the Agent tool in one session (default: 200); spawning past the cap failed with `Subagent spawn limit reached`. The [concurrent subagent limit](</docs/en/sub-agents#concurrent-subagent-limit>) and the [depth limit](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>) still apply
`CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`| Number of [subagent layers](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>) allowed below the main conversation (default: 3). At the default, subagents can spawn their own subagents, and a subagent at the third layer can’t spawn further; set `1` to turn nesting off. In v2.1.217 through v2.1.218, the default was 1, so a subagent couldn’t spawn its own unless you raised the limit; v2.1.219 raised the default to 3. Accepts a positive whole number in plain digits; anything else is ignored, so the limit can be adjusted but not removed. Requires Claude Code v2.1.217 or later
@@ -308,7 +308,7 @@
`CLAUDE_CODE_NONBLOCKING_STDOUT`| Set to `1` to write terminal output through a second non-blocking file descriptor, so a terminal that stops reading, such as a paused tmux control-mode pane or a stalled SSH connection, can’t freeze Claude Code mid-session. Applies on macOS, Linux, and WSL when stdout is a terminal. Requires Claude Code v2.1.261 or later
`CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`| Limit how many times Claude Code re-sends a [non-streaming request](</docs/en/errors#streaming-response-ended-before-any-complete-data-was-received>) that times out. With `0`, the request fails on the first timeout. See [Tune retry behavior](</docs/en/errors#tune-retry-behavior>) for the timeout. Requires Claude Code v2.1.285 or later
`CLAUDE_CODE_NO_FLICKER`| Set to `1` to enable [fullscreen rendering](</docs/en/fullscreen>), a research preview that reduces flicker and keeps memory flat in long conversations. Overrides the [`tui`](</docs/en/settings-reference#tui>) setting; you can also switch with `/tui fullscreen`
-`CLAUDE_CODE_OAUTH_REFRESH_TOKEN`| OAuth refresh token for claude.ai authentication. When set, `claude auth login` exchanges this token directly instead of opening a browser. Requires `CLAUDE_CODE_OAUTH_SCOPES`. Useful for provisioning authentication in automated environments. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>)
+`CLAUDE_CODE_OAUTH_REFRESH_TOKEN`| OAuth refresh token for claude.ai authentication. When set, `claude auth login` exchanges this token directly instead of opening a browser. Requires `CLAUDE_CODE_OAUTH_SCOPES`. A refresh token works once, because the exchange replaces it. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>)
`CLAUDE_CODE_OAUTH_SCOPES`| Space-separated OAuth scopes the refresh token was issued with, such as `"user:profile user:inference user:sessions:claude_code"`. Required when `CLAUDE_CODE_OAUTH_REFRESH_TOKEN` is set. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>)
`CLAUDE_CODE_OAUTH_TOKEN`| OAuth access token for claude.ai authentication. Alternative to `/login` for SDK and automated environments. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>). Takes precedence over keychain-stored credentials. Generate one with [`claude setup-token`](</docs/en/authentication#generate-a-long-lived-token>). Unless you run [`/login`](</docs/en/authentication#authentication-precedence>), Claude Code uses the token you set for the whole session. To replace an expired token, generate a new one and restart
`CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE`| Removed in v2.1.160 and now a no-op. Previously pinned [fast mode](</docs/en/fast-mode>) to Claude Opus 4.6 instead of the current default. Opus 4.6 no longer supports fast mode
--- a/errors.md
+++ b/errors.md
@@ -395,6 +395,7 @@
`Reading a local file from outside this session's connected folders, or through a link, needs the approval card`| Tool errors
`cannot read file_path (...) — the file could not be examined, and no one can answer the approval card`| Tool errors
`WebFetch cannot fetch localhost or other hostnames without a dot`| Tool errors
+`Claude Code is unable to fetch from ...`| Tool errors
`The safety check for domain ... is rate-limited`| Tool errors
`The safety check for domain ... is temporarily rate-limited`| Tool errors
`Unable to verify if domain ... is safe to fetch`| Tool errors
@@ -471,6 +472,7 @@
`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
`otelHeadersHelper failed; telemetry is not being exported. See /status: ...`| Configuration warnings
+`apply_flag_settings: nothing in this request was applied and earlier settings stay in force. Fix or remove these invalid settings and send it again`| [`applyFlagSettings()`](</docs/en/agent-sdk/typescript#applyflagsettings>)
`"crossSessionInbound" must be one of "accept", "hold", "refuse"`| Configuration warnings
`API Error: ANTHROPIC_FOUNDRY_RESOURCE must be a Foundry resource name`| Configuration warnings
`headersHelper not run — this workspace has no persisted trust`| Configuration warnings
@@ -4253,6 +4255,14 @@
Before v2.1.268, WebFetch reported these URLs with a generic `Invalid URL` error.
+### Claude Code is unable to fetch from a host
+
+WebFetch sends a URL’s hostname to `api.anthropic.com` before requesting the page, to check it against Anthropic’s domain safety blocklist. This message means the check answered that the hostname can’t be fetched:
+
+ Claude Code is unable to fetch from example.com
+
+Claude Code didn’t contact the host, because the check runs before the request. For what the check sends, see [WebFetch domain safety check](</docs/en/data-usage#webfetch-domain-safety-check>).
+
### WebFetch domain safety check failed
Before fetching a URL, WebFetch sends the URL’s hostname to `api.anthropic.com` to check it against Anthropic’s [domain safety blocklist](</docs/en/data-usage#webfetch-domain-safety-check>). If the check can’t complete, WebFetch can’t confirm that the domain is safe, so it doesn’t fetch the page and the tool result carries one of these messages instead:
--- a/events.md
+++ b/events.md
@@ -378,7 +378,7 @@
The handler has a shorter [time limit](</docs/en/plugins/mods/reference#limits>) of its own. If the handler itself throws or times out, Claude Code skips the hook as if it had no handler. When `guard` hadn’t called `next`, the command then goes on as it would without the mod. The same handler shape fits a guard on `prompt.submit` or `config.set`. When `next.called` is false, return the refusal that the [events reference](</docs/en/plugins/mods/reference#events>) lists for that event: `{ drop: 'the reason' }` for `prompt.submit`, `{ deny: 'the reason' }` for `config.set`. At `tool.check` and `plugin.register`, a refusal returned after `next` resolved still holds, so return it without testing `next.called`:
* **`tool.check`** : return `{ decision: 'deny', reason: 'the reason' }`
- * **`plugin.register`** : return `{ refuse: 'the reason' }`, as [Refuse mods when your check fails](</docs/en/plugins/mods/admin#refuse-mods-when-your-check-fails>) shows
+ * **`plugin.register`** : return `{ refuse: 'the reason' }`. On v2.1.326 or later, the other mod’s whole plugin then stays out. To stop only the mod, see [Refuse mods when your check fails](</docs/en/plugins/mods/admin#refuse-mods-when-your-check-fails>).
At `tool.call`, a `deny` returned after `next` resolved withholds the result from Claude.
--- a/fullscreen.md
+++ b/fullscreen.md
@@ -115,7 +115,11 @@
### Auto-follow
-Scrolling up pauses auto-follow so new output doesn’t pull you back to the bottom. A `Jump to bottom` button floats over the bottom edge of the transcript while you’re scrolled up, and shows a count such as `3 new messages` when new output arrives. Click it, press `Ctrl+End`, or scroll to the bottom to resume following. While auto-follow is paused, the view also stays where you scrolled it when a response finishes streaming. The button’s keyboard hint reflects what your keyboard can send. On macOS it suggests clicking, or `Fn+↓` to scroll, because `Ctrl+End` doesn’t reach Claude Code from a Mac keyboard. Rebind [`scroll:bottom`](</docs/en/keybindings#scroll-actions>) and the button shows your chord on every platform. On a terminal too narrow for the full label, the button shortens the hint instead of wrapping onto the transcript row underneath. To turn auto-follow off entirely so the view stays where you leave it, open `/config` and set Auto-scroll to off. With auto-scroll disabled, the view never jumps to the bottom on its own. Permission prompts and other dialogs that need a response still scroll into view regardless of this setting.
+Scrolling up pauses auto-follow so new output doesn’t pull you back to the bottom. A `Jump to bottom` button floats over the bottom edge of the transcript while you’re scrolled up, and shows a count such as `3 new messages` when new output arrives. Click it, press `Ctrl+End`, or scroll to the bottom to resume following. While auto-follow is paused, the view also stays where you scrolled it when a response finishes streaming. The button’s keyboard hint reflects what your keyboard can send. On macOS it suggests clicking, or `Fn+↓` to scroll, because `Ctrl+End` doesn’t reach Claude Code from a Mac keyboard. Rebind [`scroll:bottom`](</docs/en/keybindings#scroll-actions>) and the button shows your chord on every platform. On a terminal too narrow for the full label, the button shortens the hint instead of wrapping onto the transcript row underneath.
+
+#### Turn off Auto-scroll
+
+To keep auto-follow paused after you send a message or scroll to the bottom, open `/config` and set [Auto-scroll](</docs/en/settings-reference#autoscrollenabled>) to off.
### Mouse wheel scrolling
@@ -155,15 +159,15 @@
## Clear the conversation
-Run `/clear` to start a new conversation. If the display looks garbled or partially blank, press `Ctrl+L` to redraw the screen. The redraw keeps the conversation and your input in place. `Cmd+K` does the same as `Ctrl+L` when your terminal passes it through to Claude Code. iTerm2 and Terminal.app handle `Cmd+K` themselves and clear their own screen, and Claude Code detects the cleared screen and repaints the conversation. Before v2.1.280, starting with v2.1.260, pressing `Ctrl+L`, or `Cmd+K` where it reaches Claude Code, cleared the screen in fullscreen rendering. Before v2.1.238, pressing `Ctrl+L` twice within two seconds ran `/clear`.
+Run `/clear` to start a new conversation. If the display looks garbled or partially blank, press `Ctrl+L` to redraw the screen. The redraw keeps the conversation and your input in place. `Cmd+K` does the same as `Ctrl+L` when your terminal passes it through to Claude Code. iTerm2 handles `Cmd+K` itself and clears its own screen, and Claude Code detects the cleared screen and repaints the conversation. Before v2.1.280, starting with v2.1.260, pressing `Ctrl+L`, or `Cmd+K` where it reaches Claude Code, cleared the screen in fullscreen rendering. Before v2.1.238, pressing `Ctrl+L` twice within two seconds ran `/clear`.
## Use with tmux
-Fullscreen rendering works inside tmux, with three caveats. Mouse wheel scrolling requires tmux’s mouse mode. If your `~/.tmux.conf` doesn’t already enable it, add this line and reload your config:
+Fullscreen rendering works inside tmux, with three caveats. To scroll Claude Code with the mouse wheel while another tmux pane is active, turn on tmux’s mouse mode in `~/.tmux.conf` and reload your config:
set -g mouse on
-Without mouse mode, wheel events go to tmux instead of Claude Code. Keyboard scrolling with `PgUp` and `PgDn` works either way. Claude Code prints a one-time hint at startup if it detects tmux with mouse mode off. Fullscreen rendering is incompatible with iTerm2’s tmux integration mode, which is the mode you enter with `tmux -CC`. In integration mode, iTerm2 renders each tmux pane as a native split rather than letting tmux draw to the terminal. The alternate screen buffer and mouse tracking don’t work correctly there: the mouse wheel does nothing, and double-click can corrupt the terminal state. Don’t enable fullscreen rendering in `tmux -CC` sessions. Regular tmux inside iTerm2, without `-CC`, works fine. tmux releases through the 3.6 series don’t implement synchronized output, so under those versions you may see more flicker during redraws than when running Claude Code directly in your terminal. Claude Code probes the terminal for synchronized-output support at startup and uses it when the terminal reports it. If you see flicker under tmux, upgrade to the newest tmux or run Claude Code in its own terminal tab outside tmux.
+Fullscreen rendering is incompatible with iTerm2’s tmux integration mode, which is the mode you enter with `tmux -CC`. In integration mode, iTerm2 renders each tmux pane as a native split rather than letting tmux draw to the terminal. The alternate screen buffer and mouse tracking don’t work correctly there: the mouse wheel does nothing, and double-click can corrupt the terminal state. Don’t enable fullscreen rendering in `tmux -CC` sessions. Regular tmux inside iTerm2, without `-CC`, works fine. tmux releases through the 3.6 series don’t implement synchronized output, so under those versions you may see more flicker during redraws than when running Claude Code directly in your terminal. Claude Code probes the terminal for synchronized-output support at startup and uses it when the terminal reports it. If you see flicker under tmux, upgrade to the newest tmux or run Claude Code in its own terminal tab outside tmux.
## Keep native text selection
--- a/github-enterprise-server.md
+++ b/github-enterprise-server.md
@@ -139,7 +139,7 @@
* **Use a full git URL.** The `owner/repo` shorthand always resolves to github.com and cannot reference a GHES host.
* **Prefer HTTPS URLs.** SSH clones fail on machines that do not already trust your GHES host key. An HTTPS URL with your organization’s standard git credential helper works on any machine with credentials configured.
- * **Confirm each machine can clone from your GHES host.** If a machine lacks credentials, the marketplace is registered but never installed, and its plugins report as not found instead of prompting for credentials.
+ * **Confirm each machine can clone from your GHES host.** If a machine lacks credentials, the clone fails without prompting for them, and the `/plugin` **Errors** tab shows why.
* **Confirm the setting reaches each machine.** A managed settings file only takes effect on machines it’s deployed to, for example through your device management system. See [Deploy managed settings](</docs/en/managed-settings#delivery-mechanisms>) for file locations.
### Allowlist GHES marketplaces in managed settings
--- a/glossary.md
+++ b/glossary.md
@@ -219,13 +219,13 @@
### System reminder
-A message that Claude Code, as the harness, adds to the conversation to give Claude context. You don’t send system reminders yourself. Claude Code inserts them as a session runs, for example when the session starts, when a hook returns text, or when a file changes on disk. Claude reads them alongside your messages. The following all reach Claude as system reminders:
+A message that Claude Code, as the harness, adds to the conversation to give Claude context. You don’t send system reminders yourself. Claude Code inserts them as a session runs, for example when the session starts or when a hook returns text. Claude reads them alongside your messages. The following all reach Claude as system reminders:
* Your CLAUDE.md files
* The instructions of your output style
* Text a hook returns as `additionalContext`
* The list of available skills
- * A note that a file Claude read earlier has changed on disk
+ * A note that a file Claude edited earlier has since changed on disk
* The commit and pull request attribution lines
In a logged API request, a system reminder appears wrapped in `<system-reminder>` tags inside a user message, or on some models as a separate message with the `system` role. Learn more: [Context Claude Code adds outside the system prompt](</docs/en/agent-sdk/modifying-system-prompts#context-claude-code-adds-outside-the-system-prompt>)
--- a/headless.md
+++ b/headless.md
@@ -37,7 +37,7 @@
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:
* **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 gets 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 read earlier changes on disk, and it doesn’t get the list of available skills, including skills from an `--add-dir` folder.
+ * **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.
* **Background tasks** : Claude can’t run background commands or background subagents, and the other features that [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](</docs/en/env-vars>) turns off are off too. A command that reaches its [timeout](</docs/en/tools-reference#timeout-and-output-limits>) stops instead of [moving to the background](</docs/en/tools-reference#background-commands>).
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.
--- a/hooks-guide.md
+++ b/hooks-guide.md
@@ -570,7 +570,7 @@
`SubagentStop`| agent type| same values as `SubagentStart`
`ConfigChange`| configuration source| `user_settings`, `project_settings`, `local_settings`, `policy_settings`, `skills`
`DirectoryAdded`| how the directory was added| `slash_command`, `register_repo_root`
-`StopFailure`| error type| `rate_limit`, `overloaded`, `authentication_failed`, `oauth_org_not_allowed`, `account_on_hold`, `billing_error`, `invalid_request`, `model_not_found`, `server_error`, `max_output_tokens`, `cloud_credential_error`, `unknown`
+`StopFailure`| error type| `rate_limit`, `authentication_failed`, `oauth_org_not_allowed`, `account_on_hold`, `billing_error`, `invalid_request`, `model_not_found`, `server_error`, `max_output_tokens`, `cloud_credential_error`, `unknown`
`InstructionsLoaded`| load reason| `session_start`, `nested_traversal`, `path_glob_match`, `include`, `compact`
`Elicitation`| MCP server name| your configured MCP server names
`ElicitationResult`| MCP server name| same values as `Elicitation`
--- a/host-marketplace.md
+++ b/host-marketplace.md
@@ -158,7 +158,7 @@
### Hold users on one version
-One marketplace serves one version of each plugin at a time, so you hold users on a version by choosing what each entry points at:
+To hold users on a version, choose which ref, commit, or tag they get:
* **`ref` and `sha` on the plugin entry**: `ref` names a branch or tag and `sha` names a commit for a `github`, `url`, or `git-subdir` source. See [Plugin sources](</docs/en/plugins/marketplace-reference#plugin-sources>).
* **`#<ref>` on the add command**: users who add `your-org/your-marketplace#stable` get that branch or tag of the catalog. For two release lines at once, see Run release channels.
@@ -177,7 +177,7 @@
## Run release channels
-To offer stable and early-access tracks, host two marketplaces whose entries point at different refs of the same plugin, and let each user add the one they want. Claude Code has no release-channel concept, and one marketplace serves one version of each plugin at a time. Give the two `marketplace.json` files different `name` values. Claude Code identifies a marketplace by its `name`, so a user can’t have two marketplaces with the same name registered at once. With these two catalogs, users who add `stable-tools` install `code-formatter` from the `stable` branch, and users who add `latest-tools` install it from `latest`:
+To offer stable and early-access tracks, host two marketplaces whose entries point at different refs of the same plugin, and let each user add the one they want. Give the two `marketplace.json` files different `name` values. Claude Code identifies a marketplace by its `name`, so a user can’t have two marketplaces with the same name registered at once. With these two catalogs, users who add `stable-tools` install `code-formatter` from the `stable` branch, and users who add `latest-tools` install it from `latest`:
{
"name": "stable-tools",
--- a/how-claude-code-works.md
+++ b/how-claude-code-works.md
@@ -84,7 +84,7 @@
* Your CLAUDE.md files
* The instructions of your [output style](</docs/en/output-styles>)
- * A note when a file Claude read earlier changes on disk
+ * A note that a file Claude edited earlier has since changed on disk
* The commit and pull request attribution lines
To change or remove the attribution lines, set [`attribution`](</docs/en/settings-reference#attribution>). To remove Claude Code’s built-in commit and pull request instructions, set [`includeGitInstructions`](</docs/en/settings-reference#includegitinstructions>) to `false`. For the other switches, see [Turn off the context your agent replaces](</docs/en/agent-sdk/modifying-system-prompts#turn-off-the-context-your-agent-replaces>).
--- a/install.md
+++ b/install.md
@@ -85,7 +85,7 @@
Open the plugin browser
-Click the **+** button next to the prompt box and select **Add plugins**. If the **+** menu shows **Plugins** instead of **Add plugins** , select **Plugins** , then **Browse plugins**. The plugin browser opens with the plugins from your marketplaces.
+Click the **+** button next to the prompt box and select **Add plugins**. If the **+** menu shows **Plugins** instead of **Add plugins** , select **Plugins** , then **Browse plugins**. If **Browse plugins** is missing, select **Manage plugins**. The plugin browser opens with the plugins from your marketplaces.
2
--- a/interactive-mode.md
+++ b/interactive-mode.md
@@ -61,7 +61,7 @@
---|---|---
Quick escape| `\` \+ `Enter`| Works in all terminals
Option key| `Option+Enter`| After enabling [Option as Meta](</docs/en/terminal-config#enable-option-key-shortcuts-on-macos>) on macOS
-Shift+Enter| `Shift+Enter`| Native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Windows Terminal. For other terminals, see [Enter multiline prompts](</docs/en/terminal-config#enter-multiline-prompts>)
+Shift+Enter| `Shift+Enter`| Native in iTerm2, WezTerm, Ghostty, Kitty, Warp, Windows Terminal 1.25 or later. For other terminals, see [Enter multiline prompts](</docs/en/terminal-config#enter-multiline-prompts>)
Control sequence| `Ctrl+J`| Works in any terminal without configuration
Paste mode| Paste directly| For code blocks, logs
--- a/keybindings.md
+++ b/keybindings.md
@@ -98,7 +98,7 @@
---|---|---
`chat:cancel`| Escape| Cancel current input
`chat:clearInput`| Ctrl+L| Force a full screen redraw, preserving input and conversation
-`chat:clearScreen`| Cmd+K| Same as `chat:clearInput`. See [Clear the conversation](</docs/en/fullscreen#clear-the-conversation>) for how Cmd+K behaves on iTerm2 and Terminal.app
+`chat:clearScreen`| Cmd+K| Same as `chat:clearInput`. See [Clear the conversation](</docs/en/fullscreen#clear-the-conversation>) for how Cmd+K behaves on iTerm2
`chat:killAgents`| Ctrl+X Ctrl+K| Stop all running [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) in this session and turn off [artifact auto-replies](</docs/en/artifacts#let-claude-reply-to-comments-on-its-own>) for the rest of it. Press the shortcut twice within 3 seconds to confirm. You can press it while a background subagent’s permission prompt is open
`chat:cycleMode`| Shift+Tab*| Cycle permission modes
`chat:modelPicker`| Meta+P| Open model picker
--- a/llm-gateway-protocol.md
+++ b/llm-gateway-protocol.md
@@ -88,7 +88,7 @@
Two client-side settings change what Claude Code assumes for a model ID it doesn’t recognize, whichever connection method the developer uses:
- * **Context window** : Claude Code assumes a 1M token context window by default. To declare the real window, see [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>)
+ * **Context window** : Claude Code assumes a 1M token context window by default since v2.1.323. To declare the real window, see [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>)
* **Capabilities** : to give a gateway alias the capabilities of the model behind it, map that model’s Anthropic ID to your alias with a [`modelOverrides`](</docs/en/errors#unrecognized-model-id-on-a-request>) entry in the settings you distribute. For where the `ANTHROPIC_DEFAULT_*_MODEL_SUPPORTED_CAPABILITIES` variables apply, see feature pass-through
## Request headers
@@ -173,7 +173,7 @@
### Beta header and body field pairs
-Capabilities that add body fields pair them with a beta header, and the pair travels together. A gateway that strips the header while passing the body, or forwards an Anthropic-format body to an upstream with a different schema, produces `400` errors. When both halves are absent together, the feature turns off quietly. A gateway that rewrites or redacts request bodies for content inspection breaks the pairing the same way stripping does, so inspect without modifying. The table notes where a feature deviates from the pairing.
+Capabilities that add body fields pair them with a beta header, and the pair travels together. A gateway that strips the header while passing the body, or forwards an Anthropic-format body to an upstream with a different schema, produces `400` errors. A gateway that rewrites or redacts request bodies for content inspection breaks the pairing the same way stripping does, so inspect without modifying. The table notes where a feature deviates from the pairing.
Feature| Header and body pair| Symptom when broken| Remediation
---|---|---|---
--- a/manifest-reference.md
+++ b/manifest-reference.md
@@ -116,6 +116,7 @@
`privacyPolicyUrl`| String| Privacy policy link for the plugin’s listing in Anthropic’s directory. Claude Code doesn’t read it
`termsOfServiceUrl`| String| Terms of service link for the plugin’s listing in Anthropic’s directory. Claude Code doesn’t read it
`defaultEnabled`| Boolean| Whether the plugin starts enabled when the user hasn’t set it. Defaults to `true`
+`engines`| Object| The Claude Code versions that the plugin works on, as a [semver range](<https://github.com/npm/node-semver#ranges>) under the `claude-code` key, such as `"engines": { "claude-code": ">=2.1.400" }`. Requires Claude Code v2.1.323 or later. To keep the plugin working on v2.0.15 through v2.1.75, omit `engines`. Those versions reject the manifest with an `Unrecognized key` error when it has the field
`dependencies`| Array of strings or objects| Plugins that must be enabled for this one to work
`userConfig`| Object| Values Claude Code prompts the user for when the plugin is enabled
`types`| Path| A `.d.ts` file that declares the `$.state` values and `$` nouns of a [mod](</docs/en/plugins/mods/reference#files>)
--- a/marketplace-reference.md
+++ b/marketplace-reference.md
@@ -65,6 +65,7 @@
`strict`| boolean| Default `true`. Whether `plugin.json` is the definitive source for the plugin’s components. See Strict mode
`relevance`| object| Signals that tell Claude Code when to suggest the plugin. See [Recommend plugins for your org](</docs/en/plugins/relevance>)
`dependencies`| array| Plugins that must be enabled for this one to work. Each item is `"name"`, `"name@marketplace"`, or an object. See [Plugin dependencies](</docs/en/plugins/dependencies>)
+`engines`| object| The Claude Code versions that the plugin works on, as a [semver range](<https://github.com/npm/node-semver#ranges>) under the `claude-code` key, such as `"engines": { "claude-code": ">=2.1.400" }`. Requires Claude Code v2.1.323 or later. To keep the marketplace working on v2.0.15 through v2.1.75, omit `engines` from every entry. Those versions reject the whole `marketplace.json` when any entry has the field
`defaultEnabled`| boolean| Default `true`. Whether the plugin starts enabled when the user hasn’t set it in [`enabledPlugins`](</docs/en/settings-reference#enabledplugins>). The entry value takes precedence over `plugin.json`
`displayName`| string| Human-readable name shown in the UI. When neither the entry nor the plugin’s `plugin.json` sets one, users see the plugin’s `name`
`metadata`| object| Free-form object for your own fields. Claude Code doesn’t read it
@@ -114,7 +115,7 @@
`git-subdir`| `url`, `path`, `ref`, `sha`| One subdirectory of a git repository, fetched with a sparse checkout
`npm`| `package`, `version`, `registry`| npm registry package or tarball link, fetched with your npm client and unpacked without running install scripts
`archive`| `url`, `sha256`| Zip archive over HTTPS
-`command`| `command`, `timeout`, `mode`| Directory printed by a command Claude Code runs on the user’s machine. Requires Claude Code v2.1.229 or later
+`command`| `command`, `timeout`, `mode`| Directory printed by a command Claude Code runs on the user’s machine
The names `url` and `github` are also marketplace source types, where `url` means a direct link to a `marketplace.json` file rather than a git repository. `git` exists only as a marketplace source, and `npm` exists as both. `git-subdir`, `archive`, and `command` exist only as plugin sources. Use a relative path for a plugin in a subdirectory of the marketplace repository itself. Use `git-subdir` for a subdirectory of some other repository. `github`, `url`, and `git-subdir` sources share the `ref` and `sha` fields:
@@ -408,6 +409,7 @@
`Claude Code cannot install plugins from marketplace "x". Each part of a plugin id (plugin@marketplace) may use only the letters a-z and A-Z, digits, ".", "_" and "-", and must start with a letter or digit. Change the marketplace's "name".`| Error| `name`
`Claude Code cannot install plugin "x". Each part of a plugin id (plugin@marketplace) may use only the letters a-z and A-Z, digits, ".", "_" and "-", and must start with a letter or digit. Change this entry's "name".`| Error| `plugins[i].name`
`Duplicate plugin name "x" found in marketplace`| Error| Two entries share a `name`
+`Must be a version range such as ">=2.1.0"; got "<value>". It will be ignored at load time.`| Error| `plugins[i].engines.claude-code`
`plugins.i.source: Invalid input`| Error| The entry’s `source` matches no type. See Invalid input on a source
`plugins.i.source: Invalid string: must start with "./"`| Error| A relative-path `source` without the leading `./`. Before v2.1.285, this mistake printed `Invalid input` instead
`plugins[i].source: Path contains "..": <path>`| Error| A relative `source` that escapes the marketplace root
@@ -416,6 +418,7 @@
`chain does not resolve (<reason>) — target must be a name in plugins[], a key in renames, or null`| Error| `renames.<old>`
`target "x" is not a valid plugin name (PluginIdSchema)`| Error| `renames.<old>`
`Unknown field 'x'. Claude Code ignores it at load time.`| Warning| The named key at the top level, under `metadata`, in an entry, or under an entry’s `relevance`
+`'engines' must be an object such as { "claude-code": ">=2.1.0" }; got <type>. It will be ignored at load time.`| Warning| `plugins[i].engines`
`Marketplace has no plugins defined`| Warning| `plugins` is empty
`Plugin "x" sets headers/headersHelper, which only apply to "archive" sources; they have no effect on this entry.`| Warning| `plugins[i].headers` or `plugins[i].headersHelper`, on an entry whose `source` isn’t `archive`
`Plugin "x" fetches its archive with a headersHelper but sets no sha256 pin`| Warning| `plugins[i].source.sha256`
--- a/microsoft-foundry.md
+++ b/microsoft-foundry.md
@@ -115,7 +115,7 @@
}
}
-To keep a 200K window instead, set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/model-config#turn-off-1m-context>). If Claude Code can’t match a deployment name to a model, it assumes a 1M window by default, so [set the real window](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>) if your deployed model accepts less. Opus 4.6 and Sonnet 4.6 reach the 1M window when you append `[1m]` to the deployment name in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`, as [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) describes. Before v2.1.287, the Fable models and Opus 4.7 and later also needed that suffix on Microsoft Foundry and ran with a 200K window by default without it.
+To keep a 200K window instead, set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](</docs/en/model-config#turn-off-1m-context>). If Claude Code can’t match a deployment name to a model, it assumes a 1M window by default, so [set the real window](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>) if your deployed model accepts less. Before v2.1.323, Claude Code assumed 200K by default, so on those versions append `[1m]` to the name in your model variables if the model accepts 1M. Opus 4.6 and Sonnet 4.6 reach the 1M window when you append `[1m]` to the deployment name in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`, as [Pin models for third-party deployments](</docs/en/model-config#pin-models-for-third-party-deployments>) describes. Before v2.1.287, the Fable models and Opus 4.7 and later also needed that suffix on Microsoft Foundry and ran with a 200K window by default without it.
## Troubleshooting
--- a/model-config.md
+++ b/model-config.md
@@ -103,7 +103,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. Project and managed settings still take precedence and reapply on the next launch. An organization default model that your admin has configured to override user selection also reapplies on the next launch. In v2.1.144 through v2.1.152, `/model` applied to the current session only and `d` in the picker saved a default. The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`. 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. Resumed sessions started with `claude --resume`, `--continue`, or the `/resume` picker keep the model they were using when the transcript was saved. If the restored model has been retired or is excluded by `availableModels`, the session falls through to the normal precedence order. On providers that use provider-specific deployment IDs rather than Anthropic model IDs, such as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, the transcript model isn’t restored at all and the session resolves its model through the normal precedence order. If your `model` setting is `haiku`, a session saved on a Haiku model resumes on the model that `haiku` resolves to now. For example, once `haiku` resolves to Haiku 5.5, a session saved on Haiku 4.5 resumes on Haiku 5.5. A model you pick for the new launch with `--model` or `ANTHROPIC_MODEL` still takes precedence over the restored model. As of v2.1.195, so does an `ANTHROPIC_DEFAULT_OPUS_MODEL` family variable. `ANTHROPIC_DEFAULT_MODEL` can too, under the conditions listed in its section. When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies on the next launch. 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. 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 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:
* **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.
@@ -127,6 +127,20 @@
"model": "opus"
}
+When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override; the project or managed setting reapplies in new sessions. 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. 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.
+
+#### Which model a resumed session uses
+
+A session you resume with `claude --resume` or `--continue` keeps the model it was saved on, except in cases such as these, where it follows the priority order instead:
+
+ * You set an alias variable such as `ANTHROPIC_DEFAULT_OPUS_MODEL`, or `ANTHROPIC_DEFAULT_MODEL` under the conditions listed in its section
+ * The saved model has been retired or is excluded by `availableModels`
+ * Your provider uses provider-specific deployment IDs rather than Anthropic model IDs, as Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry do
+ * Your `model` setting is `haiku` and the session was saved on a Haiku or Sonnet model. For example, once `haiku` resolves to Haiku 5.5, a session saved on Haiku 4.5 resumes on Haiku 5.5.
+ * Your `model` setting is `opusplan` and the session was saved on an Opus or Sonnet model
+
+To resume on a model you choose, pass `--model` or set `ANTHROPIC_MODEL`.
+
#### Fix a mistyped model name
Either of these warnings means Claude Code doesn’t recognize the model ID you set, and the ID nearly spells a model name or alias it does recognize:
@@ -160,7 +174,7 @@
When you pick a model with `/model` and your next session starts on something else, these are the usual causes:
* **You chose it for one session.** Pressing `s` in the picker, launching with `--model`, and running `/model` in non-interactive mode all apply to the current session and leave your saved default alone.
- * **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an organization default your admin set to override user choices applies again at every launch. Your `/model` choice is still saved; it’s outranked. When project or managed settings set the model, the startup header names the file.
+ * **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an organization default your admin set to override user choices applies again at every new-session launch. Your `/model` choice is still saved; it’s outranked. When project or managed settings set the model, the startup header names the file.
* **Claude Code couldn’t save your choice.** `/model` writes `model` to `~/.claude/settings.json`. If you can’t write to that file, for example because another tool generates it or links it to a read-only copy, the model you chose lasts for the session and the next launch reads the old value. Set `model` in the tool that generates the file, or make the file writable. See [A change you made in Claude Code is lost in new sessions](</docs/en/settings#a-change-you-made-in-claude-code-is-lost-in-new-sessions>).
* **You resumed a session.** A session you resume with `claude --resume` or `--continue` usually keeps the model it was using rather than your current default.
@@ -315,9 +329,9 @@
* a `model` value in [managed settings](</docs/en/managed-settings>) or supplied through `--settings`
* a `model` value in your user, project, or local settings, including a model you save with `/model`
-Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings, so a model you save with `/model` applies for the current session and the organization default returns on the next launch. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted:
-
- * With the default prefix matching, `availableModels` on its own doesn’t apply to the organization default, so an organization default outside the allowlist still applies. When `enforceAvailableModels` is also set, an organization default outside the allowlist is remapped to the first allowlist entry as well
+Admins can also configure the organization default to override user selection. With override on, it takes precedence over the `model` value in user, project, and local settings. A model you save with `/model` then applies for the current session, and the organization default returns in new sessions. When your selection differs, `/model` shows `Your organization's default (<model>) applies on restart`. The `--model` flag, `ANTHROPIC_MODEL`, managed settings, and `--settings` still take precedence even with override on. To limit which models members can select, use organization model restrictions or `availableModels` instead. Claude Code reads the organization default once at startup, so a default the admin changes mid-session takes effect on the next launch. When the organization default doesn’t override user selection, the first interactive launch after the admin changes it clears the `model` key from your user settings once, so the new default applies. It changes nothing else in the file, and a model you save with `/model` after that launch is kept. The organization default passes through these restriction checks before it is adopted:
+
+ * with the default prefix matching and `enforceAvailableModels` set, an organization default outside the `availableModels` allowlist is remapped to a model on that list
* an organization default that organization model restrictions deny for your account is replaced by the newest allowed model in its family, or a lower-cost family when every version of it is restricted
* for an organization default that `deniedModels` or an `"exact"` list blocks, see Block specific models or versions
* an organization default that isn’t available to your account at all is skipped, and the Default option resolves as it would without an organization default
@@ -752,7 +766,7 @@
Apply the same pattern for `ANTHROPIC_DEFAULT_FABLE_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](<https://platform.claude.com/docs/en/about-claude/models/overview>). To upgrade users to a new model version, update these environment variables and redeploy. By default, Claude Code treats a pinned ID as having the 1M context window, with no `[1m]` suffix needed, in these cases:
* **An ID Claude Code matches to a model with a native 1M window, such as Opus 4.8 or Sonnet 5** : the ID matches when it contains the model’s Anthropic API ID, as `us.anthropic.claude-opus-4-8` contains `claude-opus-4-8`, or when a `modelOverrides` entry maps the model to it
- * **An ID Claude Code can’t match to a model** : set the real window if the model behind the ID accepts less
+ * **An ID Claude Code can’t match to a model** : set the real window if the model behind the ID accepts less. Before v2.1.323, Claude Code assumed 200K by default, so on those versions append `[1m]` to the ID if the model accepts 1M.
For a model that reaches 1M through its `[1m]` variant, such as Opus 4.6 or Sonnet 4.6, enable extended context by appending `[1m]` to the model ID in `ANTHROPIC_DEFAULT_OPUS_MODEL` or `ANTHROPIC_DEFAULT_SONNET_MODEL`:
--- a/modifying-system-prompts.md
+++ b/modifying-system-prompts.md
@@ -336,7 +336,7 @@
## Context Claude Code adds outside the system prompt
-System reminders are messages Claude Code adds to the conversation during a session to give Claude context, such as the contents of your CLAUDE.md files or a note that a file changed on disk. Claude Code sends them in the conversation, not in the system prompt, so most reach Claude whether you use the `claude_code` preset or pass your own string as `systemPrompt`. This section covers the reminders most likely to change how your agent behaves, how to turn off the ones your agent replaces, and how to see what Claude received in a specific request.
+System reminders are messages Claude Code adds to the conversation during a session to give Claude context, such as the contents of your CLAUDE.md files. Claude Code sends them in the conversation, not in the system prompt, so most reach Claude whether you use the `claude_code` preset or pass your own string as `systemPrompt`. This section covers the reminders most likely to change how your agent behaves, how to turn off the ones your agent replaces, and how to see what Claude received in a specific request.
### Reminders Claude Code adds to the conversation
@@ -349,7 +349,7 @@
* **Available skills** : the names and descriptions of the [skills](</docs/en/agent-sdk/skills>) Claude can call
* **Available subagents** : the names and descriptions of the [subagents](</docs/en/agent-sdk/subagents>) Claude can start
* **Task list nudges** : in a [session that has the task-tracking tools](</docs/en/agent-sdk/todo-tracking#model-availability>), a prompt to update the task list when Claude hasn’t touched it for several turns
- * **File-changed notes** : a note that a file Claude read earlier has changed on disk
+ * **File-changed notes** : a note that a file Claude edited earlier has since changed on disk
Claude Code introduces your CLAUDE.md files with a line telling Claude that the instructions override default behavior. If you pass your own string as `systemPrompt`, add a sentence to it that says what a system reminder is. The `claude_code` preset has one, and your string replaces the whole preset. Without it, nothing in your prompt tells Claude that reminders such as CLAUDE.md content and hook output come from the application rather than the user. For example:
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -356,7 +356,7 @@
export OTEL_RESOURCE_ATTRIBUTES="org.name=John%27s%20Organization"
-Wrapping values in quotes doesn’t escape spaces. For example, `org.name="My Company"` results in the literal value `"My Company"` with the quotes included, not `My Company`.
+Wrapping values in quotes doesn’t escape spaces.
### Attribute telemetry to Desktop SSH sessions
--- a/org.md
+++ b/org.md
@@ -131,7 +131,7 @@
Where the two lists are enforced depends on where you set them:
- * **The claude.ai admin console** : Claude Code enforces both lists in the sessions that [read server-managed settings](</docs/en/managed-settings#where-and-when-a-policy-applies>). claude.ai also checks them when anyone in your organization adds a new marketplace from a git repository on claude.ai, or from **Customize** in the Claude Desktop app outside its Code tab. That covers a marketplace a member adds for their own account and one added for the whole organization under [**Organization settings > Plugins**](<https://claude.ai/admin-settings/plugins>). claude.ai refuses a repository that the allowlist doesn’t admit or that the blocklist names. It doesn’t re-check a marketplace that was added in either place before you set the lists, and it doesn’t check uploaded plugins.
+ * **The claude.ai admin console** : Claude Code enforces both lists in the sessions that [read server-managed settings](</docs/en/managed-settings#where-and-when-a-policy-applies>). claude.ai also checks them when anyone in your organization adds a marketplace from a git repository on claude.ai, or from **Customize** in the Desktop app outside its Code tab. That covers a marketplace a member adds for their own account and one added for the whole organization under [**Organization settings > Plugins & skills**](<https://claude.ai/admin-settings/skills?tab=marketplaces>). claude.ai refuses a repository that the allowlist doesn’t admit or that the blocklist names. It doesn’t re-check a marketplace that was added in either place before you set the lists, and it doesn’t check uploaded plugins.
* **A managed settings file, OS-level policy, or other managed source** : Claude Code enforces both lists where it reads that source. claude.ai doesn’t read it.
While any allowlist is set, or a blocklist names any source other than `skills-dir`, a plugin whose marketplace Claude Code can’t find doesn’t load. `/plugin` shows the policy error for it rather than a not-found error. The common case is a stale `enabledPlugins` entry for a marketplace nobody registered.
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -453,7 +453,7 @@
* When Claude reads an [artifact someone else made](</docs/en/artifacts#read-an-artifact-shared-with-you>), the approval cases listed in that section apply
* A read from a [network path](</docs/en/permissions#network-paths>) prompts you
3. Everything else goes to the classifier, apart from critical-path removals under their default handling. The connector tools and `requiresUserInteraction` MCP tools that prompt you directly in step 1 never reach the classifier either, so neither an org-required approval nor a consent step is auto-approved
- * With [Code Mode](</docs/en/code-mode#permission-checks>) on, Claude’s code goes to the classifier once before it runs, and the tool calls inside it don’t. You can still block a call with a `deny` rule or require a prompt with an `ask` rule, but Claude can run Bash commands in [forms the rules don’t match](</docs/en/permissions#bash-rule-limits>)
+ * With [Code Mode](</docs/en/code-mode#permission-checks>) on, the code that Claude writes goes to the classifier once before it runs, and the tool calls inside it don’t. You can still block a call with a `deny` rule or require a prompt with an `ask` rule, but Claude can run Bash commands in [forms the rules don’t match](</docs/en/permissions#bash-rule-limits>)
4. If the classifier blocks, Claude receives the reason. In most sessions the reason names the rule the classifier matched, such as `[Data Exfiltration]`, rather than giving a written explanation; see [Review denials](</docs/en/auto-mode-config#review-denials>)
A [mod](</docs/en/plugins/mods/overview>) you install that handles `tool.check` can also approve an action. For the cases where its approval doesn’t get past your rules and hooks, see [Extend permissions with hooks](</docs/en/permissions#precedence-among-rules-hooks-and-mods>).For how [Claude in Chrome](</docs/en/chrome>) browser actions get approved in the VS Code extension, see [Permission prompts in VS Code sessions](</docs/en/chrome#permission-prompts-in-vs-code-sessions>).On entering auto mode, broad allow rules that grant arbitrary code execution are dropped:
--- a/plugin-evals.md
+++ b/plugin-evals.md
@@ -264,7 +264,20 @@
claude plugin eval . --allow-tools Write Edit "Bash(npm test *)"
-When a case asked for a tool you didn’t grant, the progress output lists it as `not granted`. Tools on a mocked MCP server need no grant. Tools on a real plugin MCP server need both the server started, with `--allow-real-servers` or `--mocks off`, and a grant by name, such as `--allow-tools "mcp__plugin_my-plugin_github__*"`; a plugin’s MCP tools are named `mcp__plugin_<plugin>_<server>__<tool>`. When you grant `Bash` in any form, every command runs under Claude Code’s [OS-level sandbox](</docs/en/sandboxing>). Writes are confined to the run’s workspace, your home directory and Claude Code configuration are unreadable, and network access is limited to domains you grant with `--allow-tools "WebFetch(domain:example.com)"`. If you grant Bash or PowerShell on a machine with no sandbox backend, Claude Code refuses each run rather than running it unconfined, and the case shows a run error and usually scores 0. Native Windows has no backend, so run shell-granting suites under WSL2; on Linux, install `bubblewrap` and `socat` first. See the [sandboxing prerequisites](</docs/en/sandboxing>).
+When a case asked for a tool you didn’t grant, the progress output lists it as `not granted`. Tools on a mocked MCP server need no grant. Tools on a real plugin MCP server need both the server started, with `--allow-real-servers` or `--mocks off`, and a grant by name, such as `--allow-tools "mcp__plugin_my-plugin_github__*"`; a plugin’s MCP tools are named `mcp__plugin_<plugin>_<server>__<tool>`.
+
+#### Shell grants need a sandbox
+
+When you grant `Bash` in any form, every command runs under Claude Code’s [OS-level sandbox](</docs/en/sandboxing>). Writes are confined to the run’s workspace, your home directory and Claude Code configuration are unreadable, and network access is limited to domains you grant with `--allow-tools "WebFetch(domain:example.com)"`. If you grant Bash or PowerShell on a machine with no sandbox backend, Claude Code refuses each run rather than running it unconfined, and the case shows a run error and usually scores 0. Native Windows has no backend, so run shell-granting suites under WSL2; on Linux, install `bubblewrap` and `socat` first. See the [sandboxing prerequisites](</docs/en/sandboxing>).
+
+#### Shell grants refused on a managed machine
+
+When shell-granting runs are refused on a machine your organization manages, a `sandbox` key in its [managed settings](</docs/en/managed-settings>) can be the cause. The error begins `A shell tool (Bash or PowerShell) was granted but this machine cannot confine it (no sandbox backend on this platform, or it is not installed)`. It names a missing backend even where one is installed. When a managed key is the cause, the message ends with `this machine's managed settings:` and the key, which the per-run progress line cuts off:
+
+ * **Without`--json`**: read it from the summary table’s `NOTES` column, as in `sandbox.enabled is false`
+ * **Under`--json`**: read it from the JSON result, in the run’s `error` field
+
+Ask your administrator whether that setting can change for your machine, or drop the shell grant from that run.
### Command options
@@ -554,7 +567,7 @@
### Tools are denied, MCP tools are missing, or Bash won’t run
-Anything beyond the read-only set needs your grant, such as `--allow-tools Bash Write`. Your personal MCP servers never load in a run. The plugin’s own servers don’t start unless you opt in, and their tools then also need an `--allow-tools "mcp__plugin_<plugin>_<server>__*"` grant; a mocked tool needs neither.
+Anything beyond the read-only set needs your grant, such as `--allow-tools Bash Write`. Your personal MCP servers never load in a run. The plugin’s own servers don’t start unless you opt in, and their tools then also need an `--allow-tools "mcp__plugin_<plugin>_<server>__*"` grant; a mocked tool needs neither. If you granted Bash and the runs are still refused, read the full error, which the per-run progress line cuts short. It is in the summary table’s `NOTES` column, or in the run’s `error` field under `--json`. See Shell grants refused on a managed machine when the full error names a managed setting, or Shell grants need a sandbox when it doesn’t.
### The run exits 1 but the results look fine
--- a/prompt-caching.md
+++ b/prompt-caching.md
@@ -145,7 +145,7 @@
## Actions that keep the cache
-These actions either append to the end of the conversation or don’t touch the request at all. Some of them, such as editing CLAUDE.md, keep the cache for the same reason the change doesn’t reach the running session until `/clear`, `/compact`, or a restart.
+These actions either append to the end of the conversation or don’t touch the request at all.
* Editing files in your repository
* Editing CLAUDE.md mid-session
@@ -158,11 +158,11 @@
### Editing files in your repository
-File contents enter context only when Claude reads them, and reads append to the conversation. Editing a file Claude previously read does not retroactively change the earlier read in history. Instead, Claude Code appends a [`<system-reminder>`](</docs/en/glossary#system-reminder>) noting the file changed, and Claude re-reads it if needed.
+When you edit a source file Claude already read, the cached prefix stays intact, because your edit doesn’t change the copy already in the conversation.
### Editing CLAUDE.md mid-session
-Your project-root and user-level CLAUDE.md files are read once at session start and held in memory. Editing them mid-session does not invalidate the cache, but the edit also doesn’t apply. Claude keeps working with the version that was loaded at session start. The new content loads on the next `/clear`, `/compact`, or restart. [Nested CLAUDE.md files in subdirectories](</docs/en/memory>) and [rules with `paths:` frontmatter](</docs/en/memory#path-specific-rules>) load later, on demand. Editing one yourself before it loads does take effect. After it loads, the content is part of the conversation history, so a mid-session edit doesn’t retroactively change it.
+When you edit your project-root or user-level CLAUDE.md mid-session, the cached prefix stays intact. Claude Code reads these files at session start and holds them in memory. To reload them, run `/clear` or `/compact`, or restart Claude Code. [Nested CLAUDE.md files in subdirectories](</docs/en/memory>) and [rules with `paths:` frontmatter](</docs/en/memory#path-specific-rules>) load later, on demand. Editing one yourself before it loads takes effect. After it loads, the content is part of the conversation history, so a mid-session edit doesn’t retroactively change it.
### Changing permission mode
@@ -182,7 +182,7 @@
### Rewinding the conversation
-[`/rewind`](</docs/en/checkpointing>) truncates your conversation back to an earlier turn. The remaining history is the same content the cache was built from at that point, and the system prompt and project context layers are unchanged, so the next request hits the earlier cache entry. Every turn since then has read through that prefix, which kept the entry warm even if the original turn was longer ago than the TTL. Restoring file checkpoints alongside the conversation has no separate effect on the cache. File contents enter context only when Claude reads them, the same as editing files in your repository.
+[`/rewind`](</docs/en/checkpointing>) truncates your conversation back to an earlier turn. The remaining history is the same content the cache was built from at that point, and the system prompt and project context layers are unchanged, so the next request hits the earlier cache entry. Every turn since then has read through that prefix, which kept the entry warm even if the original turn was longer ago than the TTL. Restoring file checkpoints alongside the conversation has no separate effect on the cache.
## Resuming a session
--- a/publish.md
+++ b/publish.md
@@ -167,7 +167,7 @@
### Tag a release
-Tag the release in git when other plugins declare a version range on yours, because those ranges resolve against tags. Otherwise you don’t need a tag. To tag, run `claude plugin tag` in your shell from the plugin directory. It creates a `{name}--v{version}` tag. Add `--push` to send the tag to `origin`. The [`plugin tag` reference](</docs/en/plugins/cli-reference#plugin-tag>) lists its flags.
+Tag the release in git when other plugins declare a version range on yours, because those ranges resolve against tags. To tag, run `claude plugin tag` in your shell from the plugin directory. It creates a `{name}--v{version}` tag. Add `--push` to send the tag to `origin`. The [`plugin tag` reference](</docs/en/plugins/cli-reference#plugin-tag>) lists its flags.
### Rename or remove a plugin
--- a/python.md
+++ b/python.md
@@ -1508,7 +1508,9 @@
* `result`: text of the final assistant message on `subtype="success"`, or `None` on the `error_*` subtypes. When `subtype="success"` and `is_error=True`, this holds the API error string if one is available but can be empty, so check `api_error_status` and the preceding `AssistantMessage` content for detail.
* `errors`: loop-level error strings such as the max-turns message. Populated only on the `error_*` subtypes.
* `terminal_reason`: why the query loop ended, such as `"completed"`, `"max_turns"`, `"api_error"`, `"aborted_streaming"`, or `"aborted_tools"`. A value of `"aborted_streaming"` or `"aborted_tools"` means the turn was aborted before completing. Common causes are `interrupt()` and a permission callback returning `PermissionResultDeny` with `interrupt=True`. `None` on CLI versions that predate the field, on results from local commands such as `/voice` or `/usage`, which bypass the query loop, or on synthesized error results emitted when the session fails fatally. Mirrors the TypeScript SDK’s [`SDKResultMessage.terminal_reason`](</docs/en/agent-sdk/typescript#sdkresultmessage>), which lists the full set of values.
- * `origin`: origin of the user message that triggered this turn. In [streaming input mode](</docs/en/agent-sdk/streaming-vs-single-mode>), check this to tell the result of your own prompt, where `origin` is `None` or `{"kind": "human"}`, from the result of an injected turn such as a background-task notification. Requires Python Agent SDK 0.2.137 or later.
+ * `origin`: origin of the user message that triggered this turn. Requires Python Agent SDK 0.2.137 or later. Don’t suppress a result on `kind` alone. In [streaming input mode](</docs/en/agent-sdk/streaming-vs-single-mode>), check `origin` to see whether your own prompt started the turn:
+ * **Your own prompt** : `origin` is `None` or `{"kind": "human"}`
+ * **A background-task notification** : `origin["kind"]` is `"task-notification"`. That turn’s result can also hold Claude’s answer to a message you sent while the turn ran tools.
When several background tasks finish close together, Claude Code can answer their notifications in one turn rather than one turn each. You still receive one `ResultMessage` per notification, in order, each with an `origin` whose `kind` is `"task-notification"`. All but the last have `num_turns` set to `0` and an empty `result`, and the last one carries the turn that answers them all. The `usage` dict covers the main agent loop only and excludes subagent and other nested or auxiliary model calls. In [streaming input mode](</docs/en/agent-sdk/streaming-vs-single-mode>), the values are per-turn. Prefer `model_usage` for token and cost accounting. The `usage` dict contains the following keys when present:
--- a/quickstart.md
+++ b/quickstart.md
@@ -179,7 +179,7 @@
The `async for` loop keeps running as Claude thinks, calls tools, observes results, and decides what to do next. Each iteration yields a message: Claude’s reasoning, a tool call, a tool result, or the final outcome. The SDK handles the orchestration, tool execution, context management, and retries, so you consume the stream. The loop ends when Claude finishes the task or hits an error. The message handling inside the loop filters for human-readable output. Without filtering, you’d see raw message objects including system initialization and internal state, which is useful for debugging but noisy otherwise.
-This example uses streaming to show progress in real-time. If you don’t need live output (for example, for background jobs or CI pipelines), you can collect all messages at once. See [Streaming vs. single-turn mode](</docs/en/agent-sdk/streaming-vs-single-mode>) for details.
+This example prints Claude’s text and tool calls as the loop receives them. If you don’t need live output, collect the messages in the loop and read them after the loop ends. To choose between a single-shot `query()` and streaming input, see [Choose single-shot or streaming input](</docs/en/agent-sdk/streaming-vs-single-mode#choose-single-shot-or-streaming-input>).
### Run your agent
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -96,7 +96,7 @@
### Stop a loop
- * **Self-paced loop** : while the loop is waiting for its next iteration, press `Esc` to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a background session you’ve attached to. A `Pending wakeup cancelled` notice confirms that the loop won’t fire again.
+ * **Self-paced loop** : while the loop is waiting for its next iteration, press `Esc` on an empty prompt to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a background session you’ve attached to. A `Pending wakeup cancelled` notice confirms that the loop won’t fire again.
* **Fixed-interval loop** : to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don’t stop it, or any task you scheduled by asking Claude directly. A loop you don’t cancel ends when seven days elapse.
In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either.
--- a/secure-deployment.md
+++ b/secure-deployment.md
@@ -67,7 +67,7 @@
**Setup:** For the install, configuration, and launch steps, see [Set up and launch the runtime](</docs/en/sandbox-environments#set-up-and-launch-the-runtime>). **Security considerations:**
1. **Same-host kernel** : Unlike VMs, sandboxed processes share the host kernel. A kernel vulnerability could theoretically enable escape. For some threat models this is acceptable, but if you need kernel-level isolation, use gVisor or a separate VM.
- 2. **No TLS inspection** : By default, the proxy allowlists domains based on the client-supplied hostname and doesn’t terminate or inspect encrypted traffic. Code running inside the sandbox can potentially use [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) or similar techniques to reach hosts outside the allowlist. If your threat model requires stronger guarantees, use a TLS-terminating proxy that inspects traffic, as Traffic forwarding describes. For more information, see the [sandboxing security limitations](</docs/en/sandboxing#security-limitations>).
+ 2. **No TLS inspection** : By default, the proxy enforces the allowlist based on the client-supplied hostname and doesn’t terminate or inspect encrypted traffic. Code running inside the sandbox can potentially use [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) or similar techniques to reach hosts outside the allowlist. If your threat model requires stronger guarantees, use a TLS-terminating proxy that inspects traffic, as Traffic forwarding describes. For more information, see the [sandboxing security limitations](</docs/en/sandboxing#security-limitations>).
3. **Credentials for allowed domains** : If the agent has permissive credentials for an allowed domain, ensure it cannot use that domain to trigger other network requests or to exfiltrate data.
For many single-developer and CI/CD use cases, sandbox-runtime raises the bar significantly with minimal setup. The sections below cover containers and VMs for deployments requiring stronger isolation.
--- a/self-hosted-environments-deploy.md
+++ b/self-hosted-environments-deploy.md
@@ -636,7 +636,7 @@
Each session’s child process runs the runner’s own binary by default, and the runner turns off auto-update inside the sessions it spawns. With that default, every session runs the version you installed on the host or built into the image. A host-level update takes effect the next time the runner starts. Choose which version your sessions run and when it changes:
* **Before you pin a version** : check [the Claude Code versions that models require](</docs/en/model-config#available-models>) for every model your sessions use. If a model requires a newer version than the one your sessions run, the server rejects requests for that model with [Claude Code does not support this model](</docs/en/errors#claude-code-does-not-support-this-model>).
- * **To hold a fleet on one version** : build the image with a pinned version, or on a bare host install a specific version and [disable auto-updates](</docs/en/setup#disable-auto-updates>)
+ * **To hold a fleet on one version** : build the image with a pinned version, or on a bare host [install a specific version](</docs/en/setup#install-a-specific-version>) and [disable auto-updates](</docs/en/setup#disable-auto-updates>)
* **To upgrade a fixed fleet** : read the [changelog](</docs/en/changelog>) entries between your version and the one you’re installing, then install the newer version or rebuild the image and restart the runners
* **To upgrade on-demand runners** : read the [changelog](</docs/en/changelog>) entries between your version and the one you’re installing, then change the image your [`spawn-runner` hook](</docs/en/self-hosted-environments-configuration#the-spawn-runner-hook>) starts. Each new runner gets the new version. A runner that’s already up, including a standby runner that [`--min-idle`](</docs/en/self-hosted-environments-reference#orchestrator-cli-flags>) started, keeps its version until it exits. Don’t restart it, because its work order is single-use.
* **If sessions start a different binary** : if you use [`--exec-path`](</docs/en/self-hosted-environments-reference#runner-cli-flags>) or a [`command` hook](</docs/en/self-hosted-environments-configuration#command>) to start a Claude Code binary other than the runner’s own, sessions run that binary’s version. Update that binary when you update the runner.
--- a/self-hosted-environments-quickstart.md
+++ b/self-hosted-environments-quickstart.md
@@ -23,7 +23,7 @@
Install on the host before you start:
- * **Claude Code v2.1.224 or later** , with any of the [standard install methods](</docs/en/setup>). The runner is part of the standard `claude` binary, and earlier versions don’t recognize the `self-hosted-runner` subcommand. A runner that serves Claude Tag sessions needs v2.1.229 or later and `python3` on its `PATH`, since the [hooks the control plane supplies](</docs/en/self-hosted-environments-configuration#how-each-session%E2%80%99s-config-is-assembled>) for those sessions run `python3`. To pin the exact version your fleet runs, see [Install a specific version](</docs/en/setup#install-a-specific-version>). For container images, see the Dockerfile in [Deploy to production](</docs/en/self-hosted-environments-deploy#build-the-runner-image>).
+ * **Claude Code v2.1.224 or later** , with any of the [standard install methods](</docs/en/setup>). The runner is part of the standard `claude` binary, and earlier versions don’t recognize the `self-hosted-runner` subcommand. A runner that serves Claude Tag sessions needs v2.1.229 or later and `python3` on its `PATH`, since the [hooks the control plane supplies](</docs/en/self-hosted-environments-configuration#how-each-session%E2%80%99s-config-is-assembled>) for those sessions run `python3`. To pin the exact version your fleet runs, see [Pin the version](</docs/en/self-hosted-environments-deploy#pin-the-version>). For container images, see the Dockerfile in [Deploy to production](</docs/en/self-hosted-environments-deploy#build-the-runner-image>).
* **Git 2.24 or newer**. Some git options on the deploy page need newer versions; [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>) states each floor.
Confirm the host is ready:
--- a/self-hosted-environments-testing.md
+++ b/self-hosted-environments-testing.md
@@ -63,7 +63,7 @@
The `--environment` and `--ref` dispatch flags require Claude Code v2.1.224 or later on the machine that runs the script, the same floor as the runner itself. With the hook in place and a runner started on this host, the test script:
- 1. Creates a session on the test environment with `claude -p "<prompt>" --environment <environment-id> --output-format json`. Run the command from a git checkout so the CLI can auto-detect the repository from the `origin` remote. The optional `--ref <branch>` bases the session’s checkout on a named ref instead of local HEAD. The command exits without waiting for Claude’s reply. What it prints tells your script the outcome:
+ 1. Creates a session on the test environment with `claude -p "<prompt>" --environment <environment-id> --output-format json`. Run the command from a git checkout so the CLI can auto-detect the repository from the `origin` remote. The optional `--ref <branch>` bases the session’s checkout on a named ref. The command exits without waiting for Claude’s reply. What it prints tells your script the outcome:
* **Session created** : one line of JSON such as `{"ok":true,"session_id":"session_...","title":"...","url":"...","pool_id":"..."}`
* **Session creation failed** : the line `{"ok":false,"error":"..."}`, and the command exits with status 1
* **Some earlier errors** , such as cloud sessions being unavailable for your organization or a missing prompt: the error on stderr with no JSON line, and the command exits with status 1
@@ -127,7 +127,7 @@
# 1. Create the session on the test environment. Run from a git checkout
# so the CLI can auto-detect the repo. --ref pins the checkout to a named
- # ref regardless of local HEAD.
+ # ref.
TURN1="e2e-probe-$(date +%s)-$$: say exactly 'ok: custom tools are reachable' and nothing else"
EXPECT1="ok: custom tools are reachable"
create_json=$(claude -p "$TURN1" --environment "$CLAUDE_TEST_ENVIRONMENT_ID" \
@@ -172,7 +172,7 @@
## Authenticate from CI
-Both `claude -p ... --environment` and `claude -p ... --cloud` authenticate with a claude.ai OAuth token; API keys, such as `sk-ant-xxxxx`, aren’t accepted for either call. Two approaches make a token available in CI.
+Both `claude -p ... --environment` and `claude -p ... --cloud` authenticate with a claude.ai OAuth token; API keys, such as `sk-ant-xxxxx`, aren’t accepted for either call.
### Long-lived CI host
@@ -180,7 +180,7 @@
### Ephemeral CI runners
-There is no long-lived CI token for this today. The scope that grants cloud-session control, `user:sessions:claude_code`, is capped server-side at 30 days, so `claude setup-token`, which mints a one-year inference-only token, doesn’t cover it. The [environment secret](</docs/en/self-hosted-environments-quickstart#set-up-an-environment-and-runner>) isn’t accepted either, since it only authorizes a runner to register with the environment, not to create sessions. To provision a stored login onto an ephemeral runner, set [`CLAUDE_CODE_OAUTH_REFRESH_TOKEN` and `CLAUDE_CODE_OAUTH_SCOPES`](</docs/en/env-vars#variables>) so `claude auth login` exchanges the token without a browser; the same 30-day cap applies to the refresh grant. Contact your Anthropic account team if you need a machine-identity path that isn’t bound to a human account.
+There is no long-lived CI token for this today. The scope that grants cloud-session control, `user:sessions:claude_code`, is capped server-side at 30 days, so `claude setup-token`, which mints a one-year inference-only token, doesn’t cover it. The [environment secret](</docs/en/self-hosted-environments-quickstart#set-up-an-environment-and-runner>) isn’t accepted either, since it only authorizes a runner to register with the environment, not to create sessions. Run `claude -p` from a long-lived CI host instead. Contact your Anthropic account team if you need a machine-identity path that isn’t bound to a human account.
## Create a dedicated test environment
--- a/settings-reference.md
+++ b/settings-reference.md
@@ -867,7 +867,7 @@
Choose whether Claude Code uses the auto mode classifier to review shell commands in plan mode. With the default `true`, the classifier reviews each command during planning when auto mode is available and you see no prompt, except for [critical-path removals](</docs/en/permission-modes#critical-paths>). Set `false` to get a permission prompt for every command outside the built-in read-only set. Appears in `/config` as **Use auto mode during plan**.
- * **Scope** : `User, local, or managed`. A repository can’t turn it off for you.
+ * **Scope** : `User, local, or managed`.
* A `false` in any of these files or in `--settings` turns it off, unless you leave that user or local file out with an option such as [`--setting-sources`](</docs/en/cli-reference#cli-flags>). Ignoring a left-out file requires Claude Code v2.1.314 or later
* **Type** : Boolean
* `true`: the same as unset; when auto mode is available, the classifier reviews shell commands during planning
@@ -2541,7 +2541,7 @@
### `autoScrollEnabled`
-Follow new output to the bottom of the conversation in [fullscreen rendering](</docs/en/fullscreen>). Turn it off to stay where you scrolled while Claude keeps working; permission prompts still scroll into view.
+Follow new output to the bottom of the conversation in [fullscreen rendering](</docs/en/fullscreen>).
* **Scope** : `Any file`
* **Type** : Boolean
@@ -3676,7 +3676,7 @@
Turn off the download of the [skills enabled for your claude.ai account](</docs/en/skills#how-synced-skills-behave>). Claude Code downloads them into `~/.claude/skills/synced/` in [terminal sessions where you sign in with your claude.ai account](</docs/en/skills#where-synced-skills-load>), interactive or non-interactive, and in Cowork and cloud sessions. Set `false` to stop that download and stop loading the skills it already synced. Claude Code honors only `false`: `true` is the same as unset and doesn’t turn syncing on where it’s otherwise off.
- * **Scope** : `User, local, or managed`, and files passed with `--settings`. A repository can’t turn it off for you.
+ * **Scope** : `User, local, or managed`, and files passed with `--settings`.
* **Type** : Boolean
* `false`: Claude Code stops downloading synced skills and stops loading the ones already in `~/.claude/skills/synced/`. In user or managed settings, it also moves them to `~/.claude/skills/.trash/`
* `true`: the same as unset
@@ -3694,7 +3694,7 @@
Turn off the download of the [plugins enabled for your claude.ai account](</docs/en/plugins/loading#synced-plugins>). Claude Code downloads them into `~/.claude/plugins/synced/` at the start of terminal sessions where you sign in with your claude.ai account and in Cowork sessions, and loads each one as `<name>@synced`. Set `false` to stop that download and stop loading the plugins it already synced. Claude Code honors only `false`: `true` is the same as unset and doesn’t turn syncing on where it’s otherwise off. Requires Claude Code v2.1.273 or later.
- * **Scope** : `User, local, or managed`, and files passed with `--settings`. A repository can’t turn it off for you.
+ * **Scope** : `User, local, or managed`, and files passed with `--settings`.
* **Type** : Boolean
* `false`: Claude Code stops downloading synced plugins and stops loading the ones already in `~/.claude/plugins/synced/`. In user or managed settings, it also moves them to `~/.claude/plugins/.trash/`
* `true`: the same as unset
--- a/setup.md
+++ b/setup.md
@@ -144,7 +144,7 @@
To move a native installation to the `"stable"` release channel without a downgrade, set [`minimumVersion`](</docs/en/settings-reference#minimumversion>) to the version you’re running. Background auto-updates and `claude update` refuse to install any version below the minimum. Set the minimum in `/config` to have Claude Code fill in your current version, or in your settings file to type the number yourself:
- * **In`/config`**: switch **Auto-update channel** to stable, then select **Stay on current version**. If you switch back to latest in `/config`, Claude Code clears the minimum.
+ * **In`/config`**: switch **Auto-update channel** to stable, then select the option to stay on your current version. If you switch back to latest in `/config`, Claude Code clears the minimum.
* **In your[settings file](</docs/en/settings>)**: run `claude --version` in your shell, and set `minimumVersion` to the number at the start of the output. In the same edit, set `autoUpdatesChannel` to `"stable"`.
This `~/.claude/settings.json` switches an installation on version 2.1.323 to stable:
@@ -178,11 +178,11 @@
claude update
-When an update installs, the command reports `Successfully updated from <old version> to version <new version>`. If you’re already on the newest version, it reports `Claude Code is up to date (<version>)`. Installs managed by Homebrew, WinGet, or apk report `Claude is up to date!` instead.
+When an update installs, the command prints a line that ends with `to version <new version>`. If you’re already on the newest version, it reports `Claude Code is up to date (<version>)`. Installs managed by Homebrew, WinGet, or apk report `Claude is up to date!` instead.
## Advanced installation options
-These options are for version pinning, Linux package managers, npm, network storage, and verifying binary integrity.
+These options are for installing a specific version, Linux package managers, npm, network storage, and verifying binary integrity.
### Install a specific version
--- a/skills.md
+++ b/skills.md
@@ -133,7 +133,10 @@
Send a command by including it in your prompt string, the same way you send regular text. Dispatch doesn’t depend on the `skills` option. Sending `/<name>` runs a user-invocable skill even when your `skills` list omits it. Commands that act on conversation history, such as `/compact`, need prior messages to work with. A `/<name>` that matches neither a command in the session nor a built-in Claude Code command doesn’t fail the query. Claude Code sends the prompt to Claude as an ordinary message, with a note that the command didn’t run, so the query spends a model turn and returns Claude’s reply. Before v2.1.274, a `/<name>` that matched nothing returned `Unknown command: /<name>` as the result without a model turn. A `/<name>` that matches a built-in Claude Code command that isn’t available in the session, such as `/theme`, returns `/theme isn't available in this environment.` as the result without a model turn.
-A command can hit the `maxTurns` / `max_turns` limit like any other prompt, ending the query with an error result instead of `success`. For the error-result contract, see [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>). If your command might hit the limit, wrap the loop in a `try`/`catch` in TypeScript or `try`/`except` in Python, as shown in [Single Message Input](</docs/en/agent-sdk/streaming-vs-single-mode#single-message-input>), or set `maxTurns` high enough for the work to complete.
+When a command reaches the `maxTurns` / `max_turns` limit, the query ends with an error result instead of `success`. For the error-result contract, see [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>). If your command might hit the limit, do one of these:
+
+ * Set `maxTurns` high enough for the work to complete.
+ * Wrap the `query()` loop in `try`/`catch` in TypeScript or `try`/`except` in Python.
### Compact history with `/compact`
--- a/statusline.md
+++ b/statusline.md
@@ -5,7 +5,7 @@
* Work across multiple sessions and need to distinguish them
* Want git branch and status always visible
-The status line renders in its own row above the built-in footer badges and does not replace them. With a custom status line configured, Claude Code stops showing most of the footer’s keyboard hints, including `esc to interrupt`, the `? for shortcuts` fallback, and the `hold space to speak` [voice dictation](</docs/en/voice-dictation>) hint. To add clickable link badges to the footer when an ID appears in the conversation, without writing a script, configure [`footerLinksRegexes`](</docs/en/settings-reference#footerlinksregexes>) instead. Here’s an example of a multi-line status line that displays git info on the first line and a color-coded context bar on the second.
+The status line renders in its own row above the built-in footer badges and doesn’t replace them. With a custom status line configured, Claude Code stops showing some footer hints, such as `? for shortcuts` and the `hold space to speak` [voice dictation](</docs/en/voice-dictation>) hint. To add clickable link badges to the footer when an ID appears in the conversation, without writing a script, configure [`footerLinksRegexes`](</docs/en/settings-reference#footerlinksregexes>) instead. Here’s an example of a multi-line status line that displays git info on the first line and a color-coded context bar on the second.
This page walks through setting up a basic status line, explains how the data flows from Claude Code to your script, lists all the fields you can display, and provides ready-to-use examples for common patterns like git status, cost tracking, and progress bars.
--- a/streaming-output.md
+++ b/streaming-output.md
@@ -1,6 +1,9 @@
By default, the Agent SDK yields a complete `AssistantMessage` for each non-empty content block, such as a text block or a tool call, after Claude finishes generating that block. To receive incremental updates as text and tool calls are generated, enable partial message streaming.
-This page covers output streaming (receiving tokens in real-time). For input modes (how you send messages), see [Send messages to agents](</docs/en/agent-sdk/streaming-vs-single-mode>). You can also [stream responses using the Agent SDK via the CLI](</docs/en/headless>).
+These cases are covered on other pages:
+
+ * **Sending messages to a running session** : see [Send messages to a running agent](</docs/en/agent-sdk/streaming-vs-single-mode>)
+ * **Streaming responses from the CLI** : see [stream responses using the Agent SDK via the CLI](</docs/en/headless>)
## Enable streaming output
@@ -301,6 +304,6 @@
Now that you can stream text and tool calls in real-time, explore these related topics:
- * [Interactive vs one-shot queries](</docs/en/agent-sdk/streaming-vs-single-mode>): choose between input modes for your use case
+ * [Send messages to a running agent](</docs/en/agent-sdk/streaming-vs-single-mode>): interrupt Claude’s response or attach an image to a message
* [Structured outputs](</docs/en/agent-sdk/structured-outputs>): get typed JSON responses from the agent
* [Permissions](</docs/en/agent-sdk/permissions>): control which tools the agent can use
Show diff (516 lines)
--- a/streaming-vs-single-mode.md
+++ b/streaming-vs-single-mode.md
@@ -1,244 +1,298 @@
-## Overview
-
-The Claude Agent SDK supports two distinct input modes for interacting with agents:
-
- * **Streaming Input Mode** : a persistent, interactive session
- * **Single Message Input** : one-shot queries that use session state and resuming
-
-## Streaming Input Mode (Recommended)
-
-Streaming input mode is the **preferred** way to use the Claude Agent SDK. It provides full access to the agent’s capabilities and enables rich, interactive experiences. It allows the agent to operate as a long lived process that takes in user input, handles interruptions, surfaces permission requests, and handles session management.
-
-### Benefits
-
-In streaming input mode, you work in a persistent session with these capabilities:
-
- * **Image uploads** : attach images directly to messages for visual analysis and understanding
- * **Queued messages** : send multiple messages that process sequentially, with ability to interrupt
- * **Tool integration** : full access to all tools and custom MCP servers during the session
- * **Real-time feedback** : see responses as they’re generated, not just final results
- * **Context persistence** : maintain conversation context across multiple turns naturally
-
-### Implementation Example
-
-These examples read an image named `diagram.png` from the working directory. Create one there first, or change the filename to point at your own image.
+Streaming input keeps an Agent SDK session open so your application can send it more than one message while it runs. You can also attach images to a message and stop a response partway through to redirect Claude.
+
+Streaming input covers the messages you send. To show Claude’s response as it’s generated, see [Stream responses in real-time](</docs/en/agent-sdk/streaming-output>).
+
+## Choose single-shot or streaming input
+
+Choose streaming input for an application that holds a conversation with Claude, such as a chat interface. Use streaming input to attach images to a message, interrupt a response, or [switch the model or permission mode](</docs/en/agent-sdk/configuration#change-configuration-mid-session>) while the session runs. A single-shot call passes one prompt string to `query()`. The call ends after Claude answers it. Single-shot fits a single task, such as a serverless function. To follow up after that call ends, start a new call that resumes the session. For more information, see [Continue, resume, and fork](</docs/en/agent-sdk/sessions#continue-resume-and-fork>).
+
+## Send more than one message to a session
+
+ * **TypeScript** : write an [async generator](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function%2A>) that yields [`SDKUserMessage`](</docs/en/agent-sdk/typescript#sdkusermessage>) objects, and pass it as the `prompt` of `query()`. Make the generator wait between yields for the next message from your user.
+ * **Python** : open a `ClaudeSDKClient` and pass each message to `client.query()`. Pass a string for a text message. To attach an image, pass an [async generator](<https://docs.python.org/3/glossary.html#term-asynchronous-generator>) that yields user message dicts.
+
+To have Claude answer each message in its own response, wait for the previous response’s result message before you send the next one:
+
+ * **TypeScript** : have your generator await a promise. Resolve it in your `for await` loop over `query()` when the result message arrives.
+ * **Python** : call `client.query()` with the next message after your [`receive_response()`](</docs/en/agent-sdk/python#claudesdkclient>) loop ends.
+
+A message you send during tool calls reaches Claude after those tool calls finish. Claude then answers it and your earlier message in one response. If the turn ends first, Claude starts a new turn for it. For details, see [Turns and budget](</docs/en/agent-sdk/agent-loop#turns-and-budget>).
+
+### Send a follow-up with an image
+
+This example sends a text question, then a follow-up with an image, and prints Claude’s response to each. Before you run it, save a PNG image as `diagram.png` in your working directory:
TypeScript
Python
+ import { readFile } from "node:fs/promises";
import { query, type SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
- import { readFile } from "fs/promises";
-
- async function* generateMessages(): AsyncGenerator<SDKUserMessage> {
- // First message
- yield {
- type: "user",
- message: {
- role: "user",
- content: "Analyze this codebase for security issues"
- },
- parent_tool_use_id: null
- };
-
- // Wait for conditions or user input
- await new Promise((resolve) => setTimeout(resolve, 2000));
-
- // Follow-up with image
+
+ let firstResponseDone!: () => void;
+ const firstResponseFinished = new Promise<void>((resolve) => {
+ firstResponseDone = resolve;
+ });
+
+ async function* messages(): AsyncGenerator<SDKUserMessage> {
+ yield {
+ type: "user",
+ message: {
+ role: "user",
+ content: "Explain in two sentences what a message queue does.",
+ },
+ parent_tool_use_id: null,
+ };
+
+ await firstResponseFinished;
+
+ const image = await readFile("diagram.png");
yield {
type: "user",
message: {
role: "user",
content: [
- {
- type: "text",
- text: "Review this architecture diagram"
- },
+ { type: "text", text: "Describe this image in one sentence." },
{
type: "image",
source: {
type: "base64",
media_type: "image/png",
- data: await readFile("diagram.png", "base64")
- }
- }
- ]
- },
- parent_tool_use_id: null
- };
- }
-
- // Process streaming responses
- for await (const message of query({
- prompt: generateMessages(),
- options: {
- maxTurns: 10,
- allowedTools: ["Read", "Grep"]
+ data: image.toString("base64"),
+ },
+ },
+ ],
+ },
+ parent_tool_use_id: null,
+ };
+ }
+
+ let responses = 0;
+ for await (const message of query({ prompt: messages() })) {
+ if (message.type === "assistant") {
+ for (const block of message.message.content) {
+ if (block.type === "text") {
+ console.log(block.text);
+ }
+ }
+ } else if (message.type === "result") {
+ responses += 1;
+ console.log(`Response ${responses} finished: ${message.subtype}`);
+ if (responses === 1) {
+ firstResponseDone();
+ }
}
- })) {
- if (message.type === "result" && message.subtype === "success") {
- console.log(message.result);
- }
- }
-
- from claude_agent_sdk import (
- ClaudeSDKClient,
- ClaudeAgentOptions,
- AssistantMessage,
- TextBlock,
- )
+ }
+
import asyncio
import base64
-
- async def streaming_analysis():
- async def message_generator():
- # First message
- yield {
- "type": "user",
- "message": {
- "role": "user",
- "content": "Analyze this codebase for security issues",
- },
- }
-
- # Wait for conditions
- await asyncio.sleep(2)
-
- # Follow-up with image
- with open("diagram.png", "rb") as f:
- image_data = base64.b64encode(f.read()).decode()
-
- yield {
- "type": "user",
- "message": {
- "role": "user",
- "content": [
- {"type": "text", "text": "Review this architecture diagram"},
- {
- "type": "image",
- "source": {
- "type": "base64",
- "media_type": "image/png",
- "data": image_data,
- },
+ from pathlib import Path
+
+ from claude_agent_sdk import AssistantMessage, ClaudeSDKClient, ResultMessage, TextBlock
+
+ async def image_message():
+ image_data = base64.b64encode(Path("diagram.png").read_bytes()).decode()
+ yield {
+ "type": "user",
+ "message": {
+ "role": "user",
+ "content": [
+ {"type": "text", "text": "Describe this image in one sentence."},
+ {
+ "type": "image",
+ "source": {
+ "type": "base64",
+ "media_type": "image/png",
+ "data": image_data,
},
- ],
- },
- }
-
- # Use ClaudeSDKClient for streaming input
- options = ClaudeAgentOptions(max_turns=10, allowed_tools=["Read", "Grep"])
-
- async with ClaudeSDKClient(options) as client:
- # Send streaming input
- await client.query(message_generator())
-
- # Process responses
- async for message in client.receive_response():
- if isinstance(message, AssistantMessage):
- for block in message.content:
- if isinstance(block, TextBlock):
- print(block.text)
-
- asyncio.run(streaming_analysis())
-
-When you run the example, the TypeScript version prints each response as it completes. The Python version’s `receive_response()` loop ends at the first result message, so it prints the security analysis; to read both responses, use one `query()` and `receive_response()` pair per message as shown in the [Python reference’s example of continuing a conversation](</docs/en/agent-sdk/python#example-continuing-a-conversation>). If an image block’s `source` is missing or isn’t an object, the SDK doesn’t report an error. Claude Code sends Claude a text note in place of the image, such as `[Image could not be processed: image block has no source object]`, and the session continues.
-
-In the TypeScript SDK, if your message generator throws, for example when a file it reads is missing, the stream ends with an error that reads `Claude Code process aborted by user` instead of the original error, so check the code inside your generator first when you see that message. The error may also be preceded by a long minified line of bundled SDK source, so read to the end of the output for the error text.In the Python SDK, a generator exception is logged at debug level and the session stalls without raising, so if a streaming session hangs with no output, enable debug logging and check your generator.
-
-## Single Message Input
-
-Single message input is simpler but more limited.
-
-### When to Use Single Message Input
-
-Use single message input when:
-
- * You need a one-shot response
- * You do not need image attachments or mid-session control methods
- * You need to operate in a stateless environment, such as a lambda function
-
-### Limitations
-
-Single message input mode does **not** support:
-
- * Direct image attachments in messages
- * Dynamic message queueing
- * Real-time interruption
- * Natural multi-turn conversations
-
-If a query ends with an error result, such as `error_max_turns`, a single message `query()` call raises an error that includes the failure text after yielding the final result message, so wrap the loop in a try block if your code needs to continue. See [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>) for the result subtypes.
-
-### Implementation Example
+ },
+ ],
+ },
+ }
+
+ async def main():
+ async with ClaudeSDKClient() as client:
+ await client.query("Explain in two sentences what a message queue does.")
+ async for message in client.receive_response():
+ if isinstance(message, AssistantMessage):
+ for block in message.content:
+ if isinstance(block, TextBlock):
+ print(block.text)
+ elif isinstance(message, ResultMessage):
+ print(f"Response 1 finished: {message.subtype}")
+
+ await client.query(image_message())
+ async for message in client.receive_response():
+ if isinstance(message, AssistantMessage):
+ for block in message.content:
+ if isinstance(block, TextBlock):
+ print(block.text)
+ elif isinstance(message, ResultMessage):
+ print(f"Response 2 finished: {message.subtype}")
+
+ asyncio.run(main())
+
+When you run either version, the example prints `Response 1 finished: success` and `Response 2 finished: success`. If Claude didn’t see your image, see [Image could not be processed](</docs/en/agent-sdk/troubleshooting#image-could-not-be-processed>).
+
+### Feed messages from a chat interface in TypeScript
+
+Feed your user’s messages to your prompt generator through a queue:
+
+ * **`pushMessage()`** : your interface’s input handler calls this for each message the user sends.
+ * **`closeInput()`** : the handler calls this when the user closes the chat.
+ * **`userMessages()`** : the generator you pass as the `prompt` of `query()`.
+
+`pushMessage()` adds each message to an array, and the generator reads from that array. When the array is empty, the generator waits until a message arrives or the chat closes:
+
+ import type { SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
+
+ const pending: string[] = [];
+ let wake: (() => void) | null = null;
+ let closed = false;
+
+ // The interface's input handler calls this with each message the user sends.
+ function pushMessage(text: string): void {
+ pending.push(text);
+ wake?.();
+ }
+
+ // The interface calls this when the user closes the chat.
+ function closeInput(): void {
+ closed = true;
+ wake?.();
+ }
+
+ async function* userMessages(): AsyncGenerator<SDKUserMessage> {
+ while (true) {
+ const text = pending.shift();
+ if (text !== undefined) {
+ yield { type: "user", message: { role: "user", content: text }, parent_tool_use_id: null };
+ } else if (closed) {
+ return;
+ } else {
+ await new Promise<void>((resolve) => (wake = resolve));
+ wake = null;
+ }
+ }
+ }
+
+Messages you push during a response can share one response. To choose when Claude reads a message you push during a response, set the message’s [`priority`](</docs/en/agent-sdk/typescript#sdkusermessage>) field.
+
+## Read each response
+
+Claude ends each response with a result message.
+
+ * **TypeScript** : the `for await` loop over `query()` yields each response’s messages in order. The loop ends after the last response’s result message, once your generator has returned. To match a result to the messages it answers, set a `uuid` on each message you send, and read the result’s [`user_message_uuids`](</docs/en/agent-sdk/typescript#user_message_uuids>).
+ * **Python** : start a `receive_response()` loop for each response, because each loop stops after the next [`ResultMessage`](</docs/en/agent-sdk/python#resultmessage>). The client keeps the conversation’s context from one message to the next. For more information, see [Automatic session management](</docs/en/agent-sdk/sessions#automatic-session-management>).
+
+The result message’s `subtype` field reports how the response ended, such as `success` or `error_during_execution`. If the last response ends in an error result:
+
+ * **TypeScript** : the loop over `query()` yields that result and then throws. Wrap the loop in `try`/`catch` to handle the exception. To keep the conversation going after the throw, start a new `query()` call that [resumes the session](</docs/en/agent-sdk/sessions#continue-resume-and-fork>). While your generator still has messages to send, an error result for an earlier response doesn’t throw.
+ * **Python** : `receive_response()` on a `ClaudeSDKClient` yields the error result without raising.
+
+For what each result subtype means, see [Handle the result](</docs/en/agent-sdk/agent-loop#handle-the-result>).
+
+## Interrupt Claude’s response
+
+To stop a response partway through and keep the session open, call `interrupt()` on the object that runs the session:
+
+ * **TypeScript** : pass an async generator as `prompt`, save the [`Query` object](</docs/en/agent-sdk/typescript#query-object>) returned by `query()`, and call `interrupt()` on it.
+ * **Python** : call `interrupt()` on the `ClaudeSDKClient`. If a `receive_response()` loop is reading the response, that loop ends at the interrupted response’s `ResultMessage`. Send your next message after that result arrives.
+
+When you call `interrupt()` during a response, that response ends with an `error_during_execution` result. Messages you sent before the interrupt that Claude hadn’t read yet still reach Claude once the interrupted response ends. For what the TypeScript loop does when the last response is an error result, see Read each response. This example asks Claude for a long essay. The example calls `interrupt()` three seconds after the session starts, then sends a second message to the same session once the interrupted response ends:
TypeScript
Python
- import { query } from "@anthropic-ai/claude-agent-sdk";
-
- // Simple one-shot query
- // query() throws after an error result, such as error_max_turns
- try {
- for await (const message of query({
- prompt: "Explain the authentication flow",
- options: {
- maxTurns: 5,
- allowedTools: ["Read", "Grep"]
- }
- })) {
- if (message.type === "result" && message.subtype === "success") {
- console.log(message.result);
+ import { query, type SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
+
+ let firstResponseDone!: () => void;
+ const firstResponseFinished = new Promise<void>((resolve) => {
+ firstResponseDone = resolve;
+ });
+
+ async function* messages(): AsyncGenerator<SDKUserMessage> {
+ yield {
+ type: "user",
+ message: {
+ role: "user",
+ content: "Write a 2,000-word essay on the history of the printing press.",
+ },
+ parent_tool_use_id: null,
+ };
+
+ await firstResponseFinished;
+
+ yield {
+ type: "user",
+ message: {
+ role: "user",
+ content: "In one sentence, what is a prime number?",
+ },
+ parent_tool_use_id: null,
+ };
+ }
+
+ const conversation = query({ prompt: messages() });
+
+ let responses = 0;
+ for await (const message of conversation) {
+ if (message.type === "system" && message.subtype === "init" && responses === 0) {
+ setTimeout(async () => {
+ await conversation.interrupt();
+ console.log("Interrupt sent");
+ }, 3000);
+ } else if (message.type === "assistant") {
+ for (const block of message.message.content) {
+ if (block.type === "text") {
+ console.log(block.text);
+ }
+ }
+ } else if (message.type === "result") {
+ responses += 1;
+ console.log(`Response ${responses} finished: ${message.subtype}`);
+ if (responses === 1) {
+ firstResponseDone();
}
}
- } catch (error) {
- console.error(`Query failed: ${error}`);
- }
-
- // Continue conversation with session management
- try {
- for await (const message of query({
- prompt: "Now explain the authorization process",
- options: {
- continue: true,
- maxTurns: 5
- }
- })) {
- if (message.type === "result" && message.subtype === "success") {
- console.log(message.result);
- }
- }
- } catch (error) {
- console.error(`Query failed: ${error}`);
- }
-
- from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage
+ }
+
import asyncio
- async def single_message_example():
- # Simple one-shot query using query() function
- # query() raises ResultError after an error result, such as error_max_turns
- try:
- async for message in query(
- prompt="Explain the authentication flow",
- options=ClaudeAgentOptions(max_turns=5, allowed_tools=["Read", "Grep"]),
- ):
- if isinstance(message, ResultMessage) and message.subtype == "success":
- print(message.result)
- except Exception as e:
- print(f"Query failed: {e}")
-
- # Continue conversation with session management
- try:
- async for message in query(
- prompt="Now explain the authorization process",
- options=ClaudeAgentOptions(continue_conversation=True, max_turns=5),
- ):
- if isinstance(message, ResultMessage) and message.subtype == "success":
- print(message.result)
- except Exception as e:
- print(f"Query failed: {e}")
-
- asyncio.run(single_message_example())
-
-When you run the example, each query prints its final result text: first the authentication explanation, then the authorization explanation.
+ from claude_agent_sdk import AssistantMessage, ClaudeSDKClient, ResultMessage, TextBlock
+
+ async def main():
+ async with ClaudeSDKClient() as client:
+ await client.query("Write a 2,000-word essay on the history of the printing press.")
+ await asyncio.sleep(3)
+ await client.interrupt()
+ print("Interrupt sent")
+ async for message in client.receive_response():
+ if isinstance(message, AssistantMessage):
+ for block in message.content:
+ if isinstance(block, TextBlock):
+ print(block.text)
+ elif isinstance(message, ResultMessage):
+ print(f"Response 1 finished: {message.subtype}")
+
+ await client.query("In one sentence, what is a prime number?")
+ async for message in client.receive_response():
+ if isinstance(message, AssistantMessage):
+ for block in message.content:
+ if isinstance(block, TextBlock):
+ print(block.text)
+ elif isinstance(message, ResultMessage):
+ print(f"Response 2 finished: {message.subtype}")
+
+ asyncio.run(main())
+
+When you run either version, the first response stops partway through the essay, and the example prints `Response 1 finished: error_during_execution`. Claude then answers the second message. The output ends with `Response 2 finished: success`.
+
+## Next steps
+
+ * [Stream responses in real-time](</docs/en/agent-sdk/streaming-output>): show text and tool calls as Claude generates them
+ * [Handle approvals and user input](</docs/en/agent-sdk/user-input>): answer Claude’s permission requests and clarifying questions
+ * [Change configuration mid-session](</docs/en/agent-sdk/configuration#change-configuration-mid-session>): switch the model or permission mode while the session runs
+ * [`Query` object](</docs/en/agent-sdk/typescript#query-object>) in TypeScript and [`ClaudeSDKClient`](</docs/en/agent-sdk/python#claudesdkclient>) in Python: the methods that send messages to a running session or control it
+ * [Work with sessions](</docs/en/agent-sdk/sessions>): resume, continue, or fork a conversation
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -259,7 +259,7 @@
##### Check an `agents` directory before a session
-To find files in an `agents` directory whose frontmatter doesn’t parse, run `claude plugin validate` against the directory, for example `.claude/agents` or `~/.claude/agents`. Claude Code checks only [the directory you name](</docs/en/plugins/cli-reference#validate-a-directory>), and doesn’t flag a file whose frontmatter parses but has no `name`. Requires Claude Code v2.1.233 or later.
+To find files in an `agents` directory whose frontmatter doesn’t parse, run `claude plugin validate` against the directory, for example `.claude/agents` or `~/.claude/agents`. Claude Code checks only [the directory you name](</docs/en/plugins/cli-reference#validate-a-directory>), and doesn’t flag a file whose frontmatter parses but has no `name`.
### Choose a model
@@ -687,7 +687,7 @@
When automatic delegation isn’t enough, you can request a subagent yourself. Three patterns escalate from a one-off suggestion to a session-wide default:
* **Natural language** : name the subagent in your prompt; Claude decides whether to delegate
- * **@-mention** : guarantees the subagent runs for one task
+ * **@-mention** : tells Claude to run the subagent for one task
* **Session-wide** : the whole session runs as that subagent via the `--agent` flag or the `agent` setting
For natural language, there’s no special syntax. Name the subagent and Claude typically delegates:
@@ -695,11 +695,11 @@
Use the test-runner subagent to fix failing tests
Have the code-reviewer subagent look at my recent changes
-**@-mention the subagent.** Type `@` and pick the subagent from the typeahead, the same way you @-mention files. This ensures that specific subagent runs rather than leaving the choice to Claude:
+**@-mention the subagent.** Type `@` and pick the subagent from the typeahead, the same way you @-mention files:
@"code-reviewer (agent)" look at the auth changes
-Your full message still goes to Claude, which writes the subagent’s task prompt based on what you asked. The @-mention controls which subagent Claude invokes, not what prompt it receives. Subagents provided by an enabled [plugin](</docs/en/plugins/overview>) appear in the typeahead under their scoped name, such as `my-plugin:code-reviewer` or `my-plugin:review:security` when the plugin organizes agents into subfolders. Named background subagents currently running in the session also appear in the typeahead, showing their status next to the name. You can also type the mention manually without using the picker: `@agent-<name>` for local subagents, or `@agent-` followed by the scoped name for plugin subagents, for example `@agent-my-plugin:code-reviewer`. While you type this form the typeahead shows file matches rather than agents. The agent mention still resolves when you submit. **Run the whole session as a subagent.** Pass [`--agent <name>`](</docs/en/cli-reference>) to start a session where the main thread itself takes on that subagent’s tool restrictions and model:
+Your full message still goes to Claude, which writes the subagent’s task prompt based on what you asked. Subagents provided by an enabled [plugin](</docs/en/plugins/overview>) appear in the typeahead under their scoped name, such as `my-plugin:code-reviewer` or `my-plugin:review:security` when the plugin organizes agents into subfolders. Named background subagents currently running in the session also appear in the typeahead, showing their status next to the name. You can also type the mention manually without using the picker: `@agent-<name>` for local subagents, or `@agent-` followed by the scoped name for plugin subagents, for example `@agent-my-plugin:code-reviewer`. While you type this form the typeahead shows file matches rather than agents. The agent mention still resolves when you submit. **Run the whole session as a subagent.** Pass [`--agent <name>`](</docs/en/cli-reference>) to start a session where the main thread itself takes on that subagent’s tool restrictions and model:
claude --agent code-reviewer
--- a/subagents.md
+++ b/subagents.md
@@ -182,15 +182,13 @@
### Automatic invocation
-Claude automatically decides when to invoke subagents based on the task and each subagent’s `description`. For example, if you define a `performance-optimizer` subagent with the description “Performance optimization specialist for query tuning”, Claude will invoke it when your prompt mentions optimizing queries. Write clear, specific descriptions so Claude can match tasks to the right subagent.
+Claude automatically decides when to invoke subagents based on the task and each subagent’s `description`. For example, a `performance-optimizer` subagent with the description “Performance optimization specialist for query tuning” fits a prompt about optimizing queries. Write clear, specific descriptions so Claude can match tasks to the right subagent.
### Explicit invocation
-To guarantee Claude uses a specific subagent, mention it by name in your prompt:
+To ask for a specific subagent, mention it by name in your prompt:
"Use the code-reviewer agent to check the authentication module"
-
-This bypasses automatic matching and directly invokes the named subagent.
### Forked subagents
--- a/terminal-config.md
+++ b/terminal-config.md
@@ -16,10 +16,10 @@
Terminal| Shift+Enter for newline
---|---
-Ghostty, Kitty, iTerm2, WezTerm, Warp, Windows Terminal| Works without setup
+Ghostty, Kitty, iTerm2, WezTerm, Warp, Windows Terminal 1.25 or later| Works without setup
Other terminals that support the kitty keyboard protocol, such as foot and Alacritty 0.16 or later| Works without setup. Requires Claude Code v2.1.269 or later
VS Code, Cursor, Devin Desktop, Alacritty before 0.16, Zed| Run `/terminal-setup` once
-gnome-terminal, JetBrains IDEs such as PyCharm and Android Studio| Not available; use Ctrl+J or `\` then Enter
+gnome-terminal, Windows Terminal before 1.25, JetBrains IDEs such as PyCharm and Android Studio| Not available; use Ctrl+J or `\` then Enter
For VS Code, Cursor, Devin Desktop, Alacritty before 0.16, and Zed, `/terminal-setup` writes a Shift+Enter keybinding into the terminal’s configuration file. On the first run you see a confirmation such as `Installed VSCode terminal Shift+Enter key binding`. Existing bindings are left in place; if you see a message such as `VSCode terminal Shift+Enter key binding already configured`, no change was made. Run `/terminal-setup` directly in the host terminal rather than inside tmux or screen, since it needs to write to the host terminal’s configuration. In VS Code, Cursor, and Devin Desktop, `/terminal-setup` also updates two editor settings: it sets `terminal.integrated.gpuAcceleration` to `"off"` to prevent garbled text in the integrated terminal, and it sets `terminal.integrated.mouseWheelScrollSensitivity` for smoother scrolling in [fullscreen mode](</docs/en/fullscreen>). To undo the GPU acceleration change, set it back to `"auto"` and reload the editor window. In Zed, `/terminal-setup` updates your `keymap.json` in place:
@@ -116,7 +116,7 @@
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
-To send notifications from a visible pane to the outer terminal, keep the `allow-passthrough` line and set [`preferredNotifChannel`](</docs/en/settings-reference#preferrednotifchannel>) to `"iterm2"`, `"kitty"`, or `"ghostty"`. With this sample, a pane in a window you aren’t viewing sends none. The `extended-keys` lines let tmux distinguish Shift+Enter from plain Enter so the newline shortcut works. A [mod’s `Image`](</docs/en/plugins/mods/reference#elements>) needs the `allow-passthrough` and `focus-events` lines, along with the other [requirements for drawing inside tmux](</docs/en/plugins/mods/gallery#draw-an-image-inside-tmux>). After you add the lines, also detach from tmux, attach again, and restart Claude Code.
+To use Shift+Enter, keep the last two lines, then detach from tmux, attach again, and restart Claude Code. To send notifications from a visible pane to the outer terminal, keep the `allow-passthrough` line and set [`preferredNotifChannel`](</docs/en/settings-reference#preferrednotifchannel>) to `"iterm2"`, `"kitty"`, or `"ghostty"`. With this sample, a pane in a window you aren’t viewing sends none. A [mod’s `Image`](</docs/en/plugins/mods/reference#elements>) needs the `allow-passthrough` and `focus-events` lines, along with the other [requirements for drawing inside tmux](</docs/en/plugins/mods/gallery#draw-an-image-inside-tmux>). After you add the lines, also detach from tmux, attach again, and restart Claude Code.
## Fix Backspace deleting a whole word on Windows
@@ -180,7 +180,7 @@
`text`| Default foreground text
`inverseText`| Text drawn on top of a colored background, such as status badges
`inactive`| Secondary text such as hints, timestamps, and disabled items
-`subtle`| Faint borders and de-emphasized secondary text
+`subtle`| Faint borders, dividers, and symbols
`suggestion`| Autocomplete suggestions and selection highlight in pickers
`permission`| Dialog borders, including permission prompts and pickers
`remember`| Memory and `CLAUDE.md` indicators
--- a/test.md
+++ b/test.md
@@ -314,7 +314,7 @@
* **`tier`** : call it once at the top of the test file, as in `tier('prepend')`, to load your mod as `prepend`, `append`, or `builtin`, its place in the [order mods run in](</docs/en/plugins/mods/events#the-order-mods-run-in>). Without it, your mod loads as `user`.
* **`plugins`** : pass `test` an options object ahead of the test body. Its `plugins` array holds mods you write inline, each with a `name` and a `register` function. To load one somewhere other than `user`, add `tier` to it.
-This test file loads the [policy mod from the admin page](</docs/en/plugins/mods/admin#enforce-a-policy-with-a-mod-of-your-own>) first. It checks that the policy mod refuses a mod that starts a process and allows one that doesn’t:
+This test file loads the [policy mod from the admin page](</docs/en/plugins/mods/admin#enforce-a-policy-with-a-mod-of-your-own>) first. It checks that the policy mod stops a mod that starts a process and allows one that doesn’t:
acme-guard/tests/guard.test.ts
@@ -353,7 +353,8 @@
} catch (error) {
message = error.message
}
- expect(message).toBe('runner: refused by acme-guard: Acme policy: mods may not call process.run')
+ // "hooks module left out" on v2.1.326 or later, "refused" on earlier versions
+ expect(message).toMatch(/^runner: (hooks module left out|refused) by acme-guard/)
})
test('admits a mod that starts no process', { plugins: [reader] }, async ($, on) => {
@@ -363,7 +364,7 @@
expect(out).toEqual({ result: 'reader answered' })
})
-In your shell, run `claude plugin test` from the `acme-guard` directory. Both tests pass with the policy mod as the admin page shows it. The kit loads every mod at the test’s first call on `$`. When your mod refuses one, that call throws, and the message names the refused mod, the mod that refused it, and your reason. In the second test nothing is refused, so `reader` answers the tool call before it reaches the stub.
+In your shell, run `claude plugin test` from the `acme-guard` directory. Both tests pass with the policy mod as the admin page shows it. The kit loads every mod at the test’s first call on `$`. When your mod stops one, that call throws, and the message names both mods. In the second test nothing is stopped, so `reader` answers the tool call before it reaches the stub.
## Next steps
--- a/todo-tracking.md
+++ b/todo-tracking.md
@@ -347,5 +347,5 @@
* [Agent SDK reference - TypeScript](</docs/en/agent-sdk/typescript>): the options, types, and tool schemas for the TypeScript SDK, including the Task tool input and output types
* [Agent SDK reference - Python](</docs/en/agent-sdk/python>): the options, types, and tool documentation for the Python SDK
- * [Streaming Input](</docs/en/agent-sdk/streaming-vs-single-mode>): the two input modes, and when to use streaming input instead of the single-shot calls these examples use
+ * [Send messages to a running agent](</docs/en/agent-sdk/streaming-vs-single-mode>): use streaming input in place of the single-shot calls these examples use
* [Give Claude custom tools](</docs/en/agent-sdk/custom-tools>): define your own tools with the SDK’s in-process MCP server
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -546,7 +546,7 @@
* Newer models can overwrite a file they never read this session under the same conditions as read-before-edit: reading it wouldn’t need a permission prompt and the Read tool is available.
* Jupyter notebooks, and files Claude has read only partially with a `PARTIAL view` notice, require the read on every model.
-This constraint doesn’t apply to new files. Before v2.1.228, every model required the read before overwriting an existing file. Viewing the file with Bash also satisfies this requirement under the same rules described in Edit tool behavior. For partial changes to an existing file, Claude uses Edit instead of Write.
+This constraint doesn’t apply to new files. Viewing the file with Bash also satisfies this requirement under the same rules described in Edit tool behavior. For partial changes to an existing file, Claude uses Edit instead of Write.
## Check which tools are available
--- a/troubleshoot-install.md
+++ b/troubleshoot-install.md
@@ -455,7 +455,7 @@
The connection dropped while downloading the update (attempt 3/3: aborted). Check your network — proxies sometimes cut off large downloads.
-The text in parentheses names which attempt failed and the underlying network error. `claude update` precedes the message with `Error: Failed to install native update` on stderr. A download that stays connected but doesn’t finish within 10 minutes fails with `Download timed out: exceeded the total deadline` instead. Claude Code doesn’t retry a timed-out download, because a connection too slow to finish inside the deadline won’t finish on an immediate retry either. The steps below apply to both messages. A proxy or gateway can close a long transfer before it finishes, and the Claude Code binary is a large download. **What to do:**
+The text in parentheses names which attempt failed and the underlying network error. `claude update` precedes the message with `Failed to install native update`. A download that stays connected but doesn’t finish within 10 minutes fails with `Download timed out: exceeded the total deadline` instead. Claude Code doesn’t retry a timed-out download, because a connection too slow to finish inside the deadline won’t finish on an immediate retry either. The steps below apply to both messages. A proxy or gateway can close a long transfer before it finishes, and the Claude Code binary is a large download. **What to do:**
* Run `claude update` again. On an otherwise healthy network, the download usually succeeds on the next run. For the timed-out message, run it again from a faster or less throttled network.
* If your network requires a proxy, set `HTTPS_PROXY` before running the installer or `claude update`. See Check network connectivity.
@@ -470,7 +470,7 @@
Take the step that matches the value in parentheses in your message:
- * **A value that starts with`sidecar_fetch_`**: run the same command again from your shell. `claude update` succeeded if it prints a line that starts with `Successfully updated from`, and `claude install` succeeded if it prints `Claude Code successfully installed!`.
+ * **A value that starts with`sidecar_fetch_`**: run the same command again from your shell. `claude update` succeeded if it prints a line that ends with `to version <new version>`, and `claude install` succeeded if it prints `Claude Code successfully installed!`.
* **Any other value** : try the same command again later
With any value, if the message repeats, report the problem and include the full message.
--- a/troubleshooting.md
+++ b/troubleshooting.md
@@ -1,4 +1,4 @@
-This page covers Agent SDK errors in CLI startup, CLI process exit, large tool calls and results, and structured outputs. Entries on this page are keyed to the error you see. Each entry names the cause and what to do. Symptoms tied to a feature, such as a hook not firing or a skill not being used, have a troubleshooting section on that feature’s page. The table names the section or page that covers each symptom:
+This page covers Agent SDK errors in CLI startup, CLI process exit, large tool calls and results, streaming input, and structured outputs. Entries on this page are keyed to the error you see. Each entry names the cause and what to do. Symptoms tied to a feature, such as a hook not firing or a skill not being used, have a troubleshooting section on that feature’s page. Look up your symptom in this table to find the section or page that covers it:
Symptom| Go to
---|---
@@ -11,6 +11,8 @@
An agent that works on your machine fails in a deployed service or container| [Troubleshoot deployment failures](</docs/en/agent-sdk/hosting#troubleshoot-deployment-failures>)
`Not logged in`, `Invalid API key`, `API Error`, `429`, `There's an issue with the selected model`| [Error reference](</docs/en/errors#find-your-error>)
`CLINotFoundError`, `CLIConnectionError`, `ProcessError`, `Claude Code process exited with code N`, `Claude Code returned an error result`, `CLIJSONDecodeError`, `structured_output` is `None`| CLI startup, CLI process exit, Large tool calls and results, and Structured outputs on this page
+`Operation aborted`, `Claude Code process aborted by user`, `Prompt stream failed; closing stdin`, or a Python `query()` loop that stops, with no exception, before all your messages are answered| Streaming input on this page
+`Image could not be processed`| Image could not be processed on this page
## CLI startup
@@ -126,6 +128,36 @@
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>).
+## Streaming input
+
+### Operation aborted
+
+In TypeScript, your `for await` loop over `query()` throws one of these messages as an `AbortError`. Either one means the query was aborted:
+
+ Operation aborted
+ Claude Code process aborted by user
+
+Check for these causes:
+
+ * **Your code aborted the query** : if your code calls `abort()` on the `AbortController` you passed as the [`abortController`](</docs/en/agent-sdk/typescript#options>) option, the loop throws one of these errors. If you didn’t intend the abort, check where your code calls `abort()`.
+ * **Your async generator threw** : the error doesn’t include your generator’s own error message. To see that message, wrap the generator’s body in `try`/`catch`, log the caught error, and rethrow it. Then fix the error you logged.
+
+### Prompt stream failed; closing stdin
+
+In Python, when the async generator you passed to the `query()` function raises an exception, your `async for` loop over `query()` ends with no exception. The SDK logs this line at `ERROR` level. If you haven’t configured logging, Python prints the line to stderr:
+
+ Prompt stream failed; closing stdin: <your exception's message>
+
+To see the exception’s traceback, wrap the generator’s body in `try`/`except`. Log the exception with its traceback and raise it again. Then fix the exception you logged.
+
+### Image could not be processed
+
+When an image block in your message has no `source` object, no error reaches your code. Claude receives this text note in place of the image:
+
+ [Image could not be processed: image block has no source object]
+
+Claude answers without the image. Check that each image block has a `source` object, as in [Send a follow-up with an image](</docs/en/agent-sdk/streaming-vs-single-mode#send-a-follow-up-with-an-image>).
+
## Structured outputs
### structured_output is None but the result says success
--- a/typescript.md
+++ b/typescript.md
@@ -1514,7 +1514,7 @@
The `message` field is a [`BetaMessage`](<https://platform.claude.com/docs/en/api/messages/create>) from the Anthropic SDK. It includes fields like `id`, `content`, `model`, `stop_reason`, and `usage`. `SDKAssistantMessageError` is one of: `'authentication_failed'`, `'oauth_org_not_allowed'`, `'account_on_hold'`, `'billing_error'`, `'rate_limit'`, `'overloaded'`, `'invalid_request'`, `'model_not_found'`, `'server_error'`, `'max_output_tokens'`, `'cloud_credential_error'`, or `'unknown'`. Four of these values mean more than their names say:
* `'model_not_found'`: the selected model doesn’t exist or isn’t available to your account or deployment
- * `'overloaded'`: the API returned a 529 because the server is at capacity, as opposed to `'rate_limit'`, which is a 429 against your quota
+ * `'overloaded'`: appears on [`api_retry` events](</docs/en/headless#handle-api-retries>) when the API returns a 529 because the server is at capacity. When an HTTP 529 ends the turn, the assistant message carries `'server_error'`. A 429 against your quota is `'rate_limit'`
* `'account_on_hold'`: [your account is on hold](</docs/en/errors#your-account-is-on-hold>)
* `'cloud_credential_error'`: Claude Code couldn’t obtain usable AWS or Google Cloud credentials on the machine it runs on, so no request reached the cloud provider. The usual cause is a cloud sign-in that expired or was never completed on that machine, though a briefly unreachable credential service reports the same value. See [Could not load AWS or Google Cloud credentials](</docs/en/errors#could-not-load-aws-or-google-cloud-credentials>). Requires TypeScript Agent SDK v0.3.267 or later, which bundles Claude Code v2.1.267
--- a/vs-code.md
+++ b/vs-code.md
@@ -274,7 +274,7 @@
## Customize your workflow
-You can reposition the Claude panel, run multiple conversations, group or filter the sessions list, or switch to terminal mode.
+You can reposition the Claude panel and change its font. You can also run multiple conversations, group or filter the sessions list, or switch to terminal mode.
### Choose where Claude lives
@@ -287,6 +287,19 @@
When Claude opens a tab in a new editor group, the extension locks that group. Files you open while the Claude tab is focused then go to another group instead of next to it. To stop the extension from locking groups, turn off the [Lock Editor Groups setting](<vscode://settings/claudeCode.lockEditorGroups>). Groups that are already locked stay locked until you unlock them. The setting requires Claude Code v2.1.274 or later.
Use the sidebar for your main Claude session and open additional tabs for side tasks. Claude remembers your preferred location. The Activity Bar sessions list icon is separate from the Claude panel. The sessions list is always visible in the Activity Bar, while the Claude panel icon only appears there when the panel is docked to the left sidebar.
+
+### Change the font
+
+The Claude panel uses VS Code’s chat font settings, the same ones that style VS Code’s built-in chat view. Open VS Code settings with `Cmd+,` on Mac or `Ctrl+,` on Windows and Linux, then search for `chat font`.
+
+Setting| Applies to
+---|---
+[`chat.fontSize`](<vscode://settings/chat.fontSize>)| Size of the conversation text and the prompt box, in pixels. Code blocks and tool output scale with it. Requires VS Code 1.104 or later
+[`chat.fontFamily`](<vscode://settings/chat.fontFamily>)| Font of the conversation text and the prompt box. Requires VS Code 1.104 or later
+[`chat.editor.fontSize`](<vscode://settings/chat.editor.fontSize>)| Size of diffs, in pixels. Requires Claude Code v2.1.300 or later
+[`chat.editor.fontFamily`](<vscode://settings/chat.editor.fontFamily>)| Font of code blocks and tool output
+
+To scale all of VS Code along with the Claude panel, zoom the window with `Cmd+=` on Mac or `Ctrl+=` on Windows and Linux.
### Continue conversations after a reload
@@ -568,7 +581,7 @@
## Configure settings
-You configure the extension in two places, VS Code’s extension settings and the Claude Code settings file:
+You configure the extension in VS Code’s extension settings and the Claude Code settings file:
* **Extension settings** in VS Code: control the extension’s behavior within VS Code. Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to **Extensions > Claude Code**. You can also type `/` and select **General config…** to open settings.
* **Claude Code settings** in `~/.claude/settings.json`: shared between the extension and CLI. Use it for allowed commands, environment variables, hooks, and MCP servers. With Claude Code v2.1.283 or later, you can also use it as one input to the permission mode conversations start in. On earlier versions, you can do this only on Pro, Max, Ultra, and Team plans. [Switch permission modes](</docs/en/permission-modes#switch-permission-modes>) lists the order. See [Settings](</docs/en/settings>) for details.
--- a/worktrees.md
+++ b/worktrees.md
@@ -144,7 +144,7 @@
* **gitlab.com** : fetches `merge-requests/<number>/head`
* **GitHub Enterprise, self-managed GitLab, or any other host** : tries `pull/<number>/head` first, then `merge-requests/<number>/head`
-This fetch never waits for input in your terminal. If git or ssh would ask for a password, a key passphrase, or confirmation of a new SSH host, the fetch fails instead and Claude Code exits with an `Error creating worktree: Failed to fetch PR/MR #<number>` message. A key that `ssh-agent` holds still works, so load your key there and run `git fetch` once by hand to record a new host before you start. Before v2.1.233, Claude Code accepted only `#<number>` and GitHub-style pull request URLs for `--worktree`, and always fetched `pull/<number>/head`.
+This fetch never waits for input in your terminal. If git or ssh would ask for a password, a key passphrase, or confirmation of a new SSH host, the fetch fails instead and Claude Code exits with an `Error creating worktree: Failed to fetch PR/MR #<number>` message. A key that `ssh-agent` holds still works, so load your key there and run `git fetch` once by hand to record a new host before you start.
### Copy gitignored files into worktrees