modified Use Claude Code with a screen reader View current →
--- a/accessibility.md +++ b/accessibility.md @@ -1,4 +1,4 @@ -Claude Code has a screen reader mode that replaces its visual terminal interface with plain, linear text. Instead of boxes, progress animations, and in-place redraws, Claude Code prints labeled lines that a screen reader such as VoiceOver or NVDA reads in order. You can hold a full conversation, approve tool permissions, and review output end to end. Screen reader mode is opt-in. If you use a screen magnifier, reduced motion, or a colorblind-friendly theme instead of a screen reader, set `CLAUDE_CODE_ACCESSIBILITY`, `prefersReducedMotion`, or `theme` from the Accessibility settings table. Screen reader mode adapts the terminal interface only, so you don’t need it in the VS Code extension’s chat panel. On Claude Code v2.1.236 or later, the extension [announces conversation activity to your screen reader](</docs/en/vs-code#use-a-screen-reader>) there without any setting. Screen reader mode requires Claude Code v2.1.181 or later. Earlier versions reject the `--ax-screen-reader` flag with `error: unknown option '--ax-screen-reader'`. +Claude Code has a screen reader mode that replaces its visual terminal interface with plain, linear text. Instead of boxes, progress animations, and in-place redraws, Claude Code prints labeled lines that a screen reader such as VoiceOver or NVDA reads in order. You can hold a full conversation, approve tool permissions, and review output end to end. Screen reader mode is opt-in. If you use a screen magnifier, reduced motion, or a colorblind-friendly theme instead of a screen reader, set `CLAUDE_CODE_ACCESSIBILITY`, `prefersReducedMotion`, or `theme` from the Accessibility settings table. Screen reader mode adapts the terminal interface only, so you don’t need it in the VS Code extension’s chat panel. On Claude Code v2.1.236 or later, the extension [announces conversation activity to your screen reader](</docs/en/vs-code#use-a-screen-reader>) there without any setting. ##
modified Orchestrate teams of Claude Code sessions View current →
--- a/agent-teams.md +++ b/agent-teams.md @@ -259,6 +259,8 @@ * **Body** : for an in-process teammate, Claude Code appends the definition’s body to its default system prompt as additional instructions. For a split-pane teammate, Claude Code uses the body in place of its default system prompt. * **`skills`** : Claude Code doesn’t apply the definition’s `skills` to a teammate in either display mode. The teammate loads skills from your project and user settings. * **`mcpServers`** : for a split-pane teammate, Claude Code applies the definition’s `mcpServers` under the [rules for that field](</docs/en/sub-agents#scope-mcp-servers-to-a-subagent>), which cover a session started with `--agent` as well. An in-process teammate ignores the field and loads MCP servers from your project and user settings. + +When Claude messages an in-process teammate that is no longer running, Claude Code brings it back in the same session, restores any conversation saved for it, and gives it the message as its next prompt. After you resume a session, teammates aren’t brought back this way, per the resume limitation. For a teammate it brings back, Claude Code re-applies a definition that came from a project’s `.claude/agents/` directory or an `--add-dir` directory only if you’ve [trusted the folder the agent file is in](</docs/en/permissions#what-runs-before-you-trust-a-folder>). Trusting a parent folder doesn’t count. Until then, the teammate comes back with none of the definition’s tools or instructions, keeping only the tools Claude Code adds to every in-process teammate. See [the teammate’s agent definition was not restored](</docs/en/errors#teammate-agent-definition-not-restored>) for the notice text. ###
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -1,4 +1,4 @@ -Agent view, opened with `claude agents`, is one screen for all your background sessions: what’s running, what needs your input, and what’s done. Dispatch new sessions, watch their state at a glance instead of scrolling through transcripts, and step in only when one needs you. Each background session is a full Claude Code conversation that keeps running without a terminal attached, so you can open it, reply, and leave whenever you want. Use agent view when you have several independent tasks Claude can work on without you watching every step. Dispatch a bug fix, a pull request review, and a flaky-test investigation as three rows, keep working in another window, and check back when a row shows it needs you or has a result. When you want to work more directly in any agent’s session, attach to the row to enter the full conversation. To compare agent view with subagents, agent teams, and worktrees, see [Run agents in parallel](</docs/en/agents>). +Agent view, opened with `claude agents`, is one screen for all your background sessions: what’s running, what needs your input, and what’s done. Dispatch new sessions, watch their state at a glance instead of scrolling through transcripts, and step in only when one needs you. Each background session is a full Claude Code conversation that keeps running without a terminal attached, so you can open it, reply, and leave whenever you want. Use agent view when you have several independent tasks Claude can work on without you watching every step. Dispatch a bug fix, a pull request review, and a flaky-test investigation as three rows, keep working in another window, and check back when a row shows it needs you or has a result. When you want to work more directly in any agent’s session, attach to the row to enter the full conversation. To compare agent view with subagents, agent teams, and worktrees, see [Run agents in parallel](</docs/en/agents>). Agent view runs sessions on your machine and you dispatch each one; to have Claude start and track parallel sessions in the cloud from one conversation instead, see [Projects](</docs/en/claude-projects>). Agent view is in research preview. The interface and keyboard shortcuts may change as the feature evolves. @@ -859,6 +859,7 @@ * [Cross-session messaging](</docs/en/cross-session-messaging>): have your sessions pass findings to each other * [Agent teams](</docs/en/agent-teams>): coordinate multiple sessions that message each other * [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>): run sessions in a managed cloud environment instead of locally + * [Projects](</docs/en/claude-projects>): have Claude coordinate parallel cloud sessions from one conversation and tell you which need you ##
modified Run agents in parallel View current →
--- a/agents.md +++ b/agents.md @@ -1,10 +1,11 @@ -[Subagents](</docs/en/sub-agents>), [agent view](</docs/en/agent-view>), [agent teams](</docs/en/agent-teams>), and [dynamic workflows](</docs/en/workflows>) each parallelize work in a different way. The right one depends on whether you want to stay in each conversation yourself, hand tasks off and check back later, or have Claude coordinate a group of workers for you. +Claude Code has five ways to work on several tasks at once: [subagents](</docs/en/sub-agents>), [agent view](</docs/en/agent-view>), [agent teams](</docs/en/agent-teams>), [dynamic workflows](</docs/en/workflows>), and [projects](</docs/en/claude-projects>). They differ in how involved you stay, from steering each conversation yourself to letting Claude coordinate a group of workers, and in whether the work runs on your machine or in the cloud. Approach| What it gives you| Use it when ---|---|--- [Subagents](</docs/en/sub-agents>)| Delegated workers inside one session that do a side task in their own context and return a summary| A side task would flood your main conversation with search results, logs, or file contents you won’t reference again [Agent view](</docs/en/agent-view>)| One screen to dispatch and monitor sessions running in the background, opened with `claude agents`. Research preview| You have several independent tasks and want to hand them off, check status at a glance, and step in only when one needs you [Agent teams](</docs/en/agent-teams>)| Multiple coordinated sessions with a shared task list and inter-agent messaging, managed by a lead. Experimental and disabled by default| You want Claude to split a project into pieces, assign them, and keep the workers in sync +[Projects](</docs/en/claude-projects>)| One ongoing conversation at claude.ai/code or in the desktop app. Claude starts parallel cloud sessions called threads, gives each one the project’s repositories, instructions, and memory, and shows you which ones need you. Public beta on Pro and Max| The work spans many tasks over days or weeks, should keep running when your machine is off, and you’d rather describe it once than dispatch and track each session [Dynamic workflows](</docs/en/workflows>)| A script that runs many subagents and cross-checks their results, for work too big to coordinate one turn at a time or that needs more than a single pass| A job outgrows a handful of subagents, or you want findings verified against each other: a codebase-wide audit, a 500-file migration, cross-checked research, or a plan drafted from several angles In every approach the workers are Claude sessions. To involve a different tool, expose it to Claude as an [MCP server](</docs/en/mcp>). Three more tools support this work without being a way to run agents themselves:
modified Claude Code on Amazon Bedrock View current →
--- a/amazon-bedrock.md +++ b/amazon-bedrock.md @@ -139,7 +139,7 @@ } } -As of Claude Code v2.1.181, the flat output from `aws configure export-credentials --format process` is also accepted, with the same keys at the top level instead of nested under `Credentials`. `Expiration` is optional. When the command returns a valid ISO 8601 `Expiration`, Claude Code caches the credentials until five minutes before that time. Without it, credentials are cached for one hour. When you configure `awsCredentialExport` without `awsAuthRefresh`, Claude Code uses the exported credentials directly and doesn’t re-resolve the AWS default credential provider chain at startup. Requires Claude Code v2.1.206 or later. +The flat output from `aws configure export-credentials --format process` is also accepted, with the same keys at the top level instead of nested under `Credentials`. `Expiration` is optional. When the command returns a valid ISO 8601 `Expiration`, Claude Code caches the credentials until five minutes before that time. Without it, credentials are cached for one hour. When you configure `awsCredentialExport` without `awsAuthRefresh`, Claude Code uses the exported credentials directly and doesn’t re-resolve the AWS default credential provider chain at startup. Requires Claude Code v2.1.206 or later. ###
modified Claude Code changelog View current →
Show diff (118 lines)
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,115 @@ This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Run `claude --version` to check your installed version. + +​ + +2.1.276 + +September 18, 2026 + + * Fixed every request failing with `400 … Input tag 'advisor_20260301'` when `ANTHROPIC_BASE_URL` points at a proxy or gateway (2.1.275 regression) + +​ + +2.1.275 + +September 17, 2026 + + * Added the signed-in account to Claude apps gateway sign-in: when the gateway names it, you confirm it before the credential is saved, and `/status` shows it + * Added a send-now key (ctrl+enter, or ctrl+x ctrl+s) that interrupts the current turn and sends all queued messages at once; sent and queued messages show in gray until the model receives them + * Added a startup warning when a configured `otelHeadersHelper` fails, so sessions that silently export no telemetry are noticed + * Added syncing of the skills and plugins enabled on your claude.ai account to terminal sessions signed in with it; opt out with `syncClaudeAiSkills: false` or `syncClaudeAiPlugins: false` + * Added `/plugin install <plugin> --marketplace <source>`, which offers to add the marketplace before installing the plugin + * Fixed a restored memory file’s age note changing between requests after a compaction or resume, which caused prompt cache misses + * Fixed `--forward-subagent-text` stream-json and SDK output dropping the messages of subagents spawned by a `context: fork` skill, and of forked skills invoked by a subagent or another forked skill + * Fixed @-mention file suggestions being buried below MCP resources when using a custom `fileSuggestion` command or typing `@.`/`@./` + * Fixed fullscreen mode placing background-task completion notices beneath a long turn’s collapsed tool row instead of where they arrived; each notice now closes the open row + * Fixed `claude plugin marketplace update` deleting a GitHub marketplace’s local copy when the fetch failed and the marketplace was named after its repository + * Fixed plugin and marketplace messages, logs and `claude plugin marketplace list` showing a password or token stored in a git, ssh or marketplace URL + * Fixed a resumed cloud session leaving an unanswered question open in the transcript after a queued message superseded it + * Fixed vim mode placing the cursor one character right after a dot-repeated ”!” or a fast-typed “i!” switched a non-empty prompt into shell mode + * Fixed fullscreen mode freezing or blanking for several seconds when scrolling up past a large file diff + * Fixed a stray `</ccmemory>`-style closing tag occasionally appearing in responses + * Fixed plugin messages, logs and the VS Code plugin dialog showing the wrong server for some git addresses + * Fixed a terminal `API Error: 400` on every turn for users behind a network gateway that rewrites API error responses when a beta request header is rejected + * Fixed sandboxed Bash commands on Linux reporting exit code 0 for failed commands when the shell is zsh + * Fixed the Read tool hanging instead of reporting an error when part of a large file could not be decoded under memory pressure + * Fixed `--resume`, the resume picker preview, resumed background agents and the transcript view failing on a session whose saved history contains a malformed task-reminder or @-file attachment entry + * Fixed a crash when resuming a conversation whose transcript contains a malformed message entry, and a fullscreen crash when such a conversation received new messages while scrolled up + * Fixed sessions failing to resume or start when their saved transcript contains a malformed message content block + * Fixed Grep, Glob and @-file suggestions hanging or running out of memory on searches over the 20MB output cap, and system ripgrep reporting “no matches” instead of an error after a flood of warnings + * Fixed `/rewind` in a forked or background session restoring a zero-filled or truncated file when the session’s file-history backups could not be fully copied + * Fixed fullscreen sessions sometimes exiting with “Claude Code exited after an unrecoverable interface error” when typing fast or holding a key with the slash-command dropdown open + * Fixed background sessions crashing and restarting their worker when a command fed through stdin ran on a machine that had run out of file descriptors + * Fixed a crash at launch when `~/.claude.json` holds a malformed `mcpNeedsAuthNoticed` value + * Fixed `--resume` and `--continue` dropping a conversation’s earlier thinking when a built-in tool it started with has since been switched off by a server-side flag + * Fixed text selected with the mouse in the fullscreen `claude --resume` session picker never reaching the clipboard + * Fixed plugin reload previews replacing a running session’s extracted plugin files when the plugin was loaded from a `--plugin-dir` or `--plugin-url` archive + * Fixed self-hosted runners with `--drain-wait-sec` losing the final result of a turn that finished during a SIGTERM drain; the runner now waits briefly for the turn to be reported + * Fixed `SubagentStop` hooks with a specific `matcher` firing for every stopping subagent whose agent type was empty + * Fixed sandboxed Bash commands being unable to write to project directories named `hooks/` or `config/` + * Fixed Artifact updates failing with “File not found” after a session resumes on another machine or its scratchpad is cleared: the page’s last published version is restored + * Fixed `/update-config` writing `Write(path)` permission rules, which file permission checks don’t match, instead of `Edit(path)` rules + * Fixed four dead documentation URLs (Pricing, Computer Use, Skills, CLI) in the bundled claude-api skill’s live-sources table + * Improved prompt caching for a `--system-prompt` that contains a `__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__` line: the text above it is now cached globally, as the SDK’s array form already is + * Improved the `/desktop` error when Claude Desktop does not open: it now says why and what to do next + * Improved the Artifact tool’s publish and read results: they now say who can open the page and what the owner’s Share menu offers + * Improved artifact publish results: they name the tab icon sent, warn when the page contains a NUL byte, and retry a flaky fetch of the newer page to merge after a stale publish + * Improved pasted and attached images: they are now saved where Claude can open them as files without a permission prompt, including in Desktop and VS Code + * Improved the Artifact tool’s guidance so Claude updates a shared artifact in place when you were given edit access to it, instead of publishing a separate copy + * Improved plan-usage reads: editor windows and non-interactive sessions on one machine now share a read made in the last minute instead of each calling the usage endpoint + * Improved the `ListPlugins` tool description so Claude knows it lists plugins enabled on your claude.ai account, not plugins installed locally with `/plugin` + * Improved responsiveness when the terminal is slow or paused: output no longer falls further behind while the terminal catches up + * Improved Write and Edit results for files in the synced account-skills folder: they now say the change is not saved to your account and how to save it + * Updated `/logout` for Claude apps gateway sign-ins to also end the session on gateways that advertise token revocation + * Changed hosted sessions to keep an unanswered permission prompt up after a container restart, instead of asking again + * Changed the Artifact tool to ask for a one-word tab icon on a first publish instead of an emoji favicon + * Changed Claude in Chrome in auto mode to skip the extension’s per-site check for classifier-approved calls, as bypass mode does, fixing `browser_batch` “Permission denied” after a redirect + * Changed plugins installed from an npm source to be fetched with `npm pack --ignore-scripts` and integrity-verified, so a package’s install scripts no longer run + * Changed scheduled and Run now routine runs to save data to, and republish the page of, an artifact you can edit without asking; public artifacts, first publishes and deletes still ask + * Removed the startup notice that told you a one-off scheduled routine had run since your last session + * [VSCode] Added viewing, editing and deleting a saved memory inside the Memory dialog + * [VSCode] Added sending an attached image without typing any text + * [VSCode] Added a Retry link to the MCP servers dialog when the server list fails to load + * [VSCode] Added accept and reject buttons under each change in the proposed-change diff tab, so an edit can be reviewed change by change + * [VSCode] Fixed the transcript creeping toward the bottom in small steps while a permission card waits and content keeps arriving + * [VSCode] Fixed rewound and forked conversations not keeping the permission mode you had picked for the original conversation + * [VSCode] Fixed an empty `CLAUDE_CONFIG_DIR` entry in the `environmentVariables` setting making Claude Code keep its files in the workspace + * [VSCode] Fixed plugin install links opening the Manage plugins dialog for plugin names and marketplace addresses that can’t be used in a link + * [VSCode] Fixed Remote Control staying shown as connected after a turn-off that Claude Code reported as failed; it now shows as off + * [VSCode] Fixed the scroll to the bottom on send stopping short of the reply when the reply starts arriving during the scroll + * [VSCode] Fixed the agent map showing agents a crash left unfinished as stopped instead of failed once the session is reopened + * [VSCode] Fixed the “Continuing the step” notice not appearing, and the continue limit resetting, after a reload that follows a crash with background tasks still running + * [VSCode] Fixed the session list showing when a session was last reopened, such as after a window reload, instead of when its last message was sent + * [VSCode] Fixed “Fork conversation from here” failing on the message right after one sent while Claude was working + * [VSCode] Fixed the prompt cache clock showing too few minutes after reopening a session with a message sent while Claude was working + * [VSCode] Fixed a background agent that finished while Claude was running a tool losing its completion notice, and its result on the agent map, after a window reload + * [VSCode] Fixed a rare case where text selected in a git-ignored file could be sent to Claude after the extension was unresponsive for several seconds + * [VSCode] Fixed renaming a running session reverting to the generated name (regression in 2.1.269) + * [VSCode] Fixed some claude.ai/code sessions opening in VS Code as an empty conversation with no messages + * [VSCode] Fixed slash commands typed while Claude is responding being sent to the model as text instead of running once the response finishes + * [VSCode] Fixed unreadable code in the plan preview and the Hooks and Permission rules dialogs with the High Contrast Light theme + * [VSCode] Fixed `/remote-control` being ignored while Remote Control is still connecting: running it again now turns Remote Control off immediately + * [VSCode] Fixed the conversation pulling you back to the bottom while a reply streams after you scroll up, and added a `claudeCode.scrollToBottomOnSend` setting to turn off the jump on send + * [VSCode] Fixed the Manage plugins dialog showing a password or token that was typed into a marketplace URL + * [VSCode] Improved the agent map: the pill counts running agents and turns red after a failure, the main agent stays in view while the map scrolls, and agents sort by state then end time + * [VSCode] Changed New session in a Claude editor tab to open in the sidebar when Preferred Location is set to Sidebar, instead of always opening another tab + * [VSCode] Changed a message sent while Claude is working to wait at the bottom of the conversation until Claude starts on it + * [Claude Code on the web] Added a “New routine” button to the page shown when a routine link no longer resolves, next to the link back to your routines list + * [Claude Code on the web] Fixed routine “paused” and “on hold” notifications being cut off mid-sentence; the paused-subscription notice now says to turn the routine back on yourself + * [Claude Code on the web] Fixed cloud environments with a very long allowed-domains list saving fine and then failing every session start; saving now fails up front and says how much to trim + * [Claude Code on the web] Fixed Claude’s guidance when a cloud session on a personal account is denied GitHub access: it now links to claude.ai/connect-github instead of an admin settings page + * [Claude Code on the web] Improved what Claude tells you when asked to edit, delete or run a routine it didn’t create: it now links to the routine’s page so you can do it yourself + * [Claude Tag] Added attach conditions for access bundles in Claude Tag settings: an Owner can let a bundle also apply in channels with guests or Slack Connect channels, not just member-only + * [Claude Tag] Added Amazon CloudWatch, CloudWatch Logs, Amazon SNS, Google Cloud Monitoring and Cloud Logging presets to an access bundle’s Credentials tab in Claude Tag admin settings + * [Claude Tag] Added Datadog presets for the US3, AP1, AP2 and US1-FED sites; new Datadog connections are now limited to Datadog’s read and query API routes + * [Claude Tag] Fixed S3 uploads from recent AWS CLI and SDK versions failing with a 502 error when sent through an AWS connection + * [Claude Tag] Fixed Claude treating a channel as inactive, and skipping untagged messages there, while it was still posting in that channel from a routine or a thread + * [Claude Tag] Fixed a thread’s “Claude [task]” display name reverting to plain “Claude” after the session behind that thread was refreshed or restarted + * [Claude Tag] Fixed the model you switched to in a Slack thread silently reverting to the channel’s default after that thread’s session was restarted or refreshed + * [Claude Tag] Fixed Claude sometimes replying twice when another app or bot @mentioned it in a top-level channel message + * [Claude Tag] Improved Claude’s notices in Enterprise Grid channels shared across workspaces: they now say when no workspace is set up yet, or why only organization defaults apply + * [Code Review] Fixed reviews occasionally dropping part of their analysis when one of the reviewing agents returned its findings in an unexpected format + * [Code Review] Fixed pull requests with more than 100 Claude reviews getting a full re-review on every clean merge from the base branch instead of the lighter merge-focused review ​
modified Channels reference View current →
--- a/channels-reference.md +++ b/channels-reference.md @@ -459,7 +459,7 @@ * Claude Code never masks a span that contains shell syntax, path characters, or URL characters. A mask can’t hide the command, file path, or destination being approved. * Claude Code doesn’t mask a secret that lacks a recognizable prefix, or a secret that spans whitespace, such as a private-key block. Both reach your server unmasked. -Masking doesn’t change who receives the fields. Whatever stays unmasked goes only to servers you opted in with `--channels` or the development flag. Treat both fields as untrusted unless you control the client fleet. The verdict your server sends back is `notifications/claude/channel/permission` with two fields: `request_id` echoing the ID above, and `behavior` set to `'allow'` or `'deny'`. Allow lets the tool call proceed; deny rejects it, the same as answering No in the local dialog. Neither verdict affects future calls. +Masking doesn’t change who receives the fields. Whatever stays unmasked goes only to servers you opted in with `--channels` or the development flag. Treat both fields as untrusted unless you control the client fleet. The verdict your server sends back is `notifications/claude/channel/permission` with two fields: `request_id` echoing the ID above, and `behavior` set to `'allow'` or `'deny'`. Allow lets the tool call proceed; deny rejects it. Neither verdict affects future calls. ###
modified Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry View current →
--- a/claude-apps-gateway.md +++ b/claude-apps-gateway.md @@ -370,7 +370,11 @@ Lock behavior across sources -Setting one lock doesn’t restrict the others; each key is documented in the [settings reference](</docs/en/settings-reference#all-settings>). From an admin source below the winner, the two sandbox locks still apply, and `allowManagedPermissionRulesOnly` still blocks parent-supplied allow rules and `additionalDirectories`. The hooks and MCP server locks, and `allowManagedPermissionRulesOnly`’s effect on the developer’s own rules, need the winning source by default; under the `managedSourcesBehavior` merge opt-in in [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>), Claude Code applies the strictest value any source sets for every lock. On [`policyHelper`](</docs/en/settings-reference#policyhelper>) fleets, the locks are read from the helper’s output alone. Each lock makes Claude Code ignore the developer’s own entries for that setting, so include your organization’s allowlists next to the locks. Locking network domains with an empty managed domain list blocks all sandboxed outbound traffic, and locking MCP servers with no managed or parent-supplied `allowedMcpServers` loads every server that `deniedMcpServers` doesn’t block. `allowRead` entries only re-allow paths inside `denyRead` regions, so pair them with a managed `denyRead`. +Setting one lock doesn’t restrict the others; each key is documented in the [settings reference](</docs/en/settings-reference#all-settings>). From an admin source below the winner, the two sandbox locks still apply, and `allowManagedPermissionRulesOnly` still blocks parent-supplied allow rules and `additionalDirectories`. On Claude Code v2.1.273 or later, the MCP server lock also applies from a source below the winner, and while it is on, the managed `allowedMcpServers` list comes from the highest-priority admin source that sets one. The hooks lock and `allowManagedPermissionRulesOnly`’s effect on the developer’s own rules need the winning source by default; under the `managedSourcesBehavior` merge opt-in in [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>), Claude Code applies the strictest value any source sets for every lock. On [`policyHelper`](</docs/en/settings-reference#policyhelper>) fleets, Claude Code reads the locks from the helper’s output alone. Each lock makes Claude Code ignore the developer’s own entries for that setting, so include your organization’s allowlists next to the locks: + + * **Network domains** : locking with an empty managed domain list blocks all sandboxed outbound traffic. + * **MCP servers** : locking with no `allowedMcpServers` in any admin source or in the parent-supplied settings loads every server that `deniedMcpServers` doesn’t block. + * **Read paths** : `allowRead` entries only re-allow paths inside `denyRead` regions, so pair them with a managed `denyRead`. #### @@ -378,10 +382,10 @@ Settings the locks don’t cover -Four parent-supplied settings pass the filter even with all five locks set. Under the default first-wins setting, the admin value that blocks the parent’s is the one in the highest-priority admin source. Under the `managedSourcesBehavior` merge opt-in, [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s value applies instead. +Four parent-supplied settings pass the filter even with all five locks set. Under the default first-wins setting, the admin value that blocks the parent’s is the one in the highest-priority admin source, except for `allowedMcpServers` while the MCP server lock is on. Under the `managedSourcesBehavior` merge opt-in, [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says which source’s value applies instead. * **`forceLoginOrgUUID`** : Claude Code honors a parent-supplied value when the highest-priority admin source doesn’t set an org UUID. Gateway sign-in doesn’t check this key, so it matters only for fleets that also use first-party Anthropic logins. An org UUID in the highest-priority admin source blocks the parent’s value and is the one Claude Code enforces, so set `forceLoginOrgUUID` there. - * **`allowedMcpServers`** : Claude Code honors a parent-supplied allowlist when the highest-priority admin source doesn’t set one, and `allowManagedMcpServersOnly` doesn’t block it, because the lock enforces whichever list wins as the managed value, including a parent-supplied list when the highest-priority admin source doesn’t set one. A list in the highest-priority admin source blocks the parent’s and is the list Claude Code enforces, so set `allowedMcpServers` there, next to the lock. Before v2.1.223, a value for either key in any admin source blocked the parent’s. + * **`allowedMcpServers`** : Claude Code honors a parent-supplied allowlist when no admin list is in force. `allowManagedMcpServersOnly` doesn’t block it, because the lock enforces whichever list wins as the managed value, including a parent-supplied one when no admin source supplies a list. A list in the highest-priority admin source blocks the parent’s and is the list Claude Code enforces, so set `allowedMcpServers` there, next to the lock. Before v2.1.223, a value for either key in any admin source blocked the parent’s. * **`availableModels`** : Claude Code honors a parent-supplied model list when the winning managed source doesn’t set one. If your fleet restricts models, set `availableModels` in the winning source. * **`strictPluginOnlyCustomization`** : this key passes the filter regardless of any lock, and it makes Claude Code ignore the developer’s own customization, including protective hooks. No lock blocks it.
modified Claude apps gateway deployment and operations View current →
--- a/claude-apps-gateway-deploy.md +++ b/claude-apps-gateway-deploy.md @@ -278,6 +278,7 @@ A developer’s requests fail with `Not signed in to the Cloud gateway — run /login.`| The machine’s managed settings set `forceLoginMethod: "gateway"` or `forceLoginGatewayUrl`, and the session has no gateway sign-in. A leftover claude.ai login doesn’t satisfy the requirement.| Have the developer run `/login` and complete the gateway sign-in. See also [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>). Claude Desktop reports that its bootstrap configuration couldn’t be fetched| `/user/bootstrap` returned 404: the policy matching the user doesn’t carry a `desktop` key, or no policy matched. The gateway’s audit log records each rejection as `desktop_bootstrap.denied` with the reason.| Add a `desktop` block to the policy that matches the user, or to the `match: {}` base layer; an empty `desktop: {}` suffices. See [Claude Desktop overlay](</docs/en/claude-apps-gateway-config#claude-desktop-overlay>). Startup shows `Gateway login is configured in managed settings, but this Claude Code build does not include Cloud gateway support.`| The installed Claude Code build predates gateway support| Have the developer update Claude Code to a release that includes Cloud gateway support +Startup exits with `Administrator policy requires a Cloud gateway sign-in on this machine`| The developer’s environment sets `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN`, their settings configure an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>), or an API key from an earlier Claude Console login is still saved| Have the developer clear each that applies: unset the variable, remove the `apiKeyHelper` entry, or run `claude auth logout` to remove the saved key. Then have them start `claude` and sign in with `/login`. See also [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>). Startup or `/login` reports `Claude Code may not be enabled for your organization` after a 403 on the managed settings load| The gateway, or something in front of it, answered the `/managed/settings` request with 403. The gateway’s own settings route never answers 403. The status comes from the [`access_control`](</docs/en/claude-apps-gateway-config#http-tuning>) IP checks or from a proxy or WAF in front of the gateway. The audit log records an IP-check denial as `access.denied` with the reason. The developer stays signed in.| Check the audit log for `access.denied` at the time of the failure and fix the `access_control` lists or the front end, then have the developer start `claude` again CLI `/login`: `Gateway hosts must be on your organization's private network; <host> resolves to the public (or unrecognized) address <ip>`| The gateway hostname resolves to at least one public IP address. Claude Code checks each resolved address and requires every one to be private. A common cause is a dual-stack name where one family resolves to a public address, including AWS internal dual-stack load balancers, which return public-range AAAA addresses.| Have the gateway name resolve only to private addresses on developer machines. For a dual-stack name, drop the public-range record or serve a separate internal-only DNS name. See the [private-network prerequisite](</docs/en/claude-apps-gateway#prerequisites>). If the address is public space your organization owns and uses internally, [declare that block](</docs/en/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own>) instead. CLI `/login`: `Gateway login would go through proxy <proxy>, which is not on a private network`| An `HTTPS_PROXY` or `HTTP_PROXY` applies to the gateway host and the proxy’s hostname resolves to a public address. A proxy whose host resolves only to private addresses is allowed and doesn’t trigger this error| Add the gateway host to `NO_PROXY` on the developer’s machine so the connection is direct, or use a proxy whose hostname resolves to private addresses. The message names the exact `NO_PROXY` entry to add
modified Use Claude Code in the cloud View current →
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -8,7 +8,7 @@ * **Terminal** : `claude --cloud` * **Routines** : [scheduled and triggered runs](</docs/en/routines>) each run as a cloud session -A session in your terminal, your IDE, or the Desktop app with **Local** selected runs on your own machine instead. To steer one of those local sessions from your phone or browser, use [Remote Control](</docs/en/remote-control>). +To have Claude start and keep track of many cloud sessions for one body of work, use a [project](</docs/en/claude-projects>). A session in your terminal, your IDE, or the Desktop app with **Local** selected runs on your own machine instead. To steer one of those local sessions from your phone or browser, use [Remote Control](</docs/en/remote-control>). New to cloud sessions? Start with [Get started](</docs/en/web-quickstart>) to connect your GitHub account and submit your first task. @@ -41,9 +41,9 @@ Method| How you connect| Repositories sessions can reach| Best for ---|---|---|--- **GitHub App**| Authorize the Claude GitHub App during [web onboarding](</docs/en/web-quickstart>)| Any public repository, and private repositories that the Claude GitHub App is installed on| Browser onboarding; teams that want Auto-fix -**`/web-setup`**| Run `/web-setup` in your terminal to send your local `gh` CLI token to your Claude account| Any repository your `gh` token can access, whether or not the App is installed| Individual developers who already use `gh` - -Installing the Claude GitHub App on a repository also enables Auto-fix for pull requests in it. For how `/schedule` checks repository access before creating a routine, see [Repositories and branch permissions](</docs/en/routines#repositories-and-branch-permissions>). See [Connect from your terminal](</docs/en/web-quickstart#connect-from-your-terminal>) for the `/web-setup` walkthrough, including what `/web-setup` stores and how to remove it. Quick web setup is an organization setting that lets members connect GitHub with `/web-setup`, skips the Claude GitHub App install prompt during browser onboarding, and has browser onboarding create the [**Default** environment](</docs/en/cloud-environments#the-default-environment>) for them instead of showing the environment form. On Team and Enterprise plans it’s off by default, which hides `/web-setup`. An [Owner](</docs/en/server-managed-settings#access-control>) turns it on with the **Quick web setup** toggle at [**Admin settings > Claude Code**](<https://claude.ai/admin-settings/claude-code>). +**`/web-setup`**| Run `/web-setup` in your terminal to send your local `gh` CLI token to your Claude account| Any repository your `gh` token can access, whether or not the Claude GitHub App is installed| Individual developers who already use `gh` + +Installing the Claude GitHub App on a repository also enables Auto-fix for pull requests in it. Threads in a [project](</docs/en/claude-projects>) need the Claude GitHub App installed on each repository they clone, whichever method you connected with. See [Set up GitHub access](</docs/en/claude-projects#set-up-github-access>). For how `/schedule` checks repository access before creating a routine, see [Repositories and branch permissions](</docs/en/routines#repositories-and-branch-permissions>). See [Connect from your terminal](</docs/en/web-quickstart#connect-from-your-terminal>) for the `/web-setup` walkthrough, including what `/web-setup` stores and how to remove it. Quick web setup is an organization setting that lets members connect GitHub with `/web-setup`, skips the Claude GitHub App install prompt during browser onboarding, and has browser onboarding create the [**Default** environment](</docs/en/cloud-environments#the-default-environment>) for them instead of showing the environment form. On Team and Enterprise plans it’s off by default, which hides `/web-setup`. An [Owner](</docs/en/server-managed-settings#access-control>) turns it on with the **Quick web setup** toggle at [**Admin settings > Claude Code**](<https://claude.ai/admin-settings/claude-code>). Organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled can’t use `/web-setup` or other cloud session features. @@ -200,13 +200,21 @@ ​ +Take back a queued message + +If you send a message while Claude is working, the message queues until Claude reads it. To take a queued message back, click the ✕ on it. The text returns to the message box so you can edit it or send something else. If Claude has already read the message, it stays in the conversation. + +### + +​ + Manage context Cloud sessions support [built-in commands](</docs/en/commands>) that produce text output. Commands that only run in the terminal interface, such as `/plugin` or `/resume`, aren’t available. Commands that open a picker or panel in the terminal behave differently in cloud sessions: * **`/model`, `/effort`, `/color`, and `/rename`**: pass the value as an argument, for example `/model sonnet`, instead of opening the terminal picker or slider. The argument forms require Claude Code v2.1.205 or later in the session’s environment and follow each command’s [availability notes](</docs/en/commands#all-commands>): `/effort` reports `Not applied` while a model’s [launch-default effort hold](</docs/en/model-config#adjust-effort-level>) is in force. * **`/fast`** : toggles [fast mode](</docs/en/fast-mode#use-fast-mode-in-cloud-sessions>) for the session when fast mode is [available on your account](</docs/en/fast-mode#requirements>). Requires Claude Code v2.1.271 or later in the session’s environment. - * **`/config`** : in your browser at claude.ai/code, opens the Claude Code section of your settings instead of setting a value, and text after the command, including `key=value`, is ignored. To change settings for a cloud session, use [environment variables](</docs/en/cloud-environments#set-environment-variables>) or commit [settings files](</docs/en/settings>) to the repository. + * **`/config`** : in your browser at claude.ai/code, opens the Claude Code section of your settings instead of setting a value, and text after the command, including `key=value`, is ignored. To change a setting for a cloud session, set an [environment variable](</docs/en/cloud-environments#set-environment-variables>) on the environment, or in a session with one repository, commit the key to that repository’s `.claude/settings.json`. [Settings in cloud sessions](</docs/en/settings#settings-in-cloud-sessions>) lists what each session reads. For context management specifically: @@ -396,6 +404,7 @@ Related resources * [Cloud environments](</docs/en/cloud-environments>): configure network access, environment variables, and setup scripts for cloud sessions + * [Projects](</docs/en/claude-projects>): one conversation where Claude coordinates parallel cloud sessions on your repositories and reports back * [Ultrareview](</docs/en/ultrareview>): run a deep multi-agent code review in a cloud sandbox * [Routines](</docs/en/routines>): automate work on a schedule, via API call, or in response to GitHub events * [Hooks configuration](</docs/en/hooks>): run scripts at session lifecycle events
modified Explore the .claude directory View current →
--- a/claude-directory.md +++ b/claude-directory.md @@ -125,6 +125,7 @@ `feedback-bundles/`| Redacted transcript archives written by `/feedback` on third-party providers or when no Anthropic credentials are configured, for sending to your Anthropic account team `feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>) awaiting your review in `/feedback`. Swept after `cleanupPeriodDays` or 30 days, whichever is shorter. When the queue is at its 10-draft limit, Claude Code deletes the oldest draft to make room. `usage-data/`| `report.html` and timestamped report copies written by [`/insights`](</docs/en/costs#analyze-your-usage-patterns>), plus cached per-session analysis data used to build them +`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins-reference#synced-plugins>) synced from claude.ai that Claude Code removed. Moved here instead of deleted so you can recover the files `todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory. Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule: @@ -230,6 +231,7 @@ `~/.claude/cache/changelog.md`| Nothing. Refreshed in the background. `~/.claude/policy-limits.json`| Nothing. Refreshed automatically. `~/.claude/tasks/`| Task lists that a resumed session would pick up +`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins-reference#synced-plugins>) that Claude Code removed `~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing `~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`| Nothing. Legacy directories not written by current versions.
added Let Claude coordinate ongoing work with Projects View current →
Show diff (579 lines)
--- a/claude-projects.md +++ b/claude-projects.md @@ -0,0 +1,576 @@ +Projects are in public beta on Pro and Max plans and rolling out gradually, starting with accounts that have used [cloud sessions](</docs/en/claude-code-on-the-web>) and don’t have existing projects in claude.ai chat or Cowork. They aren’t available on Team or Enterprise plans yet. If **Projects** doesn’t appear in the sidebar at [claude.ai/code](<https://claude.ai/code>) or in the Code tab of the [desktop app](</docs/en/desktop>), the rollout hasn’t reached your account, and you can [join the waitlist](<https://claude.com/form/projects>). [Run agents in parallel](</docs/en/agents>) lists what you can use in the meantime. + +A project is one ongoing conversation where Claude coordinates a stream of related work for you. You tell it what needs doing and it starts a thread for each task. Each thread is a [cloud session](</docs/en/claude-code-on-the-web>): Claude Code running in the cloud rather than on your machine. Threads run in parallel and keep going after you close the laptop, and you can check on them and steer them from your phone. Without a project, running several sessions means doing the coordinating yourself: you decide what each one works on, repeat the same background at the start of each, and check back to see which finished or needs an answer. With a project, you instead: + + * **Send work to one place** : paste a bug report, a stack trace, or a list of tasks into the conversation whenever one comes up. Claude starts a thread for each piece of work or passes it to the thread already working in that area, and answers quick questions in place. + * **Set context once** : every new thread starts with the project’s repositories, instructions, and memory, so a rule you state once, such as which branch to target, reaches all of them. + * **Walk away and come back to finished work** : when you come back an hour later or the next morning, the **Overview** pane shows which threads finished, which pull requests are ready for review, and which thread is waiting for your answer. + +If you already know the work you want a project to run, go straight to Create a project. + +## + +​ + +When to use a project + +A project is worth creating when the work has a goal that outlasts one session and keeps producing tasks. These kinds of work suit a project well: + + * **One goal across many repositories** : “Bring every service up to the new lint config.” Claude can run a thread per repository, each with its own pull request, and the **Overview** pane shows which ones are ready for review. + * **An area you keep feeding** : the bugs, stack traces, and review requests for one service, pasted into the conversation as they reach you. A pitfall you tell Claude to remember after one fix is in project memory for the next. + * **A build or migration bigger than a session** : “Build what `docs/spec.md` describes” or “Move the app off the deprecated ORM.” The work splits into threads that each take a part, decisions you ask Claude to remember early on reach the later threads, and the spec changes and bugs you find during the build go into the same conversation. + * **Work that isn’t code** : a folder of contracts or a support-ticket export you keep coming back to with new questions, such as “find the ten most common integration mistakes in these tickets.” Upload the documents instead of adding a repository, and threads deliver each write-up as a file on the project’s **Library** tab. + +In any of them you can send a batch of tasks, tell Claude to start without asking you to confirm, walk away, and find the threads that need you under **Waiting on you** when you’re back, or ask Claude to put part of the work on a schedule as a [routine](</docs/en/routines>). If one of these is your situation, create a project. + +### + +​ + +When something else fits better + +Threads work on GitHub repositories and on the files, folders, and Google Drive folders you upload to the project, not on files or tools that exist only on your machine. Something else fits better in these cases: + + * **One task that fits in a session** : “Fix the flaky login test.” Start a [cloud session](</docs/en/claude-code-on-the-web>) yourself. + * **Work that needs tools or services only your machine can reach** : a local database, a device emulator, an API behind your VPN. Use a local session, or [agent view](</docs/en/agent-view>) to run several at once. If the work only needs local files, upload them to the project instead. + * **One task that repeats on a schedule with no conversation around it** : “Post a dependency report every Monday.” Create a [routine](</docs/en/routines>) on its own. + * **Several people giving Claude work and steering it together in a Slack channel** : see [Claude Tag](<https://claude.com/docs/claude-tag/overview>). + +A project draws on the same plan limits as your other Claude Code sessions and uses them faster. Usage and cost covers what draws on your plan and how to keep it down. + +## + +​ + +How a project is organized + +A project is one coordinating conversation with Claude plus the threads it starts to do the work. These are its parts: + + * **The project conversation** : one long-running session where Claude acts as coordinator. It takes what you send, decides what becomes a thread, and keeps track of every thread it started. It sees what threads report back, not every step they take. + * **Threads** : the workers. Each is a separate [cloud session](</docs/en/claude-code-on-the-web>) with its own context window that does one piece of work on its own branch, opens a pull request when the work calls for one, and reports back to the conversation when it finishes. + * **What every thread starts with** : + * The project’s repositories and files, plus its instructions and memory + * The `CLAUDE.md`, skills, and plugins in each of the project’s repositories, and in a project with one repository, that repository’s permission rules and hooks too + * The connectors on your claude.ai account + * A cloud environment that sets its network access, environment variables, API credentials, and installed tools + * **The Overview pane** : where you see all the threads at once and which of them need you. Its other tabs are **Library** for the files you added and the files threads produced, **Pull requests** for the ones threads opened, and **Routines** for scheduled work in the project. + +Threads don’t pick up anything from the Claude Code setup on your own machine. Get skills, plugins, connectors, and tools into threads covers how to give them what they’d otherwise be missing. Here is how those parts connect, from you through the conversation to the threads doing the work, with **Overview** tracking their state: + +## + +​ + +Create a project + +You create and use projects at [claude.ai/code](<https://claude.ai/code>), in the Code tab of the desktop app, or in the Claude mobile app for [iOS](<https://apps.apple.com/us/app/claude-by-anthropic/id6473753684>) and [Android](<https://play.google.com/store/apps/details?id=com.anthropic.claude>). In the browser and the desktop app there are two ways to start a project: + + * **From scratch** , when you know the stream of work you want Claude to run: open the **New project** dialog and name it. Start a new project from scratch walks through the dialog. + * **From a cloud session that’s already doing the work** : choose **Continue as a project** from that session’s menu, and Claude proposes the project’s setup from what the session was doing. See Start from an existing cloud session. + +Either way, check the prerequisites first. + +### + +​ + +Check the prerequisites + +Before you create a project, check your plan, your GitHub setup, and what the work needs to reach: + + * **Plan** : you’re on Pro or Max and **Projects** shows in your sidebar. + * **GitHub, if the project will work on code** : your code is on github.com rather than GitHub Enterprise Server, GitLab, or Bitbucket, your connected GitHub account has push access to it, and the Claude GitHub App is installed on it. If you connected GitHub with [`/web-setup`](</docs/en/web-quickstart#connect-from-your-terminal>), that token lets your other cloud sessions reach a repository but isn’t enough for project threads, which need the Claude GitHub App. Set up GitHub access has the steps. + * **Network, credentials, and tools** : these come from the project’s cloud environment. The default environment already reaches [common package registries](</docs/en/cloud-environments#default-allowed-domains>), so check this only if the work needs other domains, a secret, or a tool that isn’t preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](<https://claude.ai/customize/connectors>). + +### + +​ + +Start a new project from scratch + +Starting a project from scratch means opening the **New project** dialog, naming the stream of work, and optionally giving it a goal and the repositories and files it works on. Only the name is required, so you can create the project first and fill in the rest as the work takes shape. + +1 + +Open Projects + +At [claude.ai/code](<https://claude.ai/code>) or in the Code tab of the desktop app, select **Projects** in the left sidebar, then select **New project**. In a browser you can also go straight to [claude.ai/code/projects/browse](<https://claude.ai/code/projects/browse>). + +2 + +Fill in the New project dialog + +Scope the project to one stream of work you’ll keep adding to, such as everything it takes to keep one API under its latency target. When to use a project has more examples. Then fill in the dialog’s fields: + + * **Name** : how the project appears in the **Projects** list. + * **Goal** (optional): one line of what you’re trying to get done, such as “Hold p95 API latency under 200 ms”. Claude in the conversation works toward it. Without a goal, Claude works from the tasks you send, and you can add a goal later in **Project settings > General**. + * **Context** (optional): the GitHub repositories this project works on, plus any files, folders, or Google Drive folders threads should read. Click **Add** for each. Add the repositories most tasks need rather than every one the work might touch; Decide which repositories to add covers the choice, and you can add more later in **Project settings > Environment**. + +Standing rules for how threads should work go in project instructions, which you set after the project exists. + +3 + +Create the project + +Click **Create project**. The project’s conversation opens with a message box at the bottom, where you describe work for Claude.On your first project, Claude takes a turn of its own as soon as the project is created, unless you send a message first. That turn uses your plan. In it, Claude may: + + * Start one thread that explores the repository without changing anything and proposes next steps, if the project has a repository it can read. + * Post **Setup recommendations** drawn from your recent cloud sessions: repositories to add, routines to create, and threads it could start. Every recommended repository and routine starts switched on. Switch off the ones you don’t want, then click **Update setup** to add the rest, or ignore the recommendations and describe work yourself. + +The project is now listed under **Projects** in the sidebar, and its conversation is open. Your first batch covers what to set up before you send it work. + +### + +​ + +Start from an existing cloud session + +If you already have a cloud session doing work that belongs in a project, open the session’s menu in the sidebar and choose **Continue as a project** or **Move to project** : + + * **Continue as a project** creates a new project named after the session and opens it. Claude reads the session and posts **Setup recommendations** in the conversation for you to confirm. The original session stays in your session list, and if it was in the middle of a turn it keeps running, so stop it yourself if you don’t want both working at once. If you use the **Set up project** banner that can appear above a cloud session’s message box instead, the result is the same, except that the session’s running turn stops once the project opens. + * **Move to project** brings the session’s work into an existing project. It posts a message in that project’s conversation asking Claude to read the session and pick up where it left off, and new work continues in the project’s own threads. The original session stays in your session list, unchanged. + +### + +​ + +Set up GitHub access + +Most GitHub setup happens once, not per project. You connect your GitHub account to Claude once, and the Claude GitHub App is installed once per repository, or once for a whole GitHub organization if you give it all repositories. You come back to these steps when you add a repository the Claude GitHub App doesn’t cover yet or one in a GitHub organization that enforces SSO. + +1 + +Connect your GitHub account + +If you haven’t used claude.ai/code before, your first visit walks you through connecting GitHub; see [Connect GitHub](</docs/en/web-quickstart#connect-github>). Otherwise use one of the [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>). + +2 + +Install the Claude GitHub App on the project's repositories + +Install the [Claude GitHub App](<https://github.com/apps/claude>) and grant it the repositories the project will use. On a repository owned by a GitHub organization, only an organization owner can complete the install; if you aren’t one, GitHub sends the owner an install request and the project can’t use the repository until they approve it. + +3 + +Authorize SSO for organizations that enforce it + +If a GitHub organization enforces SAML SSO, reconnect GitHub and authorize the Claude app for that organization. Until you do, that organization’s private repositories don’t appear in the **New project** dialog or **Project settings > Environment**. + +When one of these steps is incomplete, the **New project** dialog and the project page name the missing step and link to where you finish it. Finish the step there, then click **Check again** if the dialog offers it. If a repository is still missing from the list afterward, open the Claude GitHub App’s installation on GitHub, at [github.com/settings/installations](<https://github.com/settings/installations>) for a personal account, and confirm the repository is listed under **Repository access**. For the error messages a thread or the project reports when access is still wrong, see Repository access errors. + +## + +​ + +Work in a project + +Give Claude work through the project conversation: tasks one at a time or several at once, plus updates and loose thoughts as they come up. Claude routes each message, and threads do the work and report back. + +### + +​ + +Your first batch + +Before you send a new project a batch of work, set it up so the first threads come back the way you want: + + 1. Write project instructions: the brief every thread starts from, such as which branch to target, how a thread checks its work, and what needs your go-ahead. + 2. Send one small piece of the real work, or start one of the threads Claude suggested if it offered any, and open the thread when it finishes to see how it reports back and what it did on its branch. If it assumed something wrong or couldn’t reach what it needed, Threads guessed or stalled instead of asking covers where to fix that. + 3. Check **Thread model** and **Thread effort** in **Project settings > General**. A new project runs every thread on Opus at high effort, which draws on your plan fastest; Choose models and let Claude manage context covers the alternatives. + 4. Ask Claude to propose threads before starting them and to run a few at a time, and drop those limits once a few threads come back the way you want. + +### + +​ + +Send work and read results + +Claude decides where each message you send in the conversation goes: + + * A quick question usually gets an answer in the conversation. + * New work goes to a new thread or to a thread already working in that area, and Claude tells you which. Each new thread shows up under your message as a card: a box with the thread’s title and status, which you click to open the thread. + * Several unrelated tasks in one message become separate threads. + +If Claude routes something differently than you wanted, say so. Tune how Claude runs a project lists things you can tell it, such as reusing an existing thread for follow-ups or answering in place instead of starting a thread. A thread’s full results stay in the thread, and you open its card in the conversation to read them. Files a thread produced are also on the **Library** tab in **Overview**. Sometimes Claude proposes threads instead of starting them, in a **Suggested threads** list. Click the arrow on a suggestion to start that thread. When several are listed, a button under the list starts all of them. + +### + +​ + +Review a thread’s pull request + +When a thread changes code, this is what it does unless you tell it otherwise: + + * **Branch** : works on a new branch, started from the repository’s default branch. + * **Pull request** : opens one when you ask, and can open one on its own for a bug fix or another concrete change. + * **After it opens** : watches the pull request with [auto-fix](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>) turned on, whether or not auto-fix is on for your other cloud sessions. It pushes fixes when CI fails, addresses review comments, and replies in the thread when checks pass and the pull request is ready for you. + +When a thread has pushed a branch or opened a pull request, its card in the conversation can show a button for the next step: + + * **Resolve conflicts** , **Fix CI** , **Address comments** , and **Merge it** send that instruction to the thread as a message from you, so you can prompt the thread yourself instead of waiting for it to react to the pull request. + * **Review PR** opens the pull request on GitHub. + * **Create PR** appears when an idle thread has pushed a branch but hasn’t opened a pull request. Clicking it creates the pull request from that branch directly rather than sending the thread an instruction to open one. + +To change when threads open pull requests, for example only when you ask, or which branch they start from, say so in the task or in project instructions. + +### + +​ + +See what needs you in Overview + +The **Overview** pane beside the conversation tracks the project’s threads. It’s already open the first time you open a new project. The **Overview** button in the project header closes and reopens it, and shows a dot when a thread is waiting on you. In the desktop app, you also get a desktop notification when Claude posts in the conversation, a thread hits an error, or a thread needs your input, so you don’t have to keep the project open to find out. To also get one each time a thread finishes a turn, or to turn them off for a project, choose **Notifications** in the project’s sidebar menu. These notifications are desktop-only: in a browser, check the dot on the **Overview** button. The pane’s **Threads** tab groups threads by state: + +Group| What’s in it +---|--- +**Ready for review**| Threads whose pull request is open and awaiting review +**Waiting on you**| Threads that need your reply or approval, or that failed +**Working**| Threads still running +**Landing**| Threads whose pull request is approved or queued to merge +**Idle**| Threads that finished and aren’t waiting on anything +**Resolved**| Threads marked done: by you from the thread’s menu, by Claude once you’ve taken the last step, such as merging its pull request, or automatically after a week with no activity. You can reopen one from the same menu + +The pane’s other tabs are **Library** for the files and folders you added and the files threads produced, **Pull requests** once threads have opened any, and **Routines** for the [routines](</docs/en/routines>) Claude set up from this project. + +### + +​ + +Open a thread when you need control + +Click a thread’s card in the conversation or its row in **Overview** to open its transcript in the Overview pane. From there you can: + + * Read what Claude did, step by step. + * Steer the task by writing in the thread’s own message box. A message there goes straight to that thread, while a follow-up in the project conversation reaches it only when Claude matches the follow-up to that thread. + * Answer a permission prompt the thread is waiting on. + * Interrupt the thread with **Stop** , which replaces the send button while the thread is working, or by pressing Esc. + +### + +​ + +Choose models and let Claude manage context + +Set models and effort in **Project settings > General**. A new project runs Opus everywhere, with high [effort](</docs/en/model-config#adjust-effort-level>) for threads and low effort for the conversation: + + * **Thread model** and **Thread effort** apply to threads. To use a different model for one task, ask for it in the task; for a thread already running, use that thread’s model picker. + * **Coordinator model** and **Coordinator effort** apply to Claude in the project conversation. + +You don’t manage context windows in a project. Threads compact automatically, and the conversation works from recent messages, recent threads, and project memory rather than its full history, so it keeps going for as long as the project runs. Put anything that must never be dropped in project memory. If one thread outgrows its context, it shows Claude ran out of context on this turn. + +### + +​ + +Tune how Claude runs a project + +Tell Claude in the conversation how many threads to run at once, when to post updates, and when to open pull requests. If Claude is coordinating in a way you don’t want, say so. For example, you can say: + + * “Propose threads and wait for my go-ahead before starting them” or “Start these now without asking me to confirm” + * “Run at most two threads at a time” or “Reuse an existing thread for follow-ups in the same area” + * “Post shorter updates” or “Only post when something finishes or is blocked” + * “Give me a status update on every thread” + * “Do this task with a smaller model” + * “Don’t open a pull request until I’ve seen the plan” + * “Tell me what’s wrong in these repositories and don’t fix anything yet”, when you want to go through the findings before any of them becomes a thread + * “Answer that here instead of starting a thread”, when Claude starts a thread for something you meant as a quick question + +Claude saves preferences like these to project memory on its own and follows them in later threads. They’re instructions Claude keeps to, not enforced settings, so a thread limit you give this way isn’t a hard cap. Add one to project instructions when you want it worded exactly and applied to every thread from the start. + +### + +​ + +Unblock a thread waiting on approval + +Threads run in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) when the thread’s model supports it, so most tool calls run without asking you. When a thread needs your approval, the prompt is inside that thread and the thread waits until you answer it there. Telling Claude in the project conversation to go ahead doesn’t reach it. Each approval covers that prompt, or the rest of that thread if you choose the broader option. To let every thread run certain commands without asking, or to block some, add [permission rules](</docs/en/permissions>) to the repository’s `.claude/settings.json`. Threads apply them only in a project with one repository; see What threads pick up from your repositories. + +## + +​ + +Give a project standing context + +Project memory, project instructions, and the project’s repositories, files, and environment carry context across threads. You set each one once and it applies to every new thread. + +Context| What it carries| How you set it +---|---|--- +Project memory| Notes Claude keeps about the project, such as requirements, decisions, and pitfalls, stored as files. Every thread reads the index file `MEMORY.md` when it starts and opens the other files when it needs them| Ask Claude in the project conversation or any thread to remember a requirement, a decision, or a pitfall, or to forget one. Read, edit, and delete the files in **Project settings > Memory** +Project instructions| Text sent to each new thread and to Claude in the project conversation, up to 16,000 characters. Write project instructions covers what to put in it| **Project settings > Memory > Project instructions**, or ask Claude to change the instructions +Repositories, files, and environment| The repositories every thread clones, the folders and files every thread can read under `/mnt/project-files`, and the cloud environment threads run in| Repositories and environment in **Project settings > Environment**, or ask Claude in the conversation to add a repository to the project. Files and folders from **Add** on the **Library** tab in **Overview** + +**Project settings > Memory** lists these files under **Auto memory** , because Claude writes them itself as it works in the project. They’re separate from the [auto memory](</docs/en/memory>) Claude Code keeps on your machine, even though both use a `MEMORY.md` index. Project memory is also separate from the `CLAUDE.md` files in the project’s repositories. Each thread still reads those `CLAUDE.md` files from its clone when it starts, so put instructions about a repository in its `CLAUDE.md` and notes about the project in project memory. + +### + +​ + +Write project instructions + +Project instructions are the brief every new thread starts from. Click the gear icon in the project header to open **Project settings** , then go to **Memory > Project instructions**. A useful brief covers: + + * What the project is for + * Where the work happens: which repositories, which branch to start from, how to name pull requests + * How a thread checks its own work before calling it done + * What to do when something it needs is missing + * What needs your go-ahead first + +For example: + + This project holds p95 latency for the payments API under 200 ms: profiling, query and caching fixes, and the dependency upgrades that come with them, in the payments-api repository. + + - Branch from main and open one draft pull request per thread. + - Before you call work done, run `make test` and `make lint` and paste the summary lines in your final message. + - If you can't reach something you need, such as a repository, a secret, an API, or a connector, say exactly what's missing in your first message and stop. Don't substitute, mock, or guess. + - Don't merge, force-push, or change CI configuration without asking me in the thread. + +Rules about one repository, such as its build commands, belong in that repository’s `CLAUDE.md`, which every thread reads when the repository is part of the project. Once work is underway, when you correct a thread, also tell Claude to remember the correction: it goes into project memory and later threads start with it. + +### + +​ + +Decide which repositories to add + +The repositories you add to a project come with everything in them, their code, `CLAUDE.md`, and skills, in every thread. Repositories you don’t add are still within reach: a thread can add one to itself when its task needs it. Most projects use both: + + * **Add it to the project** , in the **New project** dialog, in **Project settings > Environment**, or by asking Claude in the conversation to add it to the project. Every thread from then on clones it and starts with its `CLAUDE.md` and skills loaded, whether or not the task touches it. Going from one repository to several also changes what threads take from each repository’s `.claude/settings.json`; see What threads pick up from your repositories. + * **Leave it off and let threads add it when needed.** A thread whose task needs a repository the project doesn’t have can add it to itself, and a note in the thread says it was added to this thread only. The clone happens partway through the task, so that repository’s `CLAUDE.md` and skills weren’t there when the thread started. The next thread starts without it again. A repository a thread adds needs the same prerequisites as a project repository: the Claude GitHub App installed on it and push access from your GitHub account. + +A project doesn’t need a repository at all. Its threads can still research, write documents, and write and run code in their own sandbox, and they deliver files to the **Library** tab. A thread there can also add a repository to itself when a task calls for one. Once the project has repositories, Claude can only add repositories from a GitHub owner the project already uses, whether it adds one to the project or a thread adds one to itself. To bring in a repository from a different owner, add it to the project yourself in **Project settings > Environment**. For a project that spans many repositories, such as one feature with server, web, mobile, and desktop code, add the one or two repositories nearly every task touches and name the others in project instructions so Claude knows where the rest of the code lives. Threads then start small and pull in the other repositories only for the tasks that need them. + +### + +​ + +What threads pick up from your repositories + +Each thread clones every repository in the project and loads `CLAUDE.md`, skills, and plugins from all of them. Permission rules, hooks, and `env` come only from the `.claude/settings.json` in the directory the thread starts in: inside the repository when the project has one, and above the clones when it has several, where no repository’s file is read for them. + +In each repository| One repository| Several repositories +---|---|--- +`CLAUDE.md`| Loaded when the thread starts| Loaded from every repository when the thread starts +Skills, agents, and commands under `.claude/`| Loaded| Loaded from every repository +Plugins enabled in `.claude/settings.json`| Loaded| Loaded from every repository. If two repositories disagree about a plugin, set it in **Project settings > Plugins**, which takes precedence +Permission rules, hooks, and `env` defined in `.claude/settings.json`| Apply to the thread, except the `env` keys that [no cloud session honors](</docs/en/cloud-environments#what-carries-over-from-your-setup>)| Don’t apply + +In a project with several repositories, each clone is attached to the thread as an [additional directory](</docs/en/memory#load-from-additional-directories>) with `CLAUDE.md` loading turned on, which is why every repository’s `CLAUDE.md` and skills load at start even though the thread starts above them. In either case, hooks that an enabled plugin provides still run, since plugins load from every repository. In a project with several repositories, put standing rules in project instructions and give threads environment variables through the cloud environment. + +### + +​ + +Choose an environment for threads + +Every new thread starts in the project’s [cloud environment](</docs/en/cloud-environments>). The environment sets which domains threads can reach, which environment variables they have, which API credentials are added to their requests, and what the setup script installs before Claude starts. Threads use a default Anthropic-hosted environment until you pick one in **Project settings > Environment**. If threads need to reach an internal API or a private package registry, or need a token your machine normally holds, change the environment rather than the project: see [Network access](</docs/en/cloud-environments#network-access>), [Add API credentials](</docs/en/cloud-environments#add-api-credentials>), and [Setup scripts](</docs/en/cloud-environments#setup-scripts>). + +### + +​ + +Get skills, plugins, connectors, and tools into threads + +Threads are cloud sessions, so they don’t have the skills, MCP servers, plugins, and tools installed only on your machine. To make each of these available to threads: + + * Skills, subagents, and commands: commit them to a repository you added to the project, for example a skill at `.claude/skills/<skill-name>/SKILL.md`. Each thread clones every repository in the project and loads `.claude/skills/`, `.claude/agents/`, and `.claude/commands/` from each of them, so a skill committed to one repository is available in every new thread. Threads also load the skills you enable for your claude.ai account. + * Plugins: add them in **Project settings > Plugins**; they load into each new thread. Plugins that a repository declares in its `.claude/settings.json` load too; see [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>). + * MCP servers: threads get their MCP tools from the connectors on your claude.ai account, which are MCP servers you connect once at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or through the **Manage connectors** link in **Project settings > Environment**. Every thread can use all of them with no per-project setup. The project conversation itself has no connectors, so send work that needs one as a task for a thread. In a project with one repository, threads also load MCP servers from that repository’s [`.mcp.json`](</docs/en/cloud-environments#what-carries-over-from-your-setup>). [How connectors reach Claude Code](</docs/en/mcp#how-connectors-reach-claude-code>) lists the rules for cloud sessions and the settings that turn connectors off. + * Command-line tools and packages: install them in the environment’s [setup script](</docs/en/cloud-environments#setup-scripts>). + +To see which connectors a running thread has at claude.ai/code, open the thread and select **Connectors** from the **+** menu beside its message box. Turning a connector off there removes it from that thread and saves that as your account default, so new threads and claude.ai chats start without it until you turn it back on. A thread picks up a connector you add or reconnect after the next message you send it. + +## + +​ + +Project settings reference + +You change project settings at claude.ai/code or in the desktop app, not in `settings.json`. Open **Project settings** from **Settings** in the project’s sidebar menu or from the gear icon in the project header. Settings save as you change them; a text field you’re editing, such as the goal or instructions, shows **Save changes** and **Discard** until you leave it. Changes to instructions, repositories, plugins, and environment in **Project settings** reach new threads, not threads already running. + +Setting| Section| What it controls +---|---|--- +Name, icon, and goal| General| The project’s name and icon in the sidebar, and its one-line goal +Coordinator model and effort| General| The model and [effort level](</docs/en/model-config#adjust-effort-level>) for Claude in the project conversation +Thread model and effort| General| The model and effort level for threads +Project instructions| Memory| Standing rules every new thread receives +Project repositories| Environment| The repositories new threads clone +Cloud environment| Environment| The cloud environment new threads run in +Connectors| Environment| A link to manage the claude.ai connectors threads get +Plugins| Plugins| The plugins that load into each new thread +Usage| Usage| Token use by thread and by model +Memory| Memory| The project’s memory files +Restart Claude| General| Restarts the project conversation when Claude stops responding there +Pause, Archive, Delete| General| Stops, hides, or removes the project; see Pause, archive, or delete a project + +### + +​ + +Pause, archive, or delete a project + +All three controls are at the bottom of **Project settings > General**: + + * **Pause** : stops everything at once. Every running thread and the conversation are interrupted, no new threads start, routines don’t run, and the project doesn’t accept messages until you resume it. Click **Resume** in the same place or on the banner above the project’s message box; a paused thread continues when you send it a message after that. + * **Archive** : hides the project from the sidebar and archives its threads, which stops any thread that was running or watching a pull request. Routines in the project don’t run while it’s archived. To bring the project back, open it from the Projects page and click **Unarchive**. Its threads stay archived until you unarchive them individually from the session list. + * **Delete** : permanently removes the project along with its threads, its memory, and its files, and turns off the project’s routines. This can’t be undone. Branches and pull requests the threads pushed to GitHub aren’t affected. + +## + +​ + +Usage and cost + +Project usage counts against the same [plan limits](</docs/en/errors#youve-hit-your-session-limit>) as your other Claude Code sessions, and a project can’t spend past those limits on its own. A thread that reaches your plan’s limit waits and continues on its own when the limit resets, so work you left running starts using your next usage window without a message from you. A thread hit the usage limit covers what you see, how to stop it, and the one case that doesn’t wait. Work goes past your plan’s limits only if you have turned on [usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>) for your account. A thread can’t turn them on for you. + +### + +​ + +What draws on your plan + +A project uses your limits faster than a single session does, and on a Pro plan in particular you should expect to reach your limit sooner on days you run one. These are the parts of a project that use your plan: + + * **Running threads** : each is a full session, and several can run at once. There’s no fixed number; Claude starts as many as the work calls for, and a limit you ask for is a preference rather than a cap. The enforced limit is 200 new threads per day across your projects. + * **The conversation** : Claude uses tokens of its own reading what threads report and deciding what to do next. + * **Threads watching a pull request** : an idle thread wakes up and uses your plan again when CI fails or a review comment arrives on its pull request. To stop that, ask in the thread for it to stop watching the pull request. + +A project with no running threads, no watched pull requests, and no new messages doesn’t use your plan while it sits idle, and neither does an archived project. + +### + +​ + +See and reduce a project’s usage + +Open **Usage** in **Project settings** to see token use by thread and by model, and how much went to the project conversation. To bring it down: + + * A follow-up routed to a thread that has been idle longer than the [cache lifetime](</docs/en/prompt-caching#cache-lifetime>), an hour on Pro and Max within your plan’s limits, re-reads that thread’s whole conversation before doing anything. For new work, asking Claude to start a fresh thread can use less than reviving a large old one. + * For work that doesn’t need the largest model, choose a smaller model or a lower effort level for threads, the conversation, or both. + * Ask Claude in the project conversation to run fewer threads at a time, or to answer small questions itself instead of starting a thread. + +## + +​ + +How projects relate to other Claude Code features + +Several Claude Code features let more than one session work at the same time, so running work in parallel is not by itself what a project is for. In a project, Claude starts and tracks the sessions instead of you, each one starts from the same repositories, instructions, and memory, and the work lives in the cloud for as long as it lasts. This is how each neighboring feature connects to a project: + + * **Claude Tag** : [Claude Tag](<https://claude.com/docs/claude-tag/overview>) is Claude in your team’s Slack channels, on Team and Enterprise plans. Anyone in a channel can give it work, everyone in the channel sees and steers it, and it uses connections an admin set up for that channel. A project is yours alone: you’re the only one who sends it work or sees its threads, it uses your own GitHub access and connectors, and it’s on Pro and Max. [How Claude Tag differs from Cowork and Claude Code](<https://claude.com/docs/claude-tag/concepts/how-it-works#how-claude-tag-differs-from-cowork-and-claude-code>) has the side-by-side. + * **Cloud sessions** : every thread is a [cloud session](</docs/en/claude-code-on-the-web>), started and tracked by Claude instead of by you. A cloud session you started yourself can become a project or feed one through **Continue as a project** or **Move to project**. + * **Routines** : when you ask for scheduled work in a project, Claude creates a [routine](</docs/en/routines>) that runs as threads in that project and appears on its **Routines** tab. Routines you create outside a project keep working on their own. + * **Local sessions and agent view** : sessions in your terminal, IDE, or the desktop app’s local environment run on your machine and can’t be part of a project. [Agent view](</docs/en/agent-view>) is a screen for tracking several of those local sessions; it has no coordinator. + * **Worktrees** : a [worktree](</docs/en/worktrees>) gives each local session its own working copy of a repository so parallel sessions on your machine don’t overwrite each other. Threads don’t need them: each thread clones its repositories into its own cloud sandbox and works on its own branch. + * **Agent teams** : an [agent team](</docs/en/agent-teams>) is one session that starts teammate sessions for a single task, on your machine or inside a cloud session, and ends with that task. + * **Projects in claude.ai chat and Cowork** : the [earlier Projects experience](<https://support.claude.com/en/articles/9517075-what-are-projects>), which groups conversations and reference files without threads or a coordinator. Those projects keep working as they do today until the redesigned experience reaches them. + +[Run agents in parallel](</docs/en/agents>) compares these options side by side. + +## + +​ + +Limitations + + * Projects are available at claude.ai/code, in the desktop app, and in the Claude mobile app, not in the terminal CLI or through Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. The CLI’s [`claude project`](</docs/en/cli-reference>) command, which manages local Claude Code state for a directory, is unrelated. + * Project threads are [cloud sessions](</docs/en/claude-code-on-the-web>) with Anthropic as the model provider. [Security](</docs/en/security>) and [Data usage](</docs/en/data-usage>) cover how cloud sessions are isolated and what’s retained. + * A local session can’t be part of a project. + * A thread’s sandbox pauses between turns and resumes when the thread continues. If the sandbox can’t be resumed, the thread continues from a fresh clone, so uncommitted changes can be lost. On long tasks, ask Claude to commit and push work in progress. + * A project belongs to one user. You can’t share a project or its threads with another user, and thread transcripts don’t have the share option other cloud sessions have. There are no organization-level controls for projects during the beta. + * A thread belongs to the one project that started it. You can’t move or copy a thread to another project, or move it out to stand alone. **Move to project** goes the other way only: it brings a cloud session’s work into a project. + +## + +​ + +Troubleshooting + +For the GitHub setup prompts in the **New project** dialog, see Set up GitHub access. + +### + +​ + +A thread looks stuck + +Claude doesn’t post each step a thread takes, so a thread that shows as running with no new messages in the project conversation is usually still working. A new thread also provisions its [cloud environment](</docs/en/cloud-environments>) before Claude begins, so its first update takes a moment. Open the thread to read its transcript. If the thread is waiting on a permission prompt, answer it there. + +### + +​ + +Threads guessed or stalled instead of asking + +When several threads come back having assumed something wrong, worked around missing access, or stopped with “blocked”, the cause is usually the same gap in the project’s setup rather than a problem with each task. Sort out which threads are sound before you fix anything: + + 1. Ask Claude in the conversation: “For every open thread, list what you asked it to do, what it assumed or couldn’t reach, and what it’s waiting on.” Claude reads each thread and answers in the conversation. + 2. For threads that started from a wrong assumption, open the thread from **Overview** and mark it resolved from its menu, or tell it what to do instead in its message box. Its branch and any pull request stay on GitHub until you delete them. + 3. Fix the gap once, in project instructions or the environment, then send one thread before sending the rest of the work again as new threads. + +### + +​ + +Claude hasn’t responded + +The project conversation shows a “Claude hasn’t responded” banner when Claude is running but its replies aren’t reaching the project. Click **Restart Claude** on the banner, or go to **Project settings > General** and click **Restart** in the **Restart Claude** row. Claude reconnects to the conversation; any reply it was in the middle of writing is lost, and threads aren’t affected. + +### + +​ + +Repository access errors + +Three messages mean a thread or the project can’t reach one of its repositories. A project thread needs the GitHub prerequisites even when your other cloud sessions clone the same repository without trouble. + + * **“Couldn’t start the session — Claude doesn’t have GitHub access to this project’s repository”** , reported before the thread starts, when the Claude GitHub App isn’t installed on that repository, is suspended, or isn’t linked to the GitHub account you connected. + * **“Unable to access your repository”** , reported by a thread when its clone fails: GitHub rejected the clone, the repository wasn’t found under the name the project has, or the branch the thread was asked to start from doesn’t exist. + * **“Claude can’t access” a repository** , shown when you save repositories in the **New project** dialog or **Project settings**. The message continues with an install link and a reconnect link. Use the install link if the Claude GitHub App isn’t on that repository, and the reconnect link if it is, since the GitHub App can be installed on GitHub without being linked to the account you connected to Claude. If the message says the GitHub App is suspended or doesn’t include this repository, follow its link to GitHub to fix that. + +To fix any of them, click the button the message offers, such as **Install GitHub App** or **Select repositories on GitHub** , then **Check again**. When the block is on the GitHub organization’s side, such as an owner who hasn’t approved the app or an IP allow list that excludes Claude, the message shows a **See how to fix** link instead. If there’s no button, follow Set up GitHub access, then send another message to retry. + +### + +​ + +A thread hit the usage limit + +When a thread or the project conversation reaches your plan’s five-hour or weekly limit, it keeps retrying on its own and continues when the limit resets. While it waits, the thread shows **Service is busy** with “Claude is still retrying and will continue automatically.” You don’t need to do anything for the work to continue. If you’d rather it not use your next usage window, click **Stop** in the thread, or pause the project to hold every thread. A thread that a routine started doesn’t wait: its turn stops with a limit error, and you send it a message after the limit resets. [Usage limit errors](</docs/en/errors#youve-hit-your-session-limit>) explain the limits and when they reset. + +### + +​ + +Additional usage credits are required + +A thread or the project conversation made a request your plan covers only with usage credits, such as one to a model or context size your plan doesn’t include, and usage credits aren’t turned on for your account. [Add usage credits to your subscription](</docs/en/costs#add-usage-credits-to-your-subscription>) covers who can turn them on or buy them on each plan. Once credits are available, send another message to retry. + +### + +​ + +Other messages + +These messages name their own cause. The table gives the next step for each. + +Message| What to do +---|--- +”Unable to connect to repository” with “Claude couldn’t reach GitHub to fetch your repository”| Wait a moment, then send another message to retry +”Unable to connect to repository” with “Claude couldn’t access your repository or environment”| Your GitHub account needs push access to the repository, and the environment must still exist. Check both in **Project settings > Environment**, then retry +”Couldn’t show the setup proposal”| The app you have open is older than the **Setup recommendations** Claude sent. Refresh the page or restart the desktop app, or ask Claude to propose the setup again +”The project’s environment was removed”| Choose a different environment in **Project settings > Environment**; the change applies to new threads +”Setup script failed”| Click **Edit setup script** on the error, fix the script in the environment, then send another message. [Setup script failed](</docs/en/web-quickstart#setup-script-failed>) lists common causes +”Claude ran out of context on this turn”| The thread filled its context window. If the message says the thread continues in a fresh session, it carries on by itself; otherwise ask Claude in the project conversation to start a new thread for the remaining work +”Reached the turn limit”| The thread reached the cap on agentic turns that [`CLAUDE_CODE_MAX_TURNS`](</docs/en/env-vars>) sets. Send another message to continue, or raise or remove that variable where it’s set + +## + +​ + +Related resources + + * [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>): how the cloud sessions behind each thread work, including GitHub access options and auto-fix on pull requests + * [Configure cloud environments](</docs/en/cloud-environments>): change what threads can reach on the network, give them environment variables and API credentials, and install tools with a setup script + * [Automate work with routines](</docs/en/routines>): schedules, triggers, and management for routines, including the ones Claude creates from a project + * [Manage multiple agents with agent view](</docs/en/agent-view>): run and track several sessions on your own machine when the work needs tools or services only your machine can reach + * [Projects redesigned: from folder to conversation](<https://claude.com/blog/projects-redesigned>): the launch announcement, with the thinking behind making a project a conversation with Claude
modified Configure cloud environments View current →
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -23,7 +23,7 @@ With only **Default** available, every session runs in it. When you have more than one environment, sessions choose one per surface: - * In the Desktop app, the mobile app, and at claude.ai/code, sessions use the environment shown in the selector. An organization default set by an Owner fills the selection when you haven’t picked one. + * In the Desktop app, the mobile app, and at claude.ai/code, sessions you start yourself use the environment shown in the selector. An organization default set by an Owner fills the selection when you haven’t picked one. Threads in a [project](</docs/en/claude-projects#project-settings-reference>) use the environment set in the project’s settings instead. * From the CLI, Claude Code uses your `/remote-env` pick, or falls back to the Anthropic-hosted environment when your list has one, and otherwise to the first environment in your list that isn’t a bridge environment, an entry [Remote Control](</docs/en/remote-control>) registers to represent your own machine rather than a cloud environment. For a [self-hosted environment](</docs/en/self-hosted-environments>), passing `--environment <environment-id>` with its `ccpool_` ID [when you dispatch a session](</docs/en/self-hosted-environments-testing#run-the-test-loop>) overrides the `/remote-env` pick and the fallback for that invocation. Claude Code rejects Anthropic-hosted `env_` IDs passed to the flag, so use `/remote-env` to target those. The flag requires Claude Code v2.1.224 or later. Configure an environment when the default isn’t enough: when Claude needs to reach domains outside the default allowlist, needs environment variables set for its sessions, or needs dependencies installed before it starts working. @@ -188,7 +188,7 @@ Each environment sets one network access level, which controls the outbound connections its sessions can make. The default level, **Trusted** , allows package registries and other allowlisted domains; **Custom** takes your own domain list. To change an environment’s network access, open it for editing and use the **Network access** selector in the dialog. The cloud icon that opens the selector appears on the app surfaces listed under The Default environment and in the [routine editor](</docs/en/routines#environments-and-network-access>); personal environments don’t have a separate page in your claude.ai account settings. -MCP connectors you enable on a session or routine work without adding their hosts to **Allowed domains** , because connector traffic travels through Anthropic’s servers rather than the session’s network. You configure connectors per session or per routine; remove any you don’t need to limit which tools Claude can reach. This relies on the same Anthropic-bound channel noted under [Security and isolation](</docs/en/claude-code-on-the-web#security-and-isolation>). +MCP connectors you enable on a session or routine 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. ### @@ -229,7 +229,7 @@ * **Sessions in this environment open another organization’s public artifacts** : Claude Code fetches those from the host directly, so add it to this list. * **You’re configuring the local CLI or a self-hosted runner** : keep the host in that allowlist. See [network access requirements](</docs/en/network-config#network-access-requirements>) and the self-hosted [network requirements](</docs/en/self-hosted-environments-deploy#network-requirements>). -Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. [Server-managed settings](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. +Each environment has its own allowed-domains list; there’s no organization-level allowlist that admins can push to every member’s environments. [Server-managed settings](</docs/en/server-managed-settings>) still apply inside cloud sessions, but none of them adds domains to the environment’s network allowlist. To give a team one standard list, an Owner can create an organization-shared environment with **Custom** network access and that list. ### @@ -281,8 +281,8 @@ | Available in cloud sessions| Why ---|---|--- Your repo’s `CLAUDE.md`| Yes| Part of the clone -Your repo’s `.claude/settings.json` hooks| Yes| Part of the clone -Your repo’s `.mcp.json` MCP servers| Yes| Part of the clone +Your repo’s `.claude/settings.json` hooks and permission rules| Yes, in a session with one repository| Part of the clone. A session with several repositories, including a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) thread, starts above the clones and doesn’t read them +Your repo’s `.mcp.json` MCP servers| Yes, in a session with one repository| Part of the clone, found from the session’s working directory Your repo’s `.claude/rules/`| Yes| Part of the clone Your repo’s `.claude/skills/`, `.claude/agents/`, `.claude/commands/`| Yes| Part of the clone Plugins declared in `.claude/settings.json`| Yes| Installed at session start from the [marketplace](</docs/en/plugin-marketplaces>) you declared. Requires network access to reach the marketplace source @@ -290,7 +290,7 @@ Your user `~/.claude/CLAUDE.md`| No| Lives on your machine, not in 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 Plugins enabled only in your user settings| No| User-scoped `enabledPlugins` lives in `~/.claude/settings.json`. Declare them in the repo’s `.claude/settings.json` instead, or enable them for your claude.ai account so Claude Code loads them as [synced plugins](</docs/en/plugins-reference#synced-plugins>) -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 +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 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| On Pro and Max plans, as API credentials| 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, or any key on a Team or Enterprise plan, 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 @@ -492,6 +492,7 @@ SessionStart hooks behave the same in the cloud as locally, with these caveats: + * **One repository per session** : a session with several repositories doesn’t load hooks from any repository’s `.claude/settings.json`, so a SessionStart hook you define there doesn’t run. Install dependencies for those sessions with a setup script instead. * **No cloud-only scoping** : hooks run in both local and cloud sessions. To skip local execution, exit early unless the `CLAUDE_CODE_REMOTE` environment variable is `true`, the way the dependency install script does. * **Requires network access** : install commands need to reach package registries. If your environment uses **None** network access, these hooks fail. The default allowlist under **Trusted** covers npm, PyPI, RubyGems, and crates.io. * **Proxy compatibility** : in Anthropic-hosted environments, all outbound traffic passes through a security proxy, and some package managers don’t work correctly with it; Bun is a known example. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic goes through your own network boundary instead.
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -46,7 +46,7 @@ `/code-review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [pr#|branch|path]`| **[Skill](</docs/en/skills#bundled-skills>).** Review the current diff, or a PR number, branch, or path you pass, for correctness bugs and cleanup opportunities. Pass `--fix` to apply findings, `--comment` to post them on the GitHub PR or GitLab merge request, or `ultra` to run a deep [cloud review](</docs/en/ultrareview>). Posting to a GitLab merge request requires Claude Code v2.1.257 or later. With `ultra` on a `github.com` PR target, pass `--post` to preselect [posting the finished findings to the PR](</docs/en/ultrareview#post-findings-to-the-pull-request>) in the launch dialog; `--post` requires Claude Code v2.1.227 or later. See [Review a diff locally](</docs/en/code-review#review-a-diff-locally>) for the effort levels, targeting, and how it relates to `/simplify`. Alias: `/review` `/color [color|default]`| Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset, or run with no argument to pick a random color. When [Remote Control](</docs/en/remote-control>) is connected, the color syncs to claude.ai/code. Also available in non-interactive mode (`-p`); requires Claude Code v2.1.205 or later `/compact [instructions]`| Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary. See [how compaction handles rules, skills, and memory files](</docs/en/context-window#what-survives-compaction>) -`/config [key=value ...]`| Open the [Settings](</docs/en/settings>) interface to adjust theme, model, [output style](</docs/en/output-styles>), and other preferences. From v2.1.181, pass one or more `key=value` pairs to set a setting directly without opening the interface, for example `/config thinking=false`. From v2.1.182, named shorthand keys are also accepted, such as `/config theme=dark` or `/config model=sonnet`. The `key=value` form also works in non-interactive mode (`-p`) and from the Claude mobile app via [Remote Control](</docs/en/remote-control>). The `key=value` form can’t turn on a setting that needs your confirmation in the panel, such as [`autoContinueAtUsageLimit`](</docs/en/interactive-mode#turn-automatic-continue-off>), though it can turn one off. Run `/config --help` to list the keys it accepts. Alias: `/settings` +`/config [key=value ...]`| Open the [Settings](</docs/en/settings>) interface to adjust theme, model, [output style](</docs/en/output-styles>), and other preferences. Pass one or more `key=value` pairs to set a setting directly without opening the interface, for example `/config thinking=false`. From v2.1.182, named shorthand keys are also accepted, such as `/config theme=dark` or `/config model=sonnet`. The `key=value` form also works in non-interactive mode (`-p`) and from the Claude mobile app via [Remote Control](</docs/en/remote-control>). The `key=value` form can’t turn on a setting that needs your confirmation in the panel, such as [`autoContinueAtUsageLimit`](</docs/en/interactive-mode#turn-automatic-continue-off>), though it can turn one off. Run `/config --help` to list the keys it accepts. Alias: `/settings` `/context [all]`| Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings. When the conversation exceeds the context window, the output includes a [warning](</docs/en/errors#context-exceeds-the-token-limit>) showing how far over the limit you are and which command frees space. In [fullscreen mode](</docs/en/fullscreen>), `/context` collapses the per-item breakdown to keep the grid visible. Pass `all` to expand it `/copy [N]`| Copy the last assistant response to clipboard. Pass a number `N` to copy the Nth-latest response: `/copy 2` copies the second-to-last. When code blocks are present, shows an interactive picker to select individual blocks or the full response. Press `w` in the picker to write the selection to a file instead of the clipboard, which is useful over SSH `/cost`| Alias for `/usage` @@ -86,6 +86,7 @@ `/memory`| Edit `CLAUDE.md` files, enable or disable [auto memory](</docs/en/memory#auto-memory>), and view auto memory entries `/mobile`| Show QR code to download the Claude mobile app. Aliases: `/ios`, `/android` `/model [model]`| Switch the AI model and save it as your default for new sessions. For models that support it, use left/right arrows to [adjust effort level](</docs/en/model-config#adjust-effort-level>). With no argument, opens a picker; press `s` on a row to switch for the current session only. See [when Claude Code asks you to confirm the switch](</docs/en/prompt-caching#switching-models>). Once you confirm the switch, if Claude Code asks, Claude Code applies the change without waiting for the current response to finish. Before v2.1.242, Claude Code decided from a feature flag it fetched from Anthropic whether to run the command mid-turn or queue it until the turn finished, and always queued it in a session that doesn’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), such as on a [third-party provider](</docs/en/third-party-integrations>). Also available in non-interactive mode (`-p`) with a model argument instead of the picker, where it applies to the current session only and isn’t saved as your default; requires Claude Code v2.1.205 or later +`/output-style [style]`| List [output styles](</docs/en/output-styles>) or switch to one, for example `/output-style concise`. See [Change your output style](</docs/en/output-styles#change-your-output-style>). Requires Claude Code v2.1.269 or later `/passes`| Share a free week of Claude Code with friends. Only visible if your account is eligible `/permissions`| Manage allow, ask, and deny rules for tool permissions. Opens an interactive dialog where you can view rules by scope, add or remove rules, manage working directories, and review [recent auto mode denials](</docs/en/auto-mode-config#review-denials>). You can also view and edit [auto mode classifier rules](</docs/en/auto-mode-config#edit-rules-from-permissions>) from the dialog’s **Auto mode** tab. When you run it while Claude is responding, Claude Code opens the dialog immediately and applies your changes starting with Claude’s next tool call in the same turn. Before v2.1.234, Claude Code queued the command until the turn finished. Alias: `/allowed-tools` `/plan [description]`| Enter plan mode directly from the prompt. Pass an optional description to enter plan mode and immediately start with that task, for example `/plan fix the auth bug`
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -368,7 +368,7 @@ Session isolation requires [Git](<https://git-scm.com/downloads>). Most Macs include Git by default. Run `git --version` in Terminal to check; if it prints a version number, Git is installed. If you run into Git errors, ask Claude in the [Cowork tab](<https://claude.com/product/cowork>) to help troubleshoot your setup. -Use the controls at the top of the sidebar to filter sessions by status, project, or environment, and to group sessions by project. To rename a session, click the session title in the toolbar at the top of the active session. To check context usage, see Check usage. When context fills up, Claude automatically summarizes the conversation and continues working. You can also type `/compact` to trigger summarization earlier and free up context space. See [the context window](</docs/en/how-claude-code-works#the-context-window>) for details on how compaction works. The desktop app sends an OS notification when a Code session finishes a task and you aren’t currently viewing that session. +Use the controls at the top of the sidebar to filter sessions by status, project, or environment, and to group sessions by project. To rename a session, click the session title in the toolbar at the top of the active session. To check context usage, see Check usage. When context fills up, Claude automatically summarizes the conversation and continues working. You can also type `/compact` to trigger summarization earlier and free up context space. See [the context window](</docs/en/how-claude-code-works#the-context-window>) for details on how compaction works. The desktop app sends an OS notification when a Code session finishes a task and you aren’t currently viewing that session. For sessions that belong to a [project](</docs/en/claude-projects#see-what-needs-you-in-overview>), you get the project’s notifications instead. ### @@ -407,7 +407,7 @@ Run long-running tasks in the cloud -For large refactors, test suites, migrations, or other long-running tasks, select **Cloud** instead of **Local** when starting a session. Cloud sessions run on Anthropic-managed infrastructure by default and continue even if you close the app or shut down your computer. Check back anytime to see progress or steer Claude in a different direction. You can also monitor cloud sessions from [claude.ai/code](<https://claude.ai/code>) or the [Claude mobile app](</docs/en/mobile>). Cloud sessions also support multiple repositories. After selecting a cloud environment, click the **+** button next to the selected repository to add more repositories to the session. Each repo gets its own branch selector. This is useful for tasks that span multiple codebases, such as updating a shared library and its consumers. See [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>) for more on how cloud sessions work. +For large refactors, test suites, migrations, or other long-running tasks, select **Cloud** instead of **Local** when starting a session. Cloud sessions run on Anthropic-managed infrastructure by default and continue even if you close the app or shut down your computer. Check back anytime to see progress or steer Claude in a different direction. You can also monitor cloud sessions from [claude.ai/code](<https://claude.ai/code>) or the [Claude mobile app](</docs/en/mobile>). Cloud sessions also support multiple repositories. After selecting a cloud environment, click the **+** button next to the selected repository to add more repositories to the session. Each repo gets its own branch selector. This is useful for tasks that span multiple codebases, such as updating a shared library and its consumers. See [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>) for more on how cloud sessions work. When one body of work needs many cloud sessions, select **Projects** in the sidebar to create a [project](</docs/en/claude-projects>), where Claude starts and tracks the sessions for you from one conversation. ###
modified Discover and install prebuilt plugins through marketplaces View current →
--- a/discover-plugins.md +++ b/discover-plugins.md @@ -219,6 +219,7 @@ * **Git URLs** : any git repository URL, including GitLab, Bitbucket, and self-hosted servers * **Local paths** : directories or direct paths to `marketplace.json` files * **Remote URLs** : direct URLs to hosted `marketplace.json` files + * **claude.ai** : marketplaces hosted on claude.ai for your account, such as your organization’s plugin library, which you add by name from the **Marketplaces** tab or your shell rather than by source ### @@ -280,13 +281,25 @@ URL-based marketplaces have some limitations compared to Git-based marketplaces. If plugin installs from a URL-based marketplace fail, see [Troubleshooting](</docs/en/plugin-marketplaces#plugins-with-relative-paths-fail-in-url-based-marketplaces>). +### + +​ + +Add from claude.ai + +In terminal sessions where [plugins sync from your claude.ai account](</docs/en/plugins-reference#synced-plugins>), claude.ai can also list marketplaces for you, such as your organization’s plugin library and your own claude.ai uploads. `claude plugin marketplace list` prints them in a `From claude.ai:` section, and the `/plugin` **Marketplaces** tab lists them. Select one there to add it. Adding a marketplace from claude.ai requires Claude Code v2.1.273 or later. To add one from your shell, run `claude plugin marketplace add` with the `--claudeai` flag and the name shown in the list: + + claude plugin marketplace add --claudeai claudeai-organization-library + +Claude Code registers the marketplace under a local name that starts with `claudeai-`, derived from the name that claude.ai lists it under: a marketplace listed as “Organization library” registers as `claudeai-organization-library`. Install its plugins by that name, for example with `claude plugin install <plugin>@claudeai-organization-library`. If you sign out or sign in with a different account, the marketplace stays configured but shows no plugins, and the plugins you already installed from it keep loading. The `From claude.ai:` section can also list git-based marketplaces shared through claude.ai. You add those with the ordinary `marketplace add` command, using the source that the list prints. + ## ​ Install plugins -Once you’ve added marketplaces, you can install a plugin by name: +Once you’ve added marketplaces, you can install a plugin by name. For a marketplace you haven’t added yet, you can instead add it and install in one command. To install by name: /plugin install plugin-name@marketplace-name @@ -316,6 +329,18 @@ Make sure you trust a plugin before installing it. Anthropic doesn’t control what MCP servers, files, or other software are included in plugins and can’t verify that they work as intended. Check each plugin’s homepage for more information. +### + +​ + +Add a marketplace and install in one command + +To install a plugin from a marketplace you haven’t added yet, name the marketplace source with `--marketplace`. Requires Claude Code v2.1.275 or later. + + /plugin install quality-review-plugin --marketplace your-org/plugins + +The source takes the same forms as `/plugin marketplace add`, such as GitHub `owner/repo`, a git URL, or a local path, except that it can’t contain spaces. Give the plugin name bare, without an `@marketplace` suffix. If you haven’t added that marketplace yet, Claude Code shows the source it resolved and asks you to confirm before adding it. Declining cancels the install and adds nothing. Once the marketplace is added, the plugin’s details open and you choose an [installation scope](</docs/en/settings#where-settings-live>). + ## ​ @@ -434,7 +459,7 @@ 3. Choose a marketplace from the list 4. Select **Enable auto-update** or **Disable auto-update** -`claude-plugins-official` and most other official Anthropic marketplaces have auto-update enabled by default. Third-party and local development marketplaces have auto-update disabled by default. Administrators can also set `"autoUpdate": true` on each [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) entry in managed settings to enable auto-update for an organization marketplace without requiring each user to toggle it. To disable automatic updates for Claude Code and for plugins fetched from marketplaces, set the `DISABLE_AUTOUPDATER` environment variable. Plugins with a [`command` source](</docs/en/plugin-marketplaces#command-sources>) follow their own once-per-session re-resolve. See [Auto updates](</docs/en/setup#auto-updates>) for details. To keep plugin auto-updates enabled while disabling Claude Code auto-updates, set `FORCE_AUTOUPDATE_PLUGINS=1` along with `DISABLE_AUTOUPDATER`: +`claude-plugins-official`, most other official Anthropic marketplaces, and marketplaces added from claude.ai have auto-update enabled by default. Other third-party marketplaces and local development marketplaces have auto-update disabled by default. Administrators can also set `"autoUpdate": true` on each [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>) entry in managed settings to enable auto-update for an organization marketplace without requiring each user to toggle it. To disable automatic updates for Claude Code and for plugins fetched from marketplaces, set the `DISABLE_AUTOUPDATER` environment variable. Plugins with a [`command` source](</docs/en/plugin-marketplaces#command-sources>) follow their own once-per-session re-resolve. See [Auto updates](</docs/en/setup#auto-updates>) for details. To keep plugin auto-updates enabled while disabling Claude Code auto-updates, set `FORCE_AUTOUPDATE_PLUGINS=1` along with `DISABLE_AUTOUPDATER`: export DISABLE_AUTOUPDATER=1 export FORCE_AUTOUPDATE_PLUGINS=1
modified Environment variables View current →
--- a/env-vars.md +++ b/env-vars.md @@ -193,8 +193,10 @@ `CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS`| When `CLAUDE_AUTO_BACKGROUND_TASKS` is enabled, seconds between reminders to Claude to check on [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) that are still running. Accepts a plain integer from `1` to `86400` only; any other value or spelling reads as unset. When unset, there are no check-in reminders. Requires Claude Code v2.1.248 or later `CLAUDE_CODE_AUTO_COMPACT_WINDOW`| Set the [auto-compact window](</docs/en/model-config#set-the-auto-compact-window>) in tokens, from `100000` to `1000000`. Accepts a plain integer such as `500000` only: a value like `500k` reads as `500` and clamps to the 100K minimum. The effective window is also capped at the model’s context window. Takes precedence over the `/autocompact` command, the `--autocompact` flag, and the `autoCompactWindow` setting. The status line’s `used_percentage` always measures against the model’s full context window, so once this variable is set, that percentage no longer indicates when compaction will run `CLAUDE_CODE_AUTO_CONNECT_IDE`| Override automatic [IDE connection](</docs/en/vs-code>). By default, Claude Code connects automatically when launched inside a supported IDE’s integrated terminal. Set to `false` to prevent this. Set to `true` to force a connection attempt when auto-detection fails, such as when tmux obscures the parent terminal. Takes precedence over the [`autoConnectIde`](</docs/en/settings-reference#autoconnectide>) global config setting +`CLAUDE_CODE_AUTO_MODE_SERVER`| On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, set to `1` to have the platform’s server-side classifier review [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) actions; where the platform doesn’t run the classifier, Claude Code falls back to its own classifier requests. When unset or `0`, the classifier runs through requests that Claude Code itself sends. Has no effect on other providers, including the Anthropic API. Requires Claude Code v2.1.271 or later `CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`| Time in milliseconds Claude Code waits for the AWS default credential provider chain to produce credentials before the request fails with [`AWS default-chain credential resolve timed out`](</docs/en/errors#aws-default-chain-credential-resolve-timed-out>) (default: `60000`). Raise it when a step in your chain legitimately needs longer, such as a browser-based SSO sign-in with MFA through a wrapper like `aws-vault`. Applies wherever Claude Code signs with the default chain: [Amazon Bedrock](</docs/en/amazon-bedrock#credential-caching-and-resolution-timeout>), [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and the [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>). Requires Claude Code v2.1.207 or later `CLAUDE_CODE_BASH_EDIT_DIFF`| Set to `0` to turn off the [diff of the files a Bash command changed](</docs/en/hooks#bash>), or `1` to record it in every permission mode. Takes precedence over the [`bashEditDiffEnabled`](</docs/en/settings-reference#basheditdiffenabled>) setting. Requires Claude Code v2.1.269 or later +`CLAUDE_CODE_BG_TASKS_REPORT_RUNNING`| Set to `0` to make a non-interactive session report an idle status to its host at every turn end, even while background work is still running. By default, the session keeps reporting a running status past turn end while background work such as a background agent or a [workflow](</docs/en/workflows>) run is still live. This keeps a host that watches the status, such as a remote session list, from announcing that Claude is waiting for your input mid-work. Background shell commands, such as a dev server, don’t hold the running status. The running-status default and the `0` opt-out require Claude Code v2.1.269 or later; on earlier versions, set `1` to hold the running status `CLAUDE_CODE_BRIDGE_SESSION_ID`| Set automatically in Bash tool and [hook command](</docs/en/hooks>) subprocesses while the session has an active [Remote Control](</docs/en/remote-control>) connection, and removed when the connection ends. The value is the session’s ID in `session_` form, the same identifier that appears in the session’s `claude.ai/code` URL, so a script can link back to the session that ran it. Requires Claude Code v2.1.199 or later. In [cloud sessions](</docs/en/claude-code-on-the-web>), read `CLAUDE_CODE_REMOTE_SESSION_ID` instead `CLAUDE_CODE_BS_AS_CTRL_BACKSPACE`| Set to `0` to make Claude Code read the `0x08` byte, also written `^H`, as plain Backspace, or `1` to read it as Ctrl+Backspace. Either value replaces the platform default. By default, Claude Code reads it as Ctrl+Backspace on Windows, except when `TERM_PROGRAM` is `mintty` or `TERM` is `cygwin`, and as plain Backspace on macOS and Linux. Set `0` in a Windows terminal where [Backspace deletes a whole word](</docs/en/terminal-config#fix-backspace-deleting-a-whole-word-on-windows>) `CLAUDE_CODE_CERT_STORE`| Comma-separated list of CA certificate sources for TLS connections. `bundled` is the Mozilla CA set shipped with Claude Code. `system` is the operating system trust store, read only on runtimes with `tls.getCACertificates`: the native binary, or Node 22.15 or later for npm installs. See [CA certificate store](</docs/en/network-config#ca-certificate-store>). Default is `bundled,system` @@ -243,9 +245,9 @@ `CLAUDE_CODE_DISABLE_THINKING`| Set to `1` to omit the `thinking` parameter from API requests entirely. This is a compatibility option for proxies and gateways that reject the parameter. On models that think by default, omitting the parameter means the model may still think. To explicitly disable [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>) on the Anthropic API, use `MAX_THINKING_TOKENS=0` instead. Neither variable turns thinking off on Fable models, which can’t have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `MAX_THINKING_TOKENS=0` likewise omits the parameter, so the two variables behave the same there `CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT`| Set to `1` to skip proactive [auto-compaction](</docs/en/costs#reduce-token-usage>) when Claude Code doesn’t recognize the model ID, such as an [LLM gateway](</docs/en/llm-gateway>) alias. Without this variable, Claude Code compacts at the context window it assumes for the ID. `CLAUDE_CODE_MAX_CONTEXT_TOKENS` can correct the assumed window instead; 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>) for when each variable applies. Requires Claude Code v2.1.223 or later `CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL`| Set to `1` to disable virtual scrolling in [fullscreen rendering](</docs/en/fullscreen>) and render every message in the transcript. Use this if scrolling in fullscreen mode shows blank regions where messages should appear +`CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER`| Set to `1` to start [PowerShell tool](</docs/en/tools-reference#powershell-tool>) commands on Windows directly instead of through the `cmd.exe` launcher. By default, the launcher lets a PowerShell command [running in the background](</docs/en/tools-reference#background-commands>) [carry over to the session’s next process](</docs/en/agent-view#the-supervisor-process>), such as when you [background the session](</docs/en/agent-view#from-inside-a-session>). If you set the variable, a backgrounded PowerShell command stops when the session’s process exits. Bash commands aren’t affected. Requires Claude Code v2.1.269 or later `CLAUDE_CODE_DISABLE_WORKFLOWS`| Set to `1` to disable [workflows](</docs/en/workflows#turn-workflows-off>). Equivalent to the [`disableWorkflows`](</docs/en/settings-reference#disableworkflows>) setting `CLAUDE_CODE_EFFORT_LEVEL`| Set the effort level for supported models. Values: `low`, `medium`, `high`, `xhigh`, `max`, or `auto` to use the model default. Available levels depend on the model. Takes precedence over `--effort`, `/effort`, and the `modelSettings` and `effortLevel` settings. A [`maxEffortLevel`](</docs/en/settings-reference#maxeffortlevel>) cap still applies. See [Adjust effort level](</docs/en/model-config#adjust-effort-level>) -`CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT`| Set to `1` to enable appending extra text to the end of the system prompt of every [subagent](</docs/en/sub-agents>) other than a [forked subagent](</docs/en/sub-agents#fork-the-current-conversation>). The [`--append-subagent-system-prompt`](</docs/en/cli-reference#cli-flags>) and [`--append-subagent-system-prompt-file`](</docs/en/cli-reference#cli-flags>) flags supply the appended text and set this variable automatically, so you don’t need to set it yourself. Requires Claude Code v2.1.205 or later `CLAUDE_CODE_ENABLE_AUTO_MODE`| Accepted for compatibility with older releases and has no effect. Auto mode is available by default on every provider, including Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. In v2.1.158 through v2.1.206, setting this to `1` was required to make [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) available on those providers `CLAUDE_CODE_ENABLE_AWAY_SUMMARY`| Override [session recap](</docs/en/interactive-mode#session-recap>) availability. Set to `0` to force recaps off regardless of the `/config` toggle. Set to `1` to force recaps on when [`awaySummaryEnabled`](</docs/en/settings-reference#awaysummaryenabled>) is `false`. Takes precedence over the setting and `/config` toggle `CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH`| Set to `1` to refresh plugin state at turn boundaries in [non-interactive mode](</docs/en/headless>) after a background install completes. Off by default because the refresh changes the system prompt mid-session, which invalidates [prompt caching](</docs/en/prompt-caching>) for that turn @@ -266,6 +268,7 @@ `CLAUDE_CODE_FORCE_SYNC_OUTPUT`| Set to `1` to force-enable DEC private mode 2026 [synchronized output](<https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036>) when your terminal supports it but is not auto-detected. Useful for emulators such as Emacs `eat` that implement BSU/ESU but do not reply to the capability probe. Has no effect under tmux. Unlike `CLAUDE_CODE_NO_FLICKER`, which switches to [fullscreen rendering](</docs/en/fullscreen>), this doesn’t change the renderer `CLAUDE_CODE_FORK_SUBAGENT`| Controls [fork mode](</docs/en/sub-agents#turn-fork-mode-on-or-off>), which lets Claude spawn [forked subagents](</docs/en/sub-agents#fork-the-current-conversation>) itself and is on by default in interactive sessions only. Set to `1` to turn it on in `claude -p` and the Agent SDK as well, or `0` to turn it off in every kind of session. You can run `/subtask` whether or not fork mode is on. The interactive default requires Claude Code v2.1.232 or later; on earlier versions, set the variable to `1` to turn fork mode on `CLAUDE_CODE_FORWARD_SUBAGENT_TEXT`| Set to `1` to emit [subagent](</docs/en/sub-agents>) text and thinking blocks in `claude -p --output-format stream-json` output, the same behavior as the [`--forward-subagent-text`](</docs/en/cli-reference#cli-flags>) flag. Use the variable when a harness invokes `claude` and can’t pass the flag itself. Unlike the flag, which exits with an error outside non-interactive mode with stream-json output, the variable is ignored there so that nested invocations keep working when it’s set process-wide. Requires Claude Code v2.1.211 or later +`CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS`| Timeout in milliseconds for the [gateway model discovery](</docs/en/llm-gateway-protocol#model-discovery>) request that `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` turns on (default: `3000`). Raise it when your gateway needs longer than three seconds to answer `/v1/models` at startup. Takes plain digits only; `0`, negative values, and other spellings keep the default. Requires Claude Code v2.1.269 or later `CLAUDE_CODE_GIT_BASH_PATH`| Windows only: path to the Git Bash executable (`bash.exe`). Use when Git Bash is installed but not in your PATH. If the path doesn’t exist or the file isn’t named `bash.exe`, `sh.exe`, `bash`, or `sh`, Claude Code ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. Before v2.1.219, Claude Code exited at startup when the path didn’t exist, and used any existing file as the shell without checking that it was bash or sh. See [Windows setup](</docs/en/setup#set-up-on-windows>) `CLAUDE_CODE_GLOB_HIDDEN`| Set to `false` to exclude dotfiles from results when Claude invokes the [Glob tool](</docs/en/tools-reference#glob-tool-behavior>). Included by default. Does not affect `@` file autocomplete, `ls`, Grep, or Read `CLAUDE_CODE_GLOB_NO_IGNORE`| Set to `false` to make the [Glob tool](</docs/en/tools-reference#glob-tool-behavior>) respect `.gitignore` patterns. By default, Glob returns all matching files including gitignored ones. Does not affect `@` file autocomplete, which has its own [`respectGitignore` setting](</docs/en/settings-reference#respectgitignore>) @@ -286,6 +289,7 @@ `CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION`| Cap on the total number of [WebSearch](</docs/en/tools-reference#websearch-tool-behavior>) calls one session can make (default: 200). When Claude reaches the cap, further WebSearch calls return a notice telling it to continue with the information it already gathered. Accepts a positive whole number with no upper bound. Anything else is ignored and the default applies, so the cap can be raised but not turned off. Requires Claude Code v2.1.212 or later `CLAUDE_CODE_MCP_ALLOWLIST_ENV`| Set to `1` to spawn stdio MCP servers with only a safe baseline environment plus the server’s configured `env`, instead of inheriting your shell environment `CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`| Elapsed time in milliseconds before a still-running MCP tool call [moves to a background task](</docs/en/mcp#automatic-backgrounding-of-long-tool-calls>) (default: 120000, or 2 minutes). Set to `0` to turn automatic backgrounding off. Requires Claude Code v2.1.212 or later +`CLAUDE_CODE_MCP_STARTUP_WAIT_MS`| How long in milliseconds the first turn of a [non-interactive](</docs/en/headless>) session waits for MCP servers that are still connecting, in place of the default [first-turn wait](</docs/en/agent-sdk/mcp#connection-timing>). When set, the wait covers every pending server. Set to `0` to skip the wait. A [`--permission-prompt-tool`](</docs/en/cli-reference#cli-flags>) server keeps its own `MCP_TIMEOUT` wait regardless of the value. Requires Claude Code v2.1.274 or later `CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT`| Idle timeout in milliseconds for MCP tool calls. When a stdio, HTTP, SSE, WebSocket, or [claude.ai connector](</docs/en/mcp#use-mcp-servers-from-claude-ai>) MCP server sends no response and no progress notification for this long, the tool call aborts with an error instead of waiting for the overall `MCP_TOOL_TIMEOUT`. Overrides the per-transport defaults of 300000 (5 minutes) for network servers and 1800000 (30 minutes) for stdio servers. Set to `0` to disable the idle check. Values below 1000 are raised to one second, and the value is capped at the effective `MCP_TOOL_TIMEOUT`. A per-server `timeout` in `.mcp.json` of at least 1000 raises that server’s idle window to at least the `timeout` value. Doesn’t apply to IDE servers or SDK in-process servers. Requires Claude Code v2.1.187 or later. Before v2.1.203, stdio servers were exempt from the idle timeout `CLAUDE_CODE_MESSAGING_SOCKET`| Set by Claude Code, not by you: in sessions that bind an [inbox socket](</docs/en/cross-session-messaging#the-sessions-inbox-socket>), Claude Code exports that socket’s path to hooks and Bash commands when it binds the socket. In a session that starts with messaging on, Claude Code binds the socket before any hook runs. Other sessions on the machine deliver messages to this path. Each session exports its own socket rather than one inherited from a parent, and messages arriving on it go through the session’s [inbound controls](</docs/en/cross-session-messaging#control-inbound-messages>). Settings `env` blocks can’t set it. Requires Claude Code v2.1.224 or later `CLAUDE_CODE_MESSAGING_TOKEN`| Set by Claude Code, not by you: in sessions that bind an [inbox socket](</docs/en/cross-session-messaging#the-sessions-inbox-socket>), Claude Code exports this per-session token to hooks and Bash commands alongside `CLAUDE_CODE_MESSAGING_SOCKET`. A script posting to the socket can send `{"type":"auth","token":"<token>"}` as its first line to prove it belongs to the session. On native Windows, Claude Code requires this line and closes any connection that doesn’t open with a valid one. The [own-child rules](</docs/en/cross-session-messaging#the-sessions-inbox-socket>) say when Claude Code consults the token. Each session exports its own token, never one inherited from a parent session. Settings `env` blocks can’t set it. Requires Claude Code v2.1.228 or later @@ -321,7 +325,7 @@ `CLAUDE_CODE_REMOTE_SESSION_ID`| Set automatically in [cloud sessions](</docs/en/claude-code-on-the-web>) to the current session’s ID. Read this to construct a link back to the session transcript. See [Link output back to the session](</docs/en/cloud-environments#link-output-back-to-the-session>) `CLAUDE_CODE_RESTRICTED`| Set to `1` to start the session in restricted mode, the same as passing [`--restricted`](</docs/en/cli-reference#cli-flags>). Claude Code ignores this variable in a settings file’s `env` block. Requires Claude Code v2.1.248 or later `CLAUDE_CODE_RESUME_INTERRUPTED_TURN`| Set to `1` to automatically resume if the previous session ended mid-turn. Used in SDK mode so the model continues without requiring the SDK to re-send the prompt. To turn this off, unset the variable or set it to `0`. Before v2.1.221, Claude Code ignored `0` and other falsy values, so setting `0` still triggered the resume in non-interactive mode and unsetting the variable was the only way to turn it off -`CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS`| Maximum age in milliseconds of the last transcript message for a session that ended mid-turn to continue automatically on resume. When the last message is older than this bound, Claude Code skips both the `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` automatic resume and the injected `CLAUDE_CODE_RESUME_PROMPT` continuation message, and the session starts idle so you continue explicitly. Unset or `0` means no bound; a negative or non-numeric value applies a one-hour bound. Spawn scripts for long-running agents can set this so a restart against an old transcript doesn’t re-run a stale prompt. Claude Code sets a one-hour bound itself when it restarts a crashed [agent view](</docs/en/agent-view>) session that inherited its conversation from an interactive session. Requires Claude Code v2.1.211 or later +`CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS`| Maximum age in milliseconds of the last transcript message for a session that ended mid-turn to continue automatically on resume. When the last message is older than this bound, Claude Code skips both the `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` automatic resume and the injected `CLAUDE_CODE_RESUME_PROMPT` continuation message, and the session starts idle so you continue explicitly. Unset or `0` means no bound, except that a turn whose last request failed with an API error resumes only while that error is less than six hours old. A positive value bounds every turn, including those; a negative or non-numeric value applies a one-hour bound. Spawn scripts for long-running agents can set this so a restart against an old transcript doesn’t re-run a stale prompt. Claude Code sets a one-hour bound itself when it restarts a crashed [agent view](</docs/en/agent-view>) session that inherited its conversation from an interactive session. Requires Claude Code v2.1.211 or later `CLAUDE_CODE_RESUME_PROMPT`| Override the continuation message injected when resuming a session that ended mid-turn. Defaults to `Continue from where you left off.`. Spawn scripts for long-running agents can set this to a more directive boot message. An empty string uses the default `CLAUDE_CODE_RETRY_WATCHDOG`| Set to `1` for unattended sessions such as eval harnesses, CI jobs, or remote workers. Retries `429` and `529` capacity errors indefinitely instead of failing after `CLAUDE_CODE_MAX_RETRIES` attempts. Claude Code fails at once when a standard-speed request gets a `429` that reports a spend limit or exhausted usage credits, even one from a [gateway spend cap](</docs/en/errors#spend-limit-reached>) that resets on a schedule. Before v2.1.239, the watchdog retried these indefinitely. For fast mode requests, see [Handle rate limits](</docs/en/fast-mode#handle-rate-limits>). The watchdog backs off up to 5 minutes between attempts, or until the limit resets when the response carries a rate-limit reset time, so a session that hits a usage limit waits out the remaining window. On v2.1.199 or later it also raises the default retry count for other transient errors, such as server errors, timeouts, and dropped connections, to 300, roughly three hours of backoff, and removes the cap of 15 on `CLAUDE_CODE_MAX_RETRIES` if you set that variable explicitly. Requires Claude Code v2.1.186 or later `CLAUDE_CODE_SAFE_MODE`| Set to `1` to start in safe mode: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto memory do not load, for troubleshooting a broken configuration. Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Equivalent to passing [`--safe-mode`](</docs/en/cli-reference#cli-flags>). Directly spawned child processes inherit the variable @@ -343,6 +347,7 @@ `CLAUDE_CODE_SKIP_MANTLE_AUTH`| Skip AWS authentication for Amazon Bedrock Mantle (for example, when using an LLM gateway) `CLAUDE_CODE_SKIP_PROMPT_HISTORY`| Set to `1` to skip writing prompt history and session transcripts to disk. Sessions started with this variable set do not appear in `--resume`, `--continue`, or up-arrow history. Useful for ephemeral scripted sessions `CLAUDE_CODE_SKIP_VERTEX_AUTH`| Skip Google authentication for Google Cloud’s Agent Platform (for example, when using an LLM gateway) +`CLAUDE_CODE_STARTUP_FAILURE_RESULTS`| Set to `1` to have a session started with `--output-format stream-json` write a [result message naming why Claude Code refused to start](</docs/en/agent-sdk/typescript#startup_failure_reason>) for startup failures that otherwise end with stderr alone. Requires Claude Code v2.1.274 or later `CLAUDE_CODE_STOP_HOOK_BLOCK_CAP`| Maximum number of consecutive times a [Stop](</docs/en/hooks#stop>) or [SubagentStop](</docs/en/hooks#subagentstop>) hook may block the turn from ending before Claude Code overrides it and ends the turn anyway (default: 8). Set to `0` to disable the cap. Raise this if your hook legitimately needs more iterations to resolve `CLAUDE_CODE_SUBAGENT_MODEL`| The default model for [subagents](</docs/en/sub-agents#choose-a-model>), [agent team](</docs/en/agent-teams#specify-teammates-and-models>) teammates, and [workflow](</docs/en/workflows>) agents that aren’t assigned a model another way. Accepts an alias such as `haiku` or a full model name. Two sources take precedence over it: a model Claude passes when it spawns the agent, and a `model` field in the agent’s definition, including `inherit`. To change that, set [`CLAUDE_CODE_SUBAGENT_MODEL_FORCE`](</docs/en/sub-agents#run-every-subagent-on-one-model>). See [Choose a model](</docs/en/sub-agents#choose-a-model>) for the full order. Setting it to `inherit` is the same as leaving it unset. Before v2.1.251, this variable overrode both the per-invocation model and the definition’s `model` field `CLAUDE_CODE_SUBAGENT_MODEL_FORCE`| Set to `1` to force one model onto subagents, teammates, and workflow agents. [Run every subagent on one model](</docs/en/sub-agents#run-every-subagent-on-one-model>) says which model that is. Requires Claude Code v2.1.257 or later @@ -370,6 +375,7 @@ `CLAUDE_CODE_USE_VERTEX`| Use [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) `CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS`| Set to the number of milliseconds [WebFetch](</docs/en/tools-reference#webfetch-tool-behavior>) keeps each fetched URL’s response cached. The default is `900000`, which is 15 minutes. Takes plain digits only; `0`, a decimal, or any other spelling keeps the default. Claude Code reads the value once per launch, so a change in a settings `env` block applies when you next launch `claude`. Requires Claude Code v2.1.233 or later `CLAUDE_CODE_WEBFETCH_DEADLINE_MS`| Upper bound in milliseconds on how long [WebFetch](</docs/en/tools-reference#webfetch-tool-behavior>) waits for a page to download, including any redirects it follows. A download that hasn’t completed by then fails with a deadline error. The default is `300000`, which is five minutes. Set to `0` to remove the limit. Takes plain digits only; a decimal or any other spelling keeps the default. Requires Claude Code v2.1.268 or later +`CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS`| How many agents a single [workflow](</docs/en/workflows>) run executes at once, from `1` to `256`. By default, a run executes up to 16 agents at once, fewer when Claude Code has fewer CPUs available; queued `agent()` calls wait for a free slot. Each running agent’s transcript stays in Claude Code’s memory, so higher values raise memory use. Takes plain digits only; out-of-range values and other spellings keep the default. Requires Claude Code v2.1.269 or later `CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS`| Upper bound in milliseconds on how long a [workflow](</docs/en/workflows>) agent waits for a same-prefix sibling’s first response to begin before sending its own first request. When a fan-out starts several agents that share a [prompt-cache prefix](</docs/en/workflows#prompt-caching-in-a-fan-out>), Claude Code holds all but the first agent for up to this long so the rest read the cached prefix instead of each processing it uncached. Default `5000`. Set to `0` to disable the wait. When `DISABLE_PROMPT_CACHING` is set, agents never wait. Requires Claude Code v2.1.229 or later `CLAUDE_CONFIG_DIR`| Override the configuration directory (default: `~/.claude`). All settings, session history, and plugins are stored under this path. For credentials, see [where Claude Code stores credentials](</docs/en/authentication#credential-management>). Useful for running multiple accounts side by side: for example, `alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'`. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](</docs/en/settings-reference#variables-claude-code-ignores-in-env>) `CLAUDE_DISABLE_ADOPT`| Set to `1` to stop in-flight background work instead of carrying it over when you background a session by pressing `←` or with [`/background`](</docs/en/agent-view#from-inside-a-session>). Claude Code asks you to confirm before backgrounding, then stops the tasks that would otherwise carry over. Requires Claude Code v2.1.195 or later @@ -424,7 +430,7 @@ `MAX_STRUCTURED_OUTPUT_RETRIES`| Number of attempts Claude Code allows when the model’s response fails validation against the [`--json-schema`](</docs/en/cli-reference#cli-flags>) in non-interactive mode with the `-p` flag; after that many failed attempts with no valid output, the run fails. The same cap applies when a [workflow](</docs/en/workflows>) subagent’s structured output fails validation. Defaults to 5, a first attempt plus four retries `MAX_THINKING_TOKENS`| Fixed token budget for [extended thinking](<https://platform.claude.com/docs/en/build-with-claude/extended-thinking>). Claude Code caps it at one token below the request’s max output tokens and never below 1,024. See `CLAUDE_CODE_MAX_OUTPUT_TOKENS` for how that limit is set. When unset and thinking is enabled, models with [adaptive reasoning](</docs/en/model-config#adjust-effort-level>) choose their own thinking depth, and other models use the cap. Set to `0` to disable thinking on the Anthropic API, except on Fable models, which can’t have thinking turned off. On [third-party providers](</docs/en/third-party-integrations>), `0` omits the `thinking` parameter instead. With thinking turned off on the Anthropic API, Claude Code sends effort `high` instead of a higher level to models it knows [don’t accept that combination](</docs/en/errors#effort-isnt-available-with-thinking-turned-off>), such as Opus 5. Claude Code ignores nonzero values on adaptive reasoning models, except on the models where `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` turns adaptive reasoning off `MCP_CLIENT_SECRET`| OAuth client secret for MCP servers that require [pre-configured credentials](</docs/en/mcp#use-pre-configured-oauth-credentials>). Avoids the interactive prompt when adding a server with `--client-secret` -`MCP_CONNECTION_NONBLOCKING`| Controls whether startup waits for MCP servers to connect before the first query. MCP startup is non-blocking by default: servers connect in the background and their tools become available as they finish. Set to `0` to make Claude Code wait for servers to connect before the first query. Servers configured with [`alwaysLoad: true`](</docs/en/mcp#exempt-a-server-from-deferral>) still make startup wait regardless, except when served from the [discovery cache](</docs/en/mcp#server-status-detail>), since their tools must be present when the first prompt is built. In non-interactive mode (`-p`), Claude Code also waits for still-pending servers before the first turn regardless of this variable, with a longer deadline when you pass [`--mcp-config`](</docs/en/cli-reference#cli-flags>) explicitly; see that flag’s entry for the cached-server exception +`MCP_CONNECTION_NONBLOCKING`| Controls whether startup waits for MCP servers to connect before the first query. MCP startup is non-blocking by default: servers connect in the background and their tools become available as they finish. Set to `0` to make Claude Code wait for servers to connect before the first query. Servers configured with [`alwaysLoad: true`](</docs/en/mcp#exempt-a-server-from-deferral>) still make startup wait regardless, except when served from the [discovery cache](</docs/en/mcp#server-status-detail>), since their tools must be present when the first prompt is built. In non-interactive mode (`-p`) without `--input-format stream-json`, Claude Code also waits for still-pending servers before the first turn regardless of this variable. When you pass [`--mcp-config`](</docs/en/cli-reference#cli-flags>) explicitly, the wait has a longer deadline; see that flag’s entry for the cached-server exception `MCP_CONNECT_TIMEOUT_MS`| How long blocking MCP startup waits, in milliseconds, for the connection batch before snapshotting the tool list (default: 5000). Applies when `MCP_CONNECTION_NONBLOCKING=0` or for servers marked [`alwaysLoad: true`](</docs/en/mcp#exempt-a-server-from-deferral>). Servers still pending at the deadline keep connecting in the background. Distinct from `MCP_TIMEOUT`, which bounds an individual server’s connect attempt `MCP_DISCOVERY_CACHE`| Turns the [MCP discovery cache](</docs/en/mcp#server-status-detail>) on or off. With the cache on, a remote HTTP or SSE server you’ve used before can show the [`cached` status](</docs/en/mcp#server-status-detail>), and Claude Code connects it on its first tool call instead of at startup. The cache is off by default unless a gradual rollout has enabled it for your account. Set to `1` to turn it on, or `0` to keep it off even when the rollout has enabled it. Before v2.1.238, the cache was on by default. The `cached` status requires Claude Code v2.1.221 or later `MCP_DISCOVERY_CACHE_MAX_STALE_S`| Maximum age, in seconds, of a [discovery-cache](</docs/en/mcp#server-status-detail>) entry (default: 14400, or 4 hours). At a start where the entry is older than that, Claude Code discards it and connects the server at startup, as it does with the cache off. Claude Code caps the value at 7 days. Before v2.1.238, the default was 86400, or 24 hours, and Claude Code didn’t cap the value
modified Error reference View current →
Show diff (435 lines)
--- a/errors.md +++ b/errors.md @@ -60,6 +60,7 @@ `OAuth token revoked` / `OAuth token has expired`| Authentication `API Error: 401 Invalid authentication credentials`| Authentication `Login expired · Please run /login`| Authentication +`Claude login not accepted · Run /login, then try again`| Authentication `Not signed in to the Cloud gateway — run /login.`| Authentication `Administrator policy requires a Cloud gateway sign-in on this machine`| Authentication `Failed to authenticate: OAuth session expired and could not be refreshed`| Authentication @@ -69,18 +70,26 @@ `Anthropic profile login expired · Run /login to use your claude.ai account instead, or re-authenticate the profile`| Authentication `does not meet scope requirement user:profile`| Authentication `claude.ai rejected the session token` / `session token rejected`| Authentication +`MCP server "<name>" needs you to sign in again (run /mcp to re-authenticate)`| Authentication +`rejected the credential from its headersHelper` / `rejected the Authorization header in its config`| Authentication +`MCP server "<name>" needs additional permissions (scope: "<scope>") — run /mcp to re-authenticate`| Authentication +`MCP server "<name>" requires re-authorization (token expired)`| Authentication `Issuer mismatch in authorization response (RFC 9207)`| Authentication `Cloud gateway session expired — run /login to reconnect.`| Authentication `Cloud gateway <url> no longer accepts this session`| Authentication `AWS credentials expired or invalid`| Authentication `AWS authentication failed`| Authentication +`Google Cloud credentials expired or invalid`| Authentication +`Google Cloud authentication failed`| Authentication +`Microsoft Foundry authentication failed`| Authentication +`Gateway refused the request`| Authentication `Could not load AWS credentials` / `Could not load Google Cloud credentials`| Authentication `AWS default-chain credential resolve timed out`| Authentication `Timed out after 60s waiting for AWS`| Authentication `A request to AWS timed out. Check your network and proxy settings, then try again.`| Authentication `Could not load the default credentials` on Google Cloud’s Agent Platform| Authentication `Unable to connect to API`| Network -`Connection refused —` / `Can't reach the API server —` / `No internet route —` / `Couldn't connect through your proxy` / `Connection dropped`, each ending with an error code in parentheses| Network +`Connection refused —` / `Can't reach the API server —` / `No internet route —` / `Couldn't connect through your proxy` / `Connection dropped`, each with an error code in parentheses| Network `Unable to connect to Anthropic services` during setup| Network `Socket is closed`| Network `Waiting for API response · will retry in`| Automatic retries, or Network if it persists @@ -175,6 +184,7 @@ `Your connected GitHub account can't see <owner>/<repo>`| Command-line errors `The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead`| Command-line errors `GitHub isn't connected to your Claude account, so this repository can't be cloned in the cloud`| Command-line errors +`Single sign-on authorization needed`| Command-line errors `Failed to resume the conversation`| Command-line errors `No conversation found with session ID: <session-id>`| Command-line errors `Cannot switch renderers in this session`| Command-line errors @@ -182,6 +192,8 @@ `Couldn't read your Zed keymap` / `Couldn't back up your Zed keymap` / `Couldn't update your Zed keymap`| Command-line errors `Your Zed keymap isn't a readable list of keybindings`| Command-line errors `Skill usage reports are not available on this connection.`| Command-line errors +`Custom output styles can't be selected over Remote Control or from a relayed message`| Command-line errors +`Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load`| Command-line errors ``plugin eval` is currently in early access` / ``plugin eval` is currently unavailable`| Plugin errors `Marketplace "<name>" is registered from an untrusted source`| Plugin errors `references ${user_config.*} in a shell-form command`| Plugin errors @@ -208,7 +220,7 @@ `Refusing to send: connected endpoint is not the expected process` / `Refusing to send: connected endpoint identity could not be read`| Tool errors `Refusing to send: connected endpoint is not owned by this user` / `Refusing to send: connected endpoint owner could not be read`| Tool errors `Refusing to send: connected endpoint is a different process with the expected pid`| Tool errors -`Refusing to read <path>: its symlink resolution changed after permission was checked` / `Refusing to search <path>: its symlink resolution changed after permission was checked`| Tool errors +`Refusing to read <path>: its symlink resolution changed after permission was checked (<reason>)` / `Refusing to search <path>: its symlink resolution changed after permission was checked`| Tool errors `Refusing to write <path>: its parent-directory symlink resolution changed after permission was checked` / `Refusing to write <path>: it is a symbolic link. Write to the link's target path instead`| Tool errors `Refusing to search <path>: a path one of its Read deny rules is written through changed while the search was being prepared` / `Refusing to search <path>: it could not be opened`| Tool errors `its permission check expired before it ran (too many concurrent file operations)` / `ripgrep was found only by name on PATH`| Tool errors @@ -241,6 +253,7 @@ `Couldn't start a background session (working directory no longer exists or is not accessible: ...)`| Background session errors `Claude Code is being updated by npm on this machine (still not runnable after 2 min, ...)`| Background session errors `Claude Code process exited with code N`| Wrapper and IDE errors +`The connection to Claude Code ended before this message completed`| Wrapper and IDE errors `Could not locate the Claude CLI on PATH`| Wrapper and IDE errors `Restored the code, but skipped N files`| Rewind warnings and errors `No files were restored: N files failed (backup missing, or the file could not be updated)`| Rewind warnings and errors @@ -1017,6 +1030,20 @@ ​ +Claude login not accepted + +You tried to start a [cloud session](</docs/en/claude-code-on-the-web>), and the server refused to create it with a 401: it didn’t accept the Claude login this machine sent, usually because the login expired or was revoked. The first part of the line is the server’s own reason when it gives one. Otherwise the line reads: + + Claude login not accepted · Run /login, then try again + +**What to do:** + + * Run `/login`, complete the sign-in, then start the session again + +### + +​ + Administrator policy requires a Cloud gateway sign-in An administrator’s [managed settings](</docs/en/managed-settings>) on this machine set [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) to `"gateway"` or set [`forceLoginGatewayUrl`](</docs/en/settings-reference#forcelogingatewayurl>). Unless you select a cloud provider through a variable such as `CLAUDE_CODE_USE_BEDROCK`, Claude Code then accepts only the [Claude apps gateway](</docs/en/claude-apps-gateway>) sign-in. You see one of two messages: @@ -1111,6 +1138,30 @@ ​ +MCP server needs you to sign in again + +A remote [MCP server](</docs/en/mcp>) rejected the credential on a tool call mid-session, usually because a sign-in or token expired or because the token lacks a permission the tool needs. The tool call fails, and `/mcp` marks the server as [needing authentication](</docs/en/mcp#authenticate-with-remote-mcp-servers>). For a server you sign in to from Claude Code, including a claude.ai connector, the sign-in expired or was revoked: + + MCP server "<name>" needs you to sign in again (run /mcp to re-authenticate) + +Run `/mcp`, select the server, and sign in again from its menu. For a server configured with a [`headersHelper`](</docs/en/mcp#use-dynamic-headers-for-custom-authentication>) script, Claude Code has already re-run the helper and retried the call once before showing this: + + MCP server "<name>" rejected the credential from its headersHelper (check the helper and run /mcp to reconnect, or to authenticate if the server also uses OAuth) + +Check that the helper returns a credential the server accepts, then reconnect from `/mcp`, which runs the helper again. For a server with a static `Authorization` header in its configuration: + + MCP server "<name>" rejected the Authorization header in its config (update it, then run /mcp to reconnect) + +Update the header value where the server is configured, then reconnect from `/mcp`. Before v2.1.273, the expired sign-in, `headersHelper`, and `Authorization` header cases all showed `MCP server "<name>" requires re-authorization (token expired)`. A server can also refuse a tool call with HTTP 403 `insufficient_scope` to ask you to authorize a scope, sometimes one your token already lists. The message names that scope: + + MCP server "<name>" needs additional permissions (scope: "<scope>") — run /mcp to re-authenticate + +Run `/mcp`, select the server, and authenticate again from its menu. When the server’s configuration sets neither [`oauth.scopes`](</docs/en/mcp#restrict-oauth-scopes>) nor [`authServerMetadataUrl`](</docs/en/mcp#override-oauth-metadata-discovery>), Claude Code requests the scope the server named. With either setting, Claude Code requests that setting’s scopes instead. If you pinned `oauth.scopes`, add the missing scope to that list before you authenticate again. Before v2.1.274, this case showed the `needs you to sign in again` message, and before v2.1.273 it showed `requires re-authorization (token expired)` like the other cases. + +### + +​ + Issuer mismatch in authorization response During an [MCP OAuth sign-in](</docs/en/mcp#authenticate-with-remote-mcp-servers>), the authorization server redirected back to Claude Code with an `iss` parameter that doesn’t name the issuer that Claude Code expected from the server’s OAuth metadata. A wrong issuer at this step is how an authorization server mix-up attack looks, so Claude Code fails the sign-in instead of exchanging the authorization code. Claude Code shows the error in the `/mcp` server menu after the browser sign-in: @@ -1131,14 +1182,15 @@ AWS credentials expired or invalid -This message requires Claude Code v2.1.198 or later and only appears when [`awsAuthRefresh`](</docs/en/amazon-bedrock#advanced-credential-configuration>) is set in your settings file. Your AWS session token expired or was rejected, and the automatic refresh Claude Code already ran didn’t produce a credential the API accepts. It appears on a 401 from [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) or the [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), which is how those providers report an expired security token. The action hint in the middle names the `awsAuthRefresh` command from your settings, so it varies. The stable part is the leading `AWS credentials expired or invalid`: +Your AWS session token expired or was rejected. This message appears on a 401 from [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) or the [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), which is how those providers report an expired security token. The action hint in the middle varies with your setup. The stable part is the leading `AWS credentials expired or invalid`: AWS credentials expired or invalid · run /login and select "Claude Platform on AWS · refresh credentials", or run `aws sso login --profile myprofile` in another terminal · API Error: 401 ... -Without `awsAuthRefresh` configured, the same 401 shows the generic `Please run /login` message instead, which can’t refresh AWS credentials. **What to do:** - - * Run the `awsAuthRefresh` command named in the message, such as `aws sso login --profile myprofile`, in another terminal and complete the browser sign-in, then retry - * In an interactive session, run `/login`, choose **3rd-party platform** , then select **Claude Platform on AWS · refresh credentials** under **Using 3rd-party platforms** to run the same command without restarting Claude Code. See [Configure AWS credentials](</docs/en/claude-platform-on-aws#1-configure-aws-credentials>) +Before v2.1.273, this message appeared only when `awsAuthRefresh` was configured. **What to do:** + + * If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here don’t apply: retry, or contact your administrator + * If [`awsAuthRefresh`](</docs/en/amazon-bedrock#advanced-credential-configuration>) is set, run the command named in the message, such as `aws sso login --profile myprofile`, in another terminal and complete the browser sign-in, then retry. Otherwise refresh the AWS credential you use yourself: your SSO sign-in, access keys, API key, or proxy token + * With `awsAuthRefresh` set in an interactive session, you can instead run `/login`, choose **3rd-party platform** , then select **Claude Platform on AWS · refresh credentials** under **Using 3rd-party platforms** to run the same command without restarting Claude Code. See [Configure AWS credentials](</docs/en/claude-platform-on-aws#1-configure-aws-credentials>) * If the error repeats after the refresh command succeeds, confirm the identity is valid outside Claude Code with `aws sts get-caller-identity` in the same shell and profile ### @@ -1147,15 +1199,72 @@ AWS authentication failed -This message requires Claude Code v2.1.198 or later and only appears when [`awsAuthRefresh`](</docs/en/amazon-bedrock#advanced-credential-configuration>) is set in your settings file. Your AWS provider returned a 403, or [Amazon Bedrock](</docs/en/amazon-bedrock>) returned a 401. Claude Code can’t tell which cause you hit. Amazon Bedrock reports an expired security token as a 403, but a 403 is also how it reports an authorization denial, such as an `AccessDeniedException` from a missing IAM permission or a model that isn’t enabled for your account. A 401 from Amazon Bedrock also lands here rather than under AWS credentials expired or invalid, because Amazon Bedrock doesn’t report an expired token as a 401. A 401 from that endpoint typically comes from something else in the request path, such as a corporate proxy. A credential refresh fixes an expired token and can’t fix the other causes, so the message offers both: +Your AWS provider returned a 403, or [Amazon Bedrock](</docs/en/amazon-bedrock>) returned a 401. Amazon Bedrock reports an expired security token as a 403, but a 403 is also how it reports an authorization denial, such as an `AccessDeniedException` from a missing IAM permission. Claude Code can’t tell those two causes apart. A 401 from Amazon Bedrock also lands here rather than under AWS credentials expired or invalid, because Amazon Bedrock doesn’t report an expired token as a 401. A 401 from that endpoint typically comes from something else in the request path, such as a corporate proxy. A credential refresh fixes an expired token and can’t fix the other causes, so the message offers both: AWS authentication failed · run /login and select "Claude Platform on AWS · refresh credentials", or run `aws sso login --profile myprofile` in another terminal · if credentials are current, check AWS permissions and model access · API Error: 403 ... -The action hint in the middle names the `awsAuthRefresh` command from your settings, so it varies. The stable part is the leading `AWS authentication failed`. **What to do:** - - * Run the `awsAuthRefresh` command named in the message, or `aws sso login`, in case an expired credential is the cause +The action hint in the middle varies with your setup. The stable part is the leading `AWS authentication failed`. When the 403 is Amazon Bedrock’s answer that you don’t have access to the model with the specified model ID, the hint instead tells you to enable the model for your account and region in the Amazon Bedrock console. Before v2.1.273, this message appeared only when `awsAuthRefresh` was configured. **What to do:** + + * If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here don’t apply: retry, or contact your administrator + * Refresh your AWS credentials in case an expired credential is the cause: run the [`awsAuthRefresh`](</docs/en/amazon-bedrock#advanced-credential-configuration>) command named in the message when one is set, or refresh your SSO sign-in, access keys, API key, or proxy token yourself * If your credentials are current, confirm the IAM permissions in [IAM configuration](</docs/en/amazon-bedrock#iam-configuration>) are attached to the identity you’re using and that the selected model is enabled for your account and region * Run `aws sts get-caller-identity` to confirm which identity your requests use; a stale `AWS_PROFILE` or default profile is a common cause of a permission mismatch + +### + +​ + +Google Cloud credentials expired or invalid + +Your Google Cloud credentials for [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) expired or were rejected: the request returned a 401, which is how Agent Platform reports credential expiry. The action hint in the middle varies with your setup. The stable part is the leading `Google Cloud credentials expired or invalid`: + + Google Cloud credentials expired or invalid · refresh your Google Cloud credentials (application default sign-in, or the key file in GOOGLE_APPLICATION_CREDENTIALS) and retry · API Error: 401 ... + +**What to do:** + + * If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here don’t apply: retry, or contact your administrator + * If you authenticate with application default credentials, run the [`gcpAuthRefresh`](</docs/en/google-vertex-ai#advanced-credential-configuration>) command named in the message, or `gcloud auth application-default login`, and complete the sign-in, then retry + * If you route through an [LLM gateway](</docs/en/llm-gateway>) with `CLAUDE_CODE_SKIP_VERTEX_AUTH` set, refresh the gateway token in `ANTHROPIC_AUTH_TOKEN` or `ANTHROPIC_CUSTOM_HEADERS`, then retry + * If you authenticate with a service account key file, confirm `GOOGLE_APPLICATION_CREDENTIALS` points at a valid key. See [Configure GCP credentials](</docs/en/google-vertex-ai#3-configure-gcp-credentials>) + * If the error repeats after a refresh, confirm the identity works outside Claude Code with `gcloud auth application-default print-access-token` in the same shell + +Before v2.1.273, a 401 from Agent Platform showed the generic `Please run /login` or `Failed to authenticate` message instead, which can’t refresh Google Cloud credentials. + +### + +​ + +Google Cloud authentication failed + +[Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>) returned a 403, which it uses for authorization denials rather than expired credentials. Usually the identity you authenticate with is missing an IAM permission, or the model isn’t enabled for your project. The action hint in the middle varies with your setup. The stable part is the leading `Google Cloud authentication failed`: + + Google Cloud authentication failed · refresh your Google Cloud credentials (application default sign-in, or the key file in GOOGLE_APPLICATION_CREDENTIALS) and retry · if credentials are current, check GCP IAM permissions and Vertex AI model access · API Error: 403 ... + +**What to do:** + + * If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here don’t apply: retry, or contact your administrator + * Confirm the roles in [IAM configuration](</docs/en/google-vertex-ai#iam-configuration>) are granted to the identity you authenticate with + * Confirm the model is enabled for your project. See [Request model access](</docs/en/google-vertex-ai#2-request-model-access>) + +Before v2.1.273, a 403 from Agent Platform showed the generic `Please run /login` or `Failed to authenticate` message instead, which can’t refresh Google Cloud credentials. + +### + +​ + +Microsoft Foundry authentication failed + +[Microsoft Foundry](</docs/en/microsoft-foundry>) returned a 401 or 403: the Azure credential on the request was rejected, or the identity behind it doesn’t have access to the Foundry resource. `/login` can’t mint Azure credentials. The action hint in the middle varies with your setup. The stable part is the leading `Microsoft Foundry authentication failed`: + + Microsoft Foundry authentication failed · refresh your Foundry credential (ANTHROPIC_FOUNDRY_AUTH_TOKEN, ANTHROPIC_FOUNDRY_API_KEY, Azure sign-in for Entra, or your proxy token) and retry · if credentials are current, check access to the Foundry resource · API Error: 401 ... + +**What to do:** + + * If the hint says credentials are managed by this environment, the app that launched Claude Code owns the credential and the other steps here don’t apply: retry, or contact your administrator + * Refresh the credential you configured in [Configure Azure credentials](</docs/en/microsoft-foundry#2-configure-azure-credentials>): rotate `ANTHROPIC_FOUNDRY_API_KEY`, mint a fresh `ANTHROPIC_FOUNDRY_AUTH_TOKEN`, or run `az login` so the default Microsoft Entra credential chain can sign in again + * If the credential is current, confirm the identity has access to the Foundry resource. See [Azure RBAC configuration](</docs/en/microsoft-foundry#azure-rbac-configuration>) + +Before v2.1.273, a 401 or 403 from Microsoft Foundry showed the generic `Please run /login` or `Failed to authenticate` message instead, which can’t refresh Azure credentials. ### @@ -1227,6 +1336,23 @@ * Run `/login` in the session and complete the browser sign-in * For a non-interactive launch, start `claude` in the same environment, run `/login`, then rerun your command + +### + +​ + +Gateway refused the request + +You’re signed in through a [Claude apps gateway](</docs/en/claude-apps-gateway>), and a request returned a 403: the gateway, or the upstream behind it, refused it. Signing in again doesn’t change a refusal, so the message points at your gateway administrator: + + Gateway refused the request · signing in again won't change this — check with your gateway administrator · API Error: 403 ... + +**What to do:** + + * Ask your gateway administrator to look up the request. The `API Error:` tail carries the refusal the gateway returned + * For administrators: an [access control rule](</docs/en/claude-apps-gateway-config#http-tuning>) on the gateway returns a 403 that the [audit log](</docs/en/claude-apps-gateway-deploy#logs>) records with its reason, and an upstream’s authorization denial passes through per [Upstream error messages](</docs/en/claude-apps-gateway-config#upstream-error-messages>) + +Before v2.1.273, a 403 on a gateway session showed the generic `Please run /login` or `Failed to authenticate` message instead, and signing in again didn’t clear the refusal. ## @@ -1248,7 +1374,7 @@ Connection refused — a firewall or proxy may be blocking it (ConnectionRefused) Can't reach the API server — check your internet or DNS (ENOTFOUND) No internet route — check your connection or VPN (EHOSTUNREACH) - Couldn't connect through your proxy (ERR_PROXY_TUNNEL) + Couldn't connect through your proxy (ERR_PROXY_TUNNEL) — the proxy refused the tunnel: check its credentials and that it allows this host Connection dropped (ECONNRESET) fetch failed Request timed out. Check your internet connection and proxy settings @@ -1358,10 +1484,10 @@ A proxy or security appliance on your network is intercepting TLS traffic with its own certificate, and Claude Code does not trust it. - Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates - Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates - -As of v2.1.199, a certificate validation failure isn’t retried, so this error appears on the first attempt instead of after the full retry budget. Earlier versions spent a few minutes retrying before showing it. Transient TLS conditions, such as a handshake timeout, still retry. During `/login` and the startup connectivity check, the same failure is reported with the OpenSSL code and the fix inline: + Unable to connect to API: SSL certificate verification failed (UNABLE_TO_GET_ISSUER_CERT_LOCALLY). The certificate comes from an authority Claude Code doesn't trust, usually a TLS-inspecting corporate proxy or a gateway signed by a private CA: set NODE_EXTRA_CA_CERTS to that CA bundle, or add it to the system certificate store · see https://code.claude.com/docs/en/network-config + Unable to connect to API: Self-signed certificate detected (SELF_SIGNED_CERT_IN_CHAIN). The certificate comes from an authority Claude Code doesn't trust, usually a TLS-inspecting corporate proxy or a gateway signed by a private CA: set NODE_EXTRA_CA_CERTS to that CA bundle, or add it to the system certificate store · see https://code.claude.com/docs/en/network-config + +Before v2.1.273, both messages ended at `Check your proxy or corporate SSL certificates`, without the OpenSSL code or the `NODE_EXTRA_CA_CERTS` hint. As of v2.1.199, a certificate validation failure isn’t retried, so this error appears on the first attempt instead of after the full retry budget. Earlier versions spent a few minutes retrying before showing it. Transient TLS conditions, such as a handshake timeout, still retry. During `/login` and the startup connectivity check, the same failure produces a different message: SSL certificate error (UNABLE_TO_GET_ISSUER_CERT_LOCALLY). If you are behind a corporate proxy or TLS-intercepting firewall, set NODE_EXTRA_CA_CERTS to your CA bundle path, or ask IT to allowlist *.anthropic.com. Run `claude doctor` for details. @@ -1511,7 +1637,12 @@ Prompt is too long · automatic compaction failed: <the underlying error> -Resolve the named error first; `/compact` fails on the same error until you do. Before v2.1.229, a failed automatic compaction surfaced `Prompt is too long` without the cause. A single-exchange conversation has no earlier turns to summarize. When automatic compaction would have run on one, Claude Code skips the attempt and explains what fills the request instead. When the API doesn’t report token counts in its error, the message reads: +Resolve the named error first; `/compact` fails on the same error until you do. Before v2.1.229, a failed automatic compaction surfaced `Prompt is too long` without the cause. When automatic compaction runs on this error, it normally summarizes your oldest exchanges and keeps the newest. As a last resort, Claude Code summarizes differently: + + * When it can’t summarize any whole exchange, Claude Code keeps your newest prompt word for word and summarizes everything before it. + * In that case, when the conversation doesn’t end with your prompt, Claude Code summarizes the whole conversation instead. + +Claude Code skips this recovery when the content it would carry forward holds no model reply and less than about 1,000 tokens of your own text, such as a short retry sent after an oversized paste. Run `/clear` to start fresh. Before v2.1.269, compaction failed whenever it couldn’t summarize a whole exchange, so a session in that state hit this error again on every turn. A single-exchange conversation has no earlier turns to summarize. When automatic compaction would have run on one, Claude Code skips the attempt and explains what fills the request instead. When the API doesn’t report token counts in its error, the message reads: Prompt is too long · this conversation is a single exchange and cannot be compacted — the request size comes mostly from system prompt, tool definitions, or attachments. @@ -1525,7 +1656,7 @@ Before v2.1.162, Claude Code attempted the compaction anyway and surfaced the bare `Prompt is too long` when it failed. **What to do:** - * In a multi-turn conversation, run `/compact` to summarize earlier turns and free space, or `/clear` to start fresh. A single-exchange conversation can’t be compacted, so shrink the request instead + * Run `/compact` to summarize earlier turns and free space, or `/clear` to start fresh. If `/compact` answers `Not enough messages to compact.`, the conversation is a single exchange with nothing earlier to summarize, so the space is taken by that one prompt and what Claude Code sends with every request: run `/clear` and resend with less pasted text or smaller attachments, or reduce the tool definitions and memory files using the steps below * Run `/context` to see a breakdown of what is consuming the window: system prompt, tools, memory files, and messages * Disable MCP servers you are not using with `/mcp disable <name>` to remove their tool definitions from context * Trim large `CLAUDE.md` memory files, or move instructions into [path-scoped rules](</docs/en/memory#path-specific-rules>) that load only when relevant @@ -2396,7 +2527,7 @@ Unknown command -You submitted a `/` name that doesn’t match any command in this session, so Claude Code reports the name instead of running anything: +In an interactive terminal session, you submitted a `/` name that doesn’t match any command in this session, so Claude Code reports the name instead of running anything: Unknown command: /hepl. Did you mean /help? @@ -2406,7 +2537,15 @@ * A command that exists but isn’t available in this session because a requirement isn’t met, such as your platform, plan, or authentication method. The troubleshooting entries for [`/web-setup`](</docs/en/web-quickstart#web-setup-shows-no-commands-match-or-unknown-command>) and [`/schedule`](</docs/en/routines#schedule-returns-unknown-command>) walk through two common cases. Some commands answer with their own message when your organization’s policy disables them, such as `Cloud sessions are disabled by your organization's policy` * A command from a [plugin](</docs/en/plugins>) or [MCP server](</docs/en/mcp#use-mcp-prompts-as-commands>) that isn’t installed or connected in this session -Claude Code doesn’t treat every prompt that starts with `/` as a command. It sends the prompt to Claude as a normal message when the first word after the `/` starts with punctuation, such as the `/--` that opens a Lean doc comment, or is a path such as `/var/log/syslog`. Before v2.1.236, if you pressed `Enter` while the command menu listed a near match for the name you typed, Claude Code ran that match, so a typo such as `/hepl` ran `/help` instead of producing this message. **What to do:** +Claude Code answers an unmatched `/` name this way only in an interactive terminal session. In every other session, it sends the prompt to Claude as a normal message instead, with a note that the command didn’t run and a list of commands Claude can run in the session. Those sessions include: + + * `-p` runs + * [Agent SDK](</docs/en/agent-sdk/overview>) applications + * The Code tab of the [Desktop app](</docs/en/desktop>) + * The chat panel of the [VS Code extension](</docs/en/vs-code>) + * [Cloud sessions](</docs/en/claude-code-on-the-web>) and [routines](</docs/en/routines>) + +For a built-in command that can’t run in one of those sessions, Claude Code still answers that the command isn’t available instead of sending it to Claude. Before v2.1.274, only cloud sessions and routines sent an unmatched name to Claude. Before v2.1.273, they answered `Unknown command` too. Claude Code doesn’t treat every prompt that starts with `/` as a command. It sends the prompt to Claude as a normal message when the first word after the `/` starts with punctuation, such as the `/--` that opens a Lean doc comment, or is a path such as `/var/log/syslog`. Before v2.1.236, if you pressed `Enter` while the command menu listed a near match for the name you typed, Claude Code ran that match, so a typo such as `/hepl` ran `/help` instead of producing this message. **What to do:** * Run the suggested name, or type `/` followed by part of the name to see what’s available in this session * If Claude Code reports a documented command as unknown, check its row in the [commands reference](</docs/en/commands>) for the requirement it names @@ -2528,6 +2667,25 @@ * Rerun the command a minute after connecting Before v2.1.268, Claude Code reported this as a temporary failure of the Claude GitHub App check and suggested retrying or installing the app; neither connects a GitHub account. + +### + +​ + +Single sign-on authorization needed + +You ran [`/install-github-app`](</docs/en/github-actions#quick-setup>) and chose a repository whose organization enforces SAML single sign-on. Before setup, Claude Code checks your access to the repository with the GitHub CLI, and GitHub refused that check because your `gh` token isn’t authorized for the organization yet. The wizard shows the warning with the steps to authorize: + + Single sign-on authorization needed + <owner>/<repo> belongs to an organization that enforces SAML single sign-on, and your GitHub CLI token isn't authorized for it yet. + +**What to do:** + + * Re-authorize your GitHub CLI login with the `repo` and `workflow` scopes by running `gh auth refresh -h github.com -s repo,workflow`, and authorize the organization when GitHub prompts for single sign-on + * If you authenticate with a personal access token in `GH_TOKEN`, open [github.com/settings/tokens](<https://github.com/settings/tokens>), select **Configure SSO** on the token, and authorize the organization + * Run `/install-github-app` again + +Before v2.1.273, Claude Code showed the `Admin permissions required` warning for this condition instead. ### @@ -2632,6 +2790,36 @@ **What to do:** * Run `/skill-doctor` in the terminal on the machine where the session is running, or run `claude -p "/skill-doctor"` there + +### + +​ + +Custom output styles can’t be selected over Remote Control + +You ran [`/output-style`](</docs/en/output-styles#change-your-output-style>) from the mobile app or web via [Remote Control](</docs/en/remote-control>), or the command arrived in a message relayed into the session. Because such a turn may not come from the account owner, Claude Code lists and selects only [built-in styles](</docs/en/output-styles#built-in-output-styles>) on it, and adds this notice whenever the command lists the styles or doesn’t recognize the name you gave. A [custom style](</docs/en/output-styles#create-a-custom-output-style>) name gets the same reply as a name that doesn’t exist: + + Custom output styles can't be selected over Remote Control or from a relayed message. Select one in the session itself, or pick a built-in style here. + +**What to do:** + + * Pick a built-in style, for example `/output-style concise` + * To use a custom style, set [`outputStyle`](</docs/en/settings-reference#outputstyle>) in the project’s `.claude/settings.local.json`, or run `/output-style <style>` at the session’s own terminal if it has one + +### + +​ + +Output styles are saved to local settings which this session doesn’t load + +You tried to switch [output styles](</docs/en/output-styles>) with `/output-style <style>` or `/config outputStyle=<style>` in a session whose setting sources exclude `local`. Examples are an [Agent SDK](</docs/en/agent-sdk/typescript>) session whose [`settingSources`](</docs/en/agent-sdk/typescript#options>) leaves out `"local"` and a CLI session started with a [`--setting-sources`](</docs/en/cli-reference#cli-flags>) value that leaves out `local`. Both commands save the style to `.claude/settings.local.json`, a file such a session never reads back, so Claude Code refuses instead of writing a setting that would have no effect: + + Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load, so the style can't be changed here. + +**What to do:** + + * Add `local` to the session’s setting sources and switch again + * Set the [`outputStyle`](</docs/en/settings-reference#outputstyle>) key in a settings file the session does load, such as `.claude/settings.json` in the project or `~/.claude/settings.json`. In the TypeScript SDK, set `outputStyle` inside the inline `settings` object instead; see [Activate an output style](</docs/en/agent-sdk/modifying-system-prompts#activate-an-output-style>) ## @@ -3023,11 +3211,11 @@ Claude Code checks a file path’s [permission rules](</docs/en/permissions#read-and-edit>), then confirms that resolution again when the tool opens the file or starts the search. When it can’t confirm that the path still leads to the location the check approved, Claude Code refuses the operation instead of following it. The refusal appears in the tool result: - Refusing to read /path/to/file: its symlink resolution changed after permission was checked. If a link in the working directory is being rewritten concurrently, stop that and retry. + Refusing to read /path/to/file: its symlink resolution changed after permission was checked (a link on the way now leads somewhere the check did not see). If a link in the working directory is being rewritten concurrently, stop that and retry. The text after the path names the reason: - * `its symlink resolution changed after permission was checked`: a symlink along the path, or at a Grep or Glob search root, was replaced between the permission check and the operation + * `its symlink resolution changed after permission was checked`: a symlink along the path, or at a Grep or Glob search root, was replaced between the permission check and the operation. In a read refusal, the parenthesized phrase names which comparison failed. * `its parent-directory symlink resolution changed after permission was checked`: a directory the write path passes through no longer resolves to the approved location * `it is a symbolic link. Write to the link's target path instead`: a symbolic link sits at the approved write location itself * `a path one of its Read deny rules is written through changed while the search was being prepared. Retry.`: a `Read` deny rule for the search names a path that passes through a symlink, and that link changed while Claude Code was preparing the search @@ -3040,6 +3228,7 @@ * Usually nothing: the refusal reaches Claude as the tool result, and the refused operation doesn’t run * If a symlink refusal repeats on one path, find what keeps rewriting a link there, such as a build tool or file watcher, or ask Claude to use the file’s resolved path instead of the linked one * If this refusal appears for every file while Claude Code runs on Windows inside an AppContainer or restricted-token sandbox, upgrade to v2.1.265 or later + * If a read refusal appears on macOS for a file that nothing is rewriting, such as a screenshot dragged into the prompt, upgrade to v2.1.273 or later * For the ripgrep refusal, install ripgrep with your package manager so `rg` resolves to an absolute path on `PATH`, or keep searches under the working directory Before v2.1.251, Claude Code re-checked a path’s resolution only for file writes, so a link replaced after the permission check could redirect a read or search to a different location without a message. Of these refusals, only the parent-directory write refusal appears on earlier versions. @@ -3421,7 +3610,7 @@ Error: Claude Code process exited with code 1 -**What to do:** +On Windows, the native build can exit with code `4294967295` right after a turn completes. When that exit lands at a turn boundary, with no message waiting and no background task running, the [VS Code extension](</docs/en/vs-code>) closes the session quietly instead of showing this error. Your next message resumes the conversation. Before v2.1.273, the extension showed the error for that exit at every turn boundary, even though nothing was lost. **What to do:** * In VS Code, follow the **View output logs** link shown with the error to see the underlying failure * In an Agent SDK application, catch the error around your message loop. The entries under [CLI process exit](</docs/en/agent-sdk/troubleshooting#cli-process-exit>) cover what your code receives in each SDK language. @@ -3443,6 +3632,21 @@ * Open a new PowerShell window outside VS Code and run `where.exe claude`. If it doesn’t print a path, the CLI isn’t on your PATH: add its install directory by following [Verify your PATH](</docs/en/troubleshoot-install#verify-your-path>). If it prints a path, the entry comes from your PowerShell profile or from a PATH change VS Code hasn’t picked up yet; the next two steps cover those cases. * Set the PATH entry as a user or system environment variable, not in your PowerShell profile. The extension doesn’t run your profile, so a PATH edit that lives only there never reaches it. * Restart VS Code after changing PATH. The extension checks the PATH that VS Code captured at startup, so a PATH change takes effect only after a restart. + +### + +​ + +The connection to Claude Code ended before this message completed + +The [VS Code extension](</docs/en/vs-code>) sent your message to the `claude` process, and the connection ended without an error before the process acknowledged or finished it. The extension can’t tell whether the message was processed, so it asks you to send it again: + + The connection to Claude Code ended before this message completed — it may not have been processed, so please send it again. + +**What to do:** + + * Send the message again. The next message starts a fresh `claude` process that resumes the conversation. + * If it repeats, run `claude` in a terminal in the same project. A failure that keeps ending the process usually reproduces there with its real error message. ##
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -292,7 +292,13 @@ The `--allowedTools` flag uses [permission rule syntax](</docs/en/settings-reference#permission-rule-syntax>). The trailing ` *` enables prefix matching, so `Bash(git diff *)` allows any command starting with `git diff`. The space before `*` is important: without it, `Bash(git diff*)` would also match `git diff-index`. -User-invoked [skills](</docs/en/skills>) and custom commands work in `-p` mode: include `/skill-name` in the prompt string and Claude Code expands it before running. Built-in commands that only run in the terminal interface, such as `/login`, aren’t available in `-p` mode. `/model`, `/effort`, `/fast`, `/color`, and `/rename` accept the value as an argument, for example `/model sonnet`, and `/mcp` with no argument prints a text summary of server status; these forms require Claude Code v2.1.205 or later and follow each command’s [availability notes](</docs/en/commands#all-commands>). To change a setting from a `-p` invocation, pass `key=value` to `/config`, for example `/config thinking=false`. +Command support differs in `-p` mode: + + * User-invoked [skills](</docs/en/skills>) and custom commands work. Include `/skill-name` in the prompt string and Claude Code expands it before running. + * Built-in commands that only run in the terminal interface, such as `/login`, aren’t available. + * `/model`, `/effort`, `/fast`, `/color`, and `/rename` accept the value as an argument, for example `/model sonnet`, and `/mcp` with no argument prints a text summary of server status. These forms require Claude Code v2.1.205 or later and follow each command’s [availability notes](</docs/en/commands#all-commands>). + * To change a setting, pass `key=value` to `/config`, for example `/config thinking=false`. Requires Claude Code v2.1.181 or later. + * `/output-style <style>` switches [output styles](</docs/en/output-styles>) and `/output-style` alone lists them. Requires Claude Code v2.1.269 or later. ###
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -636,7 +636,7 @@ Claude answers a side question from what’s already in the conversation: your messages, its replies, and the tool results it has gathered. You can ask about code Claude has already read, decisions it made earlier, or anything else from the session. A later side question also sees your earlier side questions: Claude Code replays the newest 20 exchanges with each ask, until you clear them. The question and answer never enter the conversation history. In the terminal, they appear in a dismissible overlay. The terminal keeps the thread in memory: press `x` to clear the earlier exchanges, and it’s gone when you exit Claude Code. In the [VS Code extension](</docs/en/vs-code#use-the-prompt-box>)’s chat panel, `/btw` opens a panel rather than the overlay this section describes, and you ask follow-up questions right in the panel. The panel’s thread survives window reloads, on the retention schedule that page describes. You need the extension at v2.1.227 or later. Earlier extension versions don’t offer `/btw`. * **Available while Claude is working** : you can run `/btw` even while Claude is processing a response. The side question runs independently and doesn’t interrupt the main turn. It sees everything in the conversation so far, except the reply Claude is still writing. - * **No tool access** : side questions answer only from what is already in context. Claude can’t read files, run commands, or search when answering a side question. + * **No tool access** : side questions answer only from what is already in context. Claude can’t read files, run commands, or search when answering a side question. If Claude writes out tool calls as text anyway, the answer ends with a note that nothing was executed. * **Single response** : there are no follow-up turns in the overlay. To continue the thread, ask another `/btw` question. To continue with full tool access in a local session, press `f` to fork this question and answer into a [background subagent](</docs/en/sub-agents#fork-the-current-conversation>). * **Low cost** : while the conversation’s [prompt cache](</docs/en/prompt-caching>) is warm, a side question costs little beyond the answer itself.
modified Claude Code gateway compatibility guide View current →
--- a/llm-gateway-protocol.md +++ b/llm-gateway-protocol.md @@ -197,7 +197,7 @@ Request and response -The request is `GET /v1/models?limit=1000` with a 3-second timeout, and any redirect is treated as failure so the credential can’t leak to a redirect target. A gateway that responds slowly or redirects `/v1/models`, even `http` to `https`, fails discovery silently; serve the endpoint directly at the configured base URL. Claude Code sends the discovery request with both credential headers below and omits a header whose value doesn’t resolve. Sending both headers requires Claude Code v2.1.248 or later. Earlier versions send only `Authorization` when `ANTHROPIC_AUTH_TOKEN` is set and only `x-api-key` otherwise. +The request is `GET /v1/models?limit=1000` with a timeout of 3 seconds by default, and any redirect is treated as failure so the credential can’t leak to a redirect target. A gateway that responds slower than the timeout, or one that redirects `/v1/models`, even `http` to `https`, fails discovery silently; serve the endpoint directly at the configured base URL. To give a slow gateway longer, set [`CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS`](</docs/en/env-vars#variables>). The variable requires Claude Code v2.1.269 or later. Claude Code sends the discovery request with both credential headers below and omits a header whose value doesn’t resolve. Sending both headers requires Claude Code v2.1.248 or later. Earlier versions send only `Authorization` when `ANTHROPIC_AUTH_TOKEN` is set and only `x-api-key` otherwise. * `Authorization`: `ANTHROPIC_AUTH_TOKEN` as a bearer token, otherwise the [`apiKeyHelper`](</docs/en/llm-gateway-connect#rotate-credentials-with-apikeyhelper>) value as a bearer token. In that case Claude Code waits for the helper to return before sending the request. * `x-api-key`: the API key Claude Code resolved, such as `ANTHROPIC_API_KEY`. When a helper value is the only credential, this header carries it too, so the value arrives in both headers.
modified Control MCP server access for your organization View current →
--- a/managed-mcp.md +++ b/managed-mcp.md @@ -99,12 +99,12 @@ Servers passed with `--mcp-config` or `--strict-mcp-config` -When a session receives servers through `--mcp-config` while `managed-mcp.json` is deployed, what the user sees differs between a workstation and a cloud session: +When a session receives servers through `--mcp-config` while a `managed-mcp.json` that Claude Code can read and parse is deployed, what the user sees differs between a workstation and a cloud session: * On a workstation, Claude Code exits at startup with `You cannot dynamically configure MCP servers when an enterprise MCP config is present`. * In [cloud sessions](</docs/en/claude-code-on-the-web>) on a host where the file is deployed, such as a [self-hosted runner](</docs/en/self-hosted-environments-configuration#mcp-servers>), Claude Code starts with the managed servers only and skips the claude.ai connectors and other servers the cloud host delivers through `--mcp-config`. Nothing in the session tells the user which servers were left out. Claude Code names them in a warning on its stderr, which a self-hosted runner records at the `debug` log level. -If a user passes `--strict-mcp-config`, Claude Code exits at startup on a workstation and in a cloud session alike, because that flag asks to replace the managed set. +The `--strict-mcp-config` flag asks to replace the managed set. If a user passes it while such a file is deployed, Claude Code exits at startup on a workstation and in a cloud session alike. ### @@ -261,7 +261,7 @@ Policy-based control with allowlists and denylists -Allowlists and denylists filter which configured servers are allowed to load. They aren’t a registry: a server still has to be added by a user, a plugin, or your organization before either list applies to it. Servers your organization delivers through `managedMcpServers` load without an allowlist entry, and How a server is evaluated covers `managed-mcp.json` servers. The denylist applies to every server regardless of where it came from, other than in-process `type: "sdk"` entries. To deploy servers to users, use `managed-mcp.json` or `managedMcpServers`. Both lists also filter servers passed with the [`--mcp-config` CLI flag](</docs/en/cli-reference#cli-flags>), other than in-process `type: "sdk"` entries; `--strict-mcp-config` limits which configuration files load and doesn’t bypass either list. To make the allowlist authoritative, set `allowedMcpServers` and `allowManagedMcpServersOnly: true` together in a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>), such as server-managed settings or a deployed `managed-settings.json` file. Restrict the allowlist to managed settings only shows the configuration. Without `allowManagedMcpServersOnly`, allowlists from every settings scope merge, including a user’s own `~/.claude/settings.json`, so a user can broaden what your allowlist permits. Denylists merge from every scope regardless. +Allowlists and denylists filter which configured servers are allowed to load. They aren’t a registry: a server still has to be added by a user, a plugin, or your organization before either list applies to it. Servers your organization delivers through `managedMcpServers` load without an allowlist entry, and How a server is evaluated covers `managed-mcp.json` servers. The denylist applies to every server regardless of where it came from, other than in-process `type: "sdk"` entries. To deploy servers to users, use `managed-mcp.json` or `managedMcpServers`. Both lists also filter servers passed with the [`--mcp-config` CLI flag](</docs/en/cli-reference#cli-flags>), other than in-process `type: "sdk"` entries; `--strict-mcp-config` limits which configuration files load and doesn’t bypass either list. To make the allowlist authoritative, set `allowedMcpServers` and `allowManagedMcpServersOnly: true` together in a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>), such as server-managed settings or a deployed `managed-settings.json` file. The lock applies from every admin-controlled managed source, so a lockdown in a deployed file still applies when server-managed settings that don’t mention MCP are also in use. While the lock is on, the managed allowlist comes from the highest-ranked admin source that sets one. Reading the lock and the allowlist across sources requires Claude Code v2.1.273 or later. Restrict the allowlist to managed settings only shows the configuration. Without `allowManagedMcpServersOnly`, allowlists from every settings scope merge, including a user’s own `~/.claude/settings.json`, so a user can broaden what your allowlist permits. Denylists merge from every scope regardless. `allowManagedMcpServersOnly` is separate from `allowManagedPermissionRulesOnly`, which locks down [permission rules](</docs/en/permissions#managed-settings>) only. Setting that flag does not enforce the MCP allowlist. @@ -292,7 +292,7 @@ The `serverName` validation differs between the two lists: - * In `deniedMcpServers`, `serverName` accepts any non-empty string, so you can block [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>) by their display name. For example, `{ "serverName": "claude.ai Slack" }` blocks the Slack connector. Prefer a `serverUrl` entry when you need the deny to be robust to renames, or when a connector name collides and gains a ` (N)` suffix. + * In `deniedMcpServers`, `serverName` accepts any non-empty string without leading or trailing whitespace, so you can block [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>) by their display name. For example, `{ "serverName": "claude.ai Slack" }` blocks the Slack connector. Prefer a `serverUrl` entry when you need the deny to be robust to renames, or when a connector name collides and gains a ` (N)` suffix. * In `allowedMcpServers`, `serverName` is limited to letters, numbers, hyphens, and underscores. Use `serverUrl` to allowlist a claude.ai connector Claude Code fetches itself; for connectors a cloud host delivers to self-hosted sessions, use the entries listed under [Connector traffic leaves your network](</docs/en/self-hosted-environments-deploy#connector-traffic-leaves-your-network>) instead. To turn off all the claude.ai connectors Claude Code fetches itself, see [`disableClaudeAiConnectors`](</docs/en/mcp#disable-claude-ai-connectors>). @@ -305,7 +305,7 @@ Before loading a server, including one from `managed-mcp.json`, Claude Code runs the three checks below in order. It runs them again when a user reconnects a server or turns a disabled one back on in `/mcp`. In-process `type: "sdk"` servers, which the [app that started the session registers](</docs/en/mcp#how-connectors-reach-claude-code>), skip all three. - 1. **Merge the lists.** Allowlist and denylist entries from every settings scope combine into one allowlist and one denylist, with the managed scope’s lists coming from the [managed source or sources Claude Code applies](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). When `allowManagedMcpServersOnly` is `true`, only the managed allowlist is kept; the denylist always merges from every scope. + 1. **Merge the lists.** Allowlist and denylist entries from every settings scope combine into one allowlist and one denylist. When `allowManagedMcpServersOnly` is `true`, only the managed allowlist is kept; the denylist always merges from every scope. When more than one managed source is present, [Keys read from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>) says which of them supply the managed scope’s lists. 2. **Check the denylist.** A server that matches any denylist entry, by URL, command, or name, is blocked. Nothing overrides a denylist match. 3. **Check the allowlist.** If `allowedMcpServers` isn’t set anywhere, every server that passed the denylist loads. If it is set, what the server must match depends on its type, shown in the table below. The organization’s own servers skip this check: every `managedMcpServers` entry, and any `managed-mcp.json` entry whose values use no `${VAR}` expansion. Built-in servers skip it too, such as Claude in Chrome, the `ide` server Claude Code connects to in a running VS Code or JetBrains IDE, and servers the CLI itself configures. A `managed-mcp.json` server that uses `${VAR}` expansion in its command, arguments, `env`, URL, or headers is still checked, as is every server a user, a plugin, `--mcp-config`, or claude.ai adds. @@ -510,9 +510,9 @@ ---|---|---|--- `managed-mcp.json`| Fixed server set, exclusive control| System path: `/Library/Application Support/ClaudeCode/`, `/etc/claude-code/`, or `C:\Program Files\ClaudeCode\`| MDM, GPO, fleet management, or any process with administrator privileges. Cannot be set through server-managed settings `managedMcpServers`| Remote servers provided to every user alongside their own| Managed settings sources only; the setting has no effect elsewhere| A [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>): server-managed settings, a gateway policy, `managed-settings.json`, MDM profile, or HKLM registry -`allowedMcpServers`| Allowlist of permitted servers| Any [settings scope](</docs/en/settings#where-settings-live>); Claude Code merges the lists from every scope unless `allowManagedMcpServersOnly` is set, and takes the managed scope’s list from the one [managed source it selects](</docs/en/managed-settings#precedence-within-the-managed-tier>) or [composes](</docs/en/managed-settings#compose-every-managed-source>)| For enforcement, a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>): server-managed settings, `managed-settings.json`, MDM profile, or registry -`deniedMcpServers`| Denylist of blocked servers| Any settings scope; Claude Code merges the lists from every scope, and across managed sources as [how Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) describes| Same as `allowedMcpServers` -`allowManagedMcpServersOnly`| Locks the allowlist to managed sources only| Managed settings sources only; the setting has no effect elsewhere| Same as `allowedMcpServers` +`allowedMcpServers`| Allowlist of permitted servers| Any [settings scope](</docs/en/settings#where-settings-live>); How a server is evaluated says how lists from several scopes and managed sources combine| For enforcement, a [managed settings source](</docs/en/admin-setup#decide-how-settings-reach-devices>): server-managed settings, `managed-settings.json`, MDM profile, or registry +`deniedMcpServers`| Denylist of blocked servers| Any settings scope; How a server is evaluated says how lists from several scopes and managed sources combine| Same as `allowedMcpServers` +`allowManagedMcpServersOnly`| Locks the allowlist to managed sources only| Managed settings sources only; [Keys read from every admin source](</docs/en/managed-settings#keys-read-from-every-admin-source>) says which managed sources can turn it on. The setting has no effect in other scopes| Same as `allowedMcpServers` `allowAllClaudeAiMcps`| Loads the claude.ai connectors Claude Code fetches itself alongside `managed-mcp.json`. A `managed-mcp.json` on the host that runs a cloud session still suppresses that session’s connectors| Managed settings sources only; the setting has no effect elsewhere| Same as `allowedMcpServers` ##
modified Deploy managed settings View current →
--- a/managed-settings.md +++ b/managed-settings.md @@ -152,6 +152,8 @@ * `sandbox.network.allowManagedDomainsOnly` and `sandbox.filesystem.allowManagedReadPathsOnly`: a `true` in any admin source turns the lock on. While a lock is on, Claude Code unions the allowlist it locks, `sandbox.network.allowedDomains` together with `WebFetch(domain:...)` allow rules, or `sandbox.filesystem.allowRead`, across every admin source. Without the lock, Claude Code treats the allowlist like any other key, so under `"first-wins"` an unselected admin source’s allowlist is ignored * `allowAllClaudeAiMcps` + * `allowManagedMcpServersOnly`: a `true` in any admin source turns the MCP allowlist lock on. While the lock is on, the managed `allowedMcpServers` list comes from the highest-ranked admin source that sets one. A server-managed list replaces a lower source’s list rather than combining with it. If no admin source sets a list, every server that passes the denylist loads, unless parent settings supply a list. Without the lock, Claude Code reads `allowedMcpServers` from the managed source it applies, so under `"first-wins"` an unselected admin source’s list is ignored. Requires Claude Code v2.1.273 or later + * `deniedMcpServers` and [`disableClaudeAiConnectors`](</docs/en/settings-reference#disableclaudeaiconnectors>): an entry or a `true` in any admin source applies. Requires Claude Code v2.1.273 or later * The sandbox binary paths `sandbox.bwrapPath` and `sandbox.socatPath` * The sandbox `ripgrep` binary, [`sandbox.ripgrep`](</docs/en/settings-reference#sandbox-ripgrep>) * `sandbox.filesystem.disabled` and `sandbox.network.strictAllowlist` @@ -162,7 +164,7 @@ * [`forceRemoteSettingsRefresh`](</docs/en/server-managed-settings>) * `env`, merged per variable across the admin sources: each variable comes from the highest-priority source that defines it, so lower sources fill in variables the higher ones leave unset. A few variables follow their own rules; [Per-key exceptions across managed sources](</docs/en/server-managed-settings#per-key-exceptions-across-managed-sources>) names each one. Requires Claude Code v2.1.223 or later. Before v2.1.223, Claude Code applied the selected source’s whole `env` block only -The gateway login keys follow a separate rule. Claude Code never reads them from server-managed settings, so while server-managed settings are the selected source, the highest-ranked admin source on the machine that carries a policy key still supplies them. A value in an admin source ranked below that one, or in the HKCU registry, is ignored. +The gateway login keys follow a separate rule. Claude Code never reads them from server-managed settings, so while server-managed settings are the selected source, the highest-ranked admin source on the machine that carries a policy key still supplies them. A value in an admin source ranked below that one, or in the HKCU registry, is ignored. When an admin source sets `allowManagedMcpServersOnly` or an `allowedMcpServers` list and that value isn’t the one in force, `/status` and `claude doctor` name that source and key. ### @@ -206,8 +208,8 @@ When another application launches Claude Code, such as Claude Desktop, an IDE extension, or an Agent SDK app, that host can pass its own managed settings through the SDK `managedSettings` option. Claude Code calls these parent settings. By default, Claude Code ignores parent settings whenever an admin source is present: server-managed settings, an MDM or OS-level policy, or a managed settings file. To have Claude Code merge parent settings alongside an admin source, set [`parentSettingsBehavior`](</docs/en/settings-reference#parentsettingsbehavior>) to `"merge"` in the highest-priority managed source; Claude Code reads the key from that source only. Claude Code then keeps only the host’s values that restrict what Claude can do, with one gap to know about: unless you also set the `allowManaged*Only` locks, the host’s permission allow rules and sandbox allowlists still apply. See [Restrict parent settings](</docs/en/claude-apps-gateway#restrict-parent-settings>) for the locks. A [`policyHelper`](</docs/en/settings-reference#policyhelper>) can turn parent merging off regardless of this key; its entry says when. Claude Code also applies these checks to parent-supplied values on their own: * When any admin source sets `allowManagedPermissionRulesOnly`, Claude Code drops [parent-supplied](</docs/en/claude-apps-gateway#restrict-parent-settings>) permission allow rules and `additionalDirectories` as it reads them, even when a higher-priority source leaves the key unset. The key’s effect on your own permission rules comes from the managed settings Claude Code applies, or from parent settings you’ve chosen to merge - * Claude Code enforces the `forceLoginOrgUUID` or `allowedMcpServers` value in the managed settings it applies and blocks a parent-supplied one. A value in a lower admin source that Claude Code doesn’t apply neither applies nor blocks the parent’s. The [`managedSourcesBehavior`](</docs/en/settings-reference#managedsourcesbehavior>) entry says which source supplies each key under `"merge"`. Before v2.1.223, a value in any admin source blocked the parent’s - * An `availableModels` value follows the same rule as `allowedMcpServers` + * Claude Code enforces the `forceLoginOrgUUID` or `allowedMcpServers` value in the managed settings it applies and blocks a parent-supplied one. Outside the MCP allowlist lock, a value in a lower admin source that Claude Code doesn’t apply neither applies nor blocks the parent’s. On Claude Code v2.1.273 or later, while `allowManagedMcpServersOnly` is on, the `allowedMcpServers` list from the highest-ranked admin source that sets one applies and blocks the parent’s, as a cross-source key. The parent’s list applies only when no admin source sets one. The [`managedSourcesBehavior`](</docs/en/settings-reference#managedsourcesbehavior>) entry says which source supplies each key under `"merge"`. Before v2.1.223, a value in any admin source blocked the parent’s + * For `availableModels`, Claude Code enforces the value in the managed settings it applies and blocks a parent-supplied list #### @@ -336,7 +338,7 @@ [`allowAllClaudeAiMcps`](</docs/en/settings-reference#allowallclaudeaimcps>)| Load the claude.ai connectors Claude Code fetches itself alongside a deployed `managed-mcp.json` instead of suppressing them [`allowedChannelPlugins`](</docs/en/settings-reference#allowedchannelplugins>)| Allowlist of channel plugins that may push messages. Replaces the default Anthropic allowlist when set. Requires `channelsEnabled: true`. See [Restrict which channel plugins can run](</docs/en/channels#restrict-which-channel-plugins-can-run>) [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>)| When `true`, restricts which hooks run; see [what runs under `allowManagedHooksOnly`](</docs/en/settings-reference#what-runs-under-allowmanagedhooksonly>) for the full effect list -[`allowManagedMcpServersOnly`](</docs/en/settings-reference#allowmanagedmcpserversonly>)| When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See [Managed MCP configuration](</docs/en/managed-mcp>) +[`allowManagedMcpServersOnly`](</docs/en/settings-reference#allowmanagedmcpserversonly>)| When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See Keys read from every admin source for which managed sources can set it, and [Managed MCP configuration](</docs/en/managed-mcp>) [`allowManagedPermissionRulesOnly`](</docs/en/settings-reference#allowmanagedpermissionrulesonly>)| Makes managed settings the only settings source of permission rules. The entry lists every source it ignores [`blockedMarketplaces`](</docs/en/settings-reference#blockedmarketplaces>)| Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](</docs/en/plugin-marketplaces#managed-marketplace-restrictions>) [`channelsEnabled`](</docs/en/settings-reference#channelsenabled>)| Allow [channels](</docs/en/channels>) for the organization. See [enterprise controls](</docs/en/channels#enterprise-controls>) for the default on each plan
modified Connect to external tools with MCP View current →
--- a/mcp.md +++ b/mcp.md @@ -144,7 +144,7 @@ Connection timing -Claude Code registers the servers you pass in `options.mcpServers` at startup and emits the init message once the first-turn wait, if any, resolves. Without `options.mcpServers`, Claude Code waits 2 seconds for pending servers before the first turn, so servers loaded from settings files such as `.mcp.json` commonly show `pending` at init. When each `options.mcpServers` server connects, and whether it delays the first turn, depends on its type: +Claude Code registers the servers you pass in `options.mcpServers` at startup and emits the init message once the first-turn wait, if any, resolves. Whether each `options.mcpServers` server delays the first turn, and when it connects, depends on its type: Server type| Delays the first turn?| First-turn wait timeout ---|---|--- @@ -152,7 +152,12 @@ Remote server with a cached tool list, saved by Claude Code from a previous connection| No; the cached tools are available from the first turn| None; connects on its first tool call, and that deferred connect has its own timeout In-process SDK server| Yes, until it connects and lists its tools| None; the connect and tool listing requests each have their own timeout -To block startup itself at a separate, earlier phase than the first-turn wait, before the init message is sent: +Servers loaded from settings files such as `.mcp.json` or from plugins commonly show `pending` in the init message. When `options.mcpServers` holds a stdio, HTTP, or SSE server, the first turn waits for these pending servers too, up to `MCP_TIMEOUT`. When `options.mcpServers` is empty or holds only SDK servers, the first turn waits up to 2 seconds instead: + + * **With[tool search](</docs/en/agent-sdk/tool-search>), the default**: the wait covers still-pending servers configured with [`alwaysLoad: true`](</docs/en/mcp#exempt-a-server-from-deferral>) and not the rest. The rest keep connecting in the background. [Tool availability](</docs/en/mcp#tool-availability>) describes how Claude reaches their tools once they connect. + * **Without tool search** : the wait covers every pending server. [Configure tool search](</docs/en/agent-sdk/tool-search#configure-tool-search>) covers what turns tool search off. If you exclude the `ToolSearch` tool from the session, for example through `disallowedTools`, the session also runs without tool search. + +If you set `permissionPromptToolName`, the first turn also waits for that tool’s server in every case, up to `MCP_TIMEOUT`. To set the first-turn wait yourself, add `CLAUDE_CODE_MCP_STARTUP_WAIT_MS` to the [`env` option](</docs/en/agent-sdk/configuration#set-environment-variables>), for example `CLAUDE_CODE_MCP_STARTUP_WAIT_MS: "5000"`. The first turn then waits up to that many milliseconds for every pending server, whether or not tool search is available. This deadline also replaces the `MCP_TIMEOUT` first-turn wait for stdio, HTTP, and SSE servers in `options.mcpServers`. `CLAUDE_CODE_MCP_STARTUP_WAIT_MS` requires Claude Code v2.1.274 or later. Servers still pending when the wait ends keep connecting in the background. Set the variable to `0` to skip the wait. A `permissionPromptToolName` server keeps its own `MCP_TIMEOUT` wait regardless of the value. To block startup itself at a separate, earlier phase than the first-turn wait, before the init message is sent: * Set [`MCP_CONNECTION_NONBLOCKING`](</docs/en/env-vars>) to `0` to block on the whole connection batch. Claude Code caps that wait at 5 seconds by default. Adjust the cap with the [`MCP_CONNECT_TIMEOUT_MS`](</docs/en/env-vars>) environment variable, in milliseconds. Servers still pending at that deadline keep connecting in the background. * Set `alwaysLoad: true` on a server’s config to make its tools available at their full schemas on the first turn, [exempt from tool search deferral](</docs/en/mcp#exempt-a-server-from-deferral>). Claude Code waits at startup for that server’s tools, capped at the same deadline, while other servers keep connecting in the background; a remote server with a cached tool list supplies them without connecting, per the table above.
modified Connect to MCP servers View current →
--- a/mcp-quickstart.md +++ b/mcp-quickstart.md @@ -280,7 +280,7 @@ * **Claude Code desktop app** : add servers through the [Connectors UI](</docs/en/desktop#connect-external-tools>). * **Claude Desktop chat app** : a separate app from Claude Code. To copy servers from its `claude_desktop_config.json` into the CLI, run `claude mcp add-from-claude-desktop` on macOS or WSL. * **VS Code** : see [Connect to external tools with MCP](</docs/en/vs-code#connect-to-external-tools-with-mcp>). - * **Cloud sessions** : commit a `.mcp.json` to your repository. See Edit .mcp.json directly. + * **Cloud sessions** : commit a `.mcp.json` to your repository; a session with one repository loads it. See Edit .mcp.json directly and [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>). * **Claude.ai** : connectors you add at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) load automatically in the CLI when you sign in with that account. See [Use MCP servers from Claude.ai](</docs/en/mcp#use-mcp-servers-from-claude-ai>). ##
modified How Claude remembers your project View current →
--- a/memory.md +++ b/memory.md @@ -356,7 +356,7 @@ "autoMemoryDirectory": "~/my-custom-memory-dir" } -The value must be an absolute path or start with `~/`. When you set it in a project’s `.claude/settings.json` or `.claude/settings.local.json`, Claude Code honors it under the same [workspace trust rule as hooks in settings files](</docs/en/permissions#what-runs-before-you-trust-a-folder>). The directory contains a `MEMORY.md` index and one topic file per memory: +The value must be an absolute path or start with `~/`. When you set it in a project’s `.claude/settings.json` or `.claude/settings.local.json`, Claude Code honors it under the same [workspace trust rule as hooks in settings files](</docs/en/permissions#what-runs-before-you-trust-a-folder>). While [`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>) is on, Claude Code loads no auto memory from a directory that a [repository-supplied settings file](</docs/en/permissions#when-your-local-settings-file-needs-trust>) chooses and saves none to it, wherever that directory sits. The directory contains a `MEMORY.md` index and one topic file per memory: ~/.claude/projects/<project>/memory/ ├── MEMORY.md # Index, one line per memory, loaded into every session
modified Claude Code on mobile View current →
--- a/mobile.md +++ b/mobile.md @@ -1,4 +1,4 @@ -The Claude app for [iOS](<https://apps.apple.com/us/app/claude-by-anthropic/id6473753684>) and [Android](<https://play.google.com/store/apps/details?id=com.anthropic.claude>) is a client for Claude Code sessions rather than a place where code runs. From your phone you reach cloud sessions in the cloud, a session running on your own machine through Remote Control, or the Desktop app through [Dispatch](</docs/en/desktop#sessions-from-dispatch>). +The Claude app for [iOS](<https://apps.apple.com/us/app/claude-by-anthropic/id6473753684>) and [Android](<https://play.google.com/store/apps/details?id=com.anthropic.claude>) is a client for Claude Code sessions rather than a place where code runs. From your phone you reach cloud sessions and [projects](</docs/en/claude-projects>) in the cloud, a session running on your own machine through Remote Control, or the Desktop app through [Dispatch](</docs/en/desktop#sessions-from-dispatch>). Claude Code doesn’t have a separate mobile app: cloud sessions and Remote Control both live in the **Code** tab in the Claude app, and Dispatch is a task you message in the app. @@ -34,15 +34,16 @@ Work from your phone -From the app you can start cloud sessions, drive a Claude Code session running on your computer, or message Dispatch a task. The app is the same for all three; they differ in where the work happens. +From the app you can start cloud sessions, open a project, drive a Claude Code session running on your computer, or message Dispatch a task. The app is the same for each; they differ in where the work happens. Feature| What you connect to| When to use ---|---|--- [Cloud sessions](</docs/en/claude-code-on-the-web>)| A session on cloud infrastructure, Anthropic-managed by default| Your repository is on GitHub and the task should keep running after you put your phone away. See the [cloud quickstart](</docs/en/web-quickstart>) to set up. +[Projects](</docs/en/claude-projects>)| A conversation where Claude coordinates parallel cloud sessions as threads| You have a stream of related work rather than one task and want to see which threads finished or need you. [Remote Control](</docs/en/remote-control>)| A Claude Code session running on your computer| The work needs your local filesystem, tools, or MCP servers. [Dispatch](</docs/en/desktop#sessions-from-dispatch>)| The Desktop app on your computer| You want to message a task and let Dispatch decide how to run it. Requires a Pro or Max plan. -If your computer will be off, use cloud sessions, which run in the cloud and continue with your laptop closed. Remote Control and Dispatch drive your own machine, so it needs to stay on with Claude Code or the Desktop app running. If your machine sleeps during a Remote Control session, Claude Code reconnects when the machine comes back online. For a fuller comparison, see [work when you are away from your terminal](</docs/en/platforms#work-when-you-are-away-from-your-terminal>). Cloud sessions and Remote Control run from the **Code** tab. For Dispatch, which you message as a task in the app, see [sessions from Dispatch](</docs/en/desktop#sessions-from-dispatch>). +If your computer will be off, use cloud sessions or a project, which run in the cloud and continue with your laptop closed. Remote Control and Dispatch drive your own machine, so it needs to stay on with Claude Code or the Desktop app running. If your machine sleeps during a Remote Control session, Claude Code reconnects when the machine comes back online. For a fuller comparison, see [work when you are away from your terminal](</docs/en/platforms#work-when-you-are-away-from-your-terminal>). Cloud sessions and Remote Control run from the **Code** tab. For Dispatch, which you message as a task in the app, see [sessions from Dispatch](</docs/en/desktop#sessions-from-dispatch>). ###
modified Modifying system prompts View current →
--- a/modifying-system-prompts.md +++ b/modifying-system-prompts.md @@ -148,7 +148,7 @@ Once created, activate output styles via: - * **CLI** : run `/config` and select an output style + * **CLI** : run `/output-style <style>`, for example `/output-style concise`, or run `/config` and select one. The `/output-style` command requires Claude Code v2.1.269 or later. * **Settings** : set `outputStyle` in `.claude/settings.local.json` * **TypeScript SDK** : set `outputStyle` inside the inline `settings` object passed to `query()`, or point `settings` at a settings file that sets it. `outputStyle` is not a top-level `Options` field:
modified Output styles View current →
--- a/output-styles.md +++ b/output-styles.md @@ -21,11 +21,10 @@ Pick a style in one of these ways: + * **`/output-style` command**: run `/output-style <style>` to switch, for example `/output-style concise`. With no argument, the command lists the styles you can pick and marks the current one. Claude Code saves your selection to `.claude/settings.local.json` at the [local project level](</docs/en/settings>). The command also works in [non-interactive mode](</docs/en/headless>) and Agent SDK sessions, and from the mobile app or web via [Remote Control](</docs/en/remote-control#limitations>), where you can list and select only built-in styles. Requires Claude Code v2.1.269 or later. * **Terminal** : run `/config` and select **Output style** to pick a style from a menu. Claude Code saves your selection to `.claude/settings.local.json` at the [local project level](</docs/en/settings>). * **VS Code extension** : open the [command menu](</docs/en/vs-code#use-the-prompt-box>) with `/` and select **Output styles** to pick a style, including your custom styles. Claude Code saves your selection to `.claude/settings.local.json`, the same file the terminal menu writes. Requires Claude Code v2.1.257 or later. * **Desktop app** : set the `outputStyle` field in a settings file, for example `.claude/settings.local.json`, the file the terminal menu writes. When you run `/config` there, Claude Code [opens **Settings > Claude Code**](</docs/en/desktop#what%E2%80%99s-not-available-in-desktop>) rather than a menu. - -The standalone `/output-style` command was deprecated in v2.1.73 and removed in v2.1.91. Use `/config` or edit the `outputStyle` setting directly. To set a style without the menu, edit the `outputStyle` field directly in a settings file: @@ -77,7 +76,7 @@ Switch to your style -Run `/config` in the terminal and select your style under **Output style**. Claude uses the new style starting with your next message. In the terminal, Claude Code reads style files when it starts, so if you create or edit one during a running session, restart Claude Code to pick up the change. +Run `/output-style <style>` in the terminal, or run `/config` and select your style under **Output style**. Claude uses the new style starting with your next message. In the terminal, Claude Code reads style files when it starts, so if you create or edit one during a running session, restart Claude Code to pick up the change. [Plugins](</docs/en/plugins-reference>) can also ship output styles in an `output-styles/` directory.
modified Choose a permission mode View current →
--- a/permission-modes.md +++ b/permission-modes.md @@ -526,7 +526,7 @@ * Your working directory and its parents * Your additional working directories and their parents, but only when the removal is a glob under one of them, such as `rm -rf <dir>/*`. `rm -rf <dir>` on the directory itself doesn’t trigger this check -Claude Code also treats a glob or trailing slash directly under a shell variable, such as `rm -rf "$DIR"/*`, as a critical-path removal, because the command becomes a removal from the filesystem root when the variable is empty. Hiding the removal inside command substitution with `$(...)` or backticks, or process substitution with `<(...)`, doesn’t skip the check. Claude Code finds a critical-path removal whether it sits inside the substitution, as in `echo "$(rm -rf ~)"`, or elsewhere in the same command. +Claude Code also treats a glob or trailing slash directly under a shell variable, such as `rm -rf "$DIR"/*`, as a critical-path removal, because the command becomes a removal from the filesystem root when the variable is empty. Hiding the removal inside a subshell with `(...)`, a brace group with `{ ...; }`, command substitution with `$(...)` or backticks, or process substitution with `<(...)`, doesn’t skip the check. Claude Code finds a critical-path removal whether it sits inside the nested form, as in `(rm -rf ~)` or `echo "$(rm -rf ~)"`, or elsewhere in the same command. ###
modified Platforms and integrations View current →
--- a/platforms.md +++ b/platforms.md @@ -74,6 +74,7 @@ * [VS Code](</docs/en/vs-code>): the Claude Code extension inside your editor * [JetBrains](</docs/en/jetbrains>): the extension for IntelliJ, PyCharm, and other JetBrains IDEs * [Web](</docs/en/claude-code-on-the-web>): cloud sessions from your browser at claude.ai/code that keep running when you disconnect + * [Projects](</docs/en/claude-projects>): one conversation where Claude coordinates many cloud sessions for a body of work and reports back * [Mobile](</docs/en/mobile>): the Claude app for [iOS](<https://apps.apple.com/us/app/claude-by-anthropic/id6473753684>) and [Android](<https://play.google.com/store/apps/details?id=com.anthropic.claude>) for starting and monitoring tasks while away from your computer ###
modified Constrain plugin dependency versions View current →
--- a/plugin-dependencies.md +++ b/plugin-dependencies.md @@ -59,7 +59,7 @@ ] } -Installing `backend-standard` resolves and installs all four dependencies. To add a tool to the standard set later, publish a new `backend-standard` version with the extra dependency. Auto-update is off by default for non-Anthropic marketplaces, so engineers pick up the new version in one of two ways: +Installing `backend-standard` resolves and installs all four dependencies. To add a tool to the standard set later, publish a new `backend-standard` version with the extra dependency. Unless the marketplace [auto-updates](</docs/en/discover-plugins#configure-auto-updates>), engineers pick up the new version in one of two ways: * Enable auto-update for the marketplace in `/plugin`. The next auto-update moves the bundle to the new version and installs any dependencies it adds. * Run `claude plugin update backend-standard`, then `/reload-plugins` to install the newly added dependencies.
modified Create and distribute a plugin marketplace View current →
--- a/plugin-marketplaces.md +++ b/plugin-marketplaces.md @@ -166,7 +166,7 @@ `owner`| object| Marketplace maintainer information. See Owner fields| `plugins`| array| List of available plugins| See Plugin entries -**Reserved names** : the following marketplace names are reserved for official Anthropic use and can’t be used by third-party marketplaces: `claude-code-marketplace`, `claude-code-plugins`, `claude-plugins-official`, `claude-plugins-community`, `claude-community`, `anthropic-marketplace`, `anthropic-plugins`, `agent-skills`, `anthropic-agent-skills`, `knowledge-work-plugins`, `life-sciences`, `claude-for-legal`, `claude-for-financial-services`, `financial-services-plugins`, `first-party-plugins`, `claude-tag-plugins`, `healthcare`. Names that impersonate official marketplaces, such as `official-claude-plugins` or `anthropic-plugins-v2`, are also blocked. Reserving these names prevents a third-party marketplace from presenting itself as an Anthropic-published source.Claude Code re-checks reserved names every time it loads a marketplace, not only when you add one. A marketplace that was registered under one of these names before the name became reserved stops loading and reports that it is [registered from an untrusted source](</docs/en/errors#marketplace-is-registered-from-an-untrusted-source>). Remove that marketplace and re-add it from the official Anthropic source. A third-party marketplace affected by a newly reserved name loads again as soon as you re-add it under a different name. Before v2.1.205, `first-party-plugins` and `healthcare` weren’t reserved, and a marketplace already registered under a reserved name kept loading. Before v2.1.265, `claude-tag-plugins` wasn’t reserved. +**Reserved names** : the following marketplace names are reserved for official Anthropic use and can’t be used by third-party marketplaces: `claude-code-marketplace`, `claude-code-plugins`, `claude-plugins-official`, `claude-plugins-community`, `claude-community`, `anthropic-marketplace`, `anthropic-plugins`, `agent-skills`, `anthropic-agent-skills`, `knowledge-work-plugins`, `life-sciences`, `claude-for-legal`, `claude-for-financial-services`, `financial-services-plugins`, `first-party-plugins`, `claude-tag-plugins`, `healthcare`. Names that impersonate official marketplaces, such as `official-claude-plugins` or `anthropic-plugins-v2`, are also blocked. Reserving these names prevents a third-party marketplace from presenting itself as an Anthropic-published source.Claude Code re-checks reserved names every time it loads a marketplace, not only when you add one. A marketplace that was registered under one of these names before the name became reserved stops loading and reports that it is [registered from an untrusted source](</docs/en/errors#marketplace-is-registered-from-an-untrusted-source>). Remove that marketplace and re-add it from the official Anthropic source. A third-party marketplace affected by a newly reserved name loads again as soon as you re-add it under a different name. Before v2.1.205, `first-party-plugins` and `healthcare` weren’t reserved, and a marketplace already registered under a reserved name kept loading. Before v2.1.265, `claude-tag-plugins` wasn’t reserved.You also can’t name a marketplace `npm`, `pip`, `uv`, `cargo`, `github`, or `gh`, in any casing. This check requires Claude Code v2.1.275 or later. ### @@ -278,7 +278,7 @@ `github`| object| `repo`, `ref?`, `sha?`| `url`| object| `url`, `ref?`, `sha?`| Git URL source `git-subdir`| object| `url`, `path`, `ref?`, `sha?`| Subdirectory within a git repo. Clones sparsely to minimize bandwidth for monorepos -`npm`| object| `package`, `version?`, `registry?`| Installed via `npm install` +`npm`| object| `package`, `version?`, `registry?`| npm package, fetched with your npm client and unpacked without running install scripts `archive`| object| `url`, `sha256?`| Zip archive downloaded over HTTPS. Works without git or npm on the user’s machine. Requires Claude Code v2.1.224 or later `command`| object| `command`, `timeout?`, `mode?`| Plugin directory produced by running a local command, re-run once per session to pick up changes. Requires Claude Code v2.1.229 or later @@ -417,7 +417,7 @@ npm packages -Plugins distributed as npm packages are installed using `npm install`. This works with any package on the public npm registry or a private registry your team hosts. +An npm source can name any package on the public npm registry or on a private registry your team hosts. Claude Code resolves the package with your npm client, downloads the tarball, and unpacks it into the plugin cache. The package’s install scripts, such as `preinstall` or `postinstall`, never run, and its dependencies aren’t installed during the fetch. If the package ships a supported lockfile beside its `package.json`, Claude Code installs those [Node.js package dependencies](</docs/en/plugins-reference#node-js-package-dependencies>) in a separate step, also with scripts disabled. Otherwise, publish the plugin with everything it needs already built. An MCP server that needs other packages can launch through `npx`, which installs them at first run. { "name": "my-npm-plugin", @@ -1044,7 +1044,7 @@ * For `hostPattern` sources: the marketplace host is matched against the regex pattern * For `pathPattern` sources: the marketplace’s filesystem path is matched against the regex pattern -The allowlist’s exact matching treats URLs that differ only by a trailing slash, a `.git` suffix, or the `ssh://` and `https://` scheme as different values. If your organization’s marketplace can be cloned by more than one URL form, prefer a `hostPattern` entry over a literal URL so the `https://`, `ssh://`, and `user@host:path` forms all match. Because `strictKnownMarketplaces` is set in [managed settings](</docs/en/managed-settings>), individual users and project configurations can’t override these restrictions. For complete configuration details including all supported source types and comparison with `extraKnownMarketplaces`, see the [strictKnownMarketplaces reference](</docs/en/settings-reference#strictknownmarketplaces>). +The allowlist’s exact matching treats URLs that differ only by a trailing slash, a `.git` suffix, or the `ssh://` and `https://` scheme as different values. If your organization’s marketplace can be cloned by more than one URL form, prefer a `hostPattern` entry over a literal URL so the `https://`, `ssh://`, and `user@host:path` forms all match. A [marketplace hosted on claude.ai](</docs/en/discover-plugins#add-from-claude-ai>) is matched by host: a `hostPattern` entry that matches `claude.ai` governs it, in `strictKnownMarketplaces` and in `blockedMarketplaces`. On the allowlist, such an entry doesn’t admit a member’s personal claude.ai uploads. Requires Claude Code v2.1.273 or later. Because `strictKnownMarketplaces` is set in [managed settings](</docs/en/managed-settings>), individual users and project configurations can’t override these restrictions. For complete configuration details including all supported source types and comparison with `extraKnownMarketplaces`, see the [strictKnownMarketplaces reference](</docs/en/settings-reference#strictknownmarketplaces>). ### @@ -1221,6 +1221,7 @@ ---|---|--- `--scope <scope>`| Where to declare the marketplace: `user`, `project`, or `local`. See [Plugin installation scopes](</docs/en/plugins-reference#plugin-installation-scopes>)| `user` `--sparse <paths...>`| Limit checkout to specific directories via git sparse-checkout. Useful for monorepos| +`--claudeai`| Read the argument as the name of a [marketplace hosted on claude.ai](</docs/en/discover-plugins#add-from-claude-ai>) instead of a source. Requires Claude Code v2.1.273 or later| Add a marketplace from GitHub using `owner/repo` shorthand: @@ -1249,6 +1250,12 @@ For a monorepo, limit the checkout to the directories that contain plugin content: claude plugin marketplace add acme-corp/monorepo --sparse .claude-plugin plugins + +Add a [marketplace hosted on claude.ai](</docs/en/discover-plugins#add-from-claude-ai>) by the name printed in the `From claude.ai:` section of `claude plugin marketplace list`: + + claude plugin marketplace add --claudeai claudeai-organization-library + +With `--claudeai`, the command refuses `--scope` and `--sparse`. The marketplace is hosted for your account, not declared in a settings file, so you can’t share it through a project’s `.claude/settings.json`. ### @@ -1266,7 +1273,7 @@ ---|--- `--json`| Output as JSON -With `--json`, each entry includes `name`, `source`, an `installLocation` field with the local cache path where the marketplace is stored, and source-specific fields: `repo` for GitHub sources, `url` for git and URL sources, and `path` for local sources. GitHub and git sources also include a `ref` field when the marketplace was added with a pinned branch or tag. +With `--json`, each entry includes `name`, `source`, an `installLocation` field with the local cache path where the marketplace is stored, and source-specific fields: `repo` for GitHub sources, `url` for git and URL sources, and `path` for local sources. GitHub and git sources also include a `ref` field when the marketplace was added with a pinned branch or tag. An added [claude.ai marketplace](</docs/en/discover-plugins#add-from-claude-ai>) has no local clone, so its entry carries its claude.ai identifiers, `marketplaceId` and `organizationUuid`, in place of `installLocation`. In terminal sessions where [plugins sync from your claude.ai account](</docs/en/plugins-reference#synced-plugins>), the text listing ends with a `From claude.ai:` section naming what claude.ai lists for your account beyond the marketplaces you’ve added. To add one of them, see [Add from claude.ai](</docs/en/discover-plugins#add-from-claude-ai>). The `--json` output covers configured marketplaces only and leaves that section out. Requires Claude Code v2.1.273 or later. ###
modified Recommend plugins for your org View current →
--- a/plugin-relevance.md +++ b/plugin-relevance.md @@ -74,7 +74,7 @@ `filesRead`| array of strings| Glob patterns matched against the paths of files Claude has read this session, for example `["**/*.tf"]`. Forward-slash normalized and case-insensitive. Maximum 10 patterns of 256 characters each. `manifestDeps`| array of objects| Dependencies declared in package manifests Claude has read this session. Each entry is `{ "file": "...", "pattern": "..." }`, where `file` is a regular expression matched against the manifest file’s path as recorded in session state, typically an absolute path, and `pattern` is a regular expression matched against that file’s contents. Anchor `file` at the end, for example `[/\\\\]package\\.json$` in JSON-escaped form, because a start-anchored pattern never matches an absolute path. Paths are not separator-normalized for this signal, so Windows paths use backslashes. Manifest files larger than 512 KB are skipped. Both values are JavaScript `RegExp` source strings of at most 256 characters. `file` matches case-insensitively. `pattern` is case-sensitive. Maximum 10 entries. -The `cli`, `hosts`, `filesRead`, and `manifestDeps` signals need session history, so they can only match on the spinner tip and the Discover tab. The `filesRead` and `manifestDeps` signals test the session’s recorded file state, which also includes files Claude has written or edited and auto-loaded `CLAUDE.md` memory files. The following example uses `manifestDeps` to suggest a Stripe plugin once Claude has read a `package.json` that depends on `stripe`. The `file` pattern uses `[/\\\\]` so it matches both forward-slash and backslash path separators, and `\\.` so the dot is literal. In JSON, each backslash in the regular expression is written twice. +The `cli`, `hosts`, `filesRead`, and `manifestDeps` signals need session history, so they can only match on the spinner tip and the Discover tab. The `filesRead` and `manifestDeps` signals test the session’s recorded file state, which also includes files Claude has written or edited and auto-loaded `CLAUDE.md` memory files. For these two signals, Claude Code skips paths under its own [configuration directory](</docs/en/claude-directory>) and its temporary directories. The following example uses `manifestDeps` to suggest a Stripe plugin once Claude has read a `package.json` that depends on `stripe`. The `file` pattern uses `[/\\\\]` so it matches both forward-slash and backslash path separators, and `\\.` so the dot is literal. In JSON, each backslash in the regular expression is written twice. { "name": "stripe-helpers",
modified Plugins reference View current →
--- a/plugins-reference.md +++ b/plugins-reference.md @@ -63,7 +63,7 @@ Hooks -Plugins can provide event handlers that respond to Claude Code events automatically. **Location** : `hooks/hooks.json` in plugin root, or inline in plugin.json **Format** : JSON configuration with event matchers and actions **Hook configuration** : +Plugins can provide event handlers that respond to Claude Code events automatically. **Location** : `hooks/hooks.json` in plugin root, or inline in plugin.json **Format** : JSON configuration with event matchers and actions `hooks/hooks.json` can carry a top-level `$schema` key that names a JSON Schema URL for editor autocomplete and validation. Claude Code ignores the key at load time. **Hook configuration** : { "hooks": { @@ -752,13 +752,13 @@ `bun.lock` or `bun.lockb`| `bun install --frozen-lockfile --ignore-scripts` `npm-shrinkwrap.json` or `package-lock.json`| `npm ci --ignore-scripts` -If a plugin contains more than one of these lockfiles, Claude Code uses the first match, checking in order: `bun.lock`, `bun.lockb`, `npm-shrinkwrap.json`, `package-lock.json`. Claude Code skips `yarn.lock` and `pnpm-lock.yaml` because Yarn and pnpm support resolution-time configuration hooks that bypass `--ignore-scripts`. Ship an npm lockfile for the widest reach. Claude Code runs the matched lockfile’s package manager from the user’s PATH and doesn’t fall back to the other lockfile if it’s missing. For a plugin distributed through an npm source, use `npm-shrinkwrap.json`; npm excludes `package-lock.json` from published packages. Claude Code constrains this dependency install so that no code from the plugin or its packages executes during it, and bounds how long it can run: +If a plugin contains more than one of these lockfiles, Claude Code uses the first match, checking in order: `bun.lock`, `bun.lockb`, `npm-shrinkwrap.json`, `package-lock.json`. Claude Code skips `yarn.lock` and `pnpm-lock.yaml` because Yarn and pnpm support resolution-time configuration hooks that bypass `--ignore-scripts`. When a `bunfig.toml` sits beside the matched bun lockfile, Claude Code skips the install entirely, because the file can configure a security scanner that Bun loads and runs during the install. The filename match ignores letter case. Remove the `bunfig.toml`, or ship an npm lockfile in place of the bun lockfile. Ship an npm lockfile for the widest reach. Claude Code runs the matched lockfile’s package manager from the user’s PATH and doesn’t fall back to the other lockfile if it’s missing. For a plugin distributed through an npm source, use `npm-shrinkwrap.json`; npm excludes `package-lock.json` from published packages. Claude Code constrains this dependency install so that no code from the plugin or its packages executes during it, and bounds how long it can run: * **Frozen resolution:** Bun and npm install exactly what the lockfile pins, and fail rather than re-resolve versions when `package.json` and the lockfile disagree. * **No lifecycle scripts:** `--ignore-scripts` keeps `preinstall`, `install`, and `postinstall` scripts from running, so dependencies that build native modules in those scripts download but don’t compile during this install. * **60-second timeout:** Claude Code stops an install that runs longer and treats it as failed. -Fetching an npm-source plugin itself runs `npm install` with lifecycle scripts enabled, before this dependency install runs. A failed or skipped install never blocks the plugin. When the install fails, or Claude Code skips a yarn or pnpm lockfile, it records the reason as a warning in debug output. A plugin with a `package.json` and no lockfile is skipped without a log entry. A timed-out install can leave a partial `node_modules` tree in the cached copy. You can’t turn the automatic install off; no setting or environment variable disables it. In restricted networks, see the [network access requirements](</docs/en/network-config#network-access-requirements>) for the hosts to allow. For dependencies the automatic install can’t provide, such as packages that need their lifecycle scripts to build, Python dependencies, or a plugin locked with Yarn or pnpm, install them from a hook into the persistent data directory. +Claude Code fetches an npm-source plugin before this dependency install, and none of the package’s own install scripts run during the fetch. See [npm packages](</docs/en/plugin-marketplaces#npm-packages>). A failed or skipped install never blocks the plugin. When the install fails, or Claude Code skips a yarn or pnpm lockfile or a bun lockfile with a `bunfig.toml` beside it, it records the reason as a warning in debug output. A plugin with a `package.json` and no lockfile is skipped without a log entry. A timed-out install can leave a partial `node_modules` tree in the cached copy. You can’t turn the automatic install off; no setting or environment variable disables it. In restricted networks, see the [network access requirements](</docs/en/network-config#network-access-requirements>) for the hosts to allow. For dependencies the automatic install can’t provide, such as packages that need their lifecycle scripts to build, Python dependencies, or a plugin locked with Yarn or pnpm, install them from a hook into the persistent data directory. ### @@ -1397,7 +1397,7 @@ 2. The `version` field in the plugin’s marketplace entry in `marketplace.json` 3. The git commit SHA of the plugin’s source, for `github`, `url`, `git-subdir`, and relative-path sources in a git-hosted marketplace 4. The SHA-256 digest, for [`archive` sources](</docs/en/plugin-marketplaces#zip-archives>): the `sha256` pin in the marketplace entry, or the digest of the downloaded file when you set no pin. Claude Code shortens it to the first 12 characters - 5. `unknown`, for `npm` sources or local directories not inside a git repository + 5. `unknown`, for `npm` sources, or for local directories when neither the plugin directory nor its marketplace is a git repository. Claude Code doesn’t take the version from a repository that encloses the install path, such as a git-managed `~/.claude` For a [`command` source](</docs/en/plugin-marketplaces#command-sources>), Claude Code always derives the version from what the command produced: a 12-character content hash on its own, or appended to the `plugin.json` version as `<version>-<hash>` when one is set. Claude Code ignores the marketplace entry’s `version` field for command sources. A command whose hashed output changes therefore produces a new version, even when the authored version string stays the same. In [link mode](</docs/en/plugin-marketplaces#copy-mode-and-link-mode>), the hash covers the printed directory’s real path and its top-level entries rather than the file contents. For those source types, this gives you three ways to version a plugin:
modified How Claude Code uses prompt caching View current →
--- a/prompt-caching.md +++ b/prompt-caching.md @@ -238,7 +238,7 @@ Changing output style -When you switch [output styles](</docs/en/output-styles>) mid-session with `/config` or the `outputStyle` setting, Claude uses the new style starting with your next message. Claude Code delivers the new style’s instructions as a message in the conversation, so that request still reads the system prompt and the earlier conversation from the cache. Before v2.1.251, a mid-session style switch kept the cache but didn’t apply until you ran `/clear` or started a new session. +When you switch [output styles](</docs/en/output-styles>) mid-session with [`/output-style`](</docs/en/output-styles#change-your-output-style>), `/config`, or the `outputStyle` setting, Claude uses the new style starting with your next message. Claude Code delivers the new style’s instructions as a message in the conversation, so that request still reads the system prompt and the earlier conversation from the cache. Before v2.1.251, a mid-session style switch kept the cache but didn’t apply until you ran `/clear` or started a new session. ###
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -332,10 +332,11 @@ * Text-output commands: `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/usage-credits`, `/recap`, and `/reload-plugins`. `/usage-credits` prints the billing URL instead of opening a browser. `/reload-plugins` works only when the session runs in an interactive terminal; a session without one declines it. * `/model`, `/effort`, `/fast`, `/color`, and `/rename`: pass the value as an argument, for example `/model sonnet` or `/effort high`. From mobile and web, `/model` and `/effort` take the argument in place of the terminal picker or slider. * `/mcp`: from the mobile app, returns a text summary of server status instead of opening the picker. On the web, `/mcp` on its own opens a directory of [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>) instead of returning the summary. The `reconnect`, `enable`, and `disable` [subcommands](</docs/en/commands#all-commands>) work from both. Unlike the local CLI, `/mcp reconnect` without a server name reconnects every server that has failed or needs authentication. - * `/config`, from v2.1.181: from the mobile app, pass `key=value` to set a setting, or run it with no argument to list the keys you can set. On the web, `/config` opens the Claude Code section of your settings instead, and ignores text after the command. + * `/config`: from the mobile app, pass `key=value` to set a setting, or run it with no argument to list the keys you can set. On the web, `/config` opens the Claude Code section of your settings instead, and ignores text after the command. * On Team and Enterprise, `/usage-credits` from mobile or web doesn’t send a [usage-credits request to your admin](</docs/en/costs#add-usage-credits-to-your-subscription>). Sending requires a confirmation that appears only in the interactive CLI, so the command tells you to run it there instead. Before v2.1.211, the text form sent the request without confirmation. * `/autocompact`, from v2.1.221: pass the window size as an argument, for example `/autocompact 500k`. With no argument, it prints the current window size as text instead of opening the dialog the command shows in a terminal session. * `/advisor`, from v2.1.260: pass the model as an argument, for example `/advisor opus`, or pass `off` to turn the advisor off. Both forms apply to the current session only and leave your saved default unchanged. With no argument, it prints the current advisor as text instead of opening the picker. + * `/output-style`, from v2.1.269: pass the style name as an argument, for example `/output-style concise`, or run it with no argument to list the styles. From mobile and web, you can list and select only [built-in styles](</docs/en/output-styles#built-in-output-styles>). To use a [custom style](</docs/en/output-styles#create-a-custom-output-style>), select it in the session itself. ##
modified Automate work with routines View current →
--- a/routines.md +++ b/routines.md @@ -140,7 +140,7 @@ Open the routine for editing -Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine you want to trigger via API, then click the pencil icon to open **Edit routine**. +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine you want to trigger via API, then open the menu next to the routine’s name and select **Edit**. 2 @@ -216,7 +216,7 @@ Open the routine for editing -Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine, then click the pencil icon to open **Edit routine**. +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine, then open the menu next to the routine’s name and select **Edit**. 2 @@ -297,9 +297,9 @@ From the routine detail page you can: * Click **Run now** to start a run immediately without waiting for the next scheduled time. You can optionally supply run-specific text, which reaches the routine the same way as the API trigger’s `text` field. - * Use the toggle in the **Repeats** section to pause or resume the schedule. Paused routines keep their configuration but don’t run until you re-enable them. - * Click the pencil icon to open **Edit routine** and change the name, prompt, repositories, environment, connectors, or any of the routine’s triggers. The **Select a trigger** section is where you add or remove schedules, API tokens, and GitHub event triggers. - * Click the delete icon to remove the routine. Past sessions created by the routine remain in your session list. + * Use the on/off switch at the top of the page to pause or resume the schedule. Paused routines keep their configuration but don’t run until you re-enable them. + * Open the menu next to the routine’s name and select **Edit** to change the name, prompt, repositories, environment, connectors, or any of the routine’s triggers. The **Select a trigger** section is where you add or remove schedules, API tokens, and GitHub event triggers. + * Open the same menu and select **Delete** to delete the routine. ### @@ -327,7 +327,7 @@ Connectors -Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>), or declare it in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI. +Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>). For a routine with one repository, you can instead declare it in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI. ### @@ -341,7 +341,7 @@ Open the routine for editing -On the routine’s detail page, click the pencil icon to open **Edit routine**. +On the routine’s detail page, open the menu next to the routine’s name and select **Edit**. 2 @@ -416,5 +416,6 @@ * [`/loop` and in-session scheduling](</docs/en/scheduled-tasks>): schedule local tasks within an open CLI session * [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): local scheduled tasks that run on your machine with access to local files * [Cloud environments](</docs/en/cloud-environments>): configure network access, environment variables, and setup scripts for cloud sessions + * [Projects](</docs/en/claude-projects>): ongoing work Claude coordinates across parallel cloud sessions; routines created from a project appear on its **Routines** tab * [MCP connectors](</docs/en/mcp>): connect external services like Slack, Linear, and Google Drive * [GitHub Actions](</docs/en/github-actions>): run Claude in your CI pipeline on repository events
modified Configure the sandboxed Bash tool View current →
--- a/sandboxing.md +++ b/sandboxing.md @@ -446,7 +446,7 @@ * **In your working directory and the directories above it** : the `.claude` settings files, the `.claude/skills`, `.claude/agents`, `.claude/commands`, and `.claude/hooks` directories, `.mcp.json`, and the files Claude Code runs on its own, such as `.claude/workflows` and `.claude/scheduled_tasks.json` * **In your working directory only** : shell startup files such as `.bashrc` and `.zshrc`, `.gitconfig`, the `.vscode` and `.idea` directories, and `hooks` and `config` inside `.git` - * **Files that would turn your working directory into a bare git repository** : `HEAD`, `objects`, and `refs` at the top level, plus `config` and `hooks` there when they already exist, even when the `config` directory belongs to your project rather than to git. On Linux and WSL2, the sandbox deletes a top-level `HEAD` file or `objects` or `refs` directory that appears while a sandboxed command is running + * **Files that would turn your working directory into a bare git repository** : `HEAD`, `objects`, and `refs` at the top level, plus `config` and `hooks` there when a `HEAD` sits beside them. A file named `config` is denied even with no `HEAD`. On Linux and WSL2, the sandbox deletes a top-level `HEAD` file or `objects` or `refs` directory that appears while a sandboxed command is running * **In`~/.claude`, or the directory `CLAUDE_CONFIG_DIR` points to**: most of its contents, plus `~/.claude.json` and the `.credentials.json` credential store If a symlink appears at a protected settings file’s path during the session, the sandbox also denies writes to the file it points to, starting with the next command. There is no way to exempt one of these paths: an `allowWrite` entry or an `Edit` allow rule that covers the path doesn’t lift the protection. The only way to turn the protection off is `filesystem.disabled`, which turns off filesystem isolation for every path. To see most of these paths resolved for your machine, run `/sandbox` and open the **Config** tab, which lists them under **Denied within allowed** , mixed in with your own `denyWrite` entries. If `git merge` or `git checkout` fails with `unable to unlink old` on one of these paths, see Troubleshooting.
modified Run prompts on a schedule View current →
--- a/scheduled-tasks.md +++ b/scheduled-tasks.md @@ -222,7 +222,7 @@ * Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal. * No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval. * Starting a fresh conversation clears all session-scoped tasks. When you resume a session with `claude --resume` or `claude --continue`, Claude Code restores the tasks scheduled with `CronCreate`, except recurring tasks that have expired and one-shot tasks whose scheduled time has passed. A self-paced `/loop` isn’t restored, so run `/loop` again to restart it. Background Bash and monitor tasks are never restored on resume. - * With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude` directory. When that directory or the task file in it is a symlink, Claude Code returns an error instead of scheduling the task. + * With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude/scheduled_tasks.json` file. When the `.claude` directory or that file is a symlink, Claude Code returns an error instead of scheduling the task. A saved task runs only in the project folder where you created it. If you copy the file into another folder, such as a new worktree, sessions there list the copied tasks but don’t run them, so create the task again in that folder. For cron-driven automation that needs to run unattended:
modified Settings files and precedence View current →
--- a/settings.md +++ b/settings.md @@ -355,10 +355,10 @@ A [cloud session](</docs/en/claude-code-on-the-web>) runs in a [cloud environment](</docs/en/cloud-environments>) on a fresh clone of your repository, not on your machine. That changes which settings reach it: - * **Shared project settings** (`.claude/settings.json`): read, because the file is part of the clone. Commit a setting there to apply it in cloud sessions. + * **Shared project settings** (`.claude/settings.json`): read in a session with one repository, because the file is part of the clone and the session starts inside it. Commit a setting there to apply it in those sessions. A session with several repositories starts above the clones, so from each repository’s `.claude/settings.json` it loads only the plugins and marketplaces the file declares, not permission rules, hooks, `env`, or other keys; see [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>). * **User and project local settings** (`~/.claude/settings.json` and `.claude/settings.local.json`): not read. Both stay on your machine, and the local file isn’t in the clone. * **Managed settings** : only [server-managed settings](</docs/en/server-managed-settings>) reach a cloud session; a `managed-settings.json` file or MDM profile on your device doesn’t. A [self-hosted environment](</docs/en/self-hosted-environments>) also reads the managed settings file in its runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. - * **`/config`** : in your browser at claude.ai/code, opens the Claude Code section of your claude.ai settings instead of changing a value. To change a setting for a cloud session, set an [environment variable](</docs/en/cloud-environments#set-environment-variables>) on the environment or commit the key to the repository’s `.claude/settings.json`. + * **`/config`** : in your browser at claude.ai/code, opens the Claude Code section of your claude.ai settings instead of changing a value. To change a setting for a cloud session, set an [environment variable](</docs/en/cloud-environments#set-environment-variables>) on the environment, or in a session with one repository, commit the key to that repository’s `.claude/settings.json`. [What carries over from your setup](</docs/en/cloud-environments#what-carries-over-from-your-setup>) lists the rest: `CLAUDE.md`, skills, MCP servers, plugins, and credentials.
modified All settings View current →
--- a/settings-reference.md +++ b/settings-reference.md @@ -1074,7 +1074,7 @@ } } -If only a repository’s checked-in settings file adds a directory, the block still applies to reads there. Files Claude Code itself needs stay readable, such as your skills, plugins, rules, agents, commands, and the `CLAUDE.md` memory file under `~/.claude/`. When the [sandbox](</docs/en/sandboxing>) is on, the block also denies sandboxed commands read access to home directories and mounted-volume roots outside the working directories. A retry that needs approval to [run outside the sandbox](</docs/en/sandboxing#the-unsandboxed-retry-escape-hatch>) prompts you even in `bypassPermissions` mode. Files a tool reads from your home directory, such as `~/.gitconfig`, are denied with the rest; re-open a specific path with `sandbox.filesystem.allowRead` when a tool needs it. When the session’s working directory is a linked [git worktree](</docs/en/worktrees>), including one Claude Code entered mid-session, the repository’s common `.git` directory stays readable and writable to sandboxed commands, so git keeps working there. +If only a repository’s checked-in settings file adds a directory, the block still applies to reads there. When `autoMemoryDirectory` comes from the project’s `.claude/settings.json`, or from a `.claude/settings.local.json` [treated as repository-supplied](</docs/en/permissions#when-your-local-settings-file-needs-trust>), Claude Code loads no [auto memory](</docs/en/memory#storage-location>) from that directory and saves none to it. Files Claude Code itself needs stay readable, such as your skills, plugins, rules, agents, commands, and the `CLAUDE.md` memory file under `~/.claude/`. When the [sandbox](</docs/en/sandboxing>) is on, the block also denies sandboxed commands read access to home directories and mounted-volume roots outside the working directories. A retry that needs approval to [run outside the sandbox](</docs/en/sandboxing#the-unsandboxed-retry-escape-hatch>) prompts you even in `bypassPermissions` mode. Files a tool reads from your home directory, such as `~/.gitconfig`, are denied with the rest; re-open a specific path with `sandbox.filesystem.allowRead` when a tool needs it. When the session’s working directory is a linked [git worktree](</docs/en/worktrees>), including one Claude Code entered mid-session, the repository’s common `.git` directory stays readable and writable to sandboxed commands, so git keeps working there. ### @@ -2678,7 +2678,7 @@ `axScreenReader` -Render screen-reader friendly output: flat text without decorative borders or animations. Screen-reader mode uses the classic renderer, so the `tui` setting has no effect while it is active; attached [background sessions](</docs/en/agent-view>) still render fullscreen. Requires Claude Code v2.1.181 or later. +Render screen-reader friendly output: flat text without decorative borders or animations. Screen-reader mode uses the classic renderer, so the `tui` setting has no effect while it is active; attached [background sessions](</docs/en/agent-view>) still render fullscreen. * **Scope** : `Any file` * **Type** : Boolean @@ -2692,8 +2692,6 @@ { "axScreenReader": true } - -Requires Claude Code v2.1.181 or later. ### @@ -4703,7 +4701,7 @@ Block specific MCP servers. Claude Code refuses to load a matching server wherever it’s defined, including plugin servers, servers passed with `--mcp-config`, servers from `managed-mcp.json`, servers from `managedMcpServers`, and the claude.ai connectors [it fetches itself](</docs/en/mcp#how-connectors-reach-claude-code>). In-process `type: "sdk"` servers are exempt; the app that started the session registers them. * **Scope** : `Any file`. Entries from every file merge into one denylist, and `allowManagedMcpServersOnly` doesn’t change that. Deploy it in managed settings to enforce it. - * **Type** : array of objects, each with exactly one key: `serverName`, any non-empty string, so a claude.ai connector’s display name such as `"claude.ai Slack"` works; `serverCommand`, an array of the command and its arguments matched exactly; or `serverUrl`, a URL pattern with `*` wildcards + * **Type** : array of objects, each with exactly one key: `serverName`, a string, so a claude.ai connector’s display name such as `"claude.ai Slack"` works; `serverCommand`, an array of the command and its arguments matched exactly; or `serverUrl`, a URL pattern with `*` wildcards * **Default** : unset, so no server is blocked; an empty array also blocks nothing settings.json
modified Extend agents with skills View current →
--- a/skills.md +++ b/skills.md @@ -157,7 +157,7 @@ Dispatch commands by name -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. +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.
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -538,6 +538,7 @@ WebFetch takes a URL and a prompt describing what to extract. It fetches the page, converts the response to Markdown when the server returns HTML, and runs the prompt against the content using a small, fast model. For most fetches, Claude receives that model’s answer, not the raw page. The conversion step is not configurable. This makes WebFetch lossy by design. The extraction prompt determines what reaches Claude, so a result that says a page doesn’t mention something may only mean the prompt didn’t ask about it. Ask Claude to fetch again with a more specific prompt, or use `curl` via Bash for the unprocessed page. A few behaviors shape the response Claude receives: + * WebFetch refuses `localhost` and any other hostname without a dot, such as a bare intranet name, before making a request. The [error it returns](</docs/en/errors#webfetch-cannot-fetch-localhost>) tells Claude to reach local servers with `curl` through Bash instead. * HTTP URLs are automatically upgraded to HTTPS. * Large pages are truncated to a fixed character limit before processing. * WebFetch caches each response for 15 minutes by default, so repeated fetches of the same URL return quickly. On Claude Code v2.1.233 or later, set [`CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS`](</docs/en/env-vars#variables>) to change how long WebFetch keeps each response.
modified Agent SDK reference - TypeScript View current →
Show diff (201 lines)
--- a/typescript.md +++ b/typescript.md @@ -1075,6 +1075,7 @@ signal: AbortSignal; suggestions?: PermissionUpdate[]; blockedPath?: string; + mcpServer?: { name: string; source: string }; decisionReason?: string; toolUseID: string; agentID?: string; @@ -1087,6 +1088,7 @@ `signal`| `AbortSignal`| Signaled if the operation should be aborted `suggestions`| `PermissionUpdate``[]`| Suggested permission updates so the user is not prompted again for this tool. Bash prompts include a suggestion with the `localSettings` destination, so returning it in `updatedPermissions` writes the rule to `.claude/settings.local.json` and persists across sessions. `blockedPath`| `string`| The file path that triggered the permission request, if applicable +`mcpServer`| `{ name: string; source: string }`| For an `mcp__*` tool, the MCP server that serves it and where that server’s definition came from, with the fields of `McpServerProvenance`. Absent for other tools. Requires Agent SDK v0.3.274 or later `decisionReason`| `string`| Explains why this permission request was triggered `toolUseID`| `string`| Unique identifier for this specific tool call within the assistant message `agentID`| `string`| If running within a sub-agent, the sub-agent’s ID @@ -1428,6 +1430,7 @@ permission_denials: SDKPermissionDenial[]; queued_turn_count?: number; errors: string[]; + startup_failure_reason?: SDKStartupFailureReason; user_message_uuid?: string; user_message_uuids?: string[]; terminal_reason?: TerminalReason; @@ -1450,6 +1453,7 @@ * `modelUsage`: per-model totals for every model call made through the query pipeline during this `query()` call, including the main loop, subagents, and internal calls such as compaction and Workflow agents. Helper calls outside that pipeline, such as the permission classifier and token-counting requests, are excluded. In streaming-input sessions the totals are cumulative across turns, so read the latest result rather than summing across results. See [Track costs in streaming input mode](</docs/en/agent-sdk/cost-tracking#track-costs-in-streaming-input-mode>) for resets and [Recover totals after a session crash](</docs/en/agent-sdk/cost-tracking#recover-totals-after-a-session-crash>) for zeroed results. * `total_cost_usd`: cumulative estimated cost in USD for this `query()` call, covering the same calls as `modelUsage` and reset at the same points. It is an estimate, not a billing statement. See [Track cost and usage](</docs/en/agent-sdk/cost-tracking>) for accuracy caveats. * `queued_turn_count`: the number of messages you sent with `origin: { kind: "human" }` that are still waiting when Claude Code produced the result. See `queued_turn_count` for what `0` and an absent field tell you. + * `startup_failure_reason`: why Claude Code refused to start, on the `error_during_execution` result it writes before exiting on a known startup failure. See `startup_failure_reason` for the values and which failures carry it. Requires Agent SDK v0.3.274 or later. * `terminal_reason`: why the loop ended. One of `"completed"`, `"max_turns"`, `"tool_deferred"`, `"aborted_streaming"`, `"aborted_tools"`, `"hook_stopped"`, `"stop_hook_prevented"`, `"background_requested"`, `"blocking_limit"`, `"rapid_refill_breaker"`, `"prompt_too_long"`, `"image_error"`, `"model_error"`, `"api_error"`, `"malformed_tool_use_exhausted"`, `"budget_exhausted"`, `"structured_output_retry_exhausted"`, `"tool_deferred_unavailable"`, or `"turn_setup_failed"`. * `fast_mode_state`: one of `"on"`, `"off"`, or `"cooldown"`. * `fast_mode_disabled_reason`: why [fast mode](</docs/en/fast-mode>) isn’t available right now. Absent when nothing blocks fast mode, though a request may still run at standard speed. During the cooldown after a fast mode rate limit, Claude Code reports `fast_mode_state: "cooldown"` with no reason code and re-enables fast mode when the cooldown expires. Requires Claude Code v2.1.219 or later. @@ -1514,6 +1518,56 @@ * **`0`** : Claude Code doesn’t count messages you sent without that `origin`, and doesn’t count task notifications, so a turn can still follow. * **Absent** : the final result that Claude Code emits after a crash or fatal startup error omits the field, and [may carry zeroed totals](</docs/en/agent-sdk/cost-tracking#recover-totals-after-a-session-crash>). + +#### + +​ + +`startup_failure_reason` + +Why Claude Code refused to start, so your application can offer the fix instead of a retry. Claude Code sets it on the `error_during_execution` result it writes before exiting on a known startup failure. That result carries zeroed totals, and its `errors` array carries the same text as stderr. The field is absent on every other result. Requires Agent SDK v0.3.274 or later. Set `CLAUDE_CODE_STARTUP_FAILURE_RESULTS` to `1` in `env` to receive this result for every `SDKStartupFailureReason` value. Without that variable, Claude Code writes the result only for these failures, and the rest end with stderr output, a non-zero exit, and no result message: + + * A resume that Claude Code stops because it [can’t return the session to its worktree](</docs/en/worktrees#the-session-resumes-outside-its-worktree>), with `worktree_unverified` or `worktree_resume_refused`. That section says which error carries which value. + * A refused `continue` of a conversation that a background session holds, with `session_held_by_background`. For a refused `resume` of such a conversation, Claude Code writes the result only when the variable is set. + + type SDKStartupFailureReason = + | "org_pin_api_key_conflict" + | "org_verify_failed" + | "org_pin_mismatch" + | "managed_settings_invalid" + | "remote_settings_required_unavailable" + | "gateway_signin_required" + | "gateway_access_denied" + | "proxy_invalid" + | "temp_dir_unusable" + | "cwd_unavailable" + | "shell_tool_missing" + | "session_held_by_background" + | "worktree_resume_refused" + | "worktree_unverified" + | "cli_version_too_old" + | "bypass_root"; + +Each value names one refusal: + +Value| What stopped the session +---|--- +`org_pin_api_key_conflict`| Managed settings [require a first-party or Cloud gateway sign-in](</docs/en/authentication#restrict-login-to-your-organization>), and an Anthropic API key, auth token, or `apiKeyHelper` is configured instead +`org_verify_failed`| The sign-in’s organization couldn’t be verified against the pin, for example because of a network failure or a revoked token +`org_pin_mismatch`| The sign-in belongs to an organization the pin doesn’t allow +`managed_settings_invalid`| Managed policy settings couldn’t be read, or the pin names no organization +`remote_settings_required_unavailable`| Managed settings that the organization requires couldn’t be loaded +`gateway_signin_required`| The [Cloud gateway](</docs/en/claude-apps-gateway>) ended this sign-in +`gateway_access_denied`| The managed settings request to the Cloud gateway came back with a 403, which the gateway’s [troubleshooting table](</docs/en/claude-apps-gateway-deploy#troubleshooting>) covers +`proxy_invalid`| A proxy setting isn’t a complete URL +`temp_dir_unusable`| The per-user temporary directory is unsafe or couldn’t be created +`cwd_unavailable`| The working directory was deleted, moved, or can’t be read +`shell_tool_missing`| On Windows, no shell tool is available: Git Bash is missing, and PowerShell is missing or turned off with `CLAUDE_CODE_USE_POWERSHELL_TOOL` +`session_held_by_background`| The conversation to resume or continue is running as a [background session](</docs/en/agent-view>) +`worktree_resume_refused`| The session’s worktree failed its safety checks, or the resume was launched from inside it. `errors` says whether running the same resume again continues without the worktree +`worktree_unverified`| The session’s worktree couldn’t be verified right now, and retrying may succeed +`cli_version_too_old`| This Claude Code version is below the minimum Anthropic requires +`bypass_root`| Bypass permissions mode was requested while running as root ### @@ -1537,6 +1591,7 @@ mcp_servers: { name: string; status: string; + source?: string; }[]; model: string; permissionMode: PermissionMode; @@ -1553,6 +1608,7 @@ `fast_mode_state` reports the session’s [fast mode](</docs/en/fast-mode>) state. When something blocks fast mode, `fast_mode_disabled_reason` names the check that blocked it; the field requires Claude Code v2.1.219 or later. For the reason codes and their meanings, see `fast_mode_disabled_reason` on the result message. `terminal_slash_commands` names the entries in `slash_commands` whose interface is bound to the local terminal, such as `exit`. You can send them like any other entry in `slash_commands`; the field exists so a remote or mobile client can hide them from its command menus. The field is present only when non-empty, and requires Agent SDK v0.3.229 or later. + * `source` on each `mcp_servers` entry: where the server’s definition came from, with the same values as `McpServerStatus`’s `source`. Requires Agent SDK v0.3.274 or later. * `effort`: the [effort level](</docs/en/model-config#adjust-effort-level>) Claude Code sends on the session’s next request, or `null` when it sends none. Claude Code sets the field only on the init message it sends to [Remote Control](</docs/en/remote-control>) clients, and omits it from the init message your application reads. Requires Agent SDK v0.3.234 or later. The `capabilities` array names the protocol behaviors this CLI implements, so you can feature-detect instead of comparing `claude_code_version` strings. It is an open set: ignore values you don’t recognize, and check for the specific capability whose behavior you rely on. The field requires Claude Code v2.1.205 or later and is absent on earlier CLIs. @@ -2020,7 +2076,10 @@ tool_name: string; tool_input: unknown; tool_use_id: string; - }; + mcp_server?: McpServerProvenance; + }; + +`mcp_server` is present when the tool comes from an MCP server; see `McpServerProvenance`. The `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, and `PermissionDenied` inputs carry the same field. The field requires Agent SDK v0.3.274 or later. #### @@ -2035,6 +2094,7 @@ tool_response: unknown; tool_use_id: string; duration_ms?: number; + mcp_server?: McpServerProvenance; }; #### @@ -2051,6 +2111,7 @@ error: string; is_interrupt?: boolean; duration_ms?: number; + mcp_server?: McpServerProvenance; }; #### @@ -2085,6 +2146,7 @@ tool_input: unknown; tool_use_id: string; reason: string; + mcp_server?: McpServerProvenance; }; #### @@ -2304,6 +2366,7 @@ tool_name: string; tool_input: unknown; permission_suggestions?: PermissionUpdate[]; + mcp_server?: McpServerProvenance; }; #### @@ -4772,6 +4835,32 @@ ​ +`McpServerProvenance` + +The MCP server that serves an `mcp__*` tool, and where that server’s definition came from. The `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, and `PermissionDenied` hook inputs carry it as `mcp_server`, and the `CanUseTool` options carry it as `mcpServer`. Both omit it for tools that don’t come from an MCP server. + + type McpServerProvenance = { + name: string; + source: string; + }; + +Field| Type| Description +---|---|--- +`name`| `string`| The name the server is registered under, the same value `mcpServerStatus()` reports for it +`source`| `string`| Where the server’s definition came from: `sdk`, `plugin`, or a configuration scope + +`source` takes one of the following values. The set is open, so treat a value you don’t recognize as a configured source, never as `sdk`: + + * **`sdk`** : an in-process server your application registered. Only the SDK host application can register one, so a configured server never reports `sdk`, whatever its name. + * **`plugin`** : a server a [plugin](</docs/en/agent-sdk/plugins>) provides. Its `name` is the scoped `plugin:<plugin-name>:<server-name>` form described under [plugin-provided MCP servers](</docs/en/mcp#plugin-provided-mcp-servers>). + * **A configuration scope** : `user`, `project`, `local`, `dynamic`, `managed`, `enterprise`, `claudeai`, or `agent`. A `.mcp.json` server reports `project`, and [MCP installation scopes](</docs/en/mcp#mcp-installation-scopes>) defines `local`, `project`, and `user`. Servers your application passes in the `mcpServers` option, other than in-process SDK servers, report `dynamic`. + +Base trust decisions on `source`, not on `name` or the `mcp__<server>__` tool-name prefix. For any source other than `sdk`, `name` is untrusted text: escape it before display. `McpServerProvenance` and the fields that carry it require Agent SDK v0.3.274 or later. + +### + +​ + `McpServerStatus` Status of a connected MCP server. @@ -4786,6 +4875,7 @@ error?: string; config?: McpServerStatusConfig; scope?: string; + source?: string; tools?: { name: string; description?: string; @@ -4796,6 +4886,8 @@ }; }[]; }; + +`source` says where the server’s definition came from, with the same values and trust rule as `McpServerProvenance`’s `source`. The field requires Agent SDK v0.3.274 or later and is absent on earlier versions. ###
modified Find bugs with ultrareview View current →
--- a/ultrareview.md +++ b/ultrareview.md @@ -55,7 +55,11 @@ * **Interactive** : in the launch dialog, select **Run and post the findings to the PR as me**. If you add `--post` to the command, as in `/code-review ultra 1234 --post`, Claude Code preselects that choice and still asks before launching. * **Non-interactive** : run the `claude ultrareview` subcommand with `--post`. You consent to the post by running the subcommand with the flag, so Claude Code posts without asking. In a `claude -p '/code-review ultra'` run, Claude Code exits before the findings arrive, so it posts nothing; use the subcommand instead. -Claude Code doesn’t post from your machine. It sends the findings to a [cloud session](</docs/en/claude-code-on-the-web>), which posts the comment through the GitHub account you’ve connected to Claude. Posting requires the same claude.ai sign-in as the review itself. Because posting runs through a cloud session, it isn’t available on third-party providers or when you set [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>). In an interactive session, Claude Code starts the post when the findings arrive, so keep the session open until the review finishes. Claude Code keeps the posting choice only in that session. If the session ends before the review finishes, Claude Code posts nothing, even if you resume the conversation later. When the post can’t start while your session is open, Claude tells you that nothing went to the PR and why, and the findings stay in your terminal so you can post them by hand. +Claude Code doesn’t post from your machine. It sends the review’s session ID to the Anthropic API, which posts the review’s stored findings as the comment through the GitHub account you’ve connected to Claude. Posting requires the same claude.ai sign-in as the review itself, and it isn’t available on third-party providers or when you set [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>). In an interactive session, Claude Code starts the post when the findings arrive, so keep the session open until the review finishes. Claude Code keeps the posting choice only in that session. If the session ends before the review finishes, Claude Code posts nothing, even if you resume the conversation later. When the post finishes, Claude tells you the outcome: + + * **Posted** : Claude gives you a link to the comment. + * **Already posted** : an earlier post of the same review already put the comment on the PR, so Claude links you to the pull request instead of posting again. + * **Failed** : Claude tells you why, and the findings stay in your terminal so you can post them by hand. ### @@ -143,7 +147,12 @@ * **1** : the review failed to launch, the cloud session errored, or the timeout elapsed * **130** : you interrupted the subcommand with Ctrl-C -If you interrupt the subcommand, the remote review keeps running; follow the session URL printed to stderr to watch it in the browser. With `--post`, the subcommand starts the post right after it prints the findings. If the run fails, times out, or you interrupt it, the subcommand posts nothing. If the review completes but the post can’t start, Claude Code prints the reason to stderr, and the findings stay on stdout so you can post them by hand. For automatic reviews on GitHub pull requests, [Code Review](</docs/en/code-review>) integrates with your repository directly and posts findings as inline PR comments without a CLI step. +If you interrupt the subcommand, the remote review keeps running; follow the session URL printed to stderr to watch it in the browser. With `--post`, the subcommand starts the post right after printing the findings, and prints the link to stderr. + + * If the run fails, times out, or you interrupt it, the subcommand posts nothing. + * If the review completes but the comment isn’t posted, Claude Code prints the reason to stderr, and the findings stay on stdout so you can post them by hand. + +For automatic reviews on GitHub pull requests, [Code Review](</docs/en/code-review>) integrates with your repository directly and posts findings as inline PR comments without a CLI step. ##
modified Use Claude Code in VS Code View current →
--- a/vs-code.md +++ b/vs-code.md @@ -98,7 +98,7 @@ * Select **Permissions** in the Customize section to view the session’s [permission rules](</docs/en/permissions>), grouped into Allow, Ask, and Deny. You can add rules to your user, project, or local settings and remove rules saved there. Rules from other sources, such as managed settings or approvals made for this session only, are read-only. Requires Claude Code v2.1.269 or later. * The Settings section includes **Enable Remote Control for all sessions** , which sets [`remoteControlAtStartup`](</docs/en/settings-reference#remotecontrolatstartup>) to control whether [new interactive sessions connect to Remote Control automatically](</docs/en/remote-control#enable-remote-control-for-all-sessions>). Requires Claude Code v2.1.203 or later. When you turn the toggle on or off in a VS Code window, the change applies to the sessions already open in that VS Code window, not only to sessions you start afterwards. If you turn it off, the open sessions disconnect. With Claude Code v2.1.261 or later, the change also reaches sessions open in your other VS Code windows. * The Settings section also includes **Focus view** , which hides tool calls, tool results, and thinking behind expandable rows, leaving your prompts and Claude’s responses. Toggle it there, with `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux), or from the Command Palette with **Claude Code: Toggle Focus view**. The change applies to every open session and persists across sessions. Requires Claude Code v2.1.221 or later. Claude’s latest to-do list stays visible, and so does the text a pending question from Claude is asking about; this requires Claude Code v2.1.225 or later. While Claude runs [subagents](</docs/en/sub-agents>), live progress rows with their latest activity appear under the tool-call group that started them. This requires Claude Code v2.1.269 or later. - * To report a bug, click **Report a problem** at the bottom of the menu, or type `/bug` or `/feedback` with an optional description that prefills the report. When you submit the report and you’re signed in to Anthropic on a first-party connection, Claude Code sends it to Anthropic. On a third-party provider, or without Anthropic credentials, the dialog still opens, but submitting shows an error and sends nothing: unlike the CLI’s `/bug`, the extension doesn’t write a local archive. Requires Claude Code v2.1.229 or later. + * To report a bug, click **Report a problem** at the bottom of the menu, or type `/bug` or `/feedback` with an optional description that prefills the report. When you submit the report and you’re signed in to Anthropic on a first-party connection, Claude Code sends it to Anthropic. On a third-party provider, or without Anthropic credentials, the dialog still opens, but submitting shows an error and sends nothing: unlike the CLI’s `/bug`, the extension doesn’t write a local archive. Requires Claude Code v2.1.229 or later. If your organization’s policy turns product feedback off, **Report a problem** doesn’t appear in the menu, and `/bug` and `/feedback` show a `Feedback is turned off by your organization's policy or this environment's settings.` notice instead of opening the report. * **Side questions** : type `/btw` followed by a question to ask about your session [without adding to the conversation](</docs/en/interactive-mode#side-questions-with-%2Fbtw>). The answer opens in a panel beside the chat, where you can ask follow-up questions. The thread survives window reloads. Claude Code keeps the newest 20 exchanges and expires stored threads on the [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) schedule, as long as Claude Code can [safely determine the retention period](</docs/en/claude-directory#cleaned-up-automatically>). To clear a thread, click the trash icon in the panel. Requires Claude Code v2.1.227 or later. * **Context indicator** : the prompt box shows how much of Claude’s context window you’re using. Claude automatically compacts when needed, or you can run `/compact` manually. * **Prompt cache clock** : a clock icon next to the context indicator estimates how much time the conversation’s [prompt cache](</docs/en/prompt-caching>) has left before it expires. It counts down from the cache’s five-minute or one-hour [lifetime](</docs/en/prompt-caching#cache-lifetime>), and each response that uses the cache restarts the countdown. Apart from compaction, the [actions that invalidate the cache](</docs/en/prompt-caching#actions-that-invalidate-the-cache>) don’t reset the clock, so it can still show minutes left after you switch models.
modified Get started with Claude Code in the cloud View current →
--- a/web-quickstart.md +++ b/web-quickstart.md @@ -59,13 +59,13 @@ Visit claude.ai/code -Go to [claude.ai/code](<https://claude.ai/code>) and sign in with your claude.ai account. On macOS or Windows, the first screen offers the Claude Code desktop app and other ways to install Claude Code. To stay in the browser, click **Continue on web** at the bottom of the page. +Go to [claude.ai/code](<https://claude.ai/code>) and sign in with your claude.ai account. 2 Sign in with GitHub -After you sign in, claude.ai/code prompts you to connect GitHub. Follow the prompt, and claude.ai/code sends you to GitHub’s authorization page. Approve the authorization request, and GitHub returns you to claude.ai/code. Cloud sessions work with existing GitHub repositories. To start a new project, [create an empty repository on GitHub](<https://github.com/new>) first.With this connection, a session can clone any public repository, but can work in a private repository only when the Claude GitHub App is installed on it. [Install the App](<https://github.com/apps/claude/installations/new>) on each GitHub account or organization whose private repositories you want to use. On a GitHub organization, an organization owner may need to approve the installation. Installing the App also enables [Auto-fix](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>), which lets Claude respond to CI failures and review comments on pull requests in those repositories.If onboarding prompts you to install the App at this point and you’d rather do it later, click **Skip**. +After you sign in, claude.ai/code prompts you to connect GitHub. Follow the prompt, and claude.ai/code sends you to GitHub’s authorization page. Approve the authorization request, and GitHub returns you to claude.ai/code. Cloud sessions work with existing GitHub repositories. To start a new project, [create an empty repository on GitHub](<https://github.com/new>) first.With this connection, a session can clone any public repository, but can work in a private repository only when the Claude GitHub App is installed on it. [Install the Claude GitHub App](<https://github.com/apps/claude/installations/new>) on each GitHub account or organization whose private repositories you want to use. On a GitHub organization, an organization owner may need to approve the installation. Installing it also enables [Auto-fix](</docs/en/claude-code-on-the-web#auto-fix-pull-requests>), which lets Claude respond to CI failures and review comments on pull requests in those repositories.If onboarding prompts you to install the Claude GitHub App at this point and you’d rather do it later, click **Skip**. 3 @@ -84,7 +84,7 @@ Connect from your terminal -If you already use the GitHub CLI (`gh`), you can connect GitHub for cloud sessions from your terminal. This requires the [Claude Code CLI](</docs/en/quickstart>). On Team and Enterprise plans, `/web-setup` is available only after an Owner turns on [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>). When you run `/web-setup`, Claude Code reads the token that `gh auth token` prints, asks you to confirm, and sends the token to Anthropic. Anthropic stores it encrypted with your claude.ai account, and your cloud sessions use it for GitHub access until you remove it. A cloud session can then access any repository that token can access, with no Claude GitHub App installation. If you already connected GitHub in the browser, `/web-setup` warns you that continuing replaces that connection for your cloud sessions. +If you already use the GitHub CLI (`gh`), you can connect GitHub for cloud sessions from your terminal. This requires the [Claude Code CLI](</docs/en/quickstart>). On Team and Enterprise plans, `/web-setup` is available only after an Owner turns on [Quick web setup](</docs/en/claude-code-on-the-web#github-authentication-options>). When you run `/web-setup`, Claude Code reads the token that `gh auth token` prints, asks you to confirm, and sends the token to Anthropic. Anthropic stores it encrypted with your claude.ai account, and your cloud sessions use it for GitHub access until you remove it. A cloud session you start yourself can then access any repository that token can access, with no Claude GitHub App installation. Threads in a [project](</docs/en/claude-projects#set-up-github-access>) still need the Claude GitHub App. If you already connected GitHub in the browser, `/web-setup` warns you that continuing replaces that connection for your cloud sessions. Organizations with [Zero Data Retention](</docs/en/zero-data-retention>) enabled cannot use `/web-setup` or other cloud session features. If the GitHub CLI isn’t installed or isn’t authenticated, Claude Code opens the browser onboarding flow instead.
modified Orchestrate subagents at scale with dynamic workflows View current →
--- a/workflows.md +++ b/workflows.md @@ -364,7 +364,7 @@ No mid-run user input| A run pauses on its own only for agent permission prompts and a usage-limit wait. For sign-off between stages, run each stage as its own workflow No direct filesystem or shell access from the workflow itself| Agents read, write, and run commands. The script coordinates the agents No module loading: a script that contains `import()` fails before the run starts| The script body is plain JavaScript. Put work that needs a library in an agent’s task -Up to 16 concurrent agents, fewer when Claude Code has fewer CPUs available, including inside a CPU-limited container| Bounds local resource use +Up to 16 concurrent agents by default, fewer when Claude Code has fewer CPUs available, including inside a CPU-limited container. To change the limit, set [`CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS`](</docs/en/env-vars#variables>) to a value from 1 to 256, which requires Claude Code v2.1.269 or later| Bounds local resource use In a fan-out, agents that share the first agent’s prompt-cache prefix start up to 5 seconds after it by default| All but the first read the prefix the first agent cached instead of each processing it uncached Up to 4,096 items in a single `parallel()` or `pipeline()` call: the runtime rejects a longer list with an error| A silent cap would drop part of the workload without telling the script 1,000 agents total per run| Prevents runaway loops
modified Run parallel sessions with worktrees View current →
--- a/worktrees.md +++ b/worktrees.md @@ -349,7 +349,7 @@ * `Error: ...The worktree binding is kept.` for `Could not re-enter` * `Notice: the worktree <path> for this session no longer exists...` for a gone worktree; Claude Code prints it and continues the session, as an interactive resume does -The refusal ending embedded in each error is shared with the interactive notices, so it still matches its entry under Claude Code refuses to use a worktree. +The refusal ending embedded in each error is shared with the interactive notices, so it still matches its entry under Claude Code refuses to use a worktree. In the stream-json result, [`startup_failure_reason`](</docs/en/agent-sdk/typescript#startup_failure_reason>) is `worktree_unverified` for the `could not verify worktree` error and `worktree_resume_refused` for the `cannot resume into worktree` and `The worktree binding is kept` errors. An application can branch on it instead of matching the error text. Before v2.1.274, the result carried no `startup_failure_reason` field. ##