modified Manage mods for your organization View current →
--- a/admin.md +++ b/admin.md @@ -29,7 +29,7 @@ * **No mod a user brings runs its hooks** : that covers a mod in a plugin the user installed, a mod loaded with `--plugin-dir`, and a mod [Claude wrote during a session](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) * **Your organization’s mods still run** : a mod that counts as your organization’s isn’t checked. Every other mod counts as a user’s and is refused. That includes a mod your organization turns on for its members on claude.ai. If none counts as yours, no installed mod runs its hooks. - * **Users can’t undo it** : the guard reads the option from managed settings only, so the same entry in a user, project, or local settings file, or in a file passed with `--settings`, changes nothing + * **Claude Code ignores the option in other settings files** : if someone sets it in a user, project, local, or `--settings` file, your value still applies * **A file or MDM policy covers every provider** : when you deliver the option as a file or through MDM, it works the same way on Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry. For delivery from the claude.ai admin console, see [Platform availability](</docs/en/server-managed-settings#platform-availability>) * **Users’ other customizations keep working** : their [hooks in settings files](</docs/en/hooks>) and in plugins’ `hooks/hooks.json`, status lines, and `/goal` aren’t affected * **Built-in mods keep running** : mods built into Claude Code, such as `AGENTS.md` support, each have [their own switch](</docs/en/plugins/mods/overview#mods-built-into-claude-code>) @@ -95,6 +95,7 @@ `prompt.attachment`| A message Claude Code adds for Claude, such as a reminder `skill.prompt`| A skill’s text as it’s expanded for Claude `attribution.text`| Commit or pull request attribution text +[`telemetry.log`](</docs/en/plugins/mods/reference#telemetry>)| A record bound for an OpenTelemetry collector. Passed over in v2.1.328 or later [`session.compact`](</docs/en/plugins/mods/reference#session>)| A compaction of the conversation `settings.read`| A read of settings, such as a mod’s `$.settings.read` call `session.append{door=attachment}`| The stored row for a message Claude Code adds for Claude @@ -123,7 +124,7 @@ A marketplace allowlist| A mod from the marketplaces you allow, or from any directory with `--plugin-dir`. A mod Claude writes during a session loads only when the allowlist [includes `skills-dir`](</docs/en/plugins/org#keep-skills-directory-plugins-loading>). A marketplace allowlist and `disableSideloadFlags`| A mod from the marketplaces you allow -[Manage plugins for your organization](</docs/en/plugins/org>) lists the ways a plugin loads and the setting that controls each. To check the mods in a marketplace before your users install them, see Review what a mod can do. To keep users’ mods out until you’ve done that, see Stop user-installed mods from loading. +With any of these, users can also load a mod in a plugin [synced from claude.ai](</docs/en/plugins/loading#synced-plugins>), or in a [skills-directory plugin](</docs/en/plugins/org#keep-skills-directory-plugins-loading>) unless your allowlist leaves out `skills-dir`. [Manage plugins for your organization](</docs/en/plugins/org>) lists the ways a plugin loads and the setting that controls each. To check the mods in a marketplace before your users install them, see Review what a mod can do. To keep users’ mods out until you’ve done that, see Stop user-installed mods from loading. ### Review what a mod can do @@ -164,7 +165,7 @@ No installed mod runs, with settings hooks untouched| Set `allowManagedModsOnly` and deploy no mods of your own No installed mods and no hooks at all, your managed hooks included| Set `disableAllHooks` to `true` Only your organization’s mods| Set the guard’s `allowManagedModsOnly` option, and install your mods so that they count as yours -Any mod from marketplaces you approve| Keep your [marketplace restrictions](</docs/en/plugins/org#restrict-what-users-can-install>), and set `disableSideloadFlags` to `true` +Any mod from marketplaces you approve outside claude.ai| Set a [marketplace allowlist](</docs/en/plugins/org#restrict-what-users-can-install>) without `skills-dir`, set `disableSideloadFlags` to `true`, and set [`syncClaudeAiPlugins`](</docs/en/settings-reference#syncclaudeaiplugins>) to `false` Any mod, with your own mod checking the others| Install your mod, and list it with `sec-default@builtin` in `prependPlugins` What each setting does: @@ -235,8 +236,8 @@ These rules decide whether an option takes effect: * **The id has one form here** : Claude Code reads the options only under `cc-plugin-sec-default@builtin`. `prependPlugins` accepts `sec-default@builtin` as well, and `pluginConfigs` doesn’t. - * **Only managed settings count** : the same entry in a user, project, or local settings file, or in a file passed with `--settings`, neither sets an option nor loosens one - * **The guard has to load** : if you set `prependPlugins`, name the guard in the list. Where the guard doesn’t load, neither option applies. + * **Claude Code ignores the options in other settings files** : the same entry in a user, project, or local settings file, or in a file passed with `--settings`, neither sets an option nor loosens one + * **The guard has to load** : if you set `prependPlugins`, name the guard in the list. Where the guard doesn’t load, no option applies. * **The guard fails closed** : if the guard can’t read managed settings, it refuses every user’s mod at load. If it can’t check the deny rules for a call that a user’s mod approved, it refuses the call. The [messages from the built-in guard](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>) are what your users see when either option applies.
modified How the agent loop works View current →
--- a/agent-loop.md +++ b/agent-loop.md @@ -141,11 +141,11 @@ Claude determines which tools to call based on the task, but you control whether those calls are allowed to execute. Use these options to auto-approve tools, block tools, and set the permission mode: - * **`allowed_tools` / `allowedTools`** auto-approves listed tools. A read-only agent with `["Read", "Glob", "Grep"]` in its allowed tools list runs those tools without prompting, apart from reads from [network paths](</docs/en/permissions#network-paths>). Tools not listed are still available, and calls to them that need approval fall through to the permission mode and `canUseTool`. + * **`allowed_tools` / `allowedTools`** auto-approves listed tools. An agent with `["Read", "Glob", "Grep"]` in its allowed tools list runs those tools without prompting, with exceptions such as reads from [network paths](</docs/en/permissions#network-paths>). Tools not listed are still available, and calls to them that need approval fall through to the permission mode and `canUseTool`. * **`disallowed_tools` / `disallowedTools`** blocks listed tools, regardless of other settings. See [Permissions](</docs/en/agent-sdk/permissions>) for the order that rules are checked before a tool runs. * **`permission_mode` / `permissionMode`** controls how much human oversight you want. The SDK evaluates the active mode together with your allow and deny rules in a fixed order, described in [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>). See Permission mode for available modes. -You can also scope individual tools with rules like `"Bash(npm *)"` to allow only specific commands. See [Permissions](</docs/en/agent-sdk/permissions>) for the full rule syntax. When a tool is denied, Claude receives a rejection message as the tool result and typically attempts a different approach or reports that it couldn’t proceed. +You can also scope individual tools with rules like `"Bash(npm *)"` to auto-approve specific commands. See [Permissions](</docs/en/agent-sdk/permissions>) for the full rule syntax. When a tool is denied, Claude receives a rejection message as the tool result and typically attempts a different approach or reports that it couldn’t proceed. ### Parallel tool execution
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -177,7 +177,7 @@ * A question with predefined choices: the panel lists the choices by number. With the reply input empty, press a choice’s number to fill it in, then `Enter` to send it, or type your own answer instead * A question without predefined choices: type your answer. When the empty input shows a suggested reply, press `Tab` to fill it in and edit it before sending - * A permission prompt or another dialog, such as a [sandbox](</docs/en/sandboxing>) prompt or an MCP server’s [request for input](</docs/en/mcp#respond-to-mcp-elicitation-requests>): replying doesn’t answer it. Your message waits in the queue. To answer the dialog, attach with `→` + * A permission prompt or another dialog, such as a [sandbox](</docs/en/sandboxing>) prompt or an MCP server’s [request for input](</docs/en/mcp#respond-to-mcp-elicitation-requests>): replying doesn’t answer it. To answer the dialog, attach with `→` while the reply input is empty When a [`PermissionRequest`](</docs/en/hooks#permissionrequest>) or [`PreToolUse`](</docs/en/hooks#pretooluse>) hook returns output Claude Code can’t validate for the call the session is asking about, the row shows the hook event and `hook output invalid:` with the validation error before the pending request’s text. For a hook that fails another way, the row says the hook failed. The session still waits on the same request. When a reply can’t be delivered, the error message says whether it was saved. A reply prefixed with `!` or `/` is never saved. Claude Code sends a saved reply as the session’s next prompt the next time you restart the session; send any other reply again. With [voice dictation](</docs/en/voice-dictation>) enabled in [hold mode](</docs/en/voice-dictation#hold-to-record>), hold your push-to-talk key while the reply input is focused to dictate a reply instead of typing it. The same works in the dispatch input at the bottom of agent view. Use `↑` and `↓` to peek at adjacent sessions without closing the panel, or `→` to attach. @@ -187,7 +187,7 @@ #### Switch sessions without leaving the terminal -In a session running in the foreground, one you started in the terminal rather than attached to from agent view, pressing `←` on an empty prompt backgrounds it and opens agent view with that row selected, so you can switch sessions without leaving the terminal. The same single press detaches an attached session. If you press `←` right after you delete the last of the prompt’s text or move through prompt history, Claude Code asks you to confirm: the first press shows `Press ← again to open agents`, or `Press ← again to go back to agents` in an attached session, and the second press switches. After you background a session with `←`: +In a session running in the foreground, one you started in the terminal rather than attached to from agent view, pressing `←` on an empty prompt backgrounds it and opens agent view with that row selected, so you can switch sessions without leaving the terminal. The same single press detaches an attached session. If you press `←` right after you delete the last of the prompt’s text or move through prompt history, Claude Code asks you to confirm. Press `←` again to switch. After you background a session with `←`: * Press `Enter` to reopen the conversation. * Press `Esc` to undo the switch and return to the conversation. If `Esc` shows `Still starting — try again in a moment`, the background session isn’t ready yet, so press `Esc` again in a moment.
modified Share session output as artifacts View current →
--- a/artifacts.md +++ b/artifacts.md @@ -146,7 +146,7 @@ * **Stop the task in`/tasks`**: Claude stops replying on that artifact until you ask it to resume replies there. Publishing the artifact again doesn’t start replies again, and the stop still applies when you resume the session later. * **Press`Ctrl+X Ctrl+K` twice within 3 seconds**: the chord that [stops every running background subagent](</docs/en/interactive-mode#general-controls>) also stops Claude from replying on every artifact for the rest of the session. Asking Claude to resume replies doesn’t undo this stop. -A watch that Claude Code started on its own can end after the artifact goes several hours without activity. To start the watch again, publish the artifact again or ask Claude to watch it. If the service that delivers comments becomes unavailable or stops answering, Claude Code keeps trying to reconnect for a while, then stops watching each artifact your session was watching. +A watch that Claude Code started on its own can end after the artifact goes several hours without activity. You see `Stopped watching Artifact: <name> (idle)`. To start the watch again, publish the artifact again or ask Claude to watch it. If you see `(made room for a newer watch)` in place of `(idle)`, your session reached its limit of 25 watches. Publish again to restart that watch. If the service that delivers comments becomes unavailable or stops answering, Claude Code keeps trying to reconnect for a while, then stops watching each artifact your session was watching. ## Pull live data with MCP connectors @@ -315,7 +315,7 @@ Public sharing is off by default on Team and Enterprise plans. To let members publish artifacts to public links that anyone can view without signing in, go to [**Organization settings > Artifacts**](<https://claude.ai/admin-settings/artifacts>) and turn on **External sharing** under the **Artifacts** toggle. Turning it back off blocks access through existing public links without changing each artifact’s audience; access resumes if you re-enable it. -### Set a retention policy +### Set a retention policy on Enterprise plans To set how long artifacts are kept before automatic deletion, go to [**Organization settings > Data and privacy**](<https://claude.ai/admin-settings/data-privacy-controls>). You can set separate retention periods for artifacts that are still private to their author and artifacts that have been shared.
modified Authentication View current →
--- a/authentication.md +++ b/authentication.md @@ -211,9 +211,17 @@ `apiKeyHelper`, `ANTHROPIC_API_KEY`, and `ANTHROPIC_AUTH_TOKEN` apply to the CLI and the surfaces that wrap it, including the VS Code extension, the Agent SDK, and GitHub Actions. Claude Desktop and cloud sessions do not call `apiKeyHelper` or read these environment variables: they use OAuth, except desktop sessions running a [third-party inference configuration](</docs/en/llm-gateway-connect#desktop-app>), which authenticate with that configuration’s credential. +### Check when a stored login ends + +To see when the claude.ai login you’re using ends, run `claude auth status --text` in your shell. In Claude Code v2.1.318 or later, look for a line that starts with `Sign-in`: + + Sign-in ends: between 2026-11-20 and 2026-11-23 (2026-11-23T17:04:11.000Z) + +Before the earlier date, sign in again in the browser with `/login` or `claude auth login`. Using Claude Code doesn’t extend the login. If the line says `any day now` or `may have ended`, sign in now. The line is absent for other credentials or when no date is known. When the later date is under 10 days away, a `claude -p` run with text output prints `Warning: this sign-in` on stderr, so sign in again before the earlier date. + ### Renew an expiring login -When the login you created with `/login` is within three days of expiring, Claude Code shows a warning at startup: `Your login expires in 3 days · run /login to renew`. Run `/login` to renew. The warning appears only when a claude.ai login is the active credential. +Starting on the earlier of your login’s two end dates, Claude Code shows a warning at startup: `Your login expires in 3 days · run /login to renew`. Run `/login` to renew. The warning appears only when a claude.ai login is the active credential. #### After the login expires
modified Best practices for Claude Code View current →
--- a/best-practices.md +++ b/best-practices.md @@ -238,7 +238,7 @@ * A tool call on one of your MCP servers * A [`prompt` or `agent` hook](</docs/en/hooks#hook-handler-fields>), which lets a model decide -A `prompt` or `agent` hook asks _another model_ to decide, so it isn’t deterministic either. For real enforcement, use a `command` or `http` hook, and add [`onFailure: "block"`](</docs/en/hooks#block-the-action-when-a-hook-fails>) if the action should also be stopped when the hook itself crashes or times out. For a hook that scans commits for secrets, say, you’d rather block the commit than let it through unscanned while the scanner is down. Here’s the formatter rule as a `PostToolUse` hook. It runs after every `Edit` or `Write`, and whether Claude remembers the rule no longer matters, because Claude isn’t the one running it: +A `prompt` or `agent` hook asks _another model_ to decide, so it isn’t deterministic either. For real enforcement, use a `command`, `http`, or `mcp_tool` hook, and add [`onFailure: "block"`](</docs/en/hooks#block-the-action-when-a-hook-fails>) if the action should also be stopped when the hook itself crashes or times out. For a hook that scans commits for secrets, say, you’d rather block the commit than let it through unscanned while the scanner is down. Here’s the formatter rule as a `PostToolUse` hook. It runs after every `Edit` or `Write`, and whether Claude remembers the rule no longer matters, because Claude isn’t the one running it: .claude/settings.json @@ -435,7 +435,7 @@ [`claude -p "prompt"`](</docs/en/headless>) runs once and exits, which is how Claude Code ends up in CI jobs, git hooks, and shell loops. In a script you’ll almost always want a few more flags: - * [`--bare`](</docs/en/headless#start-faster-with-bare-mode>) skips hooks, skills, plugins, MCP servers, and `CLAUDE.md` files, the repo’s as well as the machine’s, so the run does the same thing wherever it runs. It also never touches your claude.ai login: auth comes from `ANTHROPIC_API_KEY`, an `apiKeyHelper` in the file you pass with `--settings`, or your cloud provider’s credentials. + * [`--bare`](</docs/en/headless#start-faster-with-bare-mode>) skips your hooks, skills, plugins, MCP servers, and `CLAUDE.md` files from the repo and your home directory. It also doesn’t use your claude.ai login: auth comes from `ANTHROPIC_API_KEY`, an `apiKeyHelper` in the file you pass with `--settings`, or your cloud provider’s credentials. * `--append-system-prompt`, `--mcp-config`, and `--settings` explicitly pass in what the run _does_ need. Hooks you pass with `--settings` [don’t run under `--bare`](</docs/en/headless#start-faster-with-bare-mode>), so don’t use `--bare` for a run that needs them. * `--allowedTools` pre-approves its tools, and [`--permission-mode dontAsk`](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>) refuses anything else that would have prompted. * `--output-format json` gives you a single result object to parse, and `stream-json` with `--verbose` streams events as they happen.
modified Claude Code changelog View current →
Show diff (153 lines)
--- a/changelog.md +++ b/changelog.md @@ -1,4 +1,150 @@ This page is generated from the [CHANGELOG.md on GitHub](<https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md>). Longer releases are grouped by type of change, with long lists of improvements and bug fixes collapsed. Run `claude --version` to check your installed version. + +2.1.329 + +November 19, 2026 + +**Added** + + * Added a trust dialog warning that says where a folder’s hooks are declared + * Added a warning in the conversation, in Claude Desktop and other non-interactive hosts, when hooks in managed settings fail to load + * Added this session’s scheduled tasks, `/loop` wakeups, the goal and this conversation’s forks to `/tasks`; x stops one after asking + * Added a “Server message” row to a server’s page in `/mcp` that shows the JSON-RPC error message of a remote HTTP MCP server that refuses the connection + * Added a “Marketplace auto-update” row to `/status` that names managed marketplaces that get no automatic updates, and why + * Added support for turning on Code Mode while OpenTelemetry events and metrics are enabled; each tool call the code makes sends its events; tracing still keeps it off + * [VSCode] Added a line above the message box after you decline the trust prompt, with Review trust to bring the prompt back without reloading the window + +**Changed** + + * Updated computer use on macOS to newer safety rules, so some actions are refused and some apps have less access + * Changed saved scheduled tasks: in new signed-in sessions, most saved by earlier versions need scheduling again, though `--resume` of their own session still runs them + * Changed `/code-review` with no target on most models to review the whole branch against the default branch, and fixed it losing the diff on multi-commit branches + * Changed auto mode to run `git status` less often so most requests wait less in large repositories; a git command that discards changes may be blocked until the working tree is checked + * Changed `/code-review <pr number> --fix`, and `/code-review` given a pull request URL, to stop without reviewing when `gh pr diff` is refused or fails + * Changed ‘Exit and stop tasks’ to end this session’s scheduled tasks so they don’t run again on resume, unless you exit while Claude is responding + * Changed some teammate panes to start through /bin/sh, so they may not read shell start-up files + * Changed computer use on macOS to give up on an app launch that has not finished after 30 seconds + * Gateway: Changed the start-up warning shown while `access_control.allow_cidrs` is empty to a notice at every start, boxed in text logs: never expose the gateway to the public internet + * Self-hosted runner: Changed a second host name’s clone of the same owner/name to go under `_repos/clones/<host>/` in the base folder; no clone moves + * Self-hosted runner: Changed repositories with unusual characters in their address path to clone anew in a new folder; rules and volumes naming the old one stop applying, and the old clone stays put + * Self-hosted runner: Changed `--repository-folder` to take most folders in the base folder at `--capacity 1` (above 1, one there stops start-up); another repository’s session overlapping one is refused + * Changed Code Mode so a PreToolUse hook that errors no longer refuses a script’s tool call, as outside Code Mode; set `"onFailure": "block"` on a command, HTTP or MCP tool hook that must refuse + * Changed Code Mode to refuse a script’s read of a line range over 256 MiB, which could use gigabytes of memory, and fixed reads of very long lines timing out + * Changed Code Mode to also start when telemetry, nonessential traffic or feature flags are turned off; an administrator can keep it off in managed settings + * Changed Code Mode to run a script that declares its own `log`, `preview` or `sleep`, which it used to refuse + * Changed macOS login renewal to test the Keychain with a `Claude Code-write-check` item + * Changed the `/tasks` header and the footer’s background count to one number covering shells, monitors, MCP calls, agents, workflows and scheduled tasks + * Changed Stop and SubagentStop hooks to list a Monitor’s script as `monitor`, not `shell`, in `background_tasks` + * Removed 2.1.326’s automatic retry at the limit named in a `max_tokens` error; behind a gateway whose model takes fewer output tokens, set `CLAUDE_CODE_MAX_OUTPUT_TOKENS` to that limit + * [VSCode] Changed Down to stop at the last item of a permission prompt instead of wrapping to Yes + * [VSCode] Changed command output to show hidden characters and control sequences other than plain colors as symbols, so Persian, Khmer, Lao, Sinhala and Malayalam text can look broken or out of order + +Show 10 improvements + + * Improved the automatic clean-up of old sessions on computers with managed settings + * Improved `/tui` and other in-place restarts to wait briefly for a login refresh, so they are less likely to sign you out + * Improved memory use in long sessions that edit many files, and in long Claude Desktop sessions on macOS and Linux with many large MCP tool results + * Windows: Improved start-up and the first search on PCs where Claude Code’s search program starts slowly + * Improved auto mode’s handling of a short reply such as “yes” to Claude’s question when telemetry is off, behind a gateway to the Anthropic API, or on Microsoft Foundry + * Improved memory use of idle Claude Desktop and SDK sessions after a long turn, and after `--resume` or `--continue` of a session that holds screenshots or large tool results + * Improved how fast a Claude Desktop Code session with Remote Control on is ready for the next message after an answer + * Improved cloud sessions to retry plugins that failed to download at startup + * Improved Code Mode: the terminal freezes for far less time after a script makes thousands of tool calls + * Improved Code Mode: after starting a subagent, Claude now gets the same guidance on waiting as outside Code Mode + +Show 91 bug fixes + + * Fixed `~/.claude.json` sometimes being reset to defaults when a network stall or file lock made it unreadable and cleared during a save + * Fixed repeated sign-outs on macOS when Claude Code could read the Keychain but not save to it. That session now stops at expiry and says why, and other sessions stay signed in + * Fixed `/terminal-setup` corrupting VS Code settings or keybindings files around block comments, and reporting success while losing the Shift+Enter binding where keybindings.json has an unclosed string + * Fixed files accepted through the IDE diff being saved without their last newline, and losing their byte order mark (BOM) when an edit was accepted by saving the diff in VS Code + * Fixed picking a cloud session in `/teleport` replacing your open conversation: the pick now starts a new session, as `/clear` does, and `/resume` brings the old one back + * Fixed `/usage-credits` asking Pro and Max users to log in again after opening the browser, and the link disappearing after 8 seconds if the browser doesn’t open and a task stops for usage credits + * Fixed `/usage` saying usage credits are off when they had run out or reached the monthly limit, and `/model` not telling Pro and Max users when that limit blocks a model that runs on usage credits + * Fixed the spend limit menu showing your spend as your monthly limit and wrapping its rows under the pointer in narrow windows + * Fixed a status line script that prints without end freezing the prompt and using gigabytes of memory + * Fixed an empty, frozen screen after approving managed settings while the —resume picker, the trust dialog or another set-up screen was waiting + * Fixed choosing Default in `/model` replacing your saved model with your organization’s default when the Default row already showed your saved model + * Fixed an MCP server being signed in again after you cleared its authentication while a token refresh was running + * Fixed background MCP tasks that stalled after a slow reconnect: Claude Code now reconnects most HTTP MCP servers by itself when one is left on an older protocol version + * Fixed PDFs, images and `.docx`, `.xlsx` or `.pptx` files that MCP servers or websites send as `application/octet-stream` being saved as .bin, which kept Claude from reading the PDFs and images + * Fixed `/code-review <pr number>` sometimes reviewing the checked-out branch instead of the pull request without saying so: it now reads the pull request with `gh pr diff`, or says when it can’t + * Fixed `/code-review` stopping at a permission prompt, on most models, to look for a `~/.claude/CLAUDE.md` that doesn’t exist + * Self-hosted runner: Fixed `--push-outcome-on-release` sometimes deleting a session’s branch on the git host + * Fixed Code Mode hiding a script’s finished edits and the stopped command after Esc, and losing them on exit + * Fixed a runaway loop in Code Mode filling the machine’s memory; it is now stopped at a limit + * Fixed a background agent running on when it was stopped while it was being resumed + * Fixed background shell commands using memory for the earlier conversation until they exit + * Fixed Remote Control using memory for the earlier conversation after a compaction or `/clear` in sessions run by Claude Desktop, IDEs or the SDK + * Fixed Stop not ending a request in Claude Desktop sessions on Bedrock while it waits on a hung AWS credential_process or sign-in call + * Fixed Claude sometimes failing to send you a file on its first try on Opus 4.8 and Opus 5 + * Fixed Claude not being told that a connected MCP server’s tools could not be loaded, and taking it for a server with no tools, in sessions with tool search + * Fixed `claude mcp login` and `/mcp` saying a service doesn’t accept sign-ins from Claude Code when the service’s client registration had been retired (HTTP 410 Gone) + * Fixed another case of claude.ai-synced plugin hooks failing with “Plugin directory does not exist” while a session was still running on macOS + * Fixed auto mode asking for manual approval to `rm` a symlink that points outside the working directory or at itself + * Fixed `/sandbox` on Linux listing `allowUnixSockets` entries as allowed: they don’t open those sockets there, and `/sandbox` now says so + * Fixed pressing Esc twice to clear a mistyped code ending the sign-in in `/install-github-app` + * Remote Control: Fixed sessions going back to their first effort level after a restart while the app still showed the level you picked (not yet for sessions that start in Ultracode) + * Fixed a removed plugin’s MCP server staying connected in headless sessions after `reload_plugins` or when the account’s plugin list drops it + * Fixed the Claude Docs connector’s tools going missing when a plugin or MCP server at the same address failed to connect, and its error wrongly suggesting `/login` + * Fixed a new skills, commands or agents folder being missed when `--add-dir` names the working directory or Claude Code starts in the home folder + * Fixed sessions started from a pre-warmed process ignoring the `autoCompactWindow` setting in the project’s `.claude/settings.json` + * Fixed `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` staying in effect in a running session after it is removed from settings.json + * Fixed the Agent tool’s `effort` parameter being ignored for named teammates in agent teams + * Fixed `/auto-mode-setup` ignoring recent auto mode denials when it scans a project for rules to suggest; it may now offer allow rules from them, and you review each before it’s saved + * Fixed a false “Couldn’t save this change” warning after adding a permission rule or directory in a subfolder or worktree whose own `.claude/settings.local.json` is unreadable or malformed + * Fixed cloud sessions telling Claude to run a network proxy check after a failed request, which auto mode then blocked + * Fixed headless rewind and fork going ahead while a message sent right after a model change still waited on it + * Fixed Claude not being told when a background task was stopped while a cloud session was restarting + * Fixed `/team-onboarding` reporting a guide as shared on Team and Enterprise plans when the server refused the upload + * Fixed panels and questions being cut off at the prompt in fullscreen, `/help`, history search and the background tasks list losing rows or titles in short windows, and tables wrapping in dialogs + * Fixed resumed sessions showing “Rejected” or “Declined” for edits, questions and plans that were cut off when the session ended + * Fixed `/passes` showing the wrong number of passes after a server error, and offering usage credits for sharing when no guest passes are left + * Fixed `claude --help` output being cut short when piped to another program + * Fixed `/terminal-setup` turning on “Use Option as Meta key” in Terminal.app on macOS 27, and tips there suggesting Option+Enter instead of Shift+Enter + * Self-hosted runner: Fixed setup failing on Git LFS repositories cloned through Anthropic-managed git; sessions now start on pointer files, and `git lfs pull` fetches the content + * Fixed sessions on self-hosted environments not starting from a git remote with an SSH host alias, GitHub SSH certificates or a GHE.com SSH user; an unresolved alias’s error gives two git commands + * Fixed remote MCP servers in self-hosted runner sessions staying without tools, or (over https) disconnected, after a timeout or network error + * Fixed self-hosted runner sessions being shown as having stopped responding while Claude Code was still starting + * Fixed Code Mode keeping in memory every large text file that code read, and memory growing each time a background subagent was woken + * Fixed Code Mode stopping a script at its ten-minute limit while an MCP form, an MCP link prompt or a prompt that always asks was waiting for an answer + * Fixed Code Mode scripts receiving a “moved to the background” message as data from most MCP calls over two minutes: the script now waits up to ten minutes, then gets an error + * Fixed mods that list only some tools silently turning Code Mode off; such a mod no longer keeps it off, so use managed settings for that + * Fixed Code Mode ignoring an MCP tool’s request to end the turn when the tool was called from a script that Claude waits for + * Fixed a Code Mode script’s `let x;` keeping the value that an earlier script gave `x` + * Fixed a Code Mode script’s call with no argument failing with a missing-parameter error on tools that need none + * Fixed Code Mode scripts losing access to tools through `tools` in sessions with more than 4,096 tools + * Fixed the `/code-review` findings card often showing “high” for a review that ran at medium, on most models + * Fixed key hints in permission prompts, questions, `/model` and `/rewind` ignoring `keybindings.json` + * Fixed auto-scroll, the PR status badge, the auto-compact warning and the ultracode tag not following the `/config` switches that control them in a running session + * Fixed a custom cancel key not working in `/add-dir`, `/tui` feedback and the save-workflow form + * Fixed arrow keys in the save-workflow form moving the selection in the workflow view behind it + * Fixed `/config` saying nothing, or “dismissed”, after changing many settings + * Fixed Read and @-mentions showing one line too many for files that end in a newline + * Fixed `/status` not naming the model that opusplan and haiku use in plan mode + * Fixed `claude doctor` advising a Keychain unlock inside a macOS sandbox, where unlocking can’t help + * Fixed the “Jump to bottom” pill staying hidden after copying text and scrolling away, the row under it going blank when its label changed, and quick PageUp presses scrolling too far in fullscreen + * Fixed a screen update sometimes being skipped when memory is low + * Fixed long code blocks losing a blank line and repeating another in scrollback + * Fixed prompt suggestions sometimes showing placeholder text such as `_(no suggestion)_` + * Fixed the line about earlier messages on resume blaming a damaged file when the file was intact + * Fixed characters disappearing from the prompt when its text held a color code that sets several styles and a keyword or command was highlighted + * Fixed `/rename` and `UserPromptSubmit` hook titles in `claude remote-control` sessions not showing on claude.ai and mobile + * Fixed the Remote Control diff listing a file twice when the branch renamed it and it was then edited + * [VSCode] Fixed being signed out of Claude Code in every window and terminal when the sign-in server took 10 to 30 seconds to answer the extension’s token refresh + * [VSCode] Fixed keys pressed while an input method (IME) is composing moving focus on or declining a permission prompt, running menu rows and closing dialogs (anthropics/claude-code#106358) + * [VSCode] Fixed the permission prompt for Bash, Edit, Write and other built-in tools not showing why a safety check asks + * [VSCode] Fixed a half-written plan comment being lost or moved to another passage, and an input method’s Enter sending the comment, ending a session rename or picking an @-mentioned file + * [VSCode] Fixed the limit banner not saying when usage credits are in use, and the session survey covering that banner and the usage credits card + * [VSCode] Fixed screen readers not announcing a permission request that arrived while the Account & Usage dialog was open until that dialog was closed + * [VSCode] Fixed a proposed-edit diff tab staying open, with an Accept button that did nothing, after its terminal Claude Code session disconnected + * [VSCode] Fixed short tool inputs and outputs cut off at the panel’s edge with no way to read the rest (they now open in an editor tab), and dragging to select text also opening one + * [VSCode] Fixed the Up key putting an earlier message over text that an input method (IME) is composing in the message box (anthropics/claude-code#101294) + * [VSCode] Fixed dropping an Explorer folder onto the chat inserting nothing on VS Code 1.103 to 1.139 or in a floating chat window, and the drop highlight vanishing with a false “Hold Shift” hint + * [VSCode] Fixed a permission prompt moving keyboard focus away from the details you were scrolling as its buttons switched on + * [VSCode] Fixed file links in a Claude tab opening in another editor group when `claudeCode.lockEditorGroups` is off (anthropics/claude-code#108884) + * [VSCode] Fixed ranges written with a single tilde (`3~5 … 7~10`) losing their tildes and showing struck-through text between them; only `~~text~~` is struck through now + * [VSCode] Fixed dictation errors wrapping into a narrow column, the spinner turning while a question card waits, and a NUL symbol after each letter in the output of a failed UTF-16 command 2.1.328
modified Push events into a running session with channels View current →
--- a/channels.md +++ b/channels.md @@ -246,7 +246,7 @@ ## Security -Every approved channel plugin maintains a sender allowlist: only IDs you’ve added can push messages, and everyone else is silently dropped. Telegram and Discord bootstrap the list by pairing: +The Telegram, Discord, and iMessage channel plugins check direct messages against a sender allowlist. Other people’s direct messages reach your session only after you add those people to the list. Telegram and Discord bootstrap the list by pairing: 1. Find your bot in Telegram or Discord and send it any message 2. The bot replies with a pairing code
modified Channels reference View current →
--- a/channels-reference.md +++ b/channels-reference.md @@ -377,7 +377,7 @@ } await mcp.notification({ ... }) -Gate on the sender’s identity, not the chat or room identity: `message.from.id` in the example, not `message.chat.id`. In group chats, these differ, and gating on the room would let anyone in an allowlisted group inject messages into the session. The [Telegram](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/telegram>) and [Discord](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/discord>) channels gate on a sender allowlist the same way. They bootstrap the list by [pairing](</docs/en/channels#security>). See either implementation for the full pairing flow. The [iMessage](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/imessage>) channel takes a different approach: it detects the user’s own addresses from the Messages database at startup and lets them through automatically, with other senders added by handle. +Gate on the sender’s identity, not the chat or room identity: `message.from.id` in the example, not `message.chat.id`. In group chats, these differ, and gating on the room would let anyone in an allowlisted group inject messages into the session. The [Telegram](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/telegram>) and [Discord](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/discord>) channels gate direct messages on a sender allowlist the same way. They bootstrap the list by [pairing](</docs/en/channels#security>). See either implementation for the full pairing flow. The [iMessage](<https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/imessage>) channel takes a different approach: it detects the user’s own addresses from the Messages database at startup and lets them through automatically, with other senders added by handle. ## Relay permission prompts
modified Checkpointing View current →
--- a/checkpointing.md +++ b/checkpointing.md @@ -17,7 +17,7 @@ Run `/rewind`, or press `Esc` twice when the prompt input is empty, to open the rewind menu. -If the prompt input contains text, double `Esc` clears it instead of opening the menu. The cleared text is saved to your input history, so press `Up` to recall it after you finish in the rewind menu. +In [vim mode](</docs/en/interactive-mode#vim-editor-mode>), press `Esc` twice from NORMAL mode. Outside vim mode, if the prompt input contains text, double `Esc` clears it instead of opening the menu. The cleared text is saved to your input history, so press `Up` to recall it after you finish in the rewind menu. The rewind menu lists the prompts you sent during the session. Select the point you want to act on, then choose an action:
modified Use Claude Code with Chrome View current →
--- a/chrome.md +++ b/chrome.md @@ -90,7 +90,7 @@ ### Manage site permissions -Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on. In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), when the auto mode classifier itself approves a browser call to a site, the extension skips its own per-site check for that call, unless your permission rules deny any site to Claude in Chrome. +To let Claude act on a site, approve it when Claude Code asks. In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), when the classifier itself approves a browser call to a site, the extension can skip its own per-site check for that call, unless your permission rules deny any site to Claude in Chrome. ### Permission prompts in VS Code sessions
modified Claude apps gateway deployment and operations View current →
--- a/claude-apps-gateway-deploy.md +++ b/claude-apps-gateway-deploy.md @@ -160,11 +160,11 @@ ### Retry an unanswered request sooner with the first-byte deadline -To make Claude Code retry an unanswered streaming request sooner, give it a first-byte deadline by setting [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](</docs/en/env-vars>) on your developers’ machines. The deadline limits how long the first attempt waits for response headers. Without it, that attempt can wait 5 to 6 minutes. Requires Claude Code v2.1.307 or later on the developer’s machine. Set the variable to a positive whole number of milliseconds, in a gateway policy’s `env` block or a developer’s shell. Keep the value above your gateway’s longest time to first byte, or Claude Code can abort and re-send healthy requests whose headers take longer. This example sets 60 seconds in a developer’s shell: +To make Claude Code retry an unanswered streaming request sooner, give it a first-byte deadline by setting [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](</docs/en/env-vars>) on your developers’ machines. The deadline limits how long the first attempt waits for response headers. Without it, that attempt can wait 5 to 6 minutes by default. Requires Claude Code v2.1.307 or later on the developer’s machine. Set the variable to a positive whole number of milliseconds, in a gateway policy’s `env` block or a developer’s shell. Keep the value above your gateway’s longest time to first byte, or Claude Code can abort and re-send healthy requests whose headers take longer. This example sets 60 seconds in a developer’s shell: export CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS=60000 -An unanswered re-send can wait 5 to 6 minutes, until the [body idle timeout](</docs/en/network-config#streaming-idle-watchdogs>) ends it and Claude Code retries it within the [retry budget](</docs/en/errors#tune-retry-behavior>). If you lowered `API_TIMEOUT_MS` only to retry sooner, remove that value, or one unanswered re-send can end the turn with [No response from API](</docs/en/errors#no-response-from-api>). To confirm the deadline fired, have a developer start Claude Code with [debug logging](</docs/en/network-config#verify-your-configuration>), then search the log for `[first-byte] no response headers`. +By default, an unanswered re-send can wait until the [body idle timeout](</docs/en/network-config#streaming-idle-watchdogs>) ends it and Claude Code retries it within the [retry budget](</docs/en/errors#tune-retry-behavior>). Keep `API_TIMEOUT_MS` well above the body idle timeout, or one unanswered re-send can end the turn with [No response from API](</docs/en/errors#no-response-from-api>). To confirm the deadline fired, have a developer start Claude Code with [debug logging](</docs/en/network-config#verify-your-configuration>), then search the log for `[first-byte] no response headers`. ### Outage behavior @@ -396,7 +396,7 @@ `900000`| About 22.5 minutes `1800000`| About 37.5 minutes -If an upstream hangs while the gateway keeps sending pings, your developers also wait that long before Claude Code gives up on the stream. A connection that goes fully silent still ends after 5 to 6 minutes, because the [body idle timeout](</docs/en/network-config#streaming-idle-watchdogs>) doesn’t follow this variable. +If an upstream hangs while the gateway keeps sending pings, your developers also wait that long before Claude Code gives up on the stream. #### Deliver the value in a policy
modified Use Claude Code features in the SDK View current →
--- a/claude-code-features.md +++ b/claude-code-features.md @@ -101,7 +101,7 @@ ## Skills -Skills are markdown files that give your agent specialized knowledge and invocable workflows. Unlike `CLAUDE.md` (which loads every session), skills load on demand. The agent receives skill descriptions at startup and loads the full content when relevant. Skills are discovered from the filesystem through `settingSources`. When the `skills` option on `query()` is omitted, discovered user and project skills are enabled and the Skill tool is available, matching CLI behavior. To control which skills are enabled, pass `skills` as `"all"`, a list of skill names, or `[]` to disable all. When `skills` is set, the SDK adds the Skill tool to `allowedTools` automatically. If you also pass an explicit `tools` list, include `"Skill"` in that list so Claude can invoke skills. +Skills are markdown files that give your agent specialized knowledge and invocable workflows. Unlike `CLAUDE.md` (which loads every session), skills load on demand. The agent receives skill descriptions at startup and loads the full content when relevant. Skills are discovered from the filesystem through `settingSources`. When the `skills` option on `query()` is omitted, discovered user and project skills are enabled and the Skill tool is available, matching CLI behavior. To control which skills the main agent can invoke, pass `skills` as `"all"`, a list of skill names, or `[]` to disable all. If you also pass a `tools` list, include `"Skill"` so Claude can invoke skills. Python @@ -152,7 +152,7 @@ * **Filesystem hooks:** shell commands defined in `settings.json`, loaded when `settingSources` includes the relevant source. These are the same hooks you’d configure for [interactive Claude Code sessions](</docs/en/hooks-guide>). * **Programmatic hooks:** callback functions passed directly to `query()`. These run in your application process and can return structured decisions. See [Control execution with hooks](</docs/en/agent-sdk/hooks>). -Hook callbacks receive the tool input and return a decision dict. Returning `{}` means allow the tool to proceed. To block execution, return a `hookSpecificOutput` object with `permissionDecision: "deny"` and a `permissionDecisionReason`. The reason is sent to Claude as the tool result. See the [hooks guide](</docs/en/agent-sdk/hooks>) for the full callback signature and return types. +Hook callbacks receive the tool input and return a decision dict. For `PreToolUse`, return `{}` to make no decision, so the normal [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) applies. To block execution, return a `hookSpecificOutput` object with `permissionDecision: "deny"` and a `permissionDecisionReason`. The reason is sent to Claude as the tool result. See the [hooks guide](</docs/en/agent-sdk/hooks>) for the full callback signature and return types. Python @@ -175,7 +175,7 @@ "permissionDecisionReason": "Destructive command blocked", } } - return {} # Empty dict: allow the tool to proceed + return {} # Empty dict: no decision, normal permissions apply # Filesystem hooks from .claude/settings.json run automatically # when settingSources loads them. You can also add programmatic hooks: @@ -213,7 +213,7 @@ }, }; } - return {}; // Empty object: allow the tool to proceed + return {}; // Empty object: no decision, normal permissions apply }; // Filesystem hooks from .claude/settings.json run automatically
modified Use Claude Code in the cloud View current →
--- a/claude-code-on-the-web.md +++ b/claude-code-on-the-web.md @@ -1,6 +1,6 @@ Cloud sessions are available on Pro, Max, Ultra, and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats. If [custom roles](<https://support.claude.com/en/articles/13930452>) govern your access, you also need a role with the cloud sessions permission to start sessions on Anthropic’s infrastructure from the browser, apps, or terminal. Ask an Owner to add it to one of your roles at [**Organization settings > Roles**](<https://claude.ai/admin-settings/roles>). -A cloud session is a Claude Code session that runs on cloud infrastructure instead of on your machine. By default it runs on infrastructure Anthropic manages, or on your organization’s [self-hosted environment](</docs/en/self-hosted-environments>) when routed there. The session keeps running after you close your laptop, and you can check on it or steer it from any device. It counts toward your plan’s usage limits alongside the rest of your Claude and Claude Code usage, and there’s no separate charge for the cloud VM. To let cloud sessions clone your code from GitHub and push branches, connect GitHub with one of the GitHub connection methods. If your repository is on GitLab, Bitbucket, or another host, see Platform restrictions for what works. You can start a cloud session from any of these surfaces: +A cloud session is a Claude Code session that runs on cloud infrastructure. By default it runs on infrastructure Anthropic manages, or on your organization’s [self-hosted environment](</docs/en/self-hosted-environments>) when routed there. The session keeps running after you close your laptop, and you can check on it or steer it from any device. It counts toward your plan’s usage limits alongside the rest of your Claude and Claude Code usage, and there’s no separate charge for the cloud VM. To let cloud sessions clone your code from GitHub and push branches, connect GitHub with one of the GitHub connection methods. If your repository is on GitLab, Bitbucket, or another host, see Platform restrictions for what works. You can start a cloud session from any of these surfaces: * **Browser** : [claude.ai/code](<https://claude.ai/code>), also called Claude Code on the web * **Mobile** : the **Code** tab in the [Claude app](</docs/en/mobile>) @@ -189,8 +189,8 @@ After Claude pushes its changes to a branch, the **Changes** card in the panel beside the chat shows the lines added and removed, such as `+42 -18`. Click the line counts on the **Changes** card to open the diff view. - * You can also click **Changes** in the session’s title bar, or in the bar’s **⋮** menu. - * To show the panel when it’s hidden, click the **Show session rail** icon in the session’s title bar, or in the bar’s **⋮** menu. + * To show the panel when it’s hidden, click **Activity panel** or **Show session rail** in the session’s title bar, or **Show session rail** in the bar’s **⋮** menu. + * You can also [open **Changes** as a pane](</docs/en/desktop#arrange-your-workspace>). In the diff view, you can comment on lines and compare against another branch: @@ -324,13 +324,11 @@ ## Security and isolation -Each cloud session is separated from your machine and from other sessions through several layers: - - * **Isolated virtual machines** : each session runs in an isolated, Anthropic-managed VM. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own infrastructure instead, where isolation is your deployment’s responsibility +By default, a cloud session runs its shell commands and file edits in an isolated, Anthropic-managed VM. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own infrastructure instead, where isolation is your deployment’s responsibility. + * **Network access controls** : in Anthropic-hosted environments, network access is limited by default and can be disabled. See [Network access](</docs/en/cloud-environments#network-access>) for the access levels, the [default allowed domains](</docs/en/cloud-environments#default-allowed-domains>), and the traffic that doesn’t go through the allowlist. In a self-hosted environment, you restrict session egress at your own network boundary. When running with network access disabled, Claude Code can still communicate with the Anthropic API, which may allow data to exit the VM. * **Credential protection** : in Anthropic-hosted environments, git credentials and signing keys stay outside the sandbox, and a proxy authenticates on the session’s behalf with scoped credentials. In a self-hosted environment, your deployment supplies git credentials; see [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>) * **Network secrets** : in Anthropic-hosted environments, keys you [add to a cloud environment](</docs/en/cloud-environments#add-network-secrets>) stay outside the sandbox the same way, attached to matching requests after they leave the session. A self-hosted environment doesn’t have network secrets - * **Secure analysis** : code is analyzed and modified within the session’s isolated environment before creating PRs ## Troubleshooting @@ -362,9 +360,9 @@ * `Unable to get organization UUID` * `Cloud sessions need a claude.ai sign-in. Run `claude auth login` (or /login in a local session), then try again.` * `Cloud sessions aren't available with this Console sign-in. They need a claude.ai sign-in. Run `claude auth login` (or /login in a local session), then try again.` - * `Error loading Claude Code sessions` in the session picker, when you run `claude --teleport` without a session ID - -Run [`claude auth login`](</docs/en/cli-reference#cli-commands>) in your shell to sign in with your claude.ai account, then retry the command. Inside a running session, `/login` does the same. If the error names your provider instead, see the error table: cloud sessions aren’t available through third-party providers. From v2.1.274 through v2.1.289, the sign-in message read `Claude Code cloud sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.` + * `Couldn't load cloud sessions` in the session picker, when you run `claude --teleport` without a session ID. Before v2.1.328, it read `Couldn't load Claude Code sessions` or `Error loading Claude Code sessions` + +Run [`claude auth login`](</docs/en/cli-reference#cli-commands>) in your shell to sign in with your claude.ai account, then retry the command. Inside a running session, `/login` does the same. If the error names your provider instead, see the error table: cloud sessions aren’t available through third-party providers. ### Branch is not on GitHub
modified Explore the .claude directory View current →
--- a/claude-directory.md +++ b/claude-directory.md @@ -121,6 +121,7 @@ `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/loading#synced-plugins>) that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing. The files stay here so you can recover them until the sweep deletes them `plugins/installed_plugins.set-aside.<date>.<hash>.json`, `plugins/installed_plugins.unreadable.<date>.<hash>.kept`| Dated copies Claude Code makes before rewriting [`installed_plugins.json`](</docs/en/plugins/loading#find-plugins-on-disk>): install records it dropped, and the contents of a file it couldn’t read. +`plugins/data/.set-aside/`| Data directories of plugins from a marketplace that your organization replaced with one of the same name. Their age counts from the day Claude Code moved them, and a shorter `cleanupPeriodDays` in project settings doesn’t apply. To keep one, move it somewhere else before the sweep deletes it. `plugins/mcpb/`| The files Claude Code extracted from the [MCP bundles](</docs/en/plugins/components#include-a-packaged-mcpb-server>) that plugins declare. A bundle’s age counts from the last session that used it. `todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory. @@ -136,7 +137,7 @@ Claude Code skips the age-based sweep in these cases: * **Bare mode** : when you run `claude -p` with [`--bare`](</docs/en/headless#start-faster-with-bare-mode>), Claude Code doesn’t run the sweep in that session. - * **Paused sweep** : if Claude Code can’t safely determine the retention period, it pauses the sweep; the [`retention_sweep` event](</docs/en/monitoring-usage#retention-sweep-event>) lists each configuration that pauses it. When the cause is a settings file that can’t be read or parsed, or settings errors with `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` set, `/status` shows a warning until you fix the cause. + * **Paused sweep** : if Claude Code can’t safely determine the retention period, it pauses the sweep; the [`retention_sweep` event](</docs/en/monitoring-usage#retention-sweep-event>) reports why. When the cause is a settings file that can’t be read or parsed, or settings errors with `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` set, `/status` shows a warning until you fix the cause. When [managed settings](</docs/en/managed-settings>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value even when a lower-priority settings file has errors. To check that the machines in your organization run the sweep with the retention period you set, see [Check the retention sweep](</docs/en/monitoring-usage#check-the-retention-sweep>).
modified Claude Code on Claude Platform on AWS View current →
--- a/claude-platform-on-aws.md +++ b/claude-platform-on-aws.md @@ -35,7 +35,7 @@ "awsAuthRefresh": "aws sso login --profile my-profile" } -Claude Code also runs this command at startup when it can’t validate your existing AWS credentials, and shows the command’s output in an `Authentication` panel until the login completes. With `awsAuthRefresh` configured, run `/login`, select **3rd-party platform** , then select **Claude Platform on AWS · refresh credentials** under **Using 3rd-party platforms**. Claude Code runs the configured command and re-reads your AWS credentials without a restart. +Claude Code also runs this command at startup when it can’t validate your existing AWS credentials. With `awsAuthRefresh` configured, run `/login`, select **3rd-party platform** , then select **Claude Platform on AWS · refresh credentials** under **Using 3rd-party platforms**. Claude Code runs the configured command and re-reads your AWS credentials without a restart. #### Use a workspace API key
modified CLI reference View current →
--- a/cli-reference.md +++ b/cli-reference.md @@ -16,7 +16,7 @@ `claude install [version]`| Install or reinstall the native binary. Accepts a version like `2.1.118`, or `stable` or `latest`. See [Install a specific version](</docs/en/setup#install-a-specific-version>)| `claude install stable` `claude auth login`| Sign in to your Anthropic account. Use `--email` to pre-fill your email address, `--sso` to force SSO authentication, and `--console` to sign in with Anthropic Console for API usage billing instead of a Claude subscription. If managed settings require a [Claude apps gateway](</docs/en/claude-apps-gateway>) sign-in, run the command with no flags in a terminal, on v2.1.316 or later. If the command points you to `/login`, run that inside `claude`| `claude auth login --console` `claude auth logout`| Log out from your Anthropic account| `claude auth logout` -`claude auth status`| Show authentication status as JSON. Use `--text` for human-readable output. Exits with code 0 if logged in, 1 if not. The JSON includes a `configDirectory` field naming the [configuration directory](</docs/en/claude-directory>) the CLI uses. The field requires Claude Code v2.1.268 or later. The JSON’s `authMethod` field is one of `none`, `claude.ai`, `oauth_token`, `api_key`, `api_key_helper`, or `third_party`| `claude auth status` +`claude auth status`| Show authentication status as JSON. Use `--text` for human-readable output. Exits with code 0 if logged in, 1 if not. The JSON includes a `configDirectory` field naming the [configuration directory](</docs/en/claude-directory>) the CLI uses. The field requires Claude Code v2.1.268 or later. The JSON’s `authMethod` field is one of `none`, `claude.ai`, `oauth_token`, `api_key`, `api_key_helper`, or `third_party`. From v2.1.318, its `loginExpiresAt` field gives [a stored login’s latest expected end date](</docs/en/authentication#check-when-a-stored-login-ends>), or `null`| `claude auth status` `claude agents`| Open [agent view](</docs/en/agent-view>) to monitor and dispatch parallel background sessions. Use `--cwd <path>` to show only sessions started under that directory, or `--json` to print active sessions as a JSON array for scripting (`--json --all` also includes completed background sessions). Pass `--permission-mode`, `--model`, `--effort`, or `--agent` to set [defaults for dispatched sessions](</docs/en/agent-view#permission-mode-model-and-effort>). Accepts `--settings`, `--add-dir`, `--plugin-dir`, and `--mcp-config` like the top-level `claude` command. Opening agent view requires an interactive terminal| `claude agents --json` `claude attach <id|name>`| Attach to a [background session](</docs/en/agent-view#manage-sessions-from-the-shell>) in this terminal. Passing part of a running session’s name in place of the ID requires Claude Code v2.1.290 or later| `claude attach 7c5dcf5d` `claude auto-mode defaults`| Print the [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) classifier rules built into Claude Code as JSON. Use `claude auto-mode config` to see those rules with your settings applied. `--label <prefix>` prints only the rules whose label starts with that prefix, matched case-insensitively. Requires Claude Code v2.1.208 or later| `claude auto-mode defaults --label 'Git Destructive'` @@ -53,7 +53,7 @@ `--advisor <model>`| Enable the server-side [advisor tool](</docs/en/advisor>) for this session with a model alias, `fable`, `opus`, or `sonnet`, or a full model ID. Takes precedence over the `advisorModel` setting for the session. `fable` requires [Fable access](</docs/en/advisor#choose-an-advisor-model>)| `claude --advisor opus` `--agent`| Specify an agent for the current session (overrides the `agent` setting)| `claude --agent my-custom-agent` `--agents`| Define custom subagents dynamically via JSON. Accepts the [fields listed for CLI-defined subagents](</docs/en/sub-agents#choose-the-subagent-scope>). With `--print`, the value can instead be the path to a JSON file holding the object; the file form requires Claude Code v2.1.281 or later. Claude Code validates the value at startup and exits on an invalid one; see [`Invalid --agents configuration`](</docs/en/errors#invalid-agents-configuration>) for the message and for the flags and environment variable that skip the validation. Validation requires Claude Code v2.1.242 or later| `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'` -`--allow-dangerously-skip-permissions`| Add `bypassPermissions` to the `Shift+Tab` mode cycle without starting in it. Lets you begin in a different mode like `plan` and switch to `bypassPermissions` later. See [permission modes](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>)| `claude --permission-mode plan --allow-dangerously-skip-permissions` +`--allow-dangerously-skip-permissions`| Add `bypassPermissions` to the `Shift+Tab` mode cycle without starting in it. While `bypassPermissions` is in the cycle of an interactive terminal session, most edits and commands Claude attempts in plan mode run with no prompt, before you approve a plan. See [permission modes](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>)| `claude --permission-mode default --allow-dangerously-skip-permissions` `--allowedTools`, `--allowed-tools`| Tools that execute without prompting for permission, apart from reads from [network paths](</docs/en/permissions#network-paths>). See [permission rule syntax](</docs/en/settings-reference#permission-rule-syntax>) for pattern matching. To restrict which tools are available, use `--tools` instead. If you name one of the [task-tracking tools](</docs/en/tools-reference#task-tool-availability>) here, Claude Code also opts the session in| `"Bash(git log *)" "Bash(git diff *)" "Read"` `--append-subagent-system-prompt`| Append custom text to the end of every [subagent](</docs/en/sub-agents>)’s system prompt, nested subagents included, apart from a [forked subagent](</docs/en/sub-agents#fork-the-current-conversation>), which reuses the conversation’s own prompt. Only applies in non-interactive mode with `-p`. Requires Claude Code v2.1.205 or later| `claude -p --append-subagent-system-prompt "Cite file paths in every answer" "query"` `--append-subagent-system-prompt-file`| Load text from a file and append it to [subagent](</docs/en/sub-agents>) system prompts. An alternative to `--append-subagent-system-prompt` for text too long to pass on the command line. The two flags can’t be combined. Only applies in non-interactive mode with `-p`. Requires Claude Code v2.1.261 or later| `claude -p --append-subagent-system-prompt-file ./subagent-rules.txt "query"` @@ -68,6 +68,7 @@ `--chrome`| Enable [Chrome browser integration](</docs/en/chrome>) for web automation and testing| `claude --chrome` `--cloud`| With a task description, create a new [cloud session](</docs/en/claude-code-on-the-web>). With a session ID (`session_...` or `cse_...`) or a claude.ai/code URL, queue a message into that existing session instead, with `-p`. See [send a follow-up message](</docs/en/claude-code-on-the-web#send-follow-ups-from-the-cli>).| `claude --cloud "Fix the login bug"` `--continue`, `-c`| Load the most recent conversation in the current directory, including a [background session that has finished](</docs/en/sessions#where-the-session-picker-looks>); opening finished background sessions requires Claude Code v2.1.257 or later. Skips sessions created with `claude -p` or the Agent SDK, and sessions whose first prompt was `/loop`. `claude -p --continue` includes `-p`, SDK, and `/loop` sessions. Includes sessions that added this directory with `/add-dir`| `claude --continue` +`--correlation-id <id>`| With `--environment`, pass an ID to the [`spawn-runner` hook](</docs/en/self-hosted-environments-configuration#the-spawn-runner-hook>) as `CLAUDE_RUNNER_CORRELATION_ID`. Requires Claude Code v2.1.328 or later| `claude -p "Run the build" --environment ccpool_abc123 --correlation-id build-4821` `--dangerously-load-development-channels`| Enable [channels](</docs/en/channels-reference#test-during-the-research-preview>) that are not on the approved allowlist, for local development. Accepts `plugin:<name>@<marketplace>` and `server:<name>` entries. Prompts for confirmation, so it takes effect in interactive sessions. With `-p`, Claude Code ignores the flag| `claude --dangerously-load-development-channels server:webhook` `--dangerously-skip-permissions`| Skip permission prompts. Equivalent to `--permission-mode bypassPermissions`. See [permission modes](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) for what this does and does not skip. For sessions started with `--bg`, the mode [persists when the supervisor restarts the session](</docs/en/agent-view#permission-mode-model-and-effort>)| `claude --dangerously-skip-permissions` `--debug`| Enable debug mode with optional category filtering, such as `--debug='mcp,startup'` or `--debug='!mcp'`. The filter binds only in the `=` form; a space-separated filter enables debug mode without filtering| `claude --debug='mcp,startup'` @@ -95,6 +96,7 @@ `--max-budget-usd`| Stop the run once estimated spend on API calls reaches this amount (print mode only). Claude Code checks the cap against its [client-side cost estimate](</docs/en/agent-sdk/cost-tracking#estimates-not-billing>), which can differ from your bill. Spend from [subagents](</docs/en/sub-agents>) counts toward the cap. Spend can pass the cap, so [leave headroom](</docs/en/agent-sdk/agent-loop#budget-headroom>). When you return to a conversation with `--continue` or `--resume`, totals [restored from earlier runs](</docs/en/agent-sdk/cost-tracking#accumulate-costs-across-multiple-calls>) don’t count toward it. Once spend reaches the cap, spawning another subagent fails with `Budget limit reached`, and Claude Code stops background subagents that are still running; the cap-enforcement behaviors require Claude Code v2.1.217 or later| `claude -p --max-budget-usd 5.00 "query"` `--max-turns`| Limit the number of agentic turns (print mode only). No limit by default. With `--input-format stream-json`, a message still queued when the limit ends a turn stays queued and starts a new turn with its own limit| `claude -p --max-turns 3 "query"` `--mcp-config`| Load MCP servers from JSON files or strings (space-separated). When you pass this flag with `-p`, Claude Code waits for still-pending servers to connect before running the first turn, up to the [`MCP_TIMEOUT`](</docs/en/env-vars>) startup timeout, 30 seconds by default; a server with a [cached tool list](</docs/en/mcp#managing-your-servers>) skips the wait and connects on first use. In a [self-hosted environment](</docs/en/self-hosted-environments-configuration#connection-timing>), a shorter wait applies instead. The wait requires Claude Code v2.1.221 or later| `claude --mcp-config ./mcp.json` +`--metadata <key=value>`| With `--environment`, label the new session for the orchestrator’s [`--hook-label`](</docs/en/self-hosted-environments-reference#orchestrator-cli-flags>). Repeatable. Don’t put secrets in labels. Requires Claude Code v2.1.328 or later| `claude -p "Run the build" --environment ccpool_abc123 --metadata size=large` `--model`| Sets the model for the current session with a [model alias](</docs/en/model-config#model-aliases>) such as `sonnet`, `opus`, `haiku`, or `fable`, or a model’s full name. Overrides the [`model`](</docs/en/settings-reference#model>) setting and [`ANTHROPIC_MODEL`](</docs/en/model-config#environment-variables>)| `claude --model claude-sonnet-5` `--name`, `-n`| Set a display name for the session, shown in `/resume` and the terminal title. You can resume a named session with `claude --resume <name>`. @@ -121,7 +123,7 @@ `--safe-mode`| Start with all customizations disabled to troubleshoot a broken configuration: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto memory do not load. Authentication, model selection, built-in tools, and permissions work normally, which differs from [`--bare`](</docs/en/headless#start-faster-with-bare-mode>). Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Useful for checking whether a customization is what triggers [automatic model fallback](</docs/en/model-config#automatic-model-fallback>). Sets [`CLAUDE_CODE_SAFE_MODE`](</docs/en/env-vars>)| `claude --safe-mode` `--session-id`| Use a specific session ID for the conversation (must be a valid UUID)| `claude --session-id "550e8400-e29b-41d4-a716-446655440000"` `--setting-sources`| Comma-separated list of setting sources to load (`user`, `project`, `local`). See [agent view](</docs/en/agent-view#what-carries-over-when-you-background>) and [agent teams](</docs/en/agent-teams#context-and-communication>) for the sessions you start from this one that inherit the list| `claude --setting-sources user,project` -`--settings`| Path to a settings JSON file or an inline JSON string. Values you set here override the same keys in your `settings.json` files for this session. Keys you omit keep their file-based values. The file must be a regular file no larger than 2 MiB. See [settings precedence](</docs/en/settings#settings-precedence>)| `claude --settings ./settings.json` +`--settings`| Path to a settings JSON file or an inline JSON string. Values you set here override the same keys in your `settings.json` files for this session, but [most lists merge](</docs/en/settings#lists-merge-instead-of-overriding>) with theirs. Keys you omit keep their file-based values. The file must be a regular file no larger than 2 MiB. See [settings precedence](</docs/en/settings#settings-precedence>)| `claude --settings ./settings.json` `--strict-mcp-config`| Skip the MCP servers configured in places such as `.mcp.json`, `~/.claude.json`, or a plugin, and load the ones you pass with `--mcp-config`. See [Exclusive control with managed-mcp.json](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>) for what the flag does under a managed MCP file| `claude --strict-mcp-config --mcp-config ./mcp.json` `--system-prompt`| Replace the entire system prompt with custom text| `claude --system-prompt "You are a Python expert"` `--system-prompt-file`| Load system prompt from a file, replacing the default prompt| `claude --system-prompt-file ./custom-prompt.txt`
modified Configure cloud environments View current →
--- a/cloud-environments.md +++ b/cloud-environments.md @@ -221,7 +221,7 @@ ### Security proxy -Cloud sessions in Anthropic-hosted environments run behind an HTTP/HTTPS network proxy for security and abuse prevention purposes; in a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic leaves through your own network boundary instead. All outbound internet traffic from an Anthropic-hosted session passes through this proxy, which provides: +Cloud sessions in Anthropic-hosted environments run behind an HTTP/HTTPS network proxy for security and abuse prevention purposes. In a [self-hosted environment](</docs/en/self-hosted-environments-deploy#default-deny-egress>), outbound traffic leaves through your own network boundary instead. Outbound internet traffic from an Anthropic-hosted session’s VM passes through this proxy, which provides: * Protection against malicious requests * Rate limiting and abuse prevention @@ -442,7 +442,7 @@ * **Not in a project’s cloud threads** : a cloud thread in a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) doesn’t run hooks from a repository’s `.claude/settings.json`, whatever the number of repositories. In an Anthropic-hosted environment, install dependencies for threads with a setup script. In a self-hosted environment, use a hook in the [runner host’s settings](</docs/en/self-hosted-environments-configuration#repository-settings-in-sessions-with-several-repositories>) 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. Under the default **Limited** level with **Allow package managers** checked, the default allowlist 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. + * **Proxy compatibility** : in Anthropic-hosted environments, outbound traffic from the session’s VM 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. * **Adds startup latency** : hooks run each time a session starts or resumes, unlike setup scripts which benefit from environment caching. Keep install scripts fast by skipping work that’s already done, the way the dependency install script does. To customize the base image, use a setup script to install what you need on top of the provided image, or run your own image as a container alongside Claude with `docker compose`. Replacing the base image entirely isn’t supported yet.
modified Code intelligence plugins View current →
--- a/code-intelligence.md +++ b/code-intelligence.md @@ -82,7 +82,7 @@ The **LSP plugin recommendation** dialog names the plugin and offers these choices: * **Yes, install** : Claude Code installs the plugin for your user account and prints `<plugin> installed · restart to apply`. Start a new session to load the server. - * **No, not now** : the dialog closes, and a later session can offer the plugin again. Pressing **Esc** does the same. + * **Not now** : the dialog closes, and a later session can offer the plugin again. Pressing **Esc** does the same. * **Never for this plugin** : the dialog stops appearing for that plugin and still appears for others. * **Disable all LSP recommendations** : the dialog stops appearing for every language.
modified Run tool calls from code with Code Mode View current →
Show diff (171 lines)
--- a/code-mode.md +++ b/code-mode.md @@ -28,7 +28,7 @@ * **Resuming** : you can resume a Code Mode session only in the terminal, with Code Mode on * **Auto mode** : auto mode’s classifier reviews the code, not each tool call * **Long-running code** : unless code can run in the background, you wait for it to finish, and it stops after ten minutes - * **Hooks** : you can see tool calls refused when a `PreToolUse` hook can’t run or times out, and code output blocked by a `UserPromptSubmit` hook + * **Hooks** : you can see tool calls refused when a `PreToolUse` hook can’t run or times out * **Unavailable features** : you can’t use [Remote Control](</docs/en/remote-control>), [Claude in Chrome](</docs/en/chrome>), or [computer use](</docs/en/computer-use>) * **Moving the session** : you can’t move the session to the Desktop app or turn it into a [background session](</docs/en/agent-view>), and `/fork` can’t start a background copy @@ -130,27 +130,121 @@ ### Permission checks -When Claude runs code, each tool call in it goes through your `deny` and `ask` [permission rules](</docs/en/permissions>) and your [`PreToolUse` hooks](</docs/en/hooks#pretooluse>) under the tool’s usual name, such as `Bash`. Beyond rules and hooks, a classifier reviews the code in auto mode, and you answer prompts in the modes that ask: - - * **[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier reviews each piece of code before it runs, not each tool call. It doesn’t see values computed at run time, such as a path taken from search output, so keep rules or hooks for calls you must control. You can still be prompted when new code starts while earlier code runs - * **Other[permission modes](</docs/en/permission-modes>)**: the code starts without a review, and you’re prompted for each tool call that would prompt you in that mode - -If you have a `PreToolUse` hook that allows or blocks shell commands, make it check each part of a command, as [Bash rules do](</docs/en/permissions#compound-commands>). In Code Mode, a `git push` in a folder named `app` can reach your hook as `cd 'app' && git push`. To check the code itself, write a `PreToolUse` hook that matches `REPL`, the tool that runs the code, and read the JavaScript from `tool_input.code`. +In auto and `bypassPermissions` modes, code can run from start to finish without a permission prompt. Some calls still prompt you, such as the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). Each tool call in the code goes through your `deny` and `ask` [permission rules](</docs/en/permissions>) and [`PreToolUse` hooks](</docs/en/hooks#pretooluse>) under the tool’s usual name, such as `Bash` or an [MCP tool’s name](</docs/en/permissions#mcp>). Beyond rules and hooks, a classifier reviews the code in auto mode, and you answer prompts in the modes that ask: + + * **[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>)** : the classifier reviews each piece of code before it runs, not each tool call. It doesn’t see values computed at run time, such as a path taken from search output, so keep rules or hooks for calls you must control. You can still be prompted for some calls, such as calls in code that you approved yourself after repeated classifier blocks + * **Other[permission modes](</docs/en/permission-modes>)**: you’re prompted for each tool call that would prompt you in that mode + +If you have a `PreToolUse` hook that allows or blocks shell commands, make it check each part of a command, as [Bash rules do](</docs/en/permissions#compound-commands>). In Code Mode, a `git push` in a folder named `app` can reach your hook as `cd 'app' && git push`. To check the code itself, write a `PreToolUse` hook that matches `REPL`, the tool that runs the code, and read the JavaScript from `tool_input.code`. To check what the code returns, see Check code output with a hook. Bash rules match command text, so Claude can run a denied command [in a form the rule doesn’t match](</docs/en/permissions#bash-rule-limits>), with or without Code Mode. For limits that don’t depend on command text, see [sandboxing](</docs/en/sandboxing>). +#### Require approval for a command + +To see a prompt for a specific command in auto or `bypassPermissions` mode, add an `ask` rule for it. You’re prompted for the [forms of the command that the rule matches](</docs/en/permissions#bash-rule-limits>). To be prompted for commands that start with `git push`, save this rule in `~/.claude/settings.json`: + + { + "permissions": { + "ask": ["Bash(git push *)"] + } + } + +To test the rule, start a new session in auto mode in a repository with no remote, and ask Claude to run `git push origin main`. You see a prompt for that command. + +#### Approve each piece of code first + +To read and approve code before it starts, add an `ask` rule for `REPL`, the tool that runs the code. Save this rule in `~/.claude/settings.json`: + + { + "permissions": { + "ask": ["REPL"] + } + } + +To test the rule, start a new session and give Claude a task. You see a prompt that doesn’t include the code. To read the code before you answer, press `Ctrl+O`, expand the **Code** row, and press `Ctrl+O` again to return. From the main conversation, you don’t see a [subagent](</docs/en/sub-agents>)’s code in that view. If you approve in auto mode, the code starts even when the classifier would have blocked it, and its project edits and read-only commands run without a prompt. If Claude reports that the code can’t start a subagent, remove the rule. + +#### Answer a permission prompt while code runs + +To stop the code at a prompt for one of its tool calls, answer **No** without a comment. These results apply to prompts that aren’t labeled as coming from a subagent: + + * **No, or`Esc`**: the code stops, and changes from calls that already finished stay in place + * **No, with a[comment](</docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt>)**: the call is refused, and the code can continue with its other calls + +### Limit shell commands with the sandbox + +Your [sandbox](</docs/en/sandboxing>) settings apply to the shell commands that code runs. The JavaScript itself and its file, web, and MCP tool calls run [outside the sandbox](</docs/en/sandboxing#what-runs-outside-the-sandbox>). To isolate the JavaScript and those calls too, run Claude Code in a [container or virtual machine](</docs/en/sandbox-environments>). To keep commands in the sandbox when code requests to run them unsandboxed, turn on [strict sandbox mode](</docs/en/sandboxing#turn-off-the-retry-with-strict-sandbox-mode>). In auto mode, the classifier reviews the code that makes the request, and the command has no separate review. + ### Long-running code While code runs a long build or test, Claude either waits for it or lets it continue in the background: - * **Waiting** : Claude answers after the code finishes, and the code stops after ten minutes, including time you spend at permission prompts + * **Waiting** : Claude answers after the code finishes, and the code stops after ten minutes. In Manual and `acceptEdits` [modes](</docs/en/permission-modes#available-modes>), time you spend at a tool’s permission prompt doesn’t count toward the ten minutes. Before v2.1.328, that time counted. * **Background** : you can keep talking to Claude, and the code can run for up to two hours For background code, start your session in auto or `bypassPermissions` mode. If Claude still waits, check your current mode and how you started the session: * **You switched to another mode** : press `Shift+Tab` until you’re back in the mode you started in - * **You started in another mode, or picked the session from the`claude --resume` list**: if [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to you, exit, then run `claude --continue --permission-mode auto` with Code Mode on + * **You started in another mode** : if [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to you, exit, then run `claude --continue --permission-mode auto` with Code Mode on + * **You’re on a version before v2.1.328 and picked the session from the`claude --resume` list**: exit, [update Claude Code](</docs/en/setup#update-claude-code>), then run the same `claude --resume` command with Code Mode on. To stay on your version, replace `--resume` with `--continue` * **You passed tool names to`--tools`**: start again in auto mode without that flag + +### Stop code in progress + +To stop code while Claude is responding or waiting for the code, press `Esc`. To stop background code after Claude finishes responding, run [`/tasks`](</docs/en/commands>) in the session, select the running task, and press `x`. After you stop the code, check `/tasks` for [subagents](</docs/en/sub-agents>), [shell commands](</docs/en/interactive-mode#background-bash-commands>), and [MCP calls](</docs/en/mcp#automatic-backgrounding-of-long-tool-calls>) that the code started and that are still running. To stop one, select it and press `x`. + +### Check code output with a hook + +To check or redact what the code returns before Claude reads it, write a [`PostToolUse` hook](</docs/en/hooks#posttooluse>) that matches `REPL`, the tool that runs the code. The same hook runs when background code finishes and when code throws an error. + +#### Read code output in the hook + +In your `PostToolUse` hook, read the output from `tool_response`, which has fields such as these: + + { + "code": "(await $`cat notes.txt`.text())", + "result": "deploy token: abc123", + "stdout": "", + "stderr": "", + "toolsUsed": ["Bash"] + } + +#### Redact code output + +To hide part of the output, return a changed copy of `tool_response` as [`updatedToolOutput`](</docs/en/hooks#posttooluse-decision-control>), and build the copy this way: + + * **Change the text** : redact `result`, `stdout`, `stderr`, and `error`. Handle a `result` that’s missing or `null`, and expect `error` only when the code failed or was stopped + * **Keep the shape** : return `code`, `stdout`, and `stderr` as strings, and return `error` as a string or leave it out. If you break this shape, Claude gets the original output + * **Remove images and PDFs** : if the copy has `images` or `documents` to hide, set that field to `[]` + +To hide the deploy token in the `notes.txt` result, print this JSON: + + { + "hookSpecificOutput": { + "hookEventName": "PostToolUse", + "updatedToolOutput": { + "code": "(await $`cat notes.txt`.text())", + "result": "deploy token: REDACTED", + "stdout": "", + "stderr": "", + "toolsUsed": ["Bash"] + } + } + } + +To test the hook, create a file that contains a value your hook redacts. Then start a Code Mode session, and ask Claude to read and quote the file. Type the path without `@`, and check that Claude’s reply shows your replacement text. + +Don’t rely on this hook to hide a value in a refused tool call’s input, such as a Bash command. The `refusedCalls` field can repeat that input, and Claude reads it unchanged. + +#### Redact when your hook blocks or hits an error + +Return a changed copy of `tool_response` as `updatedToolOutput` even when your hook blocks or hits an error: + + * **Your hook blocks** : print the redacted copy in the same JSON as [`"decision": "block"`](</docs/en/hooks#posttooluse-decision-control>). Without the copy, Claude still reads the original output + * **Your hook hits an error** : catch the error, and print a copy with placeholder text in the fields that you redact. If the hook crashes, times out, or prints invalid JSON, Claude gets the original output + +#### Move a check from a `UserPromptSubmit` hook + +If you check code output in a [`UserPromptSubmit` hook](</docs/en/hooks#userpromptsubmit>), move that check to your `PostToolUse` hook. On v2.1.328 or later, `UserPromptSubmit` hooks don’t receive code output, even when an administrator sets them in [managed settings](</docs/en/managed-settings>). ## Troubleshooting @@ -178,11 +272,11 @@ ### Permission prompt with a countdown -When Claude starts more code in auto mode while earlier code is still running, the earlier code loses its classifier review. Claude Code then asks you about the earlier code’s remaining calls that would need a review. With no IDE connected, the prompt shows a countdown: +In auto mode, if you approve code yourself after [repeated classifier blocks](</docs/en/permission-modes#when-auto-mode-falls-back>), you can be asked about tool calls in that code and in earlier code that’s still running. With no IDE connected, the prompt can show a countdown: Claude Code will automatically block this request in 1:59, to avoid holding up an unattended session -Answer before the countdown ends. Otherwise that call is refused, and later calls that would show a countdown are refused without a prompt. To see the prompts again, send Claude a message. +Answer before the countdown ends. Otherwise that call is refused, and later calls that would show a countdown are refused without a prompt. To see the prompts again, send Claude a message. Before v2.1.327, you could also be asked about the remaining calls in running code after Claude started new code, even if the classifier allowed the new code. To see fewer of these prompts, [update Claude Code](</docs/en/setup#update-claude-code>) to v2.1.327 or later. ### Tool call refused by a hook @@ -195,10 +289,13 @@ ### Code output withheld by a hook -If Claude reports a hook’s block reason where you expected output from code, check your [`UserPromptSubmit`](</docs/en/hooks#userpromptsubmit>) hooks. When code can run in the background, `command`, `http`, and `mcp_tool` hooks on that event also run on code output. To let the output through, change the hook so that it doesn’t block when `source` in its input is `poll_event`. +If you expected output from code and see `UserPromptSubmit operation blocked by hook` in Claude’s reply, your [`UserPromptSubmit`](</docs/en/hooks#userpromptsubmit>) hook received the output as a prompt and blocked it. If Claude reports only the hook’s reason, ask it to quote the message it received. On v2.1.328 or later, `UserPromptSubmit` hooks don’t receive code output. To let the output through on an earlier version, update Claude Code or change the hook: + + * **Update** : if you rely on the hook to check code output, first move the check to a `PostToolUse` hook. Then [update Claude Code](</docs/en/setup#update-claude-code>) to v2.1.328 or later + * **Stay on your version** : change the hook so that it doesn’t block when `source` in its input is `poll_event` ## Related resources * [Permission modes](</docs/en/permission-modes>): compare auto mode with the modes that prompt you - * [Hooks reference](</docs/en/hooks>): write `PreToolUse` and `UserPromptSubmit` hooks + * [Hooks reference](</docs/en/hooks>): write `PreToolUse` and `PostToolUse` hooks * [Managed settings](</docs/en/managed-settings>): apply one configuration across an organization
modified Set up Code Review View current →
--- a/code-review-setup.md +++ b/code-review-setup.md @@ -41,7 +41,7 @@ Choose repositories -Select the repositories you want reviewed, then click **Continue**. Adding a repository needs write access to it from the GitHub account you connected. You can add more repositories later. +Select the repositories you want reviewed, then click the button that adds them, which reads **Add 2 repositories** when you’ve selected two. Adding a repository needs write access to it from the GitHub account you connected. You can add more repositories later. 5 @@ -114,7 +114,7 @@ ### Add more repositories -To add repositories after setup, click **Add** above the **Repositories** table in the **Code review** section. The **Add a repository** dialog opens. Select repositories and click **Continue**. +To add repositories after setup, click **Add** above the **Repositories** table in the **Code review** section. The **Add a repository** dialog opens. Select repositories and click the button that adds them, which reads **Add 2 repositories** when you’ve selected two. * **A repository isn’t listed** : see [A repository isn’t listed in Add a repository](</docs/en/code-review-troubleshooting#a-repository-isn%E2%80%99t-listed-in-add-a-repository>). * **You want every repository in a GitHub organization** : cover the organization instead of selecting repositories one at a time
modified Commands View current →
--- a/commands.md +++ b/commands.md @@ -123,7 +123,7 @@ `/tasks`| View and manage background work in the current session, including subagents that have finished. Also available as `/bashes` `/team-onboarding`| Generate a team onboarding guide from your Claude Code usage history. Claude analyzes your sessions, commands, and MCP server usage from the past 30 days. It produces a markdown guide a teammate can paste as a first message to get set up quickly. For claude.ai subscribers on Team and Enterprise plans, also returns a share link teammates can open directly in Claude Code `/teleport`| Pull a [cloud session](</docs/en/claude-code-on-the-web#from-cloud-to-terminal>) into this terminal. Opens a picker, then fetches the branch and conversation. Also available as `/tp`. Requires a claude.ai subscription -`/terminal-setup`| [Install a Shift+Enter keybinding for newlines](</docs/en/terminal-config#enter-multiline-prompts>) in VS Code, Cursor, Devin Desktop, Alacritty, or Zed. In Apple Terminal, [enable Option+Enter for newlines and turn off the audible bell](</docs/en/terminal-config#enable-option-key-shortcuts-on-macos>) instead. In iTerm2, [turn on clipboard access so that `/copy` works](</docs/en/terminal-config#enable-option-key-shortcuts-on-macos>) +`/terminal-setup`| [Install a Shift+Enter keybinding for newlines](</docs/en/terminal-config#enter-multiline-prompts>) in VS Code, Cursor, Devin Desktop, Alacritty, or Zed. In Apple Terminal, [turn off the audible bell](</docs/en/terminal-config#enable-option-key-shortcuts-on-macos>) instead. In iTerm2, [turn on clipboard access so that `/copy` works](</docs/en/terminal-config#enable-option-key-shortcuts-on-macos>) `/theme`| Change the color theme. Includes an `auto` option that matches your terminal’s light or dark background, light and dark variants, colorblind-accessible (daltonized) themes, ANSI themes that use your terminal’s color palette, and any [custom themes](</docs/en/terminal-config#create-a-custom-theme>) from `~/.claude/themes/` or plugins. Select **New custom theme…** to create one `/tui [classic|fullscreen]`| Set the terminal UI renderer and relaunch into it. `fullscreen` enables the [flicker-free alt-screen renderer](</docs/en/fullscreen>). `default`, or `classic` on v2.1.327 or later, selects the classic renderer. With no argument, prints the active renderer `/ultraplan <prompt>`| Removed. Use [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) instead. Previously sent a planning task to a [cloud session](</docs/en/claude-code-on-the-web>) for review in your browser @@ -145,7 +145,7 @@ * **Highlighting** : Claude Code highlights the top suggestion only when the letters after the `/` match a command’s name or alias, from the start of the name or from a word within it, ignoring the `:`, `_`, and `-` separators. Typing `/adddir` highlights `/add-dir`, and typing `/new` highlights `/clear` through its alias. Press `Enter` to run the highlighted suggestion. These highlighting rules require Claude Code v2.1.236 or later. * **After a typo** : Claude Code highlights nothing. The close matches stay listed, and you can pick one with `Tab` or the arrow keys, but `Enter` submits your text as typed and reports [Unknown command](</docs/en/errors#unknown-command>). - * **Commands that aren’t available to you** : Claude Code leaves them out of the menu. When nothing matches, Claude Code shows `No commands match "/name"`. Most unavailable commands return [Unknown command](</docs/en/errors#unknown-command>) when you submit them; a few, such as [`/schedule` on a Console API key](</docs/en/routines#schedule-returns-unknown-command>), answer with their own availability message instead. Some commands also answer with a message of their own when your organization’s policy disables them. + * **Commands that aren’t available to you** : Claude Code leaves most of them out of the menu. When nothing matches, Claude Code shows `No commands match "/name"`. If you submit an unavailable command, you see [Unknown command](</docs/en/errors#unknown-command>) or a message that says why the command is unavailable. * **Hidden commands** : Claude Code keeps a few available commands, such as `/heapdump`, out of the menu by design. A partial name never brings a hidden command into the menu: if the partial matches nothing visible, Claude Code shows the same no-match message. Claude Code lists the command only once you’ve typed its full name, and submitting the full name runs it. ## MCP prompts
modified Common workflows View current →
--- a/common-workflows.md +++ b/common-workflows.md @@ -351,7 +351,7 @@ [Cloud scheduled tasks](</docs/en/routines>)| Cloud, Anthropic-managed by default| Tasks that should run even when your computer is off. Can also trigger on API calls or GitHub events in addition to a schedule. Configure at [claude.ai/code/routines](<https://claude.ai/code/routines>). [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>)| Your machine, via the desktop app| Tasks that need direct access to local files, tools, or uncommitted changes. [GitHub Actions](</docs/en/github-actions>)| Your CI pipeline| Tasks tied to repo events like opened PRs, or cron schedules that should live alongside your workflow config. -[`/loop`](</docs/en/scheduled-tasks>)| The current CLI session| Quick polling while a session is open. `--resume` and `--continue` restore unexpired fixed-interval loops. +[`/loop`](</docs/en/scheduled-tasks>)| The current CLI session| Quick polling while a session is open. When writing prompts for scheduled tasks, be explicit about what success looks like and what to do with results. The task runs autonomously, so it can’t ask clarifying questions. For example: “Review open PRs labeled `needs-review`, leave inline comments on any issues, and post a summary in the `#eng-reviews` Slack channel.”
modified Let Claude use your computer from the CLI View current →
--- a/computer-use.md +++ b/computer-use.md @@ -70,11 +70,11 @@ Warning| Applies to ---|--- -Equivalent to shell access| Terminal, iTerm, VS Code, Warp, and other terminals and IDEs -Can read or write any file| Finder +Can run commands on your computer| Terminal, iTerm, VS Code, Warp, and other terminals and IDEs +Can open, change, or delete any file, and run apps and scripts| Finder Can change system settings| System Settings -These apps aren’t blocked. The warning lets you decide whether the task warrants that level of access. Approve Finder to let Claude click the desktop, the Dock, or a Finder window. Claude’s level of control also varies by app category: browsers and trading platforms are view-only, terminals and IDEs are click-only, and everything else gets full control. See [app permissions in Desktop](</docs/en/desktop#app-permissions>) for the complete tier breakdown. +These apps aren’t blocked. The warning lets you decide whether the task warrants that level of access. Approve Finder to let Claude click the desktop, the Dock, or a Finder window. Claude’s level of control also varies by app category: view only for browsers and trading platforms, click only for terminals and IDEs, and full access for most other apps. See [app permissions in Desktop](</docs/en/desktop#app-permissions>) for what each level lets Claude do. ## How Claude works on your screen
modified Configure your agent View current →
--- a/configuration.md +++ b/configuration.md @@ -2,7 +2,7 @@ ## Pass options to a session -Every `query()` call accepts an options object: `Options` in TypeScript, `ClaudeAgentOptions` in Python. Each field is optional, and a session started with no options runs with the SDK’s defaults. The example below configures a read-only session that summarizes a project’s open TODOs. Pairs read as TypeScript / Python where the spellings differ: +Every `query()` call accepts an options object: `Options` in TypeScript, `ClaudeAgentOptions` in Python. Each field is optional, and a session started with no options runs with the SDK’s defaults. The example below configures a session that summarizes a project’s open TODOs. Pairs read as TypeScript / Python: * **`model`** : picks the model * **`allowedTools` / `allowed_tools`**: pre-approves a read-only tool list @@ -57,7 +57,7 @@ Settings files supply configuration beyond the options object. Two options control how they load: * **`settingSources` / `setting_sources`**: controls which filesystem sources load: user, project, and local. Settings files and CLAUDE.md files arrive through these sources. - * **`settings`** : loads a settings file path or an inline JSON string in either language, and TypeScript also accepts a settings object. Whichever form you pass overrides user, project, and local filesystem settings; only managed policy settings rank higher. The references document the full precedence order under [Settings precedence](</docs/en/agent-sdk/typescript#settings-precedence>) for TypeScript and [Settings precedence](</docs/en/agent-sdk/python#settings-precedence>) for Python. + * **`settings`** : loads a settings file path or an inline JSON string in either language, and TypeScript also accepts a settings object. Permission rules and most other lists you pass [add to](</docs/en/settings#lists-merge-instead-of-overriding>) those in user, project, and local settings files. For most single values, Claude Code takes yours over those files; only managed policy settings rank higher. See the full order for [TypeScript](</docs/en/agent-sdk/typescript#settings-precedence>) and [Python](</docs/en/agent-sdk/python#settings-precedence>). Pass `[]` to disable user, project, and local settings. For more information, see [Use Claude Code features in the SDK](</docs/en/agent-sdk/claude-code-features>).
modified Manage costs effectively View current →
--- a/costs.md +++ b/costs.md @@ -151,9 +151,9 @@ ### Claude Console -API organizations manage Claude Code spend through [workspaces](<https://platform.claude.com/docs/en/build-with-claude/workspaces>). You can [set workspace spend limits](<https://platform.claude.com/docs/en/build-with-claude/workspaces#workspace-limits>) on total Claude Code spend and [view cost and usage reporting](<https://platform.claude.com/docs/en/build-with-claude/workspaces#usage-and-cost-tracking>) in the Console. - -When you first authenticate Claude Code with your Claude Console account, a workspace called “Claude Code” is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace; it is exclusively for Claude Code authentication and usage.For organizations with custom rate limits, Claude Code traffic in this workspace counts toward your organization’s overall API rate limits. You can set a [workspace rate limit](<https://platform.claude.com/docs/en/api/rate-limits#setting-lower-limits-for-workspaces>) on this workspace’s Limits page in the Claude Console to cap Claude Code’s share and protect other production workloads. +API organizations manage Claude Code spend through [workspaces](<https://platform.claude.com/docs/en/build-with-claude/workspaces>). You can [set workspace spend limits](<https://platform.claude.com/docs/en/build-with-claude/workspaces#workspace-limits>) and [view cost and usage reporting](<https://platform.claude.com/docs/en/build-with-claude/workspaces#usage-and-cost-tracking>) in the Console. + +The first time a member signs in and Claude Code [creates an API key](</docs/en/authentication#sign-in-without-an-api-key>) for them, a workspace called “Claude Code” is automatically created in your Console organization. You can’t create API keys for this workspace yourself; it is exclusively for Claude Code authentication and usage.For organizations with custom rate limits, Claude Code traffic in this workspace counts toward your organization’s overall API rate limits. You can set a [rate limit for this workspace](<https://platform.claude.com/docs/en/api/rate-limits#setting-lower-limits-for-workspaces>) on the [Rate limits page](<https://platform.claude.com/usage/limits>) in the Claude Console to cap the workspace’s share and protect other production workloads. For per-user reporting, the [Console dashboard](<https://platform.claude.com/claude-code>) shows spend and lines accepted per member, and the [Claude Code Analytics API](<https://platform.claude.com/docs/en/build-with-claude/claude-code-analytics-api>) returns daily per-user metrics programmatically with an [Admin API key](<https://platform.claude.com/settings/admin-keys>). See [analytics for API customers](</docs/en/analytics#access-analytics-for-api-customers>).
modified Create a marketplace View current →
--- a/create-marketplace.md +++ b/create-marketplace.md @@ -68,11 +68,11 @@ claude plugin marketplace add ./my-marketplace -The command prints `✔ Successfully added marketplace: my-marketplace (declared in user settings)`, which means the marketplace is recorded in your user settings file.Install the plugin. The install id is the entry’s `name`, an `@`, and the marketplace `name`. +In a terminal, the command prints `✔ Added marketplace: my-marketplace (declared in user settings)`, which means the marketplace is recorded in your user settings file.Install the plugin. The install id is the entry’s `name`, an `@`, and the marketplace `name`. claude plugin install my-first-plugin@my-marketplace -The command prints `✔ Successfully installed plugin: my-first-plugin@my-marketplace (scope: user)`.Inside a session, `/plugin marketplace add ./my-marketplace` registers the marketplace the same way. `/plugin install my-first-plugin@my-marketplace` opens the plugin’s details in the `/plugin` panel, where you install it. For that flow, see [Install and manage plugins](</docs/en/plugins/install>). +In a terminal, the command prints `✔ Installed plugin: my-first-plugin@my-marketplace (scope: user)`.Inside a session, `/plugin marketplace add ./my-marketplace` registers the marketplace the same way. `/plugin install my-first-plugin@my-marketplace` opens the plugin’s details in the `/plugin` panel, where you install it. For that flow, see [Install and manage plugins](</docs/en/plugins/install>). 5
modified Message your other Claude Code sessions View current →
--- a/cross-session-messaging.md +++ b/cross-session-messaging.md @@ -105,7 +105,7 @@ On another of your machines| Through Anthropic servers, arriving over that machine’s [Remote Control](</docs/en/remote-control>) connection In the [cloud](</docs/en/claude-code-on-the-web>)| Through Anthropic servers, straight to the cloud session -Starting a conversation with a session on another of your machines requires Claude Code v2.1.225 or later and a target that appears in the listing. A session’s row in the listing can show a condition that changes what happens when Claude messages that session: +Starting a conversation with a session on another of your machines requires Claude Code v2.1.225 or later. A session’s row in the listing can show a condition that changes what happens when Claude messages that session: * **`offline`** : that session’s Remote Control connection has dropped. The message goes through, but arrives only after that session’s machine reconnects. * **`can't receive cross-session messages (off in that session)`** : messaging isn’t available in that session, or its [`crossSessionInbound`](</docs/en/settings-reference#crosssessioninbound>) value is `refuse`. Claude Code refuses a message to that session before the message leaves this machine. The result under Claude’s `SendMessage` call begins `Not sent` and names the reason. Once the cause is fixed in that session, a later listing no longer shows this condition, and Claude can message that session.
modified Give Claude custom tools View current →
--- a/custom-tools.md +++ b/custom-tools.md @@ -381,7 +381,7 @@ } } -To try the policy, replace the `options` in the Call a custom tool script with this example’s `options`, then run that script from your terminal. The script prints `Approval requested for mcp__weather__get_temperature`, followed by Claude’s answer about the temperature. For a complete script, see the [TypeScript reference](</docs/en/agent-sdk/typescript#mcpsdkserverconfigwithinstance>). If you use `auto` or `plan` [permission mode](</docs/en/agent-sdk/permissions#permission-modes>), set `destructiveHint: true` in the tool’s annotations so calls to the tool still reach your callback. Otherwise the [auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) can approve some `always_ask` calls, under [conditions listed in the TypeScript reference](</docs/en/agent-sdk/typescript#permission-modes-that-can-approve-an-always_ask-call>), and a call it approves doesn’t reach your callback. Set the hint explicitly, because an unset `destructiveHint` counts as `false` for `always_ask` calls rather than defaulting to `true`. +To try the policy, replace the `options` in the Call a custom tool script with this example’s `options`, then run that script from your terminal. The script prints `Approval requested for mcp__weather__get_temperature`, followed by Claude’s answer about the temperature. For a complete script, see the [TypeScript reference](</docs/en/agent-sdk/typescript#mcpsdkserverconfigwithinstance>). If you use `auto` or `plan` [permission mode](</docs/en/agent-sdk/permissions#permission-modes>), set `destructiveHint: true` in the tool’s annotations to keep the [auto mode classifier](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) from approving calls in place of your callback. Otherwise the classifier can approve some `always_ask` calls, under [conditions listed in the TypeScript reference](</docs/en/agent-sdk/typescript#permission-modes-that-can-approve-an-always_ask-call>). Set the hint explicitly, because an unset `destructiveHint` counts as `false` for `always_ask` calls rather than defaulting to `true`. ## Handle errors
modified Plugin dependencies View current →
--- a/dependencies.md +++ b/dependencies.md @@ -39,7 +39,7 @@ ### Bundle plugins for a team -To let engineers install a curated set of plugins with one command, publish a plugin whose manifest contains a `name` and a `dependencies` array. A plugin manifest needs only `name`, so this is a valid plugin, and installing it installs every dependency. For example, a platform team can publish role-specific bundles in an internal marketplace so engineers run one `claude plugin install` instead of installing each plugin separately: +To let users install a curated set of plugins with one command, publish a plugin whose manifest contains a `name` and a `dependencies` array. A plugin manifest needs only `name`, so this is a valid plugin. For example, a platform team can publish role-specific bundles in an internal marketplace so users run one `claude plugin install` instead of installing each plugin separately: .claude-plugin/plugin.json @@ -55,12 +55,12 @@ ] } -To add a plugin to the standard set later, publish a new `backend-standard` version with the extra dependency. When the marketplace doesn’t [auto-update by default](</docs/en/plugins/loading#which-marketplaces-and-plugins-auto-update>), engineers either turn on auto-update for the marketplace or update manually: +To add a plugin to the standard set later, publish a new `backend-standard` version with the extra dependency. When the marketplace doesn’t [auto-update by default](</docs/en/plugins/loading#which-marketplaces-and-plugins-auto-update>), users either turn on auto-update for the marketplace or update manually: - * **Turn on auto-update for the marketplace** : the next auto-update moves the bundle to the new version and installs any dependencies it adds. + * **Turn on auto-update for the marketplace** : the next auto-update moves the bundle to the new version and installs the added dependency. That install requires Claude Code v2.1.319 or later. * **Update manually** : run `claude plugin update backend-standard` in a shell, then `/reload-plugins` in an open session to install the newly added dependencies. -For the engineer-side steps, see [Keep plugins updated](</docs/en/plugins/install#keep-plugins-updated>). To deploy a bundle to everyone in an organization, an administrator adds it to `enabledPlugins` in managed settings. See [Pre-install and require plugins](</docs/en/plugins/org#pre-install-and-require-plugins>). +Your users follow the steps in [Keep plugins updated](</docs/en/plugins/install#keep-plugins-updated>). To deploy a bundle to everyone in an organization, an administrator adds it to `enabledPlugins` in managed settings. See [Pre-install and require plugins](</docs/en/plugins/org#pre-install-and-require-plugins>). ### Depend on a plugin from another marketplace @@ -101,7 +101,7 @@ * **You disabled the local copy** : your plugin is disabled at the next plugin load, with an error that ends `is disabled — enable it or remove the dependency`. When the error names the dependency as `<name>@inline`, that identifier refers to the `--plugin-dir` copy. * **You started a session without the dependency’s`--plugin-dir` flag**: the error reports the dependency as not installed. Pass the flag again, or install the dependency from its marketplace. -When both plugins are in one parent folder, you can pass that folder to `--plugin-dir` once. If the folder isn’t itself a plugin, Claude Code loads each child folder that has a `.claude-plugin/plugin.json`. Requires Claude Code v2.1.265 or later. +When both plugins are in one parent folder, you can pass that folder to `--plugin-dir` once. If the folder isn’t itself a plugin, Claude Code loads it as a [folder of plugins](</docs/en/plugins/create#load-a-folder-of-plugins>). Requires Claude Code v2.1.265 or later. ## Release a plugin that others depend on @@ -127,11 +127,16 @@ ### Constrain a dependency that has a non-git source -Tag-based resolution applies only to git-backed sources. For a dependency with an `npm`, `archive`, or `command` [plugin source](</docs/en/plugins/marketplace-reference#plugin-sources>), the constraint doesn’t control which version is fetched. It’s still checked when the plugin loads, and the dependent plugin is disabled if the installed version doesn’t satisfy it. For `npm`, `archive`, and `command` sources, the version checked is the `version` in the dependency’s `plugin.json`. Set one there before you constrain that dependency, because a `plugin.json` that sets no version satisfies no constraint. Claude Code never installs a dependency with a `command` source itself, so users [install it first](</docs/en/plugins/marketplace-reference#command-plugin-source>). It also never runs a dependency’s [`headersHelper`](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>), so users also install a dependency whose marketplace entry sets one before they install your plugin. Besides `claude plugin install`, these operations also install any missing declared dependency, and the `command` and `headersHelper` limits apply to them too: +Tag-based resolution applies only to git-backed sources. For a dependency with an `npm`, `archive`, or `command` [plugin source](</docs/en/plugins/marketplace-reference#plugin-sources>), the constraint doesn’t control which version is fetched. It’s still checked when the plugin loads, and the dependent plugin is disabled if the installed version doesn’t satisfy it. For `npm`, `archive`, and `command` sources, the version checked is the `version` in the dependency’s `plugin.json`. Set one there before you constrain that dependency, because a `plugin.json` that sets no version satisfies no constraint. Claude Code never installs a dependency with a `command` source itself, so users [install it first](</docs/en/plugins/marketplace-reference#command-plugin-source>). It also never runs a dependency’s [`headersHelper`](</docs/en/plugins/host-marketplace#authenticate-archive-downloads>), so users also install a dependency whose marketplace entry sets one before they install your plugin. + +### When a dependency installs automatically + +Besides `claude plugin install`, these operations also install a missing declared dependency, and the `command` and `headersHelper` limits apply to them too: * `/reload-plugins` * Auto-update of the dependent plugin’s marketplace * Re-running `claude plugin install` on the dependent plugin + * Updating the dependent plugin with `claude plugin update` or **Update now** in `/plugin`, unless [non-essential traffic is turned off](</docs/en/plugins/troubleshooting#dependency-errors>). Requires Claude Code v2.1.319 or later * `claude plugin marketplace add` ## How dependencies behave for your users
modified Desktop application View current →
Show diff (159 lines)
--- a/desktop.md +++ b/desktop.md @@ -114,7 +114,7 @@ #### Turn off scripts in SSH and WSL previews for your organization -To keep HTML previews in SSH and WSL sessions from running scripts, set the `disableRemotePreviewScripts` managed setting to `true`. Users can still browse external sites. Requires Claude Desktop v5.1231.0 or later. +To keep the Browser pane’s HTML previews in SSH and WSL sessions from running scripts, set the `disableRemotePreviewScripts` managed setting to `true`. Users can still browse external sites. Requires Claude Desktop v5.1231.0 or later. Earlier versions ignore `disableRemotePreviewScripts`. To stop the scripts there, update Desktop, or also set `disableBrowserExternalNavigation` to `true`. Users then can’t browse external sites on any computer that receives `disableBrowserExternalNavigation`. @@ -124,7 +124,7 @@ Then have users restart Desktop to make sure that the setting applies, and tell them what to expect: - * **Files they open** : the preview doesn’t run scripts, so charts and tables that scripts draw stay empty. Its notice starts with `This preview doesn't run scripts`. + * **SSH and WSL files they open in the Browser pane** : the preview doesn’t run scripts, so charts and tables that scripts draw stay empty * **Previews that are running scripts** : if Desktop picks up the setting before the restart, they close. Users see `This preview closed because scripts are turned off for previews. Open the file again to view it without scripts.` * **Files they export** : if a user exports a file and opens it in a browser, its scripts run there, with or without this setting @@ -134,14 +134,14 @@ ### Browse external sites -The Browser pane is a tabbed browser, so you can open documentation, issue trackers, or any other site next to your running app. To open the Browser, press **Cmd+Shift+B** on macOS or **Ctrl+Shift+B** on Windows, or click **Browser** in the session’s title bar. You can sign in to sites in the pane, including popup sign-in flows such as Google OAuth. The first time you click an external link in the chat, a dialog asks whether links open in the Browser pane or in your default browser. To change your choice later, use **Open links in built-in browser** in the Browser pane’s **⋮** menu. **Cmd** -click on macOS or **Ctrl** -click on Windows opens a link in your default browser directly. Claude can read and interact with external pages using the same tools it uses to verify your app, with two additional safety checks: - - * Safety classifiers review Claude’s write actions on external pages, such as clicking and typing, in every permission mode. These are the same classifiers auto mode uses, and when they flag an action, you get a permission prompt regardless of mode. +The Browser pane is a tabbed browser, so you can open documentation, issue trackers, or any other site next to your running app. To open the Browser, press **Cmd+Shift+B** on macOS or **Ctrl+Shift+B** on Windows, or select **Browser**. You can sign in to sites in the pane, including popup sign-in flows such as Google OAuth. The first time you click an external link in the chat, a dialog asks whether links open in the Browser pane or in your default browser. To change your choice later, use **Open links in built-in browser** in the Browser pane’s **⋮** menu. **Cmd** -click on macOS or **Ctrl** -click on Windows opens a link in your default browser directly. Claude can read and interact with external pages using the same tools it uses to verify your app, with two additional safety checks: + + * When auto mode is available for the session, its safety classifiers review Claude’s write actions on external pages, such as typing, in every permission mode. A flagged action is blocked, or prompts you after [repeated blocks](</docs/en/permission-modes#when-auto-mode-falls-back>). * In permission modes other than Auto and Bypass permissions, a domain allowlist check also applies before Claude navigates to a new site. #### Approve Claude’s actions on a site -The first time Claude acts on an external site, a permission card appears and Claude waits for your choice: **Allow once** , **Always allow** , or **Deny**. **Allow once** approves the action without saving anything. **Always allow** saves the approval for that site on your device, and you can revoke it in Settings. Each site needs its own approval, including subdomains. Your local dev servers and project files don’t need approval, so auto-verify keeps working without prompts. Even on an approved site, Claude won’t purchase items, create accounts, or bypass CAPTCHAs without your input. Browsing in the Browser pane uses the same safety model as the [Claude in Chrome extension](</docs/en/chrome>). See [Using Claude in Chrome safely](<https://support.claude.com/en/articles/12902428-using-claude-in-chrome-safely>) for how Claude handles sensitive sites and risky actions. +Outside Auto and Bypass permissions modes, a permission card appears before Claude uses an external site you haven’t approved. Choose **Allow once** , **Always allow** , or **Deny**. **Allow once** approves the action without saving anything. **Always allow** saves the approval for that site on your device, and you can revoke it in Settings. Each site needs its own approval. Your local dev servers and project files don’t need approval. Even on an approved site, Claude won’t purchase items, create accounts, or bypass CAPTCHAs without your input. Browsing in the Browser pane uses the same safety model as the [Claude in Chrome extension](</docs/en/chrome>). See [Using Claude in Chrome safely](<https://support.claude.com/en/articles/12902428-using-claude-in-chrome-safely>) for how Claude handles sensitive sites and risky actions. #### Choose between the Browser and the Chrome extension @@ -153,7 +153,7 @@ ### Review changes with diff view -After Claude makes changes to your code, the diff view lets you review modifications file by file before creating a pull request. To open the diff view, click the line counts, such as `+12 -1`, in the **Changes** card of the session details panel. You can also click **Changes** in the session’s title bar. A cloud session’s diff against the base branch can [leave out changes that aren’t pushed yet](</docs/en/claude-code-on-the-web#troubleshoot-a-missing-file-in-the-diff-view>). To comment on specific lines, hover over a line and click the **+** that appears beside its line number to open a comment box. Type your feedback and press **Enter** to add the comment. After adding comments to multiple lines, submit all comments at once: +After Claude makes changes to your code, the diff view lets you review modifications file by file before creating a pull request. To open the diff view, click the line counts, such as `+12 -1`, in the **Changes** card of the session details panel, or select **Changes**. A cloud session’s diff against the base branch can [leave out changes that aren’t pushed yet](</docs/en/claude-code-on-the-web#troubleshoot-a-missing-file-in-the-diff-view>). To comment on specific lines, hover over a line and click the **+** that appears beside its line number to open a comment box. Type your feedback and press **Enter** to add the comment. After adding comments to multiple lines, submit all comments at once: * **macOS** : press **Cmd+Enter** * **Windows** : press **Ctrl+Enter** @@ -185,12 +185,12 @@ ## Arrange your workspace -The Code tab is built around panes you can arrange in any layout: chat, diff, browser, terminal, file, plan, tasks, and subagent, along with the [iOS Simulator](</docs/en/desktop-ios-simulator>) on macOS. Drag a pane by its header to reposition it, or drag a pane edge to resize it. Press **Cmd+\** on macOS or **Ctrl+\** on Windows to close the focused pane. To open another pane, click its icon button in the session’s title bar. Hover to see each button’s name, such as **Terminal** , **Changes** for the diff view, **Browser** , and **Files**. If the pane you want has no button in the title bar, select it from the **⋮** menu beside the buttons: - - * **When the window is narrow** : buttons that don’t fit move into the menu - * **For panes with no button** : panes such as **Background tasks** and **Plan** are listed once the session has something to show in those panes - -To work across screens, pop a pane such as the diff or terminal out into its own window, and dock it back when you’re done. Claude keeps working in the main window. +The Code tab is built around panes you can arrange in any layout: chat, diff, browser, terminal, file, plan, tasks, and subagent, along with the [iOS Simulator](</docs/en/desktop-ios-simulator>) on macOS. Drag a pane by its tab or the handle at its top to reposition it, or drag a pane edge to resize it. Press **Cmd+\** on macOS or **Ctrl+\** on Windows to close the focused pane. To open another pane, hover over the icons at the top of the session to see each button’s name, such as **Terminal** or **Show side panel**. Then follow the steps for the buttons you have: + + * **Show side panel** or **Hide side panel** : show the panel if it’s hidden, then pick a pane from the panel’s list or **+** menu. + * **Terminal** , **Changes** for the diff view, **Browser** , and **Files** : click the pane’s button. If the pane has no button, select it from the **⋮** menu beside the buttons. + +To open **Background tasks** or **Plan** , select it from the side panel or the **⋮** menu once the session has something to show in it. To work across screens, pop a pane such as the diff or terminal out into its own window, and dock it back when you’re done. Claude keeps working in the main window. The pane layout, terminal, file editor, and view modes in this section require Claude Desktop v1.2581.0 or later. Open **Claude > Check for Updates…** on macOS or **Help > Check for Updates…** on Windows to update. @@ -200,7 +200,7 @@ #### Hide or show the session details panel -To hide or show the panel, click **Hide session rail** or **Show session rail** in the session’s title bar, or in the bar’s **⋮** menu. If you still don’t see the panel, check which Code tab layout you have. +To hide or show the panel, click **Hide session rail** or **Show session rail** in the session’s title bar, or in the bar’s **⋮** menu. If you see neither name, click **Activity panel** in the title bar. If you still don’t see the panel, check which Code tab layout you have. ### Minimize a pane @@ -213,7 +213,7 @@ ### Run commands in the terminal -The integrated terminal lets you run commands alongside your session without switching to another app. Click **Terminal** in the session’s title bar or press **Ctrl+`** on macOS or Windows. The terminal opens in your session’s working directory and shares the same environment as Claude, so commands like `npm test` or `git status` see the same files Claude is editing. To open a second terminal tab, click **+** in the terminal pane header or right-click a folder in the chat to choose **Open in terminal**. If a WSL session has no terminal, see [If the terminal or connectors are unavailable](</docs/en/desktop-wsl#check-for-the-terminal-and-connectors>). The terminal is available in local and SSH sessions, with a limit on Windows remote machines. +The integrated terminal lets you run commands alongside your session without switching to another app. To open it, select **Terminal** or press **Ctrl+`** on macOS or Windows. The terminal opens in your session’s working directory and shares the same environment as Claude, so commands like `npm test` or `git status` see the same files Claude is editing. To open a second terminal tab, click **+** above the terminal, then select **Terminal** if a menu opens. If a WSL session has no terminal, see [If the terminal or connectors are unavailable](</docs/en/desktop-wsl#check-for-the-terminal-and-connectors>). The terminal is available in local and SSH sessions, with a limit on Windows remote machines. ### Open and edit files @@ -316,7 +316,7 @@ ### Enable computer use -Computer use is off by default. If you ask Claude to do something that needs it while it’s off, Claude tells you it could do the task if you enable computer use in Settings. +Computer use is off by default. 1 @@ -349,7 +349,7 @@ * **Accessibility** : lets Claude click, type, and scroll * **Screen Recording** : lets Claude see what’s on your screen -The Settings page shows the current status of each permission. If either is denied, click the badge to open the relevant System Settings pane. +The Settings page shows the current status of each permission. If either is denied, click **Open System Settings** next to it. ### App permissions @@ -359,7 +359,7 @@ ---|---|--- View only| See the app in screenshots| Browsers, trading platforms Click only| Click and scroll, but not type or use keyboard shortcuts| Terminals, IDEs -Full control| Click, type, drag, and use keyboard shortcuts| Everything else +Full access| Click, type, drag, and use keyboard shortcuts| Most other apps Apps with broad reach, like terminals, Finder or File Explorer, and System Settings or Settings, show an extra warning in the prompt so you know what approving them grants. In Settings, the **Computer use** section where you turned computer use on includes these options: @@ -438,7 +438,7 @@ ### Watch background tasks -The tasks pane shows the background work running inside the current session: subagents, background shell commands, and [dynamic workflows](</docs/en/workflows>). Once the session has background work, open the pane with **Background tasks** in the title bar’s **⋮** menu. Click any entry to see its output in the subagent pane or stop it. To see what other sessions are doing, use the sidebar, or ask Claude to check on them for you. +The tasks pane shows the background work running inside the current session: subagents, background shell commands, and [dynamic workflows](</docs/en/workflows>). Once the session has background work, open the **Background tasks** pane. Click any entry to see its output in the subagent pane or stop it. To see what other sessions are doing, use the sidebar, or ask Claude to check on them for you. ### Work across sessions @@ -619,7 +619,7 @@ ] } -Localhost addresses open directly, exactly like the default port address. This includes `localhost`, any `*.localhost` subdomain, `127.0.0.1`, and `::1`. For security, a localhost `url` must be your server’s origin alone, with no path or query. Its port must match the entry’s port. To show a specific page, ask Claude to navigate there after the preview opens. A localhost `url` with a path, query, or mismatched port is reported as a configuration error that names the url and shows the fix. For any other address, Desktop asks for your permission the first time the preview opens it, the same as when you browse to a new site in the preview. External addresses may include paths. Choose **Always allow** to skip the prompt for that site in the future. Organization policies that restrict external sites in the preview still apply. To preview a server you already run yourself, set `url` without a command. Claude attaches the preview to your running server instead of starting one: +Localhost addresses open directly, exactly like the default port address. This includes `localhost`, any `*.localhost` subdomain, `127.0.0.1`, and `::1`. For security, a localhost `url` must be your server’s origin alone, with no path or query. Its port must match the entry’s port. To show a specific page, ask Claude to navigate there after the preview opens. A localhost `url` with a path, query, or mismatched port is reported as a configuration error that names the url and shows the fix. Any other address goes through the same site approval as a new site Claude opens in the preview. External addresses may include paths. Choose **Always allow** to skip the prompt for that site in the future. Organization policies that restrict external sites in the preview still apply. To preview a server you already run yourself, set `url` without a command. Claude attaches the preview to your running server instead of starting one: { "version": "0.0.1", @@ -890,9 +890,14 @@ Add the connection -On the **SSH** tab of the **New environment** dialog, open the **Host** list, select **Add SSH connection…** , and fill in the connection details: - - * **Name** : a friendly label for this connection. +In the **New environment** dialog, select the **SSH** tab, then open the form for a new connection from **Host** : + + * **Host shows a button** : select **Add SSH connection…** + * **Host shows a list** : open the list and select **Add SSH connection…** at the bottom + +Fill in the connection details: + + * **Name (optional)** : a friendly label for this connection. Leave empty to use the **SSH host** value as the name. * **SSH host** : `user@hostname` or a host defined in `~/.ssh/config`. * **SSH port** : defaults to 22 if left empty, or uses the port from your SSH config. * **SSH key (optional)** : path to your private key, such as `~/.ssh/id_ed25519`. Leave empty to use your SSH config or SSH agent. @@ -1813,8 +1818,8 @@ `autoMode`| customize what the auto mode classifier trusts and blocks across your organization. See [Configure auto mode](</docs/en/auto-mode-config>). `browserExternalPageTools`| set to `"disabled"` to prevent Claude from using tools to read or act on external pages in the Browser pane. Users can still navigate to external sites themselves, and local dev server previews are unaffected. `disableMobileSimulatorTools`| set to `true` to block Claude’s tools for controlling and capturing devices in the [iOS Simulator pane](</docs/en/desktop-ios-simulator#turn-off-simulator-access>). The pane stays usable for the user’s own taps; only Claude’s access is removed. The value must be the JSON boolean `true`; the string `"true"` is ignored. -`disableBrowserExternalNavigation`| set to `true` to turn off external browsing in the Browser pane entirely. Neither users nor Claude can navigate to external sites, and localhost dev server previews are unaffected. HTML previews in SSH and WSL sessions don’t run scripts. The value must be the JSON boolean `true`; the string `"true"` is ignored. -`disableRemotePreviewScripts`| set to `true` to turn off only the scripts in HTML previews in SSH and WSL sessions. Desktop doesn’t read it from the remote machine or the WSL distribution. The value must be the JSON boolean `true`; the string `"true"` is ignored. Requires Claude Desktop v5.1231.0 or later. +`disableBrowserExternalNavigation`| set to `true` to turn off external browsing in the Browser pane entirely. Neither users nor Claude can go to external sites, and localhost dev server previews are unaffected. The Browser pane’s HTML previews in SSH and WSL sessions don’t run scripts. The value must be the JSON boolean `true`; the string `"true"` is ignored. +`disableRemotePreviewScripts`| set to `true` to turn off scripts in the Browser pane’s HTML previews in SSH and WSL sessions, without turning off external browsing. Desktop doesn’t read it from the remote machine or the WSL distribution. The value must be the JSON boolean `true`; the string `"true"` is ignored. Requires Claude Desktop v5.1231.0 or later. `sshConfigs`| pre-configure SSH connections that appear in the environment selector. Users can’t delete managed connections or edit anything but their own **Worktree folder**. `sshHostCommands`| give users SSH connections whose host comes from a command, alongside their own. Desktop reads it from the managed settings file or MDM policy on the computer, and ignores it in [server-managed settings](</docs/en/server-managed-settings>). Requires Claude Desktop v3.6556.0 or later on macOS or Linux, or v4.16336.0 or later on Windows, signed in with a Claude account. On Windows, Desktop also has to connect through the OpenSSH client. `sshHostAllowlist`| restrict SSH sessions to hosts whose resolved hostname matches one of these patterns. Read from managed settings only.
modified Test iOS apps in the simulator View current →
--- a/desktop-ios-simulator.md +++ b/desktop-ios-simulator.md @@ -48,7 +48,11 @@ When the app launches in a simulator, the iOS Simulator pane opens next to the conversation. The first time Claude uses a device, the desktop app asks you to allow it; see Grant Claude access to a device. Claude installs the app, taps through it, and reads the screen to verify its own changes while you watch. -When your request is about seeing the app, for example “does the new screen look right?”, Claude starts a simulator before it begins the work. After Claude fixes a bug or changes a screen, ask it to verify the change. The simulator pane shows whichever device the app actually launched in. To test on a specific device, name it in your request, for example “run it on the iPhone SE simulator”, and Claude targets that device when it builds and launches. A device Claude boots also appears in Apple’s Simulator app, or in Device Hub on Xcode 27. Claude can install the app on a device you already have booted. You can also open the simulator pane yourself. Once the session has a simulator attached or Claude Code detects iOS app work, an **iOS Simulator** button appears in the session’s title bar. If the pane isn’t showing a device yet, click **Attach simulator** , or pick a specific device from the device menu next to it; picking a shut-down device boots it. If Xcode or its simulators are missing, the pane shows the setup steps instead and checks them off as you complete them. +When your request is about seeing the app, for example “does the new screen look right?”, Claude starts a simulator before it begins the work. After Claude fixes a bug or changes a screen, ask it to verify the change. The simulator pane shows whichever device the app actually launched in. To test on a specific device, name it in your request, for example “run it on the iPhone SE simulator”, and Claude targets that device when it builds and launches. A device Claude boots also appears in Apple’s Simulator app, or in Device Hub on Xcode 27. Claude can install the app on a device you already have booted. + +### Open the simulator pane yourself + +Once the session has a simulator attached or Claude Code detects iOS app work, select **iOS Simulator** in the session’s title bar or [side panel](</docs/en/desktop#arrange-your-workspace>). If the pane isn’t showing a device yet, click **Attach simulator** , or pick a specific device from the device menu next to it; picking a shut-down device boots it. If Xcode or its simulators are missing, the pane shows the setup steps instead and checks them off as you complete them. ## Control the simulator yourself @@ -68,7 +72,7 @@ You can minimize or close the simulator pane, and Claude can still use the device either way. * If you minimize the pane, the device stays in view at a small size. To minimize the pane or expand it again, see [Minimize a pane](</docs/en/desktop#minimize-a-pane>). - * If you close the full-size or minimized pane, the device stays attached and running. To show the device again, click **iOS Simulator** in the session’s title bar. + * If you close the full-size or minimized pane, the device stays attached and running. To show the device again, reopen the pane. ## How sessions manage devices
modified Development containers View current →
--- a/devcontainer.md +++ b/devcontainer.md @@ -71,7 +71,7 @@ ## Enforce organization policy -A dev container is a convenient place to apply organization policy, because the same image and configuration run on every engineer’s machine. Claude Code reads `/etc/claude-code/managed-settings.json` on Linux and applies it at the highest precedence in the [settings hierarchy](</docs/en/settings#settings-precedence>), so values there override anything an engineer sets in `~/.claude` or the project’s `.claude/` directory. Copy the file into place from your Dockerfile: +A dev container is a convenient place to apply organization policy, because the same image and configuration run on every engineer’s machine. Claude Code reads `/etc/claude-code/managed-settings.json` on Linux and applies it at the highest precedence in the [settings hierarchy](</docs/en/settings#settings-precedence>). Copy the file into place from your Dockerfile: Dockerfile
modified Environment variables View current →
--- a/env-vars.md +++ b/env-vars.md @@ -206,12 +206,13 @@ `CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD`| Set to `1` to skip the check that an [Amazon Bedrock](</docs/en/amazon-bedrock>) streaming response carries the `application/vnd.amazon.eventstream` content-type. Without this variable, when a response carries a different content-type, Claude Code fails the request with an error naming that type, which means a [gateway or proxy is transforming the response](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>). Configure the gateway to forward the `Content-Type` header and body unmodified rather than setting this variable. Requires Claude Code v2.1.208 or later `CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF`| Set to `1` to stop a [background session’s](</docs/en/agent-view>) in-flight work when the [supervisor](</docs/en/agent-view#the-supervisor-process>) stops, restarts, or updates that session’s process, instead of handing it to the session’s next process. That work is the session’s running background shell commands, plus background subagents as of v2.1.198. Affects only that handoff: backgrounding a session with `←` or [`/background`](</docs/en/agent-view#from-inside-a-session>) still carries in-flight background work over. Requires Claude Code v2.1.196 or later `CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP`| Set to `1` to stop Claude Code from terminating [background shell commands](</docs/en/interactive-mode#background-bash-commands>) under memory pressure. By default, on macOS and Linux, Claude Code terminates background shells when the operating system reports critical memory pressure and the session has been idle for 30 minutes with no turn or subagent running. Windows has no memory-pressure signal, so this variable has no effect there. Requires Claude Code v2.1.193 or later -`CLAUDE_CODE_DISABLE_BG_STABLE_PATH`| On macOS with the native installer, set to `1` to run each [background session’s](</docs/en/agent-view>) host process from the installed binary, not `~/.local/share/claude/ClaudeCode.app`. macOS may then ask again for permissions such as [folder access](</docs/en/agent-view#background-sessions-can%E2%80%99t-read-desktop-documents-or-downloads-on-macos>), including after each update. Set it in the `env` block of user settings, a managed settings file, or an MDM policy, not your shell. To remove `ClaudeCode.app`, delete it yourself. Requires Claude Code v2.1.295 or later +`CLAUDE_CODE_DISABLE_BG_STABLE_PATH`| On macOS with the native installer, set to `1` to run each [background session’s](</docs/en/agent-view>) host process from the installed binary, not `~/.local/share/claude/ClaudeCode.app`. macOS may then ask again for permissions such as [folder access](</docs/en/agent-view#background-sessions-can%E2%80%99t-read-desktop-documents-or-downloads-on-macos>), including after each update. Set it in the `env` block of user settings, a managed settings file, or an MDM policy, not your shell. Requires Claude Code v2.1.295 or later `CLAUDE_CODE_DISABLE_BUNDLED_SKILLS`| Set to `1` to disable the [skills](</docs/en/skills>) and workflows included with Claude Code: bundled skills and workflows are removed entirely, while built-in commands like `/init` stay typable but are hidden from the model. `/doctor` stays typable like the built-in commands; hide it with `DISABLE_DOCTOR_COMMAND` instead. Skills from plugins, `.claude/skills/`, and `.claude/commands/` are unaffected. Equivalent to the [`disableBundledSkills`](</docs/en/settings-reference#disablebundledskills>) setting `CLAUDE_CODE_DISABLE_CFC_PROMPT`| For hosts that embed Claude Code and supply their own browser guidance. Set to `1` to keep the [Claude in Chrome](</docs/en/chrome>) browser tools available while omitting the Chrome section of the system prompt and the `/claude-in-chrome` [bundled skill](</docs/en/skills#bundled-skills>). In VS Code, the extension at v2.1.314 or later also leaves the Claude in Chrome instructions out of a session’s messages. Requires Claude Code v2.1.257 or later `CLAUDE_CODE_DISABLE_CLAUDE_MDS`| Set to `1` to prevent loading any CLAUDE.md memory files into context, including user, project, and auto memory files `CLAUDE_CODE_DISABLE_CRON`| Set to `1` to disable [session-scoped scheduled tasks](</docs/en/scheduled-tasks#disable-scheduled-tasks>). The `/loop` skill and `CronCreate` become unavailable and any already-scheduled tasks stop firing, including tasks that are already running mid-session `CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT`| Set to `1` to turn off the `auto` and `bypassPermissions` [time limit and denials](</docs/en/permission-modes#time-limits-and-denials-in-auto-and-bypasspermissions-modes>) on critical-path removals. These removals then go to the classifier in `auto` mode, and get an untimed prompt in `bypassPermissions` mode wherever Claude Code can show one. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.281 or later +`CLAUDE_CODE_DISABLE_DEFERRED_TOOL_RESUME`| Set to `1` to skip a [deferred tool call](</docs/en/hooks#defer-a-tool-call-for-later>) when you resume or continue with `-p`. Claude can still repeat the call. Ignored in a settings `env` block. Requires Claude Code v2.1.328 or later `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`| Set to `1` to strip pre-release `anthropic-beta` request headers, the body fields that pair with them, and beta tool-schema fields such as `defer_loading` and `eager_input_streaming` from API requests. Use this when a proxy gateway rejects requests with an `Unexpected value(s)` error for the `anthropic-beta` header or an `Extra inputs are not permitted` error. [Disable pre-release capabilities](</docs/en/llm-gateway-protocol#disable-pre-release-capabilities>) lists what the variable removes, including [MCP tool search](</docs/en/mcp#scale-with-mcp-tool-search>), and what Claude Code keeps sending `CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS`| Set to `1` to disable the built-in [Explore and Plan subagents](</docs/en/sub-agents#built-in-subagents>). Claude explores with its search tools or the general-purpose subagent instead, and [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) reads files directly rather than launching Explore and Plan agents. Custom subagents named `Explore` or `Plan` are unaffected. To remove every built-in subagent type in the Agent SDK or non-interactive mode, use `CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS` instead. Requires Claude Code v2.1.198 or later `CLAUDE_CODE_DISABLE_FAST_MODE`| Set to `1` to disable [fast mode](</docs/en/fast-mode>) @@ -240,7 +241,7 @@ `CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS`| Set to `1` to stop Claude Code from sending the structured-output `output_config.format` field and the `anthropic-beta` value that pairs with it, for an [LLM gateway](</docs/en/llm-gateway-protocol#feature-pass-through>) whose upstream rejects them. This leaves on the other pre-release capabilities that [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](</docs/en/llm-gateway-protocol#disable-pre-release-capabilities>) turns off. Requires Claude Code v2.1.288 or later `CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT`| Set to `1` to turn off the [critical-path](</docs/en/permission-modes#critical-paths>) check for a recursive `rm` whose target is entirely the output of a command substitution, such as `rm -rf "$(pwd)"`. The other critical-path checks keep running. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.281 or later `CLAUDE_CODE_DISABLE_TERMINAL_TITLE`| Set to `1` to disable automatic terminal title updates based on conversation context. This also skips the background small/fast-model request that [generates a session title](</docs/en/sessions#name-your-sessions>), and turns off [status reports to your terminal](</docs/en/terminal-config#see-session-status-in-your-terminal>) -`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 Opus 5.5, Sonnet 5.5, Haiku 5.5, or the 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_THINKING`| Set to `1` to omit the `thinking` parameter from the API requests for the main conversation’s turns, subagent turns, and the compaction summary. This is a compatibility option for proxies and gateways that reject the parameter. On models that think by default, 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. See [where you can’t turn thinking off](</docs/en/model-config#where-you-cant-turn-thinking-off>) `CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK`| Set to `1` so [`claude ultrareview`](</docs/en/ultrareview#trust-the-folder-before-the-review-runs>) doesn’t exit with `Error: Workspace not trusted` when run without a terminal or with `CI=true`. `claude ultrareview` still asks when it can. From v2.1.314, the variable also skips the trust check in `/ultrareview` and `/code-review ultra`. Set it in the launch environment, not a settings `env` block, and only where every review starts in a folder you trust. Requires Claude Code v2.1.309 or later `CLAUDE_CODE_DISABLE_ULTRATHINK`| Set to `1` to turn the [`ultrathink`](</docs/en/model-config#use-ultrathink-for-one-off-deep-reasoning>) keyword off. Requires Claude Code v2.1.316 or later `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 @@ -289,6 +290,7 @@ `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL`| Set to `1` to stop `/ide` from installing the IDE extension. Equivalent to setting [`autoInstallIdeExtension`](</docs/en/settings-reference#autoinstallideextension>) to `false`. Claude Code versions before v2.1.318 also install or update the extension when you start `claude` in a VS Code, Cursor, or Devin Desktop terminal. This variable stops that too `CLAUDE_CODE_IDE_SKIP_VALID_CHECK`| Set to `1` to skip validation of IDE lockfile entries during connection. Use when auto-connect fails to find your IDE despite it running `CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS`| Context size, in tokens, at which [idle compaction](</docs/en/settings-reference#idlecompaction>) applies to a conversation (default: `200000`). Accepts a positive whole number, and anything else is ignored. Values below `100000` are raised to `100000`, the lowest threshold. Idle compaction is on by default for conversations that meet its conditions. To turn it off, set `idleCompaction` to `false`. Requires Claude Code v2.1.290 or later +`CLAUDE_CODE_LOOP_KEEPALIVE`| Set to `1` to run one extra iteration of an interactive [self-paced `/loop`](</docs/en/scheduled-tasks#stop-a-loop>) when its second or later iteration ends with nothing scheduled `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS`| How many [subagents](</docs/en/sub-agents#concurrent-subagent-limit>) can be running in one session before the Agent tool refuses to spawn another (default: 20). Accepts a positive whole number in plain digits; anything else is ignored, so the variable can adjust the cap but can’t disable it. Requires Claude Code v2.1.217 or later `CLAUDE_CODE_MAX_CONTEXT_TOKENS`| Override the context window size Claude Code assumes for the active model. As of v2.1.193, how it applies depends on how Claude Code resolves the model ID; see [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>). Use this when routing to a model through `ANTHROPIC_BASE_URL` whose context window does not match the built-in size for its name `CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH`| Maximum length in characters of MCP tool descriptions and MCP server instructions that Claude Code sends to the model. The value you set replaces both [default limits](</docs/en/mcp#for-mcp-server-authors>): 4096, and 16384 for the description of a tool that Claude loads through tool search. Accepts a positive whole number in plain digits. Anything else is ignored and the defaults apply. Requires Claude Code v2.1.280 or later @@ -372,6 +374,8 @@ `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_STRICT_INLINE_SHELL_RM_PROMPT`| Set to `1` to flag more of the [`-c` scripts](</docs/en/permission-modes#removals-inside-nested-commands-and-inline-scripts>) that Claude Code can’t check, including ones that name neither `rm` nor `rmdir`. Set it in the environment that launches Claude Code, not a settings `env` block. Has no effect when `CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT` is `1`. Requires Claude Code v2.1.299 or later +`CLAUDE_CODE_SUBAGENT_EFFORT`| The default [effort level](</docs/en/model-config#adjust-effort-level>) for [subagents](</docs/en/sub-agents#choose-an-effort-level>) and [workflow](</docs/en/workflows>) agents: `low`, `medium`, `high`, `xhigh`, or `max`. It doesn’t apply to forks, forked skills, or teammates. Requires Claude Code v2.1.315 or later +`CLAUDE_CODE_SUBAGENT_HISTORY`| Set to `0` to remove the `/tasks` row where you [reopen subagents that have ended](</docs/en/sub-agents#finished-subagents-in-the-panel-and-task-list>) `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 `CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL`| Set `5m` or `1h`, the only values Claude Code accepts, to choose the [prompt cache TTL](</docs/en/prompt-caching#cache-lifetime>) for requests outside the main conversation, such as [subagents](</docs/en/sub-agents>), workflows, and background work. Takes precedence over the `subagentPromptCacheTtl` setting and over `ENABLE_PROMPT_CACHING_1H`, and `FORCE_PROMPT_CACHING_5M` overrides it. The API bills 1-hour cache writes at a higher rate. Requires Claude Code v2.1.242 or later @@ -553,8 +557,6 @@ * Have Claude read [another organization’s public artifact](</docs/en/artifacts#read-an-artifact-shared-with-you>) * Get the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) by default for claude.ai and Console accounts on Windows with Git Bash installed; Claude Code routes shell commands through Git Bash unless you set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`. On Windows without Git Bash, the tool stays on * Get [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>), which Claude Code turns on through a fetched flag - * Have Claude [treat large pastes as pasted rather than typed text](</docs/en/terminal-config#how-claude-treats-pasted-text>); the content behind a `[Pasted text #N]` placeholder reaches Claude unmarked - * Have Claude Code [exclude MCP tools whose input schema the API would reject](</docs/en/mcp#tools-with-invalid-input-schemas>) ### First session after an install or upgrade
modified Error reference View current →
Show diff (251 lines)
--- a/errors.md +++ b/errors.md @@ -34,6 +34,7 @@ `Agent terminated early due to an API error`| Server errors `You've hit your session limit` / `You've hit your weekly limit` / `You've hit your Opus limit` / `You've hit your Sonnet limit`| Usage limits `Usage credits required for 1M context`| Usage limits +`Usage credits ran out before the response was finished.`| [Add usage credits](</docs/en/costs#add-usage-credits-to-your-subscription>) `the prompt to confirm went unanswered · nothing was sent`, from v2.1.324| Usage limits `Claude stopped here · send a message to be asked again`| Usage limits `Server is temporarily limiting requests`| Usage limits @@ -78,6 +79,7 @@ `Remote Control was turned off by your organization's policy`| [Troubleshoot Remote Control](</docs/en/remote-control#remote-control-was-turned-off-by-your-organizations-policy>) `Session failed: working folder not found:`| [Troubleshoot Remote Control](</docs/en/remote-control#working-folder-not-found>) `The program file this Remote Control started from is gone`| [Troubleshoot Remote Control](</docs/en/remote-control#program-file-is-gone>) +`Session failed: program not found:`| [Troubleshoot Remote Control](</docs/en/remote-control#program-file-is-gone>) `Session failed: spawn error:` followed by an `ENOENT` message| [Troubleshoot Remote Control](</docs/en/remote-control#program-file-is-gone>) `Remote Control disconnected:` followed by a reason that mentions a `share link`| [Remote Control](</docs/en/remote-control#what-connected-devices-see>) `OAuth token revoked` / `OAuth token has expired`| Authentication @@ -85,6 +87,7 @@ `Your account does not have access to Claude. Please login again or contact your administrator.`| Authentication `API Error: 401 Invalid authentication credentials`| Authentication `Login expired · Please run /login`| Authentication +`Warning: this sign-in`| [Check when a stored login ends](</docs/en/authentication#check-when-a-stored-login-ends>) `The browser can't return the sign-in to Claude Code automatically`| Authentication `Couldn't start the local listener that receives the browser sign-in. Try again.`| Authentication `Failed to start OAuth callback server`| Authentication @@ -97,6 +100,7 @@ `Login reached its time limit · Please run /login` / `Failed to authenticate: this login reached its time limit`| Authentication `Failed to authenticate: your claude.ai login expired`| [After the login expires](</docs/en/authentication#after-the-login-expires>) `claude.ai login ended · usage now billed to` / `Warning: the claude.ai login on this machine has ended`| [After the login expires](</docs/en/authentication#after-the-login-expires>) +`The refresh token in CLAUDE_CODE_OAUTH_REFRESH_TOKEN was used for this attempt`| Fix the refusal printed above it, then set [`CLAUDE_CODE_OAUTH_REFRESH_TOKEN`](</docs/en/env-vars#variables>) to a new token. `Could not refresh your login because another Claude Code process is refreshing it`| Authentication `Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh`| Authentication `Could not refresh your login: the disk that holds the Claude Code config directory (~/.claude by default), or your disk quota on it, is full`| Authentication @@ -149,10 +153,11 @@ `403` with `x-deny-reason: host_not_allowed` in a cloud session or cloud scheduled task| Network `proxy refused the connection`| Network `403` with `GitHub GraphQL is not available from Claude Code sessions` in a cloud session| [GitHub proxy](</docs/en/cloud-environments#github-proxy>) +`ENOTFOUND` with `In this cloud session a host fails to resolve like this`| Network `The cloud environments service returned an empty response` / `The cloud environments service returned a response in an unexpected format`| Network `Failed to fetch session from Sessions API: Failed to fetch session logs`| Network `Couldn't load the history of cloud session`| Network -`Couldn't reconnect to your Remote Control session`| Network +`Couldn't reconnect to your Remote Control session`| [Troubleshoot Remote Control](</docs/en/remote-control#couldnt-reconnect-to-your-remote-control-session>) `N sessions ended while this machine was offline — the environment was cleaned up on the server and can't be resumed.`| Network `Couldn't share the transcript.`| Network `Couldn't send feedback`| Network @@ -200,6 +205,7 @@ `thinking.type.enabled is not supported for this model`| Request errors `Effort '<level>' isn't available with thinking turned off on this model`| Request errors `effort '<level>' is not supported when thinking is disabled`| Request errors +`API Error: 400 Invalid effort level` / `Your organization limits effort for <model>, so Claude Code is using '<level>' instead of '<level>'`| [Organization effort limits](</docs/en/model-config#organization-effort-limits>) `max_tokens must be greater than thinking.budget_tokens`| Request errors `Claude's response exceeded the ... output token maximum`| Request errors `API Error: 400 due to tool use concurrency issues`| Request errors @@ -306,7 +312,7 @@ `Claude Code couldn't restart`| Command-line errors `Couldn't open Claude Desktop`| Command-line errors `Failed to open Claude Desktop. Please try opening it manually.`| Command-line errors -`Couldn't read your Zed keymap` / `Couldn't back up your Zed keymap` / `Couldn't update your Zed keymap`| Command-line errors +`Couldn't read your Zed keymap` / `Couldn't back up your Zed keymap` / `Couldn't update your Zed keymap` / `Your Zed keymap is a symbolic link`| 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 @@ -324,6 +330,8 @@ `Cannot add marketplace "<name>": Claude Code cannot install plugins from a marketplace with this name`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#cannot-install-plugins-from-a-marketplace-with-this-name>) `Cannot add marketplace "<name>": Claude Code reserves this name and cannot register a marketplace under it`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#claude-code-reserves-this-name>) `Marketplace "<name>" is added but ignored`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#marketplace-is-added-but-ignored>) +`Marketplace "<name>", which managed settings declare, stands from another source and cannot be taken back while its declared source is unreachable`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#marketplace-cannot-be-taken-back-while-its-declared-source-is-unreachable>) +`The list of installed plugins (installed_plugins.json) could not be read, so marketplace "<name>", which managed settings declare, cannot be taken back from another source`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#installed-plugins-could-not-be-read-so-marketplace-cannot-be-taken-back>) `Marketplace "<name>" is registered but was refused (see the debug log)`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#marketplace-is-added-but-ignored>) `references ${user_config.*} in a shell-form command`| Plugin errors `Monitor "<name>" from plugin <plugin> references ${user_config.*} in its command`| Plugin errors @@ -344,6 +352,7 @@ `"<plugin>" was not uninstalled: it is still switched on in <file>`| Plugin errors `"<plugin>" was not uninstalled: <file> is there and could not be read`| Plugin errors `Plugin "<plugin>" was not uninstalled: installed_plugins.json`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#installed-plugins-json-holds-a-record-this-version-cannot-read>) +`was updated or removed, so this hook did not run`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#plugin-directory-does-not-exist>) `Plugin directory does not exist: <path>`| [Plugin troubleshooting](</docs/en/plugins/troubleshooting#plugin-directory-does-not-exist>) `Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)`| Plugin errors `is not added on this machine, so your organization's marketplace policy keeps its plugins off`| [Add a marketplace](</docs/en/plugins/install#add-a-marketplace>) @@ -379,6 +388,7 @@ `cannot be handed to a teammate intact`| Tool errors `Message too large for cross-session delivery`| Tool errors `Too many messages to this session just now`| Tool errors +`Held a message from <sender>` / `Dropped the held message from <sender> without delivering it`| [Control inbound messages](</docs/en/cross-session-messaging#control-inbound-messages>), or [Non-interactive sessions](</docs/en/cross-session-messaging#non-interactive-sessions>) for `claude -p` `Cross-session message was dropped at the recipient session's inbox`| Tool errors `Refusing to send: reply target is a symlink` / `Refusing to send: cannot vet reply target`| 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 @@ -398,6 +408,7 @@ `File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary`| Tool errors `git is not installed on this Mac. To install it, run xcode-select --install, then try again.`| Tool errors `Refusing to apply edits to <path>: a hook is configured for file edits in this session`| Tool errors +`blocking because onFailure is "block"`| [Block the action when a hook fails](</docs/en/hooks#block-the-action-when-a-hook-fails>) `the source file is not valid UTF-8 text` / `the source file is not valid UTF-16 text`| Tool errors `the source file has the replacement character U+FFFD`| Tool errors `Not published: that file is on a network share`| Tool errors @@ -584,7 +595,7 @@ A non-streaming attempt ends at its request timeout or at the body idle timeout, whichever comes first: * **Request timeout** : `API_TIMEOUT_MS` when you set a positive value, otherwise 300 seconds in a local session. - * **[Body idle timeout](</docs/en/network-config#streaming-idle-watchdogs>)** : 5 to 6 minutes without a response, however high you set `API_TIMEOUT_MS`, where it runs and you haven’t turned it off. + * **[Body idle timeout](</docs/en/network-config#streaming-idle-watchdogs>) where it runs**: by default, 5 to 6 minutes without a response, however high you set `API_TIMEOUT_MS`. ## Server errors @@ -625,7 +636,8 @@ * If every request fails with this message and you set `API_TIMEOUT_MS` to `0`, check `claude --version`. On a version before v2.1.305, update Claude Code or set a positive value. * Retry the request - * If a slow network or proxy is the cause, raise `API_TIMEOUT_MS` as described in Automatic retries + * If the message continues past `Request timed out` and names an [environment variable](</docs/en/env-vars#set-environment-variables>), do what the message says. `No data arrived` means the [body idle timeout](</docs/en/network-config#streaming-idle-watchdogs>) ended the request. + * With a slow network or proxy on a version before v2.1.328, raise `API_TIMEOUT_MS`. If the request still times out, [update to v2.1.328 or later](</docs/en/setup#update-claude-code>) and set any variable the next timeout message names. If you can’t update, set [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) to `0`. * If timeouts are frequent and your network is otherwise healthy, see Network and connection errors below ### No response from API @@ -998,7 +1010,7 @@ ### Your apiKeyHelper script is failing -Claude Code ran the command in your [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) setting and didn’t get a key back. Without one, the request reaches the API with a placeholder credential, and the API rejects it with `401`. The `Authentication` panel in the terminal shows which of these happened: +Claude Code ran the command in your [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) setting and didn’t get a key back. Without one, the request reaches the API with a placeholder credential, and the API rejects it with `401`. A panel in the terminal shows which of these happened: * The command exited with an error or timed out * The command printed nothing to stdout @@ -1012,7 +1024,6 @@ * If the command reports an expired session, re-authenticate with your credential provider, for example by signing in to your SSO or secrets vault again * Fix the command so it prints only the key to stdout, as a single token of printable ASCII up to 16,384 characters, and exits with code 0. See [rotate credentials with apiKeyHelper](</docs/en/llm-gateway-connect#rotate-credentials-with-apikeyhelper>) for a working setup. * Run `/status` to see the failure and confirm `apiKeyHelper` is the active credential source. The `apiKeyHelper` row shows `Failing` with the last failure’s detail, such as the exit code and the command’s error output, and disappears after the next successful run. Before v2.1.274, `/status` showed only the credential source, not the failure. - * Each time the command fails, its exit code and error output also appear in an `Authentication` panel in the terminal. Before v2.1.212, the panel was titled `Cloud authentication`. ### Claude Code didn’t send your claude.ai login @@ -1309,7 +1320,7 @@ An API key may still be in `~/.claude.json` too if a Console login created one on Linux or Windows. **What to do:** - * Run `claude auth logout` in your shell to try the save again. When the save goes through, the command prints `Successfully logged out from your Anthropic account.` + * Run `claude auth logout` in your shell to try the save again ### Couldn’t start the local listener that receives the browser sign-in @@ -1844,7 +1855,7 @@ The cloud environments service returned a response in an unexpected format (HTTP 200 with a non-JSON body). This is usually temporary — try again in a moment. The cloud environments service returned a response in an unexpected format (HTTP 200 without a usable environments list). This is usually temporary — try again in a moment. -The server accepted the request but answered with a body that isn’t the environments list: empty, not JSON, or JSON without the list. This usually accompanies a service-side disruption and clears on its own. Depending on the surface that requested the list, Claude Code may add a prefix, such as `couldn't list environments:` in the `/remote-env` dialog. **What to do:** +**What to do:** * Retry the action. Claude Code requests the list again each time * If the message keeps appearing, check [status.claude.com](<https://status.claude.com>) for active incidents @@ -1875,15 +1886,7 @@ ### Couldn’t reconnect to your Remote Control session - Couldn't reconnect to your Remote Control session. Retry, or start a fresh session without --resume. - -Resuming with `claude --resume` or `claude --continue` reconnects to the [Remote Control](</docs/en/remote-control>) session recorded in that conversation. This message means the reconnection failed for a reason that may be temporary, such as a network interruption or a server error, so Claude Code can’t confirm whether the remote session still exists. Your local session keeps running without Remote Control. **What to do:** - - * Run `/remote-control` to retry the connection - * Start a new session with `claude --remote-control` to create a new Remote Control session - * For other Remote Control startup messages, see [Troubleshoot Remote Control](</docs/en/remote-control#troubleshooting>) - -If the server reports instead that the previous session is gone, you don’t see this message. Claude Code starts a new session in its place or shows [`Previous session is unavailable — run /remote-control to start a new one`](</docs/en/remote-control#previous-session-is-unavailable>). +For the cause and the fix, see [this message in Remote Control troubleshooting](</docs/en/remote-control#couldnt-reconnect-to-your-remote-control-session>). ### Sessions ended while this machine was offline @@ -2135,7 +2138,12 @@ API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid API Error: 400 ... tools.N.custom.input_schema.properties: Property keys should match pattern '^[a-zA-Z0-9_.-]{1,64}$' -The first form means the schema isn’t valid JSON Schema draft 2020-12. The second means a top-level property name doesn’t match the pattern the message quotes. Claude Code [excludes MCP tools whose input schema would fail this validation](</docs/en/mcp#tools-with-invalid-input-schemas>) when it loads a server’s tools, so requests normally never include one. On a [deployment where flag fetching is off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), or on a machine whose flags have never arrived, Claude Code records in the server’s log which tool would be rejected but sends it anyway, so this error can still occur. The error can also occur for a tool whose schema declares a JSON Schema dialect other than draft 2020-12 in `$schema`. Claude Code doesn’t check those schemas against the JSON Schema meta-schema, though the top-level property-name check still applies. Before v2.1.216, no deployment ran the exclusion checks. **What to do:** +The first form means the schema isn’t valid JSON Schema draft 2020-12. The second means a top-level property name doesn’t match the pattern the message quotes. Claude Code [excludes MCP tools whose input schema would fail this validation](</docs/en/mcp#tools-with-invalid-input-schemas>) when it loads a server’s tools, so requests normally never include one. The error can still occur, such as when: + + * [Feature flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) is on but the [flags haven’t arrived](</docs/en/env-vars#first-session-after-an-install-or-upgrade>). Before v2.1.328, the error could also occur with fetching off. + * The tool’s schema declares a JSON Schema dialect other than draft 2020-12 in `$schema`. + +**What to do:** * If your Claude Code version is earlier than v2.1.300, run [`claude update`](</docs/en/setup#update-claude-code>) in your shell. Before v2.1.300, Claude Code didn’t [retry the request without the rejected tool’s parameters](</docs/en/mcp#tools-whose-input-schema-the-api-refuses>), so this error repeated on every request that included the tool. * Remove or [disable](</docs/en/mcp#disable-a-server-without-removing-it>) the MCP server that declares the invalid schema. The error names the tool only by position. On v2.1.216 or later, check each server’s log for a line naming a tool whose input schema would be rejected. If no log names one, disable servers one at a time. @@ -3382,7 +3390,7 @@ ### /terminal-setup left your Zed keymap unchanged -You ran [`/terminal-setup`](</docs/en/terminal-config#enter-multiline-prompts>) in Zed, and Claude Code couldn’t complete the update to your Zed `keymap.json`, so it left the file as it was. Each message names the path to your keymap and ends with the keybinding block to add yourself: +You ran [`/terminal-setup`](</docs/en/terminal-config#enter-multiline-prompts>) in Zed, and Claude Code couldn’t complete the update to your Zed `keymap.json`, so it left the file as it was. Each message names the path to your keymap and includes the keybinding block to add yourself: Couldn't update your Zed keymap, so it was left unchanged. To add the binding yourself, add this block to the keymap array in <path to keymap.json>: @@ -3392,6 +3400,7 @@ * `Couldn't read your Zed keymap, so it was left unchanged.`: Claude Code couldn’t read the file, for example because of file permissions * `Your Zed keymap isn't a readable list of keybindings, so it was left unchanged.`: the file read fine but doesn’t parse as an array of keybinding blocks, even with `//` comments and trailing commas allowed + * `Your Zed keymap is a symbolic link, so it was left unchanged.`: `keymap.json` links to another file * `Couldn't back up your Zed keymap; not modifying it.`: Claude Code couldn’t copy the file to a `.bak` backup beside it, so it changed nothing * `Couldn't update your Zed keymap, so it was left unchanged.`: the merged result didn’t verify as a valid keymap carrying the binding, so Claude Code discarded it instead of writing. A keybinding block with a duplicated key can cause this @@ -3482,15 +3491,7 @@ ### Marketplace is registered from an untrusted source -The marketplace is registered under a name that is [reserved for official Anthropic marketplaces](</docs/en/plugins/marketplace-reference#marketplace-file>), but its registered source isn’t an `anthropics` GitHub repository. Claude Code re-checks reserved names every time it loads or refreshes a marketplace, so the marketplace and the plugins installed from it stop loading. Before v2.1.205, an entry registered before its name became reserved kept loading. - - Marketplace "claude-community" is registered from an untrusted source: The name 'claude-community' is reserved for official Anthropic marketplaces. Only repositories from 'github.com/anthropics/' can use this name. To fix it, remove the marketplace and re-add it from the official source. - -For a marketplace whose source isn’t a GitHub repository or a Git URL, such as a local directory, the middle sentence reads `can only be used with GitHub sources from the 'anthropics' organization` instead. `claude plugin marketplace add` runs the same check, and refuses a reserved name with `Failed to add marketplace:` followed by the same reserved-name sentence. **What to do:** - - * If the marketplace is already registered, run `claude plugin marketplace remove <name>`, then add it again from the official `github.com/anthropics` repository - * If you publish a third-party marketplace that used the name before it became reserved, rename it and ask users to re-add it from your source - * See the reserved name list under [Marketplace schema](</docs/en/plugins/marketplace-reference#marketplace-file>) +For the cause and the fix, see [this message in plugin troubleshooting](</docs/en/plugins/troubleshooting#marketplace-is-registered-from-an-untrusted-source>). ### Marketplace name is another spelling of a reserved name @@ -3556,19 +3557,7 @@ ### Plugin archive integrity check failed -The plugin’s marketplace entry uses an [`archive` source](</docs/en/plugins/marketplace-reference#archive-plugin-source>) with a `sha256` pin, and the digest of the downloaded file doesn’t match the pin. Claude Code refuses the install, so nothing changes in the plugin cache. The mismatch has three possible causes: - - * The file at the URL changed after the author computed the pin - * The author entered the wrong digest in the marketplace entry - * The URL serves a different file than the author pinned - - Plugin archive integrity check failed for https://artifacts.example.com/claude-plugins/my-plugin.zip: expected sha256 6bfa50e3d2e00c052b46abe51fff89346ac803e45771f76dcf6df1ab74cca5e1, got ac52220c0914ef8ca6a602e4a7362f88d30fb021110f72a6d15b68c3fe7df2b7. The archive was not installed. Verify the sha256 in the marketplace entry, or that the URL serves the intended file. - -**What to do:** - - * If you publish the plugin, recompute the digest of the exact file the URL serves, for example with `shasum -a 256 my-plugin.zip`, or `Get-FileHash -Algorithm SHA256 my-plugin.zip` in PowerShell, and update the `sha256` in the marketplace entry - * If you install the plugin, run `/plugin marketplace update <name>` to refresh the catalog in case the entry was corrected, then retry the install - * If the digests still disagree after a refresh, ask the marketplace owner which file they pinned before installing +For the causes and the fix, see [this message in plugin troubleshooting](</docs/en/plugins/troubleshooting#plugin-archive-integrity-check-failed>). ### Path escapes plugin directory @@ -5221,12 +5210,7 @@ ### Sandbox mask files left behind at write-deny paths -This warning in `claude doctor` and `/status` lists mask files: 0-byte read-only placeholder files at paths the [sandbox](</docs/en/sandboxing>) denies writes to. It appears on Linux and WSL2 when sandboxing is enabled with filesystem isolation on. Delete them from your shell once no Claude Code session is open in the project that holds them. The sandbox creates a placeholder while a sandboxed command runs and removes it when the command ends. One stays behind in cases such as these: - - * The session is killed before the command ends, for example by SIGKILL - * You quit the session while a sandboxed command is still running, such as one in the background - -In `claude doctor`, the warning reads: +This warning in `claude doctor` and `/status` lists mask files: 0-byte read-only placeholder files at paths the [sandbox](</docs/en/sandboxing>) denies writes to. It appears on Linux and WSL2 when sandboxing is enabled with filesystem isolation on. Delete them from your shell once no Claude Code session is open in the project that holds them. In `claude doctor`, the warning reads: - Sandbox mask files left behind at write-deny paths: /home/you/project/.claude/settings.local.json Fix: A session leaves one where it was killed, or where it exited while a sandboxed command was still running. Remove each with `rm <path>` while no other Claude Code session is running in that project — a 0-byte read-only file where a settings file belongs makes "Yes, and don't ask again" fail to save, and the sandbox binds it read-only again on every start
modified React to events with a mod View current →
--- a/events.md +++ b/events.md @@ -61,7 +61,7 @@ // A regular expression matches by pattern: every tool of one MCP server on('tool.call', { tool: /^mcp__github__/ }, hook) -`hook` runs once for a Bash, Edit, or Write call, and once for a call to a tool whose name starts with `mcp__github__`. A call to any other tool, such as Read, matches none of the three, so `hook` doesn’t run for it. The event name can be a wildcard. `'classic.*'` matches every settings hook event. `'*'` matches every event except the [telemetry events](</docs/en/plugins/mods/reference#telemetry>), which take their own name and a `{ to: 'collector' }` filter. Register each event once per matcher. If you call `on` twice for `session.start` with no matcher, the module fails to load with `on("session.start") is registered twice without a matcher`. Put everything your mod does at session start in one hook. +`hook` runs once for a Bash, Edit, or Write call, and once for a call to a tool whose name starts with `mcp__github__`. A call to any other tool, such as Read, matches none of the three, so `hook` doesn’t run for it. The event name can be a wildcard. `'classic.*'` matches every settings hook event. `'*'` matches most events, but not the [telemetry events](</docs/en/plugins/mods/reference#telemetry>), which take their own name and a `{ to: 'collector' }` filter. Register each event once per matcher. If you call `on` twice for `session.start` with no matcher, the module fails to load with `on("session.start") is registered twice without a matcher`. Put everything your mod does at session start in one hook. #### Hook other mods’ drawings and controls
modified Feature availability View current →
--- a/feature-availability.md +++ b/feature-availability.md @@ -77,7 +77,7 @@ 4 Dashboard and API only. [Contribution metrics](</docs/en/analytics#enable-contribution-metrics>) requires a claude.ai Team or Enterprise organization. 5 Requires Claude Code v2.1.224 or later on macOS and Linux, including Linux inside WSL 2. On native Windows, requires Claude Code v2.1.234 or later. With API key authentication, messaging is same-machine only. On Amazon Bedrock, Claude Platform on AWS, Google Cloud (Anthropic managed), Google Cloud (Google managed), and Microsoft Foundry, messaging is same-machine only and requires Claude Code v2.1.248 or later. Claude can find your [cloud sessions](</docs/en/claude-code-on-the-web>) and your sessions on other machines only from a session that is connected to [Remote Control](</docs/en/remote-control>). To connect, you need a claude.ai sign-in and the other [Remote Control requirements](</docs/en/remote-control#requirements>). See [Message sessions on other machines](</docs/en/cross-session-messaging#message-sessions-on-other-machines>). -If you authenticate through an [LLM gateway](</docs/en/llm-gateway>), feature availability matches the underlying provider the gateway forwards to, except for the features Claude Code itself turns off. Whenever `ANTHROPIC_BASE_URL` points at a host other than `api.anthropic.com`, Claude Code turns off features such as [Remote Control](</docs/en/remote-control#requirements>) and [server-managed settings](</docs/en/server-managed-settings#platform-availability>), whatever the gateway forwards. Some features, such as the [Advisor](</docs/en/advisor#requirements>), work only if the gateway forwards requests intact.For how the requests Claude Code sends differ between an Amazon Bedrock- or Agent Platform-format gateway, an `ANTHROPIC_BASE_URL` gateway, and a Claude apps gateway sign-in, see [client behavior by connection method](</docs/en/llm-gateway-protocol#how-the-connection-method-changes-client-behavior>). +If you authenticate through an [LLM gateway](</docs/en/llm-gateway>), feature availability matches the underlying provider the gateway forwards to, except for the features Claude Code itself turns off. Whenever `ANTHROPIC_BASE_URL` points at a host other than `api.anthropic.com`, Claude Code turns off features such as [Remote Control](</docs/en/remote-control#requirements>), whatever the gateway forwards. Some features, such as the [Advisor](</docs/en/advisor#requirements>), work only if the gateway forwards requests intact.For how the requests Claude Code sends differ between an Amazon Bedrock- or Agent Platform-format gateway, an `ANTHROPIC_BASE_URL` gateway, and a Claude apps gateway sign-in, see [client behavior by connection method](</docs/en/llm-gateway-protocol#how-the-connection-method-changes-client-behavior>). ### Summary by provider
modified Claude Code GitHub Actions View current →
--- a/github-actions.md +++ b/github-actions.md @@ -60,10 +60,10 @@ Claude Code pushes a branch with the workflow files, already set to use your secret, and opens GitHub with a pull request ready for you to create. Create and merge that pull request to turn on the workflows. To test mentions, tag `@claude` in an issue comment. -To stop setup partway through, press Esc in Claude Code. Claude Code finishes any change it’s already writing to the repository and doesn’t start new ones. The closing message lists what already happened in the repository, such as a pushed branch or a saved secret. If you select the review workflow, Claude posts each review on the pull request itself, as an inline comment on each issue it finds or as one summary comment when it finds none. Claude skips some pull requests, such as drafts. The review workflow example uses the same skill and lists them. Before v2.1.229, Claude wrote its review only to the workflow run log. To update a review workflow that an earlier version generated, do one of the following: - - * Run `/install-github-app` again. When the repository already has a `claude.yml`, select **Update workflow file with latest version**. Claude Code pushes fresh copies of the workflow files to a new branch and opens the pull request, the same as a first install. - * Add the `--comment` argument and the `claude_args` line from the review workflow example to the checked-in file yourself, which keeps any other edits you made to it. +To stop setup partway through, press Esc in Claude Code. Claude Code finishes any change it’s already writing to the repository and doesn’t start new ones. The closing message lists what already happened in the repository, such as a pushed branch or a saved secret. If you select the review workflow, Claude posts each review on the pull request itself, as an inline comment on each issue it finds or as one summary comment when it finds none. Claude skips some pull requests, such as drafts. The review workflow example uses the same skill and lists them. Before v2.1.229, Claude wrote its review only to the workflow run log. To update a review workflow file made before v2.1.229, add: + + * `--comment` to the `prompt` line, as in the review example + * The example’s `claude_args` line * When you install the GitHub App, you grant it several permissions. See GitHub App permissions for the full set * Quick setup works with the Claude API and Claude subscriptions. If you use Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, see [Use Claude Code GitHub Actions with cloud providers](</docs/en/github-actions-cloud-providers>)
modified Glossary View current →
--- a/glossary.md +++ b/glossary.md @@ -43,7 +43,7 @@ ### Bare mode -With `--bare`, Claude Code starts without loading hooks, skills, custom commands, subagents, installed plugins, MCP servers, auto memory, or CLAUDE.md, apart from skills in a directory you pass with `--add-dir`. Recommended for CI and scripted calls where you need the same result on every machine. Learn more: [Start faster with bare mode](</docs/en/headless#start-faster-with-bare-mode>) +With `--bare`, Claude Code starts without your hooks, skills, custom commands, subagents, installed plugins, MCP servers, auto memory, or CLAUDE.md, apart from skills in a directory you pass with `--add-dir`. Recommended for CI and scripted calls. Learn more: [Start faster with bare mode](</docs/en/headless#start-faster-with-bare-mode>) ### Bundled skills
modified Keep Claude working toward a goal View current →
--- a/goal.md +++ b/goal.md @@ -12,7 +12,7 @@ Approach| Next turn starts when| Stops when ---|---|--- `/goal`| The previous turn finishes, or, in an interactive session, an idle check-in or an automatic retry comes due| A model confirms the condition is met or judges it impossible, or a turn fails on an error you have to fix, or you run `/goal clear` -[`/loop`](</docs/en/scheduled-tasks#run-a-prompt-repeatedly-with-%2Floop>)| A time interval elapses| You stop it, or Claude decides the work is done +[`/loop`](</docs/en/scheduled-tasks#run-a-prompt-repeatedly-with-%2Floop>)| A time interval elapses| You stop it, or [the loop ends on its own](</docs/en/scheduled-tasks#stop-a-loop>) [Stop hook](</docs/en/hooks-guide#prompt-based-hooks>)| The previous turn finishes| Your own script or prompt decides `/goal` and a Stop hook both fire after every turn. `/goal` is a session-scoped shortcut: you type a condition and it’s active for the current session only. A Stop hook lives in your settings file, applies to every session in its scope, and can run a script for deterministic checks or a prompt for model-evaluated ones. [Auto mode](</docs/en/auto-mode-config>) on its own approves tool calls within a single turn but doesn’t start a new one. Claude stops when it judges the work done. `/goal` adds a separate evaluator that checks your condition after every turn, so completion is decided by a fresh model rather than the one doing the work. The two are complementary: auto mode removes per-tool prompts, and `/goal` removes per-turn prompts.
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -20,7 +20,7 @@ ### Start faster with bare mode -Add `--bare` to reduce startup time by skipping auto-discovery of hooks, skills, custom commands, [subagents](</docs/en/sub-agents>), installed plugins, MCP servers, auto memory, and CLAUDE.md. Without it, `claude -p` discovers and loads them as an interactive session would, including anything configured in the working directory or `~/.claude`. Bare mode is useful for CI and scripts where you need the same result on every machine. A hook in a teammate’s `~/.claude` or an MCP server in the project’s `.mcp.json` won’t run, because bare mode never reads them. A directory you name with `--add-dir` is a partial exception: bare mode loads skills from its `.claude/skills/` folder, but still skips its `.claude/commands/` and `.claude/agents/` folders. [Skills from additional directories](</docs/en/skills#skills-from-additional-directories>) covers what does and doesn’t load. Without `--bare`, a `-p` session runs the hooks in a project’s `.claude/settings.json` and connects the servers in its `.mcp.json`, even in a folder you’ve never trusted. A `-p` session shows no workspace trust dialog and no per-server approval prompt. [What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) covers each kind of repository content under `-p` and how to keep it out. This example runs a one-off summarize task in bare mode and pre-approves the Read tool so the call completes without a permission prompt. Set `ANTHROPIC_API_KEY` before running it, because bare mode doesn’t use your subscription login: +Add `--bare` to reduce startup time by skipping auto-discovery of your hooks, skills, custom commands, [subagents](</docs/en/sub-agents>), installed plugins, MCP servers, auto memory, and CLAUDE.md. Without it, `claude -p` discovers and loads them as an interactive session would, including anything configured in the working directory or `~/.claude`. In bare mode, Claude Code still reads settings files and their [permission rules](</docs/en/permissions#what-runs-before-you-trust-a-folder>), but a hook in `~/.claude/settings.json` or an MCP server in the project’s `.mcp.json` won’t run. A directory you name with `--add-dir` is a special case: bare mode loads skills from its `.claude/skills/` folder, but still skips its `.claude/commands/` and `.claude/agents/` folders. [Skills from additional directories](</docs/en/skills#skills-from-additional-directories>) covers what does and doesn’t load. Without `--bare`, a `-p` session runs the hooks in a project’s `.claude/settings.json` and connects the servers in its `.mcp.json`, even in a folder you’ve never trusted. A `-p` session shows no workspace trust dialog and no per-server approval prompt. [What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) covers each kind of repository content under `-p` and how to keep it out. This example runs a one-off summarize task in bare mode and pre-approves the Read tool so the call completes without a permission prompt. Set `ANTHROPIC_API_KEY` before running it, because bare mode doesn’t use your subscription login: claude --bare -p "Summarize README.md" --allowedTools "Read"
modified Intercept and control agent behavior with hooks View current →
--- a/hooks.md +++ b/hooks.md @@ -69,7 +69,7 @@ } } - # Return empty object to allow the operation + # Empty object: no decision, normal permissions apply return {} async def main(): @@ -113,7 +113,7 @@ }; } - // Return empty object to allow the operation + // Empty object: no decision, normal permissions apply return {}; }; @@ -133,7 +133,7 @@ } } -The hook denies a Write or Edit call whose `file_path` ends in `/.env`, in any letter case. On Windows, `file_path` uses backslashes, such as `C:\project\.env`, and this hook allows a Write or Edit call to `C:\project\.env`. +The hook denies a Write or Edit call whose `file_path` ends in `/.env`, in any letter case. On Windows, `file_path` uses backslashes, such as `C:\project\.env`, and this hook doesn’t block a Write or Edit call to `C:\project\.env`. The `Write|Edit` matcher limits this hook to the Write and Edit tools. If Claude writes `.env` with a Bash command, the hook doesn’t run. To block Bash writes to a file where [the sandbox runs](</docs/en/sandboxing>), see the sandbox configuration for [Python](</docs/en/agent-sdk/python#sandbox-configuration>) or [TypeScript](</docs/en/agent-sdk/typescript#sandbox-configuration>). @@ -245,7 +245,7 @@ * For `PostToolUse` hooks, you can set `additionalContext` to append information to the tool result. To replace the tool’s output before Claude sees it, set `updatedToolOutput`, which works for built-in and MCP tools in both SDKs. The older `updatedMCPToolOutput` field replaces MCP tool output only. * In the TypeScript SDK, a `PostToolUse` callback can also return `classifierContext`, a short note about the tool call’s result for the [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) permission classifier. Because your callback runs in your application’s own process, the classifier may weigh a user statement you relay in the note as user intent. The field requires TypeScript Agent SDK v0.3.236 or later. [Annotate a result for the auto mode classifier](</docs/en/hooks#annotate-a-result-for-the-auto-mode-classifier>) covers the length cap, the synchronous-only rule, and what not to put in the note. -Return `{}` to allow the operation without changes. SDK callback hooks use the same JSON output format as [Claude Code shell command hooks](</docs/en/hooks#json-output>), which documents every field and event-specific option. For the SDK type definitions, see the [TypeScript](</docs/en/agent-sdk/typescript#synchookjsonoutput>) and [Python](</docs/en/agent-sdk/python#synchookjsonoutput>) SDK references. +For `PreToolUse`, return `{}` to make no decision, so the normal [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) applies. SDK callback hooks use the same JSON output format as [Claude Code shell command hooks](</docs/en/hooks#json-output>), which documents every field and event-specific option. For the SDK type definitions, see the [TypeScript](</docs/en/agent-sdk/typescript#synchookjsonoutput>) and [Python](</docs/en/agent-sdk/python#synchookjsonoutput>) SDK references. When multiple `PreToolUse` hooks return different [decisions](</docs/en/hooks#pretooluse-decision-control>), `deny` takes priority over `defer`, which takes priority over `ask`, which takes priority over `allow`.
modified Hosting the Agent SDK View current →
--- a/hosting.md +++ b/hosting.md @@ -2,7 +2,7 @@ ## The subprocess model -Every hosting decision on this page follows from how the SDK runs the agent. When your code calls `query()`, the SDK spawns a separate `claude` CLI process and talks to it over stdio. That subprocess owns the shell, the working directory, and the JSONL session transcripts on local disk. One agent session maps to one subprocess. Running N concurrent sessions means N subprocesses, each with its own process tree and transcript file. By default they all inherit your application’s working directory. When sessions need separate filesystems, pass a distinct `cwd` in the options of each session’s `query()` call: +Every hosting decision on this page follows from how the SDK runs the agent. When your code calls `query()`, the SDK spawns a separate `claude` CLI process and talks to it over stdio. That subprocess owns the shell, the working directory, and the JSONL session transcripts on local disk. One agent session maps to one subprocess. Running N concurrent sessions takes N subprocesses, each with its own process tree and transcript file. By default they all inherit your application’s working directory. When sessions need separate working directories, pass a distinct `cwd` in the options of each session’s `query()` call: TypeScript
modified Install and manage plugins View current →
--- a/install.md +++ b/install.md @@ -53,7 +53,7 @@ * **Install for all collaborators on this repository (project scope)** : it’s enabled for everyone who works in this repository * **Install for you, in this repo only (local scope)** : you get it in this repository only -Choose an install scope says which settings file each one writes to and which applies when the same plugin is set at more than one.After you select a scope, Claude Code installs the plugin along with any dependencies it declares, then prints an install summary. +Choose an install scope says which settings file each one writes to and which applies when the same plugin is set at more than one.After you select a scope, Claude Code installs the plugin, then prints an install summary. 4 @@ -167,7 +167,7 @@ claude plugin install formatter@your-org --scope project -The command prints `Successfully installed plugin: formatter@your-org (scope: project)` when it finishes. Some plugins install by running a command that their marketplace names, called a [`command` source](</docs/en/plugins/marketplace-reference#command-plugin-source>). Claude Code shows you that command and asks you to accept it before it runs. A script has no one to answer that prompt, so pass `--yes` there to accept it. For the other `claude plugin install` flags, see [plugin install](</docs/en/plugins/cli-reference#plugin-install>). +In a terminal, the command prints `Installed plugin: formatter@your-org (scope: project)` when it finishes. Some plugins install by running a command that their marketplace names, called a [`command` source](</docs/en/plugins/marketplace-reference#command-plugin-source>). Claude Code shows you that command and asks you to accept it before it runs. A script has no one to answer that prompt, so pass `--yes` there to accept it. For the other `claude plugin install` flags, see [plugin install](</docs/en/plugins/cli-reference#plugin-install>). ## Add a marketplace @@ -204,7 +204,7 @@ claude plugin install deploy-helper --marketplace your-org/plugins -The shell command adds the marketplace without a confirmation step. A marketplace you’ve already added from that source is reused. A new one is added under the same [organization policy checks](</docs/en/plugins/org#restrict-what-users-can-install>) as `claude plugin marketplace add`, and is declared in your user settings even when you pass `--scope project`. If you haven’t added that marketplace yet, the command prints `Successfully added marketplace: <name> (declared in user settings)` and then installs the plugin. +The shell command adds the marketplace without a confirmation step. A marketplace you’ve already added from that source is reused. A new one is added under the same [organization policy checks](</docs/en/plugins/org#restrict-what-users-can-install>) as `claude plugin marketplace add`, and is declared in your user settings even when you pass `--scope project`. If you haven’t added that marketplace yet, your terminal shows `Added marketplace: <name> (declared in user settings)`, and the command then installs the plugin. ### Add a private marketplace @@ -257,8 +257,8 @@ When you choose **Uninstall** for a plugin that this repository’s `.claude/settings.json` enables, whether from the **Installed** tab or with `/plugin uninstall`, Claude Code asks whether to disable it for you or uninstall it for everyone: - * **Disable for me** : press **y**. Claude Code writes `false` for the plugin in your `.claude/settings.local.json` and leaves it installed for the project. - * **Uninstall for everyone** : press **u**. Claude Code removes the plugin from the shared `.claude/settings.json`. + * **Disable for me** : Claude Code writes `false` for the plugin in your `.claude/settings.local.json` and leaves it installed for the project. + * **Uninstall for everyone** : Claude Code removes the plugin from the shared `.claude/settings.json`. ### See what an installed plugin adds to your sessions @@ -294,7 +294,7 @@ ## Keep plugins updated -Plugins update automatically when the marketplace they came from has auto-update turned on. After a session starts, Claude Code refreshes those marketplaces and updates the on-disk copies of the plugins you installed from them. The running session keeps the versions it already loaded. After an update, you see `Plugin updated: <name> · Run /reload-plugins to apply`, and the next session loads the new versions automatically. These are the auto-update defaults for each kind of marketplace: +Plugins update automatically when the marketplace they came from has auto-update turned on. After a session starts, Claude Code refreshes those marketplaces and updates the on-disk copies of the plugins you installed from them. When you see `Plugin updated: <name> · Run /reload-plugins to apply`, run [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>) in that session. Whether or not you reload, the new versions load on your next launch. These are the auto-update defaults for each kind of marketplace: * **On by default** : `claude-plugins-official` and the other [official marketplace names](</docs/en/plugins/security#official-marketplace-names>) except `knowledge-work-plugins` and `first-party-plugins`, plus marketplaces added from claude.ai. * **Off by default** : every other marketplace, including the community marketplace, third-party marketplaces, and local development marketplaces.
modified Interactive mode View current →
--- a/interactive-mode.md +++ b/interactive-mode.md @@ -22,7 +22,7 @@ `Tab`| Accept an autocomplete suggestion, or add a comment to a permission answer| While autocomplete suggestions are showing in the prompt input, accepts the selected suggestion. On most permission prompts, with **Yes** or **No** focused, opens a comment field on that option, and pressing it again closes the field. See [add a comment when you answer a permission prompt](</docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt>) `Up/Down arrows` or `Ctrl+P`/`Ctrl+N`| Move cursor or navigate command history| When the input spans more than one visual row, whether wrapped or multiline, first moves the cursor within the prompt. Once the cursor is on the first or last visual row, pressing again navigates command history. While you have messages queued, `Up` from the first row instead takes them back `Esc`| Interrupt Claude, or close a dialog| Stop the current response or tool call mid-turn so you can redirect. Claude keeps the work done so far. If you have messages queued, Claude Code sends them next. When a dialog is open, `Esc` closes the dialog. While a footer item is selected, such as a row in the [subagent panel](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) below the prompt, `Esc` [deselects it](</docs/en/keybindings#footer-actions>) instead of interrupting. On a permission prompt, `Esc` declines the action, the same as [**No** without a comment](</docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt>) -`Esc` \+ `Esc`| Clear input draft, or rewind| When the prompt input contains text, double `Esc` clears it and saves the draft to history so `Up` recalls it. When the input is empty, double `Esc` opens the [rewind menu](</docs/en/checkpointing>) to restore or summarize code and conversation from a previous point +`Esc` \+ `Esc`| Clear input draft, or rewind| Outside vim mode, when the prompt input contains text, double `Esc` clears it and saves the draft to history so `Up` recalls it. When the input is empty, double `Esc` opens the [rewind menu](</docs/en/checkpointing>) to restore or summarize code and conversation from a previous point. In vim mode, the menu opens from NORMAL mode `Ctrl+Enter` or `Ctrl+X Ctrl+S`| Send queued messages now| Sends your queued messages, and your draft with them, right away. When Claude Code sends what you queued covers what happens to the turn Claude is working on. In shell mode, the key only queues your command. In terminals that don’t report extended keys, `Ctrl+Enter` arrives as plain `Enter`; `Ctrl+X Ctrl+S` works in any terminal. Requires Claude Code v2.1.275 or later `Shift+Tab`, or `Alt+M` on Windows when the Node or Bun runtime doesn’t enable VT input mode| Cycle permission modes| Cycle through `default` (labeled Manual in the mode indicator), `acceptEdits`, and `plan`, then `bypassPermissions` and `auto` where available. See [permission modes](</docs/en/permission-modes>). On a file permission prompt, the same key closes an open [comment field](</docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt>). With no field open, it selects the option that allows the action for the rest of the session, when the prompt offers that option. At the plan approval prompt, it approves the plan `Option+P` (macOS) or `Alt+P` (Windows/Linux)| Switch model| Switch models without clearing your prompt
modified Draw in the interface with a mod View current →
--- a/interface.md +++ b/interface.md @@ -533,8 +533,8 @@ Element| What it draws| Where ---|---|--- -`Box`| A flex container that takes layout props such as `flexDirection`, [`borderStyle`](</docs/en/plugins/mods/reference#box-border-styles>), and `width`. Spacing props such as `columnGap` and `padding` take a number or a [step name](</docs/en/plugins/mods/reference#box-spacing-steps>) from `'xs'` to `'xl'`.| Everywhere -`Text`| Styled text. Takes `color`, `bold`, `dimColor`, `italic`, `wrap`, and others such as [`weight`](</docs/en/plugins/mods/reference#text-typography>). A `color` is a theme key or a color such as `'red'`. A `wrap` is `'wrap'`, `'truncate'`, `'truncate-start'`, `'truncate-middle'`, or `'truncate-end'`.| Everywhere +`Box`| A flex container that takes layout props such as `flexDirection`, [`borderStyle`](</docs/en/plugins/mods/reference#box-border-styles>), `width`, and `overflowX`. Spacing props such as `columnGap` and `padding` take a number or a [step name](</docs/en/plugins/mods/reference#box-spacing-steps>) from `'xs'` to `'xl'`. `overflowX` requires Claude Code v2.1.326 or later.| Everywhere +`Text`| Styled text. Takes `color`, `bold`, `dimColor`, `italic`, `wrap`, `maxLines`, and others such as [`weight`](</docs/en/plugins/mods/reference#text-typography>). A `color` is a theme key or a color such as `'red'`. A `wrap` is a value such as `'wrap'`, `'truncate'`, `'truncate-start'`, `'truncate-middle'`, `'truncate-end'`, or `'clip'`. `maxLines` and `'clip'` require Claude Code v2.1.326 or later.| Everywhere `Button`| A control that calls `onPress`| Everywhere `Link`, `Code`, `Markdown`| A link with `href` and an optional `label`, a code block, and text formatted the way Claude’s replies are. `Markdown` takes its content in a `text` prop, not in `children`, and needs a `key` when you pass `onLinkPress`.| Everywhere `Input`, `Select`| A text field and a dropdown| Terminal, Desktop, VS Code
modified Customize keyboard shortcuts View current →
--- a/keybindings.md +++ b/keybindings.md @@ -189,7 +189,7 @@ `historySearch:execute`| Enter| Execute selected command `historySearch:cycleScope`| Ctrl+S| Cycle scope: session, project, everywhere -The `historySearch:next`, `historySearch:accept`, `historySearch:cancel`, and `historySearch:execute` defaults apply to the inline history search in the classic renderer, which always searches prompts from all projects. `historySearch:cycleScope` takes effect only in [fullscreen rendering](</docs/en/fullscreen>), where `Ctrl+R` opens a search dialog instead and `Ctrl+S` cycles its scope. The dialog’s other keys are fixed and can’t be rebound: `Enter` or `Tab` places the highlighted match in the prompt input and `Esc` cancels. +`historySearch:accept`, `historySearch:cancel`, and `historySearch:execute` take effect only in the classic renderer’s inline search. That search covers prompts from all projects. `historySearch:cycleScope` takes effect only in [fullscreen rendering](</docs/en/fullscreen>), where `Ctrl+R` opens a search dialog instead and `Ctrl+S` cycles its scope. In the dialog, `Enter` or `Tab` places the highlighted match in the prompt input and `Esc` cancels. ### Task actions
modified Set up Claude Code in a monorepo or large codebase View current →
--- a/large-codebases.md +++ b/large-codebases.md @@ -271,7 +271,7 @@ - Always wrap database tests in a transaction that rolls back - Mock external services in `src/__tests__/mocks/` -A different subdirectory holds different skills the same way: `packages/web/.claude/skills/component-patterns/` describes the frontend’s component conventions instead of testing. When Claude works on a file in `packages/api/`, it loads the api-testing skill. When it works in `packages/web/`, it loads component-patterns. You can also scope a skill by file pattern instead of by placement. The [`paths` frontmatter field](</docs/en/skills#frontmatter-reference>) takes glob patterns, and Claude loads the skill automatically only when it works with matching files. Use this for a skill that lives in the repository root’s `.claude/skills/` but applies only to certain files, such as a database-migration skill scoped to `**/migrations/**`. For more on creating and organizing skills, see [Skills](</docs/en/skills>). +A different subdirectory holds different skills the same way: `packages/web/.claude/skills/component-patterns/` describes the frontend’s component conventions instead of testing. When Claude works on a file in `packages/api/`, it loads the api-testing skill. When it works in `packages/web/`, it loads component-patterns. You can also scope a skill by file pattern instead of by placement. The [`paths` frontmatter field](</docs/en/skills#frontmatter-reference>) takes glob patterns, and Claude loads the skill automatically when it works with matching files. Use this for a skill that lives in the repository root’s `.claude/skills/` but applies only to certain files, such as a database-migration skill scoped to `**/migrations/**`. For more on creating and organizing skills, see [Skills](</docs/en/skills>). ### Keep skills discoverable
modified Roll out an LLM gateway for your organization View current →
--- a/llm-gateway-rollout.md +++ b/llm-gateway-rollout.md @@ -148,7 +148,7 @@ "apiKeyHelper": "/usr/local/bin/get-gateway-key" } -Add the conditional variables from the table to the same `env` block. A managed `ANTHROPIC_BASE_URL` is enforced and cannot be overridden by a developer’s shell export, since Claude Code applies it over the process environment and lower-precedence settings. Don’t include `forceLoginMethod`, `forceLoginOrgUUID`, or `forceLoginGatewayUrl` in managed settings alongside a gateway credential. `forceLoginMethod` or `forceLoginOrgUUID`, with any value, blocks `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, and `apiKeyHelper` at startup, and developers can’t proceed. They see `This machine's managed settings require a first-party login`, or [`Administrator policy requires a Cloud gateway sign-in`](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) when the file sets `forceLoginMethod` to `"gateway"` or sets `forceLoginGatewayUrl`. [Server-managed settings](</docs/en/server-managed-settings#platform-availability>) delivery requires a direct connection to `api.anthropic.com`, so it does not reach gateway-routed sessions. Gateway deployments use this file-based managed settings path, which enforces the same keys. For the credential, distribute one [`apiKeyHelper`](</docs/en/llm-gateway-connect#rotate-credentials-with-apikeyhelper>) command in the managed settings file as shown above; the command authenticates to your secrets store as the local developer, so each machine receives its own key. Alternatively, deliver each developer their key through your existing secrets process and have them set `ANTHROPIC_AUTH_TOKEN` themselves. Some environments need separate delivery: +Add the conditional variables from the table to the same `env` block. Don’t include `forceLoginMethod`, `forceLoginOrgUUID`, or `forceLoginGatewayUrl` in managed settings alongside a gateway credential. `forceLoginMethod` or `forceLoginOrgUUID`, with any value, blocks `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, and `apiKeyHelper` at startup, and developers can’t proceed. They see `This machine's managed settings require a first-party login`, or [`Administrator policy requires a Cloud gateway sign-in`](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) when the file sets `forceLoginMethod` to `"gateway"` or sets `forceLoginGatewayUrl`. For the credential, distribute one [`apiKeyHelper`](</docs/en/llm-gateway-connect#rotate-credentials-with-apikeyhelper>) command in the managed settings file as shown above; the command authenticates to your secrets store as the local developer, so each machine receives its own key. Alternatively, deliver each developer their key through your existing secrets process and have them set `ANTHROPIC_AUTH_TOKEN` themselves. Some environments need separate delivery: * The desktop app reads gateway routing from its third-party inference configuration, not from managed settings; deploy that file through MDM alongside managed settings so desktop sessions route through the gateway too. See the [desktop third-party configuration docs](<https://claude.com/docs/third-party/claude-desktop/configuration>) and the [desktop gateway docs](<https://claude.com/docs/third-party/claude-desktop/gateway>) * CI runners need `ANTHROPIC_BASE_URL` and the credential set in the [runner’s environment](</docs/en/llm-gateway-connect#configure-each-surface>)
modified Plugin loading reference View current →
--- a/loading.md +++ b/loading.md @@ -22,14 +22,14 @@ * `known_marketplaces.json` records each marketplace Claude Code has fetched, with its `source`, `installLocation`, `lastUpdated`, and `autoUpdate`. There is one `known_marketplaces.json` per user, so a marketplace you add in one project is available in every project * `installed_plugins.json` records each install with its `scope`, `installPath`, and `version` * `cache/` holds the plugin files - * **Loaded, in the running session** : the plugin set Claude Code loaded at startup or at the last `/reload-plugins`. Changes to settings or to disk don’t reach this layer until you run `/reload-plugins` or start a new session. That is why `claude plugin update` ends with `Restart to apply changes.` and background updates prompt you with `Run /reload-plugins to apply` + * **Loaded, in the running session** : the plugin set Claude Code loaded at startup or at the last reload. After you install, update, enable, or disable a plugin outside the `/plugin` panel, run [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>) in the session or start a new session ### Plugins and marketplaces that aren’t on disk at session start Plugins load at session start from `installed_plugins.json` and the cache without using the network. After the session starts, Claude Code checks the declared marketplaces in the background: * **A marketplace that settings declare but`known_marketplaces.json` lacks**: Claude Code clones it, then reloads plugins and downloads enabled plugins that aren’t cached yet - * **A declared marketplace whose source changed in settings** : Claude Code re-fetches it from the new source and shows `Plugins changed. Run /reload-plugins to activate.` + * **A declared marketplace whose source changed in settings** : Claude Code re-fetches it from the new source An enabled plugin that neither path fetched and that has no usable cache directory shows `Plugin "<name>" not cached at <path>` in the `/plugin` **Errors** tab. For the fix, see [`Plugin "<name>" not cached at <path>`](</docs/en/plugins/troubleshooting#plugin-not-cached-at>). @@ -130,7 +130,7 @@ Source| Where you set it| Reaches ---|---|--- -`--add-dir`| `.claude/settings.json` or `.claude/settings.local.json` in a directory you pass with `--add-dir`| This session only. Only a `true` value has an effect, and every other source overrides it +`--add-dir`| `.claude/settings.json` or `.claude/settings.local.json` in a directory you pass with `--add-dir`| This session only, and every other source overrides it. Can be skipped until you save trust for the directory `user`| `~/.claude/settings.json`| You, in every project `project`| `.claude/settings.json`| Everyone who clones the repository `local`| `.claude/settings.local.json`| You, in this repository only @@ -145,6 +145,10 @@ ### Enabled in an `--add-dir` directory but not loaded +Until you save trust for the added directory, Claude Code skips its [`extraKnownMarketplaces`](</docs/en/permissions#what-runs-before-you-trust-a-folder>) entries. In an interactive terminal session, it also skips `enabledPlugins` entries set to `true`. Answering the prompt that `--add-dir` shows doesn’t save that trust. To save it, start a session in the directory and accept the [workspace trust dialog](</docs/en/permissions#project-allow-rules-and-workspace-trust>). If no dialog appears, [set the trust key yourself](</docs/en/permissions#what-runs-before-you-trust-a-folder>). The trust check requires Claude Code v2.1.319 or later. + +A directory inside a [pull request worktree](</docs/en/worktrees#branch-from-a-pull-request>) can be skipped even after you trust it, so pass your main checkout’s copy to `--add-dir` instead. + Claude Code reads an `enabledPlugins` entry of `true` in one of the added directory’s files only when that file’s setting sources are on: * **`.claude/settings.json`** : `project` @@ -180,7 +184,7 @@ ## Find plugins on disk -Claude Code keeps plugin files and state records under one plugins root, which is `~/.claude/plugins` unless you set [`CLAUDE_CODE_PLUGIN_CACHE_DIR`](</docs/en/env-vars>). Every path in the table is relative to that root. +Claude Code keeps plugin files and state records under a plugins root, which is `~/.claude/plugins` unless you set [`CLAUDE_CODE_PLUGIN_CACHE_DIR`](</docs/en/env-vars>). Every path in the table except `synced/` and `.trash/` is relative to that root. Those two stay under `~/.claude/plugins`. Path| What it holds ---|--- @@ -306,7 +310,7 @@ ### When auto-update runs -In an interactive session, after you send your first message, Claude Code waits a random delay of up to ten minutes. It then refreshes every marketplace with auto-update on and updates the plugins installed from them on disk. The running session keeps the versions it loaded, and you see `Plugin updated: <name> · Run /reload-plugins to apply`. Whether or not you reload, the new versions load on your next launch. +In an interactive session, after you send your first message, Claude Code waits a random delay of up to ten minutes. It then refreshes every marketplace with auto-update on and updates the plugins installed from them on disk. When you see `Plugin updated: <name> · Run /reload-plugins to apply`, run [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>) in that session. Whether or not you reload, the new versions load on your next launch. #### Which marketplaces and plugins auto-update
modified Control MCP server access for your organization View current →
--- a/managed-mcp.md +++ b/managed-mcp.md @@ -103,7 +103,7 @@ 1. `claude mcp list` shows only the servers in `managed-mcp.json`, plus any you provide through `managedMcpServers`. Two other results mean something is wrong: * If a user’s own servers still appear, Claude Code isn’t reading the file, so check its path and the permissions on its parent directories. - * If the file’s servers don’t appear and the `MCP config diagnostics` section marks the enterprise config as failed to parse, Claude Code can’t read or parse the file. Fix the error that section names, then have the user restart Claude Code. + * If the file’s servers don’t appear and the `MCP config diagnostics` section lists errors for the enterprise config, fix those errors, then have the user restart Claude Code. 2. `claude mcp add --transport http test https://example.com/mcp` fails with `Cannot add MCP server: enterprise MCP configuration is active and has exclusive control over MCP servers`. The URL doesn’t need to be a real server, since the policy check rejects the command before anything is contacted. ### Disable MCP entirely @@ -312,7 +312,7 @@ ### Example configuration -The configuration below sets up a hard allowlist with a denylist. The highlighted lines change how the rest of the list is evaluated, and the callouts after the block explain each one: +The configuration below sets up an allowlist with a denylist. The highlighted lines change how the rest of the list is evaluated, and the callouts after the block explain each one: { "allowedMcpServers": [
modified Deploy managed settings View current →
--- a/managed-settings.md +++ b/managed-settings.md @@ -112,7 +112,11 @@ Claude Code checks the sources in this order, highest priority first: - 1. Remote settings, delivered from claude.ai as [server-managed settings](</docs/en/server-managed-settings>) or by a [Claude apps gateway](</docs/en/claude-apps-gateway>). Claude Code fetches this source only when the session authenticates to Anthropic’s API directly with an [eligible credential](</docs/en/server-managed-settings#platform-availability>), signs in to a gateway with `/login`, or runs in Claude Desktop’s Code tab behind a gateway that [serves that session settings](</docs/en/claude-apps-gateway-config#apply-code-settings-in-the-code-tab>). On other providers, or when `ANTHROPIC_BASE_URL` points somewhere other than Anthropic’s API, it starts at the next source + 1. Remote settings, delivered from claude.ai as [server-managed settings](</docs/en/server-managed-settings>) or by a [Claude apps gateway](</docs/en/claude-apps-gateway>). Claude Code fetches this source only when the session meets one of these conditions: + * It has an [eligible credential](</docs/en/server-managed-settings#platform-availability>) + * It signs in to a gateway with `/login` + * It runs in Claude Desktop’s Code tab behind a gateway that [serves that session settings](</docs/en/claude-apps-gateway-config#apply-code-settings-in-the-code-tab>) +If you set a provider or `ANTHROPIC_BASE_URL`, [check the fetch outcome on a machine](</docs/en/server-managed-settings#verify-settings-delivery>) to see whether Claude Code skips this source 2. MDM or OS-level policies: the macOS plist or the HKLM registry key 3. Managed settings files, `managed-settings.d/*.json` and `managed-settings.json` merged together 4. The HKCU registry, on Windows, and on WSL once the HKLM registry or the Windows managed settings file turns [`wslInheritsWindowsSettings`](</docs/en/settings-reference#wslinheritswindowssettings>) on and the HKCU value also sets it. Claude Code reads it only when no admin document is present above it and no host-supplied parent settings supply a restrictive key @@ -220,6 +224,7 @@ * **Local admin rights** : a developer who is an administrator on the machine can edit the managed source itself, which is why MDM tooling can redeploy the profile or file on a schedule and why the HKLM registry and the macOS managed preferences domain exist. * **The server-managed cache** : server-managed settings come from Anthropic’s servers, and an edit to the local cache [lasts only until the next successful fetch](</docs/en/server-managed-settings#security-considerations>). * **Other tools** : managed settings bind Claude Code only. A developer who calls the API from another tool isn’t under them. + * **Allow rules and allowlists** : a developer can [add entries](</docs/en/settings#lists-merge-instead-of-overriding>) to lists such as `permissions.allow` and `allowedMcpServers`, so deploy the list’s `allowManaged*Only` key where it has one. With [`allowManagedPermissionRulesOnly`](</docs/en/settings-reference#allowmanagedpermissionrulesonly>), move the deny and ask rules you rely on into managed settings too. ## Check that a policy is in force
modified Plugin manifest reference View current →
--- a/manifest-reference.md +++ b/manifest-reference.md @@ -105,7 +105,7 @@ `version`| String| Version string. Setting it keeps users on that version until you change it `description`| String| Short explanation of what the plugin provides `author`| Object| `name`, which is required, plus optional `email` and `url` -`homepage`| String| Documentation URL. Must parse as a URL, or the plugin fails to load +`homepage`| String| Documentation URL. Must parse as a URL `repository`| String| Source repository URL. Not validated `license`| String| SPDX identifier such as `MIT` or `Apache-2.0` `keywords`| Array of strings| Discovery tags @@ -118,6 +118,7 @@ `defaultEnabled`| Boolean| Whether the plugin starts enabled when the user hasn’t set it. Defaults to `true` `engines`| Object| The Claude Code versions that the plugin works on, as a [semver range](<https://github.com/npm/node-semver#ranges>) under the `claude-code` key, such as `"engines": { "claude-code": ">=2.1.400" }`. Requires Claude Code v2.1.323 or later. To keep the plugin working on v2.0.15 through v2.1.75, omit `engines`. Those versions reject the manifest with an `Unrecognized key` error when it has the field `dependencies`| Array of strings or objects| Plugins that must be enabled for this one to work +`network`| Object| The hosts your plugin reaches, such as `"network": { "hosts": ["api.example.com"] }`, in [`sandbox.network.allowedDomains`](</docs/en/settings-reference#sandbox-network-alloweddomains>) syntax. `claude plugin validate` lists them. The field doesn’t allow or block any host. Requires Claude Code v2.1.328 or later `userConfig`| Object| Values Claude Code prompts the user for when the plugin is enabled `types`| Path| A `.d.ts` file that declares the `$.state` values and `$` nouns of a [mod](</docs/en/plugins/mods/reference#files>) `channels`| Array of objects| Message channels the plugin provides, each bound to one of its MCP servers
modified Connect to MCP servers View current →
--- a/mcp-quickstart.md +++ b/mcp-quickstart.md @@ -224,7 +224,7 @@ * For HTTP servers, `url` is the endpoint Claude Code connects to. * For stdio servers, `command` and `args` are the program it runs. -After saving the file, start a new Claude Code session in the project. Claude Code reads `.mcp.json` at startup. The first time Claude Code sees a project-scoped server, it asks you to approve it. The prompt exists so a repository you clone can’t launch processes on your machine without your consent. Approve the prompt. If you dismissed it, run `claude mcp reset-project-choices` and restart Claude Code to see it again. Once you’ve approved, run `/mcp` and check that the servers show as connected. If one shows an error instead, see Troubleshooting. +After saving the file, start a new Claude Code session in the project. Claude Code reads `.mcp.json` at startup. If Claude Code asks you to approve the servers, approve them. If you dismissed the prompt, run `claude mcp reset-project-choices` and restart Claude Code to see it again. Then run `/mcp` and check that the servers show as connected. If one shows an error instead, see Troubleshooting. ## Connect from other surfaces
modified Model configuration View current →
--- a/model-config.md +++ b/model-config.md @@ -237,8 +237,8 @@ * [Cloud sessions](</docs/en/claude-code-on-the-web>), including those you start from the Desktop app, run on Anthropic-managed VMs by default: settings deployed to your device do not reach them, so deliver the allowlist through server-managed settings. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own compute and also read the managed settings file in the runner image. [How Claude Code combines managed sources](</docs/en/managed-settings#how-claude-code-combines-managed-sources>) says when that file applies. A mid-session model switch in a cloud session is rejected when the requested model is excluded by the allowlist. When the `availableModels` list in your server-managed settings is non-empty, the server rejects a request to start a cloud session at claude.ai/code or from the Desktop app on a model the list excludes. * [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions run in cloud environments but don’t receive server-managed settings; in a [self-hosted environment](</docs/en/self-hosted-environments>), they still read the managed settings file in the runner image. To set the model for those sessions, see [Choose the model for a scope](<https://claude.com/docs/claude-tag/admins/customize#choose-the-model-for-a-scope>) in the Claude Tag admin guide. * Cowork, the agentic-work tab in the Claude Desktop app, runs its sessions on Claude Code but, by design, does not receive server-managed settings from the claude.ai admin console. When the `availableModels` list in your server-managed settings is non-empty and a user picks a model outside it, the server rejects that model for a remote Cowork session. A managed settings file applies to Cowork sessions when it is present where the session runs; remote Cowork sessions run on Anthropic-managed VMs, where a device-deployed file is not present. - * Sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) do not receive server-managed settings, so deliver the allowlist through MDM or managed settings files there. - * Delivery from the admin console also requires the session to fetch with an [eligible login](</docs/en/server-managed-settings#platform-availability>) to your organization or an OAuth token issued for it. For fleets that authenticate with API keys, whether configured directly or generated by an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script, deliver the allowlist through MDM or managed settings files. + * For sessions on [third-party providers](</docs/en/server-managed-settings#platform-availability>) such as Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), deliver the allowlist through MDM or managed settings files. + * Delivery from the admin console requires the session to fetch with an [eligible login](</docs/en/server-managed-settings#platform-availability>) to your organization or an OAuth token issued for it. For fleets that authenticate with API keys, whether configured directly or generated by an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script, deliver the allowlist through MDM or managed settings files. * The Desktop Code tab also hosts [SSH sessions](</docs/en/desktop#ssh-sessions>), which read the managed settings file from the remote host they run on. See [Desktop managed settings](</docs/en/desktop#managed-settings>). * The model pickers on claude.ai and in the Desktop app hide or grey out models excluded by your organization’s allowlist. The picker state is a convenience for users; it doesn’t enforce the allowlist. @@ -319,7 +319,7 @@ * Haiku models are always available and can’t be disabled, so every member keeps at least one usable model. * An access change takes effect on new requests within about a minute; the `/model` picker reflects it the next time a session starts. -Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions reach sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments only; on any other provider, use `availableModels` instead. +Both restrictions apply together: a model is selectable only when it is permitted by `availableModels` and not restricted by the organization. Organization restrictions reach sessions on the Anthropic API and [LLM gateway](</docs/en/llm-gateway>) deployments only; with a [gateway credential](</docs/en/llm-gateway#subscriptions-and-gateways>) or on any other provider, use `availableModels` instead. ## Organization default model @@ -345,6 +345,8 @@ * Levels above the cap aren’t offered in the `/effort` picker, and naming a higher level with `--effort` or `/effort` runs at the cap instead. If you start a plain-text `--print` run with `--effort` above the cap, a warning on stderr names the requested and applied levels. In interactive sessions, with `json` or `stream-json` output, or in background agents, that warning goes to the [debug log](</docs/en/errors#configuration-warnings>) instead. * Caps are per model, so switching models can change which levels are available. * When several of your roles grant the same model, the least restrictive cap applies. + * If you see `Your organization limits effort for <model>` and need the higher level, ask an organization admin to raise the limit, then restart Claude Code. + * If a request fails with `API Error: 400 Invalid effort level`, update to v2.1.314 or later and restart. If it still fails, remove any `output_config.effort` key from [`CLAUDE_CODE_EXTRA_BODY`](</docs/en/env-vars#variables>). Effort limits are delivered together with organization model restrictions and reach the same sessions. @@ -369,7 +371,7 @@ * **In plan mode** : uses `opus` for complex reasoning and architecture decisions * **In execution mode** : automatically switches to `sonnet` for code generation and implementation -This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. The plan-mode Opus phase uses the same context window as the `opus` model setting, and the execution phase uses the same window as `sonnet`. When `opus` and `sonnet` resolve to models that run with the 1M context window by default, as the current models do on the Anthropic API, both phases run with it. To request 1M context for both phases where they don’t, set the model to `opusplan[1m]`, for example with `/model opusplan[1m]`. Setting it with `/model` requires Claude Code v2.1.265 or later; on earlier versions, use the `--model` flag or the `model` setting instead. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). +This pairs Opus’s reasoning for planning with Sonnet’s efficiency for execution. To request the 1M context window where `opus` and `sonnet` don’t have it by default, set the model to `opusplan[1m]`, for example with `/model opusplan[1m]`. Setting it with `/model` requires Claude Code v2.1.265 or later; on earlier versions, use the `--model` flag or the `model` setting instead. When `availableModels` excludes the newest Opus but permits an older version, for example `["sonnet", "claude-opus-4-6"]`, `opusplan` uses the newest permitted Opus for planning and stays on Sonnet only when every Opus is excluded. A Haiku session that would normally upgrade to Sonnet in plan mode likewise uses the newest permitted Sonnet, and stays on Haiku only when every Sonnet is excluded. Before v2.1.205, plan mode stayed on the session’s model whenever the newest version of the upgrade family was excluded, even when the allowlist permitted an older one. The substitution of an older permitted version applies on the Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>). On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Mantle, whose deployments use provider-specific model IDs, plan mode stays on the session’s model whenever the upgrade model is excluded. For a hybrid approach where Claude decides mid-task when to consult a second model rather than switching at the plan boundary, see the [advisor tool](</docs/en/advisor>). ### Fallback model chains @@ -545,7 +547,7 @@ #### Effort level of subagents and teammates -On the main conversation’s model, a [subagent](</docs/en/sub-agents#choose-an-effort-level>) or [teammate](</docs/en/agent-teams#specify-teammates-and-models>) with no `effort` of its own runs at the level you pick in the session or set with `--effort`. On another model, that level doesn’t apply. To pick a subagent’s level, set `effort` in its definition. +On the main conversation’s model, a [subagent](</docs/en/sub-agents#choose-an-effort-level>) or [teammate](</docs/en/agent-teams#specify-teammates-and-models>) with [no other level set](</docs/en/sub-agents#when-a-subagent-has-no-effort-field-or-parameter>) runs at the level you pick in the session or set with `--effort`. On another model, that level doesn’t apply. To pick a subagent’s level, set `effort` in its definition. #### Check the effort level you set @@ -772,7 +774,7 @@ export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6[1m]' -With the `[1m]` suffix, the 1M context window applies to all usage of the pinned alias, including the plan-mode Opus phase of `opusplan` and [subagents](</docs/en/sub-agents#choose-a-model>) whose `model` frontmatter names the alias. +With the `[1m]` suffix, the pinned alias runs with the 1M context window. * Claude Code strips the suffix before sending the model ID to your provider. * Only append `[1m]` when the underlying model [supports 1M context](<https://platform.claude.com/docs/en/build-with-claude/context-windows#context-window-sizes-by-model>). @@ -780,7 +782,7 @@ When you set an `ANTHROPIC_DEFAULT_*_MODEL` variable, the `/model` picker shows one row for that model in place of the family’s built-in rows, including any 1M context rows. To reach the 1M window without adding the suffix to that variable, your users run `/model opus[1m]`, and Claude Code applies the suffix to the model the variable names. `/model sonnet[1m]` works the same way. -An `availableModels` allowlist delivered through [MDM or a managed settings file](</docs/en/managed-settings#delivery-mechanisms>) still applies when using third-party providers; [server-managed settings are not delivered there](</docs/en/server-managed-settings#platform-availability>).Filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, map it through `modelOverrides` or list its full provider-form ID: +`availableModels` filtering matches on a model alias such as `opus`, a version prefix such as `claude-opus-4-8`, or the full provider-form model ID. Provider-specific prefixes such as `us.anthropic.` are not stripped, so to allow a specific model, map it through `modelOverrides` or list its full provider-form ID: * **Google Cloud’s Agent Platform** : when the ID Claude Code requests carries an `@` date, such as `claude-sonnet-4-5@20250929`, include the date in your allowlist entry. On its own, `claude-sonnet-4-5` doesn’t match that ID under either [`availableModelsMatch`](</docs/en/settings-reference#availablemodelsmatch>) setting. * **Pinned models** : list the value you set in the model’s `ANTHROPIC_DEFAULT_*_MODEL` variable
modified Monitoring View current →
--- a/monitoring-usage.md +++ b/monitoring-usage.md @@ -413,7 +413,7 @@ * **You set it on the computer that runs Desktop** : Desktop doesn’t pass a value you set there to the SSH session * **You exported it in`/etc/profile` or another file that only login shells read**: the name arrives when you run `claude` from a login shell, but not in a Desktop SSH session. Desktop doesn’t start Claude Code through a login shell. Set the variable under `env` in the [managed settings file](</docs/en/desktop#managed-settings>) on the remote machine instead. - * **A value has a space inside it** : Claude Code then copies none of the keys onto events or datapoints. To see which value has the space, run `/status` in a session on the remote machine. Take the space out of the value. + * **A value has a space inside it** : Claude Code can then leave `host.name` off events and datapoints. To see which value has the space, run `/status` in a session on the remote machine. Take the space out of the value. * **Something else already sets the variable** : in a session that the desktop app starts, a variable already set in the launch environment [takes precedence over settings files](</docs/en/settings-reference#how-env-values-interact-with-your-shell>). The [debug log](</docs/en/debug-your-config>) can name an ignored variable. When a third-party Desktop deployment names an OTLP endpoint in the environment it provides, that environment carries Desktop’s own `OTEL_RESOURCE_ATTRIBUTES`. ### Example configurations @@ -1194,7 +1194,7 @@ * `is_built_in`: Whether the subagent is a built-in agent type * `is_async`: Whether the subagent ran in the [background](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) * `total_tokens`: The token footprint of the subagent’s final API request: that one request’s input, cache creation, cache read, and output tokens, roughly the subagent’s context size at completion. Not a sum across the run - * `total_tool_uses`: Number of tool calls the subagent made across the whole run + * `total_tool_uses`: Number of tool calls the subagent made across the whole run, excluding [`SubagentHandback`](</docs/en/tools-reference>) * `duration_ms`: Run time in milliseconds * `model`: The model the subagent was resolved to run * `final_model`: The model that produced the subagent’s final response, which differs from `model` after a mid-run switch such as a fallback @@ -1220,7 +1220,7 @@ Logged once per run of the retention cleanup sweep, which deletes [session transcripts and other application data](</docs/en/claude-directory#cleaned-up-automatically>) older than the [`cleanupPeriodDays`](</docs/en/settings-reference#cleanupperioddays>) setting. Claude Code runs the sweep in the background at most once per session, and a run that deletes nothing still emits the event. If Claude Code ran the sweep in any session on the same machine in the last 24 hours, it delays this session’s sweep by at least 10 minutes, so a session that exits sooner emits nothing. When you run `claude -p` with `--bare`, Claude Code doesn’t run the sweep and emits nothing. Like every OTel event on this page, it goes only to the telemetry backend you configure. Requires Claude Code v2.1.227 or later. Read `result` to see whether the sweep ran: * `"complete"`: the sweep ran, and the event carries its counts - * `"skipped"`: Claude Code couldn’t safely determine the retention period, so it paused the sweep and the event carries no counts. If `skip_reason` is `"settings_unknowable"` or `"settings_invalid_key_set"`, fix the settings error that `/status` reports on that machine so a later session can run the sweep + * `"skipped"`: Claude Code couldn’t safely determine the retention period, so it paused the sweep and the event carries no counts. If `skip_reason` is `"settings_unknowable"` or `"settings_invalid_key_set"`, fix any settings error that `/status` reports on that machine so a later session can run the sweep When [managed settings](</docs/en/server-managed-settings>) set `cleanupPeriodDays`, the managed value pins the retention period and the sweep runs even when a settings file in a lower-priority scope is broken or invalid. **Event Name** : `claude_code.retention_sweep` **Attributes** : @@ -1233,7 +1233,7 @@ * `used_default`: `"true"` when `period_days` fell back to `30`, `"false"` otherwise. On complete events, `"true"` means the 30-day default applied * `skip_reason`: Why Claude Code paused the sweep. Present only when `result` is `"skipped"`: * `"user_source_disabled"`: User settings are excluded, for example by the [`--setting-sources`](</docs/en/cli-reference#cli-flags>) flag or the SDK’s [`settingSources`](</docs/en/agent-sdk/typescript#options>) option, and no enabled source provides `cleanupPeriodDays` - * `"settings_unknowable"`: A settings file couldn’t be read or parsed, so `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` may be set to a value Claude Code can’t see + * `"settings_unknowable"`: A settings source couldn’t be read or parsed, so `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` may be set to a value Claude Code can’t see * `"settings_invalid_key_set"`: Settings have validation errors and `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` is explicitly set, so falling back to the default could delete or keep files against that setting * `"remote_settings_unknowable"`: A session in Claude Desktop’s Code tab on a third-party deployment requested [server-managed settings](</docs/en/server-managed-settings>). It received no usable response, so `cleanupPeriodDays` may be set to a value Claude Code can’t see * `transcripts_deleted`: Number of session transcripts, the top-level `~/.claude/projects/*/*.jsonl` files, that the sweep deleted
modified Enterprise network configuration View current →
--- a/network-config.md +++ b/network-config.md @@ -131,19 +131,19 @@ Claude Code runs four independent timers that abort a streaming model response when it goes quiet, so a dead connection fails and retries instead of hanging. A request that gets no response headers at all ends in one of two ways: * **Where the first-byte deadline runs** : the first attempt ends no later than that deadline. To change it, set `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`. For the retry’s wait, see [No response from API](</docs/en/errors#no-response-from-api>). - * **On the other connections** : the request ends after 5 to 6 minutes, when the body idle timeout fires, unless you turned that timeout off. To end the request sooner, lower `API_TIMEOUT_MS`. In a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, you can instead end the first attempt sooner by [turning on the first-byte deadline](</docs/en/claude-apps-gateway-deploy#retry-an-unanswered-request-sooner-with-the-first-byte-deadline>). + * **On the other connections** : by default, the request ends after 5 to 6 minutes, when the body idle timeout fires. To end the request sooner, lower `API_TIMEOUT_MS`. In a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, you can instead end the first attempt sooner by [turning on the first-byte deadline](</docs/en/claude-apps-gateway-deploy#retry-an-unanswered-request-sooner-with-the-first-byte-deadline>). Timer| Aborts when| Runs on| Default timeout ---|---|---|--- First-byte deadline| No response headers arrive after Claude Code sends the request| Direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), including through an HTTPS proxy, but not when `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL` routes them through a [gateway](</docs/en/gateways>). Opt-in for a [Claude apps gateway session](</docs/en/claude-apps-gateway-deploy#retry-an-unanswered-request-sooner-with-the-first-byte-deadline>), and on Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API and 300 seconds on Claude Platform on AWS or Amazon Bedrock, plus one second per 32KB of request body Event-level watchdog| No response events parse. Where the byte-level watchdog runs on a connection other than Amazon Bedrock, arriving bytes, including keep-alive pings, also reset this watchdog, for a limited time without a parsed event. That time is about five minutes when bytes arrive at least every 10 seconds. On a Claude apps gateway’s 15-second pings it is about 7.5 minutes, so a pings-only stream ends after about 12.5 minutes at the default timeout.| Every provider| 300 seconds Byte-level watchdog| No bytes arrive on the wire, including SSE keep-alive pings| Direct Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), and [gateway](</docs/en/gateways>) connections, including a custom `ANTHROPIC_BASE_URL`. Opt-in on Amazon Bedrock `vnd.amazon.eventstream` responses with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`; doesn’t run on Google Cloud’s Agent Platform or Microsoft Foundry| 180 seconds on the direct Anthropic API. 300 seconds on Claude Platform on AWS, on Amazon Bedrock, in a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, and through a custom `ANTHROPIC_BASE_URL` -Body idle timeout| No bytes arrive for 5 minutes, counting the wait for response headers| Providers other than the direct Anthropic API, Claude Platform on AWS, and Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` set, unless [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) changes that| 5 minutes +Body idle timeout| No bytes arrive, counting the wait for response headers| Providers other than the direct Anthropic API, Claude Platform on AWS, and Amazon Bedrock with `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1` set, unless [`API_FORCE_IDLE_TIMEOUT`](</docs/en/env-vars>) changes that| 5 minutes If you set `CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK=1`, the byte-level watchdog replaces the body idle timeout on Bedrock rather than running alongside it. `CLAUDE_STREAM_IDLE_TIMEOUT_MS` then also governs how long a Bedrock stream may stay silent before Claude Code treats the connection as dead, within the limits listed below. Arriving bytes still don’t reset the event-level watchdog on Bedrock. With debug logging on, each Bedrock stream then logs a debug message that starts with `wire-heartbeat: _chunkTimes absent`. Configure the timers with these variables, each detailed in the [environment variables reference](</docs/en/env-vars>): * `CLAUDE_ENABLE_STREAM_WATCHDOG` and `CLAUDE_ENABLE_BYTE_WATCHDOG` force the corresponding watchdog on with `1` or off with `0`, within the connections the table lists; neither variable extends a watchdog to a connection type it doesn’t cover. `CLAUDE_ENABLE_BYTE_WATCHDOG` set to `0` also turns off the first-byte deadline. - * `CLAUDE_STREAM_IDLE_TIMEOUT_MS` sets both watchdogs’ timeout. Claude Code raises values below 5 minutes to 5 minutes, and caps the value at 30 minutes for the byte-level watchdog. + * `CLAUDE_STREAM_IDLE_TIMEOUT_MS` sets both watchdogs’ timeout. Claude Code raises values below 5 minutes to 5 minutes, and caps the value at 30 minutes for the byte-level watchdog. Set more than 5 minutes to also lengthen the body idle timeout, up to 30 minutes, on v2.1.328 or later. * `CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS` sets the byte-level watchdog’s timeout without changing the event-level watchdog’s, clamped to between 10 seconds and 30 minutes, and takes precedence over `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for that watchdog. * `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` sets the first-byte deadline. In a Claude apps gateway session, set this variable to [turn the deadline on](</docs/en/claude-apps-gateway-deploy#retry-an-unanswered-request-sooner-with-the-first-byte-deadline>). If you leave the variable unset on another connection where the deadline runs, Claude Code uses the byte-level watchdog’s timeout, so `CLAUDE_STREAM_IDLE_TIMEOUT_MS` and `CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS` change the deadline too. For the limits on the value, see [No response from API](</docs/en/errors#no-response-from-api>). * `API_TIMEOUT_MS` limits the wait for response headers, not how long a response streams after them. Where the first-byte deadline doesn’t run, set `API_TIMEOUT_MS` to a positive value under `300000` to retry an unanswered request in less than 5 minutes. Keep `API_TIMEOUT_MS` above the longest wait for headers, and the longest [non-streaming request](</docs/en/errors#streaming-response-ended-before-any-complete-data-was-received>), that you expect: a request that needs longer times out again on each retry.
modified Manage Claude Code plugins for your organization View current →
--- a/org.md +++ b/org.md @@ -305,7 +305,7 @@ Marketplace owners can attach `relevance` signals to entries so Claude Code suggests the plugin when a project matches. Suggestions from a marketplace appear only when it’s registered on the user’s machine, you list its name in `pluginSuggestionMarketplaces` in managed settings, and you declare its source in the same policy. Declare the source either as the marketplace’s `extraKnownMarketplaces` entry or as an allowlist entry. The official marketplace needs only the name. See [Enable suggestions in managed settings](</docs/en/plugins/relevance#enable-suggestions-in-managed-settings>). -In a cloud session’s conversation, Claude can suggest plugins whether or not you set `pluginSuggestionMarketplaces`. To turn those suggestions off, see [Turn off plugin suggestions](</docs/en/claude-code-on-the-web#turn-off-plugin-suggestions>). +In a cloud session’s conversation or the desktop app’s Code tab, Claude can suggest plugins whether or not you set `pluginSuggestionMarketplaces`. To turn those suggestions off, see [Turn off plugin suggestions](</docs/en/claude-code-on-the-web#turn-off-plugin-suggestions>). ## Audit and review
modified Choose a permission mode View current →
--- a/permission-modes.md +++ b/permission-modes.md @@ -6,14 +6,14 @@ Mode| What runs without asking| Best for ---|---|--- -`default`| Reads only| Reviewing every action yourself, sensitive work +`default`| File reads inside your working directories and other [actions that need no approval](</docs/en/tools-reference>), such as starting a subagent| Sensitive work, unfamiliar code `acceptEdits`| Reads, file edits, and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.)| Iterating on code you’re reviewing `plan`| Reads, plus classifier-approved commands when auto mode is available| Exploring a codebase before changing it `auto`| Everything, with background safety checks| Long tasks, reducing prompt fatigue `dontAsk`| File reads inside your working directories and pre-approved tools; anything that would prompt is denied, though a [mod](</docs/en/plugins/mods/overview>) you installed can still approve some of those calls| Locked-down CI and scripts `bypassPermissions`| Everything| Isolated containers and VMs only -The mode that reviews every action is named **Manual** in the CLI, in `claude --help`, in the VS Code and JetBrains extensions, and in the desktop app. Its config value is `default`, which is what hooks and SDK integrations use. The CLI accepts `manual` as an alias wherever you type the value, for example `claude --permission-mode manual` or `"defaultMode": "manual"`. Each mode has its own rule for writes to protected paths. Modes set the baseline. Layer [permission rules](</docs/en/permissions#manage-permissions>) on top to pre-approve or block specific tools. Deny rules block in every mode, including `bypassPermissions`. Deny and ask rules don’t apply to [`EndConversation`](</docs/en/tools-reference#endconversation-tool-behavior>) as long as Claude still has at least one other tool it can call. Allow rules have no effect in `bypassPermissions`. +The CLI accepts `manual` as an alias for `default` wherever you type the value, for example `claude --permission-mode manual` or `"defaultMode": "manual"`. Each mode has its own rule for writes to protected paths. Modes set the baseline. Layer [permission rules](</docs/en/permissions#manage-permissions>) on top to pre-approve or block specific tools. Deny rules block in every mode, including `bypassPermissions`. Deny and ask rules don’t apply to [`EndConversation`](</docs/en/tools-reference#endconversation-tool-behavior>) as long as Claude still has at least one other tool it can call. Allow rules have no effect in `bypassPermissions`. ### Actions no mode auto-approves @@ -35,7 +35,7 @@ You want to| Start with| Isolation needed| Notes ---|---|---|--- -Review every action yourself| Manual mode: `claude --permission-mode default`| None| Sensitive work, unfamiliar code +Answer permission prompts yourself| Manual mode: `claude --permission-mode default`| None| Sensitive work, unfamiliar code Iterate locally with fewer prompts, without a classifier| Manual mode plus the Bash sandbox in [auto-allow mode](</docs/en/sandboxing#sandbox-modes>): `claude --permission-mode default`, then run `/sandbox` and select auto-allow| The built-in Bash sandbox, on macOS, Linux, and WSL2| Deny rules still apply, and ask rules that name a command, such as `Bash(git push *)`, still prompt. [Auto-allow mode](</docs/en/sandboxing#auto-allow-mode>) covers other commands that can prompt. To turn the sandbox on from a settings file instead, set [`sandbox.enabled`](</docs/en/settings-reference#sandbox-enabled>) and [`sandbox.autoAllowBashIfSandboxed`](</docs/en/settings-reference#sandbox-autoallowbashifsandboxed>) to `true` Explore before changing anything| `claude --permission-mode plan`| None| Claude Code blocks edits until you approve a plan Work hands-off in auto mode| `claude --permission-mode auto`, the built-in starting permission mode with v2.1.283 or later| None; a sandbox or container adds defense in depth| Requires a supported model, and your organization can turn auto mode off @@ -398,7 +398,7 @@ ### The first read outside the working directories -While [`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>) is off, file reads other than [reads from network paths](</docs/en/permissions#network-paths>) run without a prompt in auto mode, including reads outside the [working directories](</docs/en/permissions#working-directories>). The first time Claude uses the Read, Grep, or Glob tool on a path outside them, Claude Code asks whether to allow that read. The prompt doesn’t appear in non-interactive `-p` runs or background sessions; reads there run as before. Whatever you answer, Claude keeps working: +While [`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>) is off, file reads other than [reads from network paths](</docs/en/permissions#network-paths>) run without a prompt in auto mode, including reads outside the [working directories](</docs/en/permissions#working-directories>). The first time Claude uses the Read, Grep, or Glob tool on a path outside them, Claude Code asks whether to allow that read. The prompt doesn’t appear in `-p` runs, Agent SDK sessions, background sessions, the VS Code chat panel, or the desktop app. There, the read runs. Whatever you answer, Claude keeps working: * **Yes, and keep allowing any reads outside the working directories** : the read runs, later reads outside the working directories run as before, and Claude Code records your answer so the prompt doesn’t appear again * **No, and block reads outside the working directories from now on** : the read is refused, and Claude Code sets [`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>) to `true` in your user settings, which makes the file tools refuse such reads in this and every later session and every permission mode. To lift the block, remove the setting from every [settings file](</docs/en/settings#settings-files-and-who-they-affect>) that sets it, then restart each running session. For one directory this session, use `/add-dir`. @@ -407,7 +407,7 @@ ### Boundaries you state in conversation -The classifier treats boundaries you state in the conversation as a block signal. If you tell Claude “don’t push” or “wait until I review before deploying”, the classifier blocks matching actions even when the default rules would allow them. A boundary stays in force until you lift it in a later message. Claude’s own judgment that a condition was met does not lift it. Boundaries are not stored as rules. The classifier re-reads them from the transcript on each check, so a boundary can be lost if [context compaction](</docs/en/costs#reduce-token-usage>) removes the message that stated it. For a hard guarantee, add a [deny rule](</docs/en/permissions#permission-rule-syntax>) instead. +The classifier treats boundaries you state in the conversation as a block signal. If you tell Claude “don’t push” or “wait until I review before deploying”, the classifier blocks matching actions it reviews even when the default rules would allow them. A boundary stays in force until you lift it in a later message. Claude’s own judgment that a condition was met does not lift it. Boundaries are not stored as rules. The classifier re-reads them from the transcript on each check, so a boundary can be lost if [context compaction](</docs/en/costs#reduce-token-usage>) removes the message that stated it. For a hard guarantee, add a [deny rule](</docs/en/permissions#permission-rule-syntax>) instead. ### Approvals you state in conversation @@ -447,7 +447,7 @@ * Ask rules that match on a command’s content, such as `Bash(git push *)`, fall back to a permission prompt * A write that the [symlink check](</docs/en/permissions#symlinks>) resolves to a protected path prompts you when the path Claude requested isn’t itself protected * A read from a [network path](</docs/en/permissions#network-paths>) prompts you even when an allow rule matches - 2. Read-only actions and file edits in your working directory are auto-approved, except writes to protected paths and the first read outside the working directories, which prompts you + 2. Read-only actions and file edits in your working directory are auto-approved, except writes to protected paths and a read that shows the first-read prompt. * In a session with server-side classifier review, file edits, read-only shell commands, and [sandboxed](</docs/en/sandboxing#sandbox-modes>) shell commands wait for that review and are blocked if it flags them * A write inside your working directory that the [symlink check](</docs/en/permissions#symlinks>) resolves to a location outside it prompts you * When Claude reads an [artifact someone else made](</docs/en/artifacts#read-an-artifact-shared-with-you>), the approval cases listed in that section apply @@ -468,7 +468,7 @@ * `Agent` allow rules * [`Monitor`](</docs/en/tools-reference#monitor-tool>) allow rules, because Claude Code runs Monitor commands through the shell -Narrow rules like `Bash(npm test)` stay in effect. Claude Code restores the dropped rules when you leave auto mode. Before v2.1.236, Claude Code left `Monitor` allow rules in effect in auto mode, so a rule that matched the whole tool approved Monitor commands without classifier review.Claude Code can also run `git status` itself before a command that would discard uncommitted work, such as `git reset --hard` or `rm -rf`, and show the classifier whether staged, modified, or untracked work is present. Claude Code reports untracked files in that check even when the repository’s git configuration sets `status.showUntrackedFiles=no`.Under server-side classifier review, `git reset --hard` can be blocked on a clean working tree, because Claude Code can skip `git status` unless auto mode recently blocked an action. After the block, the classifier can see the clean status and allow Claude’s retry.In the classifier requests sent by Claude Code itself, the classifier sees user messages, tool calls other than read-only lookups such as file reads and searches, and your CLAUDE.md content. Tool results are stripped from those requests, so hostile content in a file or web page can’t manipulate the classifier directly.You can annotate a call’s result with a [PostToolUse hook’s `classifierContext` field](</docs/en/hooks#annotate-a-result-for-the-auto-mode-classifier>), which the classifier reads as application-provided context. The field requires Claude Code v2.1.236 or later.A separate server-side probe scans incoming tool results and flags suspicious content before Claude reads it. For more on how these layers work together, see the [auto mode announcement](<https://claude.com/blog/auto-mode>) and the [engineering deep dive](<https://www.anthropic.com/engineering/claude-code-auto-mode>). +Narrow rules like `Bash(npm test)` stay in effect. Claude Code restores the dropped rules when you leave auto mode. Before v2.1.236, Claude Code left `Monitor` allow rules in effect in auto mode, so a rule that matched the whole tool approved Monitor commands without classifier review.Claude Code can also run `git status` itself before a command that would discard uncommitted work, such as `git reset --hard` or `rm -rf`, and show the classifier whether staged, modified, or untracked work is present. Claude Code reports untracked files in that check even when the repository’s git configuration sets `status.showUntrackedFiles=no`.Under server-side classifier review, `git reset --hard` can be blocked on a clean working tree. After the block, the classifier can see the clean status and allow Claude’s retry.In the classifier requests sent by Claude Code itself, the classifier sees user messages, tool calls other than read-only lookups such as file reads and searches, and your CLAUDE.md content. Tool results are stripped from those requests, so hostile content in a file or web page can’t manipulate the classifier directly.You can annotate a call’s result with a [PostToolUse hook’s `classifierContext` field](</docs/en/hooks#annotate-a-result-for-the-auto-mode-classifier>), which the classifier reads as application-provided context. The field requires Claude Code v2.1.236 or later.A separate server-side probe scans incoming tool results and flags suspicious content before Claude reads it. For more on how these layers work together, see the [auto mode announcement](<https://claude.com/blog/auto-mode>) and the [engineering deep dive](<https://www.anthropic.com/engineering/claude-code-auto-mode>). How auto mode handles subagents @@ -484,12 +484,19 @@ ## Allow only pre-approved tools with dontAsk mode -If you set `dontAsk` mode, Claude Code auto-denies every tool call that would otherwise prompt you, though a [mod](</docs/en/plugins/mods/overview>) you installed can still approve some of those calls. To check which calls a mod can approve, see [Extend permissions with hooks](</docs/en/permissions#precedence-among-rules-hooks-and-mods>). Claude still runs actions that need no approval in Manual mode, such as file reads inside your working directories and [read-only Bash commands](</docs/en/permissions#read-only-commands>). Actions matching your `permissions.allow` rules and calls approved by a [PreToolUse hook](</docs/en/permissions#extend-permissions-with-hooks>) run too. Use this mode for CI pipelines or restricted environments where you pre-define what Claude may do; the session never waits for input. The status bar shows `⏵⏵ don't ask on` in this mode. Claude Code denies calls matching your explicit [`ask` rules](</docs/en/permissions#manage-permissions>) rather than prompting. It also denies the built-in `AskUserQuestion` tool even if your allow rules match it, and does the same to connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code. It denies MCP tools marked [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>) the same way, because their approval card needs an answer this mode never collects. An allow rule or `PreToolUse` hook can’t approve these: +If you set `dontAsk` mode, Claude Code auto-denies every tool call that would otherwise prompt you, though a [mod](</docs/en/plugins/mods/overview>) you installed can still approve some of those calls. To check which calls a mod can approve, see [Extend permissions with hooks](</docs/en/permissions#precedence-among-rules-hooks-and-mods>). Don’t rely on `dontAsk` to stop a [tool call a mod makes itself](</docs/en/plugins/mods/reference#mods-api-methods>). Claude still runs actions that need no approval in Manual mode, such as file reads inside your working directories and [read-only Bash commands](</docs/en/permissions#read-only-commands>). Actions matching your `permissions.allow` rules and calls approved by a [PreToolUse hook](</docs/en/permissions#extend-permissions-with-hooks>) run too. Use this mode for CI pipelines or restricted environments where you pre-define what Claude may do. The status bar shows `⏵⏵ don't ask on` in this mode. These calls are denied where you’d otherwise see a prompt: + + * **Your`ask` rules**: Claude Code denies calls matching your explicit [`ask` rules](</docs/en/permissions#manage-permissions>). + * **`AskUserQuestion`** : Claude Code denies this built-in tool even if your allow rules match it. + * **Connector tools[your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>)**: these are denied in sessions where that setting reaches Claude Code. + * **MCP tools marked[`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>)**: these are denied because their approval card needs an answer this mode can’t collect. + +An allow rule or `PreToolUse` hook can’t approve these: * Recognized `rm` and `rmdir` critical-path removals, such as `rm -rf /` and `rm -rf ~` * Reads from a [network path](</docs/en/permissions#network-paths>) -[Cloud sessions](</docs/en/claude-code-on-the-web>) ignore `defaultMode: "dontAsk"`; see bypassPermissions for details. Set it at startup with the flag: +[Cloud sessions](</docs/en/claude-code-on-the-web>) ignore `defaultMode: "dontAsk"`. See bypassPermissions for details. Set it at startup with the flag: claude --permission-mode dontAsk
modified Configure permissions View current →
--- a/permissions.md +++ b/permissions.md @@ -1,4 +1,4 @@ -The Claude Agent SDK provides permission controls to manage how Claude uses tools. Use permission modes and rules to define what’s allowed automatically, and the [`canUseTool` callback](</docs/en/agent-sdk/user-input>) to handle everything else at runtime. +The Claude Agent SDK provides permission controls to manage how Claude uses tools. Use permission modes and rules to define what’s allowed automatically, and the [`canUseTool` callback](</docs/en/agent-sdk/user-input>) to handle calls that still need approval. ## How permissions are evaluated
modified How Claude Code uses prompt caching View current →
--- a/prompt-caching.md +++ b/prompt-caching.md @@ -79,7 +79,7 @@ Mid-session change| Cache| Tool definitions in the next request ---|---|--- A server connects, or a [dynamic tool update](</docs/en/mcp#dynamic-tool-updates>) adds tools| Invalidated| The new definitions are added -A server drops out with no action on your part, such as a stdio server’s process exiting| Kept| The server’s definitions stay unchanged. A call to one of its tools returns an error instead of running, unless Claude Code [starts the server again](</docs/en/mcp#stdio-servers-that-exit-or-fail-to-start>) for that call +A server drops out with no action on your part, such as a stdio server’s process exiting| Kept| The server’s definitions stay unchanged A remote server [reconnects automatically](</docs/en/mcp#automatic-reconnection>) after its connection drops| Kept, unless a request sent while the server reconnects adds the `WaitForMcpServers` tool, which invalidates the cache once| The server’s definitions stay unchanged. A request sent while the server reconnects can add `WaitForMcpServers` when the conversation hasn’t listed it yet, and the tool then stays listed for the rest of the conversation You remove a tool on purpose, such as with a deny rule or by disabling its server in `/mcp`| Invalidated| The definition is removed @@ -124,7 +124,7 @@ [Compaction](</docs/en/context-window#what-survives-compaction>) replaces your message history with a summary. By design, this invalidates the conversation layer: the next request has a new, shorter history that doesn’t share a prefix with the old one. - * **System prompt** : the next request reads this layer from the cache, unless a resumed conversation kept a system prompt that is now out of date. The first time that conversation is compacted, Claude Code switches it to the current prompt, and the next request rebuilds this layer’s cache once. + * **System prompt** : when the conversation’s prompt is current, the next request reads this layer from the cache. If that prompt is out of date, such as after you resume the conversation, Claude Code switches to the current prompt and the next request rebuilds this layer’s cache once. * **Project context** : Claude Code reloads this layer from disk. It’s cached together with the conversation, so after `/compact` or automatic compaction its cache is rebuilt even if its files are unchanged. To produce the summary, Claude Code sends a separate request. The request repeats your conversation’s system prompt, tools, and the history being summarized. It ends with a summarization instruction. While the cache is warm, that request reads your prefix from the cache. A mid-session `/compact` then costs a fraction of what the context size suggests and spends most of its time generating the summary. After a break longer than the cache lifetime, there is no cache left to read, so the summarization request reprocesses that history as uncached input. This is why `/compact` costs the most when you [resume an old session](</docs/en/sessions#resume-a-session>). In both the warm and cold cases, the turn after compaction rebuilds the conversation cache for only the much shorter history, so that turn isn’t the slow part.
modified Agent SDK reference - Python View current →
--- a/python.md +++ b/python.md @@ -804,7 +804,7 @@ `plugins`| `list[SdkPluginConfig]`| `[]`| Load custom plugins from local paths. See [Plugins](</docs/en/agent-sdk/plugins>) for details `sandbox`| `SandboxSettings` ` | None`| `None`| Configure sandbox behavior programmatically. See Sandbox settings for details `setting_sources`| `list[SettingSource] | None`| `None` (CLI defaults: all sources)| Control which filesystem settings to load. Pass `[]` to disable user, project, and local settings. With `skills` set and this field unset, only user and project sources load. Set `setting_sources` explicitly to keep local settings. Endpoint-managed policy loads regardless; server-managed settings are fetched when the session authenticates with an organization credential on an [eligible configuration](</docs/en/server-managed-settings#platform-availability>). For inputs read regardless of this option, see [What settingSources does not control](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) -`skills`| `list[str] | Literal["all"] | None`| `None`| Skills available to the session. Pass `"all"` to enable every discovered skill, or a list of skill names. Pass exact names only. The SDK rejects malformed and wildcard-form names with a `ValueError` before starting the Claude Code process; this check requires Python Agent SDK 0.2.129 or later. When set, the SDK adds the Skill tool to `allowed_tools` automatically. If you also pass `tools`, include `"Skill"` in that list. See [Skills](</docs/en/agent-sdk/skills>) +`skills`| `list[str] | Literal["all"] | None`| `None`| Limits the main agent’s skills. Pass `"all"` to enable every discovered skill, or a list of skill names. Pass exact names only. The SDK rejects malformed and wildcard-form names with a `ValueError` before starting the Claude Code process; this check requires Python Agent SDK 0.2.129 or later. If you also pass `tools`, include `"Skill"` in that list. See [Skills](</docs/en/agent-sdk/skills>) `max_thinking_tokens`| `int | None`| `None`| _Deprecated_ \- Maximum tokens for thinking blocks. Use `thinking` instead `thinking`| `ThinkingConfig` ` | None`| `None`| Controls extended thinking behavior. Takes precedence over `max_thinking_tokens` `effort`| `EffortLevel` ` | None`| `None`| Effort level for thinking depth. See [adjust the effort level](</docs/en/model-config#adjust-effort-level>) @@ -983,7 +983,7 @@ 2. Project settings (`.claude/settings.json`) 3. User settings (`~/.claude/settings.json`) -Programmatic options such as `agents`, `allowed_tools`, and `settings` override user, project, and local filesystem settings. Managed policy settings take precedence over programmatic options. +Permission rules you pass in `allowed_tools` or `settings` [add to](</docs/en/settings#lists-merge-instead-of-overriding>) these files’ rules. For most single values, Claude Code takes the one in `settings` over these files. Managed policy settings take precedence over most programmatic options. ### `AgentDefinition` @@ -1031,7 +1031,7 @@ "default", # Standard permission behavior "acceptEdits", # Auto-accept file edits "plan", # Planning mode - Claude explores and plans - "dontAsk", # Deny anything not pre-approved instead of prompting + "dontAsk", # Deny calls that would otherwise prompt "bypassPermissions", # Bypass permission checks; explicit ask rules still prompt (use with caution) "auto", # A model classifier reviews actions such as shell commands and network requests ] @@ -2268,7 +2268,7 @@ Launches a new agent to handle complex, multi-step tasks autonomously. When Claude leaves `run_in_background` out of an `Agent` call, by default your main agent doesn’t wait for the new agent and a subagent waits: * **From your main agent** : the new agent runs in the background, and the result has `status: "async_launched"`. To make your main agent wait for the new agent instead, see [Choose whether Claude waits for subagents](</docs/en/agent-sdk/subagents#choose-whether-claude-waits-for-subagents>). - * **From one of your subagents** : the calling subagent [waits for the new agent](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>). The new agent runs in the background instead when its definition sets `background` to `True`, or when you [turn fork mode off](</docs/en/sub-agents#turn-fork-mode-on-or-off>) by setting `CLAUDE_CODE_FORK_SUBAGENT` to `0`. + * **From one of your subagents** : the calling subagent [waits for the new agent](</docs/en/sub-agents#let-subagents-spawn-their-own-subagents>). The new agent runs in the background instead when its definition sets `background` to `True`. Before Python SDK v0.2.169, agents that your subagents started also ran in the background by default. That release is the first to bundle Claude Code v2.1.302 or later. **Output (status:`"completed"`):** @@ -2285,7 +2285,7 @@ ], "resolvedModel": str | None, # Model the subagent started on "modelsUsed": list[str] | None, # Models used in order, with consecutive repeats collapsed - "totalToolUseCount": int, # Number of tool calls the agent made + "totalToolUseCount": int, # Number of tool calls the agent made, excluding SubagentHandback calls "totalDurationMs": int, # Execution duration in milliseconds "totalTokens": int, # Token count from the final API request, not the whole run "usage": { # Token usage statistics
modified Recommend plugins for your org View current →
--- a/relevance.md +++ b/relevance.md @@ -3,7 +3,7 @@ These cases are covered on other pages: * **You want to install plugins** : see [Install and manage plugins](</docs/en/plugins/install>) - * **You want to turn suggestions off** : see Understand how plugin relevance works, or for the suggestions Claude makes in a cloud session’s conversation, [Turn off plugin suggestions](</docs/en/claude-code-on-the-web#turn-off-plugin-suggestions>) + * **You want to turn suggestions off** : see Understand how plugin relevance works, or for the suggestions Claude makes in the conversation, [Turn off plugin suggestions](</docs/en/claude-code-on-the-web#turn-off-plugin-suggestions>) Start with the sections for your role:
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -14,8 +14,8 @@ Before using Remote Control, confirm that your environment meets these conditions: * **Subscription** : available on Pro, Max, Ultra, Team, and Enterprise plans. API keys are not supported. On Team and Enterprise, an Owner must first enable the Remote Control toggle in [Claude Code admin settings](<https://claude.ai/admin-settings/claude-code>). - * **Custom roles** : if your Enterprise organization manages your access with [custom roles](<https://support.claude.com/en/articles/13930452>), your roles must give you both the cloud sessions permission and the **Claude Code remote control** permission. If either is missing, starting Remote Control shows `Remote Control is disabled by your organization's policy`. Ask an Owner to check your roles and add what’s missing at [**Organization settings > Roles**](<https://claude.ai/admin-settings/roles>). - * **Authentication** : run `claude` and use `/login` to sign in through claude.ai if you haven’t already. Without an eligible login, `claude remote-control` exits with an error, while `claude --remote-control` still starts an interactive session and shows a Remote Control failure notification shortly after launch. + * **Custom roles** : if your Enterprise organization manages your access with [custom roles](<https://support.claude.com/en/articles/13930452>), your roles must give you both the cloud sessions permission and the **Claude Code remote control** permission. If either is missing, `/remote-control` shows `Remote Control is disabled by your organization's policy`. Ask an Owner to check your roles and add what’s missing at [**Organization settings > Roles**](<https://claude.ai/admin-settings/roles>). + * **Authentication** : run `claude` and use `/login` to sign in through claude.ai if you haven’t already. Without an eligible login, `claude remote-control` exits with an error, while `claude --remote-control` starts an interactive session with Remote Control off. * **API endpoint** : not available in any of these configurations: * You use Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. * You point [`ANTHROPIC_BASE_URL`](</docs/en/env-vars>) at a host other than `api.anthropic.com`, such as an [LLM gateway](</docs/en/llm-gateway>) or proxy. Unset the variable to use Remote Control. @@ -152,8 +152,8 @@ Remote Control only activates when you explicitly run `claude remote-control`, `claude --remote-control`, or `/remote-control`, unless auto-connect is turned on. To turn auto-connect on for every interactive session, run `/config` inside Claude Code and set **Enable Remote Control for all sessions**. The toggle takes three values: - * **`true`** : connect automatically when an interactive session starts. - * **`false`** : turn auto-connect off, though a `true` from [managed settings](</docs/en/managed-settings>) outranks it, because Claude Code saves the choice to your user settings. A `false` in project or local settings (`.claude/settings.json`, `.claude/settings.local.json`) turns auto-connect off even over a managed `true`. + * **`on`** : connect automatically when an interactive session starts. + * **`off`** : turn auto-connect off, though a `true` from [managed settings](</docs/en/managed-settings>) outranks it, because Claude Code saves the choice to your user settings. A `false` in project or local settings (`.claude/settings.json`, `.claude/settings.local.json`) turns auto-connect off even over a managed `true`. * **`default`** : clear your choice and follow your organization’s admin default if one is set, otherwise Claude Code’s current default. If you set `DISABLE_TELEMETRY` or `DO_NOT_TRACK`, see Auto-connect with `DISABLE_TELEMETRY` or `DO_NOT_TRACK` set. The VS Code extension and the Desktop app also have an auto-connect toggle: @@ -167,8 +167,8 @@ With only `DISABLE_TELEMETRY` or `DO_NOT_TRACK` set, your sessions don’t auto-connect through your organization’s admin default or Claude Code’s own default. If something else makes Remote Control unavailable for you, such as [`CLAUDE_CODE_DISABLE_FEATURE_FLAGS`](</docs/en/env-vars#variables>) or an LLM gateway, start with Requirements instead. Before you turn auto-connect on with only `DISABLE_TELEMETRY` or `DO_NOT_TRACK` set, confirm that your Claude Code version meets the requirement for these variables. Then check whether your organization requires Trusted Devices: - * **Not required** : set **Enable Remote Control for all sessions** to `true` in `/config`. - * **Required** : Remote Control isn’t available while `DISABLE_TELEMETRY` or `DO_NOT_TRACK` is set. Unset whichever of the two variables you set. If your sessions still don’t auto-connect, set **Enable Remote Control for all sessions** to `true` in `/config`. + * **Not required** : turn on **Enable Remote Control for all sessions** in `/config`. + * **Required** : Remote Control isn’t available while `DISABLE_TELEMETRY` or `DO_NOT_TRACK` is set. Unset whichever of the two variables you set. If your sessions still don’t auto-connect, turn on **Enable Remote Control for all sessions** in `/config`. ### Resume sessions after stopping the server @@ -354,7 +354,7 @@ You’re not signed in with a claude.ai account, or another credential is taking precedence over your login. The message takes one of these forms: - * Signed out, from `/remote-control` or `--remote-control`: `Remote Control requires a claude.ai subscription.` or `/remote-control requires a claude.ai subscription.` + * Signed out, from `/remote-control`: `Remote Control requires a claude.ai subscription.` or `/remote-control requires a claude.ai subscription.` * Signed out, from `claude remote-control`: `You must be logged in to use Remote Control. Remote Control is only available with claude.ai subscriptions.` * Signed in, but an API key or token is in use: `Remote Control requires claude.ai subscription auth.` followed by the credential in use, such as `ANTHROPIC_API_KEY is set, so this session is using API-key auth`. An `apiKeyHelper` setting and `ANTHROPIC_AUTH_TOKEN` are named the same way. @@ -391,7 +391,7 @@ A policy blocks Remote Control. Check these causes in order: - * **The error mentions`disableRemoteControl`**: your IT administrator has disabled Remote Control on this device through [managed settings](</docs/en/managed-settings>), independent of the organization-wide toggle and of how you’re signed in. + * **The error mentions`disableRemoteControl`**: remove the key from your settings files. If it’s in [managed settings](</docs/en/managed-settings>), ask your administrator. Changing your sign-in or the organization toggle won’t help. * **Your claude.ai plan is Pro, Max, or Ultra** : Claude Code is still signed in under a Team or Enterprise organization from an earlier login, so it checks that organization’s Remote Control policy. Run `/status` to see which plan and organization your sign-in uses. Run `claude auth logout` then `claude auth login` to sign in again under your current plan. * **The message doesn’t say to contact your organization admin** : your organization has the [HIPAA configuration](</docs/en/hipaa-setup>) applied, which turns Remote Control off. To confirm, run `/status` and look for `HIPAA` on the `Organization configuration` line. An Owner sees the **Remote Control** toggle grayed out in [admin settings](<https://claude.ai/admin-settings/claude-code>) and can’t turn it on. If you have questions about the configuration, ask an Owner, who can contact your organization’s Anthropic account team. Before v2.1.267, this case showed “Remote Control isn’t available for your organization due to its compliance policy” instead. * **Remote Control works for others in your organization but not for you** : if your Enterprise organization manages your access with [custom roles](<https://support.claude.com/en/articles/13930452>), your roles can be the cause. Remote Control needs both the cloud sessions permission and the **Claude Code remote control** permission. Ask an Owner to check whether your roles include both and add what’s missing at [**Organization settings > Roles**](<https://claude.ai/admin-settings/roles>). @@ -413,10 +413,10 @@ Claude Code couldn’t fetch your organization’s policy and has no saved copy on this machine to use instead, so it keeps Remote Control off until it can confirm that your organization allows it. This usually happens when you start Claude Code offline or before a VPN connects, or when a proxy interferes with the request. On a slow connection it can also appear while the first request is still in flight. The message takes one of these forms: - * From `/remote-control`, `claude remote-control`, or `claude --remote-control`: `Couldn't verify your organization's policy for remote control. Check your network connection and try again.` + * From `/remote-control` or `claude remote-control`: `Couldn't verify your organization's policy for remote control.` followed by what to do next * From auto-connect when a session starts: `couldn't verify your organization's policy — check your network connection and try again`, prefixed with `Remote Control failed` in the notification and `Remote Control disconnected` in the conversation. The session then leaves Remote Control off. -Restore your network connection, then run `/remote-control` or run the command again. Each attempt checks for the policy again, so you don’t need to restart Claude Code. If the message keeps appearing, run `claude doctor` and read its `Organization policy` line, which says why the policy didn’t load. Before v2.1.281, this state showed `Remote Control is disabled by your organization's policy` instead. +Restore your network connection first. Restart Claude Code if the message says to, then run `/remote-control` or run the command again. If the message keeps appearing, run `claude doctor` and read its `Organization policy` line, which says why the policy didn’t load. Before v2.1.281, this state showed `Remote Control is disabled by your organization's policy` instead. ### ”Remote credentials fetch failed” @@ -440,11 +440,15 @@ ### “The program file this Remote Control started from is gone” -This warning in the terminal running `claude remote-control` means the program file the server started from is missing, and new sessions run the newer version that replaced it. To move the server to that version too, stop it and run `claude remote-control` again. If Claude Code is installed on network storage, restart the server now and follow [Install on network storage](</docs/en/setup#install-on-network-storage>). Otherwise, new sessions start without a restart. When the program file is gone and Claude Code finds no newer version to run, new sessions fail. The terminal shows an error such as `Session failed: spawn error:` followed by an `ENOENT` message. Stop the server, [install Claude Code](</docs/en/setup#install-claude-code>) again if `claude` doesn’t run in your shell, and run `claude remote-control` again. Before v2.1.318, new sessions failed this way even with a newer version installed. +This warning in the terminal running `claude remote-control` means the program file the server started from is missing, and new sessions run the newer version that replaced it. To move the server to that version too, stop it and run `claude remote-control` again. If Claude Code is installed on network storage, restart the server now and follow [Install on network storage](</docs/en/setup#install-on-network-storage>). Otherwise, new sessions start without a restart. When the program file is gone and Claude Code finds no newer version to run, new sessions fail. The terminal shows an error such as `Session failed: program not found:`, or `Session failed: spawn error:` with `ENOENT`. Stop the server, [install Claude Code](</docs/en/setup#install-claude-code>) again if `claude` doesn’t run in your shell, and run `claude remote-control` again. Before v2.1.318, new sessions failed this way even with a newer version installed. ### “Couldn’t reconnect to your Remote Control session” -When you resume a conversation with `claude --resume` or `claude --continue`, Claude Code reconnects to the Remote Control session recorded in that conversation. This message means the reconnection failed for a reason that may be temporary, such as a network interruption or a server error, so Claude Code can’t confirm whether the remote session still exists. Run `/remote-control` to retry the connection, or start a new session with `claude --remote-control` to create a new Remote Control session. Your local session keeps running without Remote Control in the meantime. +When you resume a conversation with `claude --resume` or `claude --continue`, Claude Code reconnects to the Remote Control session recorded in that conversation. This message means the reconnection failed for a reason that may be temporary, such as a network interruption or a server error, so Claude Code can’t confirm whether the remote session still exists. The full message looks like this: + + Couldn't reconnect to your Remote Control session. Retry, or start a fresh session without --resume. + +Run `/remote-control` to retry the connection, or start a new session with `claude --remote-control` to create a new Remote Control session. Your local session keeps running without Remote Control in the meantime. If the server reports that the previous session is gone, you don’t see this message. Claude Code starts a new session in its place or shows `Previous session is unavailable — run /remote-control to start a new one`. ### “Previous session is unavailable — run /remote-control to start a new one”
modified Automate work with scheduled tasks View current →
--- a/routines.md +++ b/routines.md @@ -425,9 +425,9 @@ ### `/schedule` returns “Unknown command” -The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type. Submitting it returns `Unknown command: /schedule`, except in the cases below that note a different answer. The cause is usually one of the following: - - * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, and feature-flag fetching enabled, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login. A profile or federation credential takes precedence too, so switch that off as well +If you submit `/schedule` when one of its requirements isn’t met, you see `Unknown command: /schedule` or a message that says why the command is unavailable. The cause is usually one of the following: + + * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, and feature-flag fetching enabled, submitting `/schedule` shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it, since it takes precedence over a claude.ai login. If you use a profile or federation credential, switch that off as well * You are fully signed out, with no API key or other credential. With feature-flag fetching enabled, submitting `/schedule` shows `/schedule requires a claude.ai subscription. Run /login to sign in with your claude.ai account.` Before v2.1.268, a signed-out session showed the same Claude for Enterprise message as a Console API key * You are inside a cloud session, where submitting `/schedule` answers that the command isn’t available in that environment. Manage scheduled tasks from the [web UI](<https://claude.ai/code/routines>) instead * Your organization’s policy disables [cloud sessions](</docs/en/claude-code-on-the-web>), which scheduled tasks require. In this case, submitting `/schedule` answers [`Cloud sessions are disabled by your organization's policy`](</docs/en/errors#cloud-sessions-are-disabled-by-your-organizations-policy>) instead. Before v2.1.268, it returned `Unknown command: /schedule`
modified Choose a sandbox environment View current →
--- a/sandbox-environments.md +++ b/sandbox-environments.md @@ -4,7 +4,7 @@ ## Compare sandboxing approaches -The first two approaches in the table below run on the host operating system without containers. The rest place Claude Code inside a container or virtual machine. +The first two approaches in the table below run on the host operating system without containers. The rest use a container or virtual machine. Approach| What is isolated| Requires Docker| Setup effort ---|---|---|--- @@ -13,9 +13,9 @@ Dev container| Full development environment| Yes| Medium Custom container| Full development environment| Yes| Medium to high Virtual machine| Full operating system| No| High -Cloud sessions| Full operating system, hosted by Anthropic| No| None; requires a Claude subscription, and a connected GitHub account to clone a GitHub repository +Cloud sessions| By default, shell commands and file edits in a VM hosted by Anthropic| No| None; requires a Claude subscription, and a connected GitHub account to clone a GitHub repository -The [sandboxed Bash tool](</docs/en/sandboxing>) is built into Claude Code and restricts Bash commands. Built-in file tools, MCP servers, and hooks still run directly on your host. Every other approach in the table puts the whole Claude Code process inside the isolation boundary, so file tools, MCP servers, and hooks are restricted too. +The [sandboxed Bash tool](</docs/en/sandboxing>) is built into Claude Code and restricts Bash commands. Built-in file tools, MCP servers, and hooks still run directly on your host. The sandbox runtime and your own container or VM put the whole Claude Code process inside the isolation boundary, so file tools, MCP servers, and hooks are restricted too. Sandbox isolation reduces the impact of a breach, but it does not eliminate risk. Any approach that allows network egress can still leak data the agent can read, and any approach that mounts your project directory writable can still modify that code. Review the [security limitations](</docs/en/sandboxing#security-limitations>) before relying on a sandbox as a hard control.Isolation also does not change what is sent to the model. Your prompts and the files Claude reads are transmitted to the Anthropic API or your configured provider with or without a sandbox. See [Data usage](</docs/en/data-usage>) for what Claude Code sends and how to reduce it. @@ -112,7 +112,7 @@ ## Cloud sessions -A [cloud session](</docs/en/claude-code-on-the-web>) runs in an isolated, Anthropic-managed virtual machine. A network proxy enforces a default allowlist, and a separate proxy holds your GitHub token outside the sandbox while issuing scoped credentials for repository access inside it. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on infrastructure you provision instead, where isolation, egress control, and git credentials are your deployment’s responsibility. Use this approach when you want full VM isolation without provisioning infrastructure yourself, or when you are delegating tasks from a device that does not have a local development environment. It requires: +By default, a [cloud session](</docs/en/claude-code-on-the-web>) runs its shell commands and file edits in an isolated, Anthropic-managed virtual machine. A network proxy enforces a default allowlist, and a separate proxy holds your GitHub token outside the sandbox while issuing scoped credentials for repository access inside it. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on infrastructure you provision instead, where isolation, egress control, and git credentials are your deployment’s responsibility. Use this approach when you want commands to run in a VM without provisioning infrastructure, or when you delegate tasks from a device with no local development environment. It requires: * **Subscription** : a Claude subscription * **GitHub** : a connected GitHub account to work in a GitHub repository. When you launch from the CLI with `--cloud`, you don’t need one if Claude Code [bundles and uploads your local repository](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>)
modified Configure the sandboxed Bash tool View current →
Show diff (104 lines)
--- a/sandboxing.md +++ b/sandboxing.md @@ -184,7 +184,7 @@ * **An ask rule for the parameter** : add an [ask rule](</docs/en/permissions#match-by-input-parameter>) for `Bash(dangerouslyDisableSandbox:true)` to be prompted on Bash retries. You get the prompt in auto mode and `bypassPermissions` mode too, and the rule takes precedence over a matching allow rule * **[`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>)** : [Actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) covers the retries that prompt while it’s on -While commands are refused with a `Sandbox is required` message, Claude Code ignores the `dangerouslyDisableSandbox` parameter and refuses the retry too. +If you use Code Mode, retries in auto mode work differently. See [Limit shell commands with the sandbox](</docs/en/code-mode#limit-shell-commands-with-the-sandbox>). While commands are refused with a `Sandbox is required` message, Claude Code ignores the `dangerouslyDisableSandbox` parameter and refuses the retry too. #### Turn off the retry with strict sandbox mode @@ -338,7 +338,7 @@ When you mask a credential, Claude Code shows sandboxed commands a per-session placeholder called the sentinel, and the sandbox proxy substitutes the real value on outbound requests to hosts you allow. A `deny` entry under Protect credentials blocks the credential instead. For files on macOS, Claude Code blocks the file instead of masking it. The [`sandbox.credentials`](</docs/en/settings-reference#sandbox-credentials>) reference lists every field. Masking requires the following: * **TLS termination** : the proxy substitutes the real value inside request contents, so it has to see them. Set [`network.tlsTerminate`](</docs/en/settings-reference#sandbox-network-tlsterminate>) so the proxy terminates TLS itself. Without it, masking fails without exposing anything: the command still sees only the sentinel, but the sentinel reaches the server unchanged and authentication fails. To check for this misconfiguration, run `claude doctor` in your terminal and look for the `TLS termination is unavailable` warning. - * **An allowed destination** : each `mask` entry can list `injectHosts`, the hosts the real value is allowed to reach. The proxy injects only on connections the domain allowlist admits, so each `injectHosts` host must also be reachable through `network.allowedDomains`. For a `mask` entry with no `injectHosts`, the proxy substitutes the real value on requests to every host in `network.allowedDomains`. + * **An allowed destination** : each `mask` entry can list `injectHosts`, the hosts the real value is allowed to reach. The proxy injects only on connections the domain allowlist admits, so each `injectHosts` host must also be reachable through `network.allowedDomains`. For most `mask` entries with no `injectHosts`, the proxy substitutes the real value on requests to every host in `network.allowedDomains`. * **A trusted settings scope** : masking authorizes the proxy to send your real credential somewhere, so Claude Code honors `mask` entries, `network.tlsTerminate`, [`credentials.allowPlaintextInject`](</docs/en/settings-reference#sandbox-credentials-allowplaintextinject>), `awsPairs`, and `sigv4` only from user settings, managed settings, and the `--settings` flag. It ignores them in a repository’s `.claude/settings.json` or `.claude/settings.local.json`. When your administrator delivers `mask` entries, `network.tlsTerminate`, or `credentials.allowPlaintextInject` through server-managed settings, they count as [settings that need approval](</docs/en/server-managed-settings#security-approval-dialogs>). #### Mask environment variables @@ -370,7 +370,7 @@ #### Re-sign AWS requests -AWS requests carry SigV4 signatures over the request contents, so mask `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` together. The proxy detects a SigV4 request by the access key’s sentinel and re-signs the request with the real values, which requires Claude Code v2.1.221 or later. If you mask only the secret, requests are signed with a placeholder the proxy can’t detect, so they fail at AWS. Claude Code links the conventional `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` variables into one credential automatically when you mask their whole values. If your AWS credential is in variables with other names, group them with [`credentials.awsPairs`](</docs/en/settings-reference#sandbox-credentials-awspairs>), which requires Claude Code v2.1.224 or later. Streaming uploads, presigned URLs, and SigV4A requests carry signatures the proxy can’t recompute. When one of these requests is signed with a masked pair’s placeholder, the proxy fails it rather than forward a broken signature. Requests signed with unmasked credentials aren’t affected. Use [`credentials.sigv4`](</docs/en/settings-reference#sandbox-credentials-sigv4>), which requires Claude Code v2.1.224 or later, to forward one of these request forms instead. AWS still rejects the request, so the calling tool receives AWS’s own rejection response instead of a proxy error. +AWS requests carry SigV4 signatures over the request contents, so mask `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` together. The proxy detects a SigV4 request by the access key’s sentinel. Re-signing a request with the real values requires Claude Code v2.1.221 or later. If you mask only the secret, requests are signed with a placeholder the proxy can’t detect, so they fail at AWS. Claude Code links the conventional `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` variables into one credential automatically when you mask their whole values. If your AWS credential is in variables with other names, group them with [`credentials.awsPairs`](</docs/en/settings-reference#sandbox-credentials-awspairs>), which requires Claude Code v2.1.224 or later. Streaming uploads, presigned URLs, and SigV4A requests carry signatures the proxy can’t recompute. When one of these requests is signed with a masked pair’s placeholder, the proxy fails it rather than forward a broken signature. Requests signed with unmasked credentials aren’t affected. Use [`credentials.sigv4`](</docs/en/settings-reference#sandbox-credentials-sigv4>), which requires Claude Code v2.1.224 or later, to forward one of these request forms instead. AWS still rejects the request, so the calling tool receives AWS’s own rejection response instead of a proxy error. #### Mask credential files @@ -433,11 +433,11 @@ If you set [`allowNestedUserNamespaces`](</docs/en/settings-reference#sandbox-allownestedusernamespaces>) to `true` on Linux or WSL2, don’t rely on protected paths: code from a sandboxed command can end up running outside the sandbox. -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 A git command fails with `unable to unlink old`. +To see most of these paths resolved for your machine, run `/sandbox` and open the **Config** tab, which lists them 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 A git command fails with `unable to unlink old`. #### When the sandbox deletes `HEAD`, `objects`, or `refs` -After a sandboxed command ends, a newer top-level `HEAD`, `objects`, or `refs` entry in your working directory is deleted unless it’s a folder with contents. Newer means the entry wasn’t there when the sandbox last built its configuration: at session start, or after a change such as [`/cd`](</docs/en/commands>). A newer `objects` or `refs` folder with contents is deleted too, with its contents, when a `HEAD` file or symlink was there the last time the sandbox built its configuration. To keep a folder, see A folder named `objects` or `refs` disappears after a command. +After a sandboxed command ends, a newer top-level `HEAD`, `objects`, or `refs` entry in your working directory is deleted unless it’s a folder with contents. Newer means the entry wasn’t there when the sandbox last built its configuration: at session start, or after a change such as [`/cd`](</docs/en/commands>). When a `HEAD` file or symlink was there the last time the sandbox built its configuration, a newer `objects` or `refs` folder is instead renamed to `<name>.claude-sandbox-quarantine-<hex>`. Its contents stay intact. To keep a folder or restore a renamed one, see A folder named `objects` or `refs` disappears after a command. #### Denied paths that pass through a symlink @@ -498,6 +498,13 @@ * **Allow lists** : Claude Code never allows more than you wrote. It rewrites an ambiguous entry to its host-and-port reading when that reading parses cleanly, and may drop the entry entirely rather than widen the allowlist To find ambiguous entries, run `claude doctor` in your terminal and look for the `Sandbox network domain entries have unreliable spellings` warning. Rewrite each ambiguous entry in the bracketed form. + +#### Usernames and passwords in proxy variables + +If a command’s `HTTPS_PROXY` or other proxy URL contains a username and password, check the username and host: + + * **Host`127.0.0.1` or `localhost`, and username `srt` or one that starts with `srt.`**: treat it as the built-in sandbox proxy’s own login, which isn’t one of your credentials + * **Any other username or host** : treat it as one of your own credentials ### OS-level enforcement @@ -566,7 +573,7 @@ The two keys beyond `enabled` control what happens when the sandbox cannot run a command: - * **`failIfUnavailable`** : when the platform doesn’t support the sandbox or the dependency check at startup fails, Claude Code refuses to start rather than falling back to unsandboxed execution + * **`failIfUnavailable`** : when the platform doesn’t support the sandbox or the dependency check at startup fails, Claude Code refuses to start rather than falling back to unsandboxed execution. In an Anthropic-hosted environment, the session can start anyway * **`allowUnsandboxedCommands: false`** : Claude Code ignores the `dangerouslyDisableSandbox` escape hatch, so when a command fails under the sandbox, Claude can’t retry it unsandboxed Consider these additions alongside them: @@ -712,7 +719,12 @@ ### A folder named `objects` or `refs` disappears after a command -A top-level `objects` or `refs` folder that appeared during the session can be deleted after a sandboxed command ends. It doesn’t matter whether a command, Claude, or you created it. To keep a folder, leave something in it. If a `HEAD` file or symlink has been at the top level during the session, move it away, then restart every Claude Code session open there. Before v2.1.307, the folder was deleted even with something in it and no `HEAD`. On an earlier version, [update Claude Code](</docs/en/setup#update-claude-code>). +A top-level `objects` or `refs` folder that appeared during the session can be renamed or deleted after a sandboxed command ends. It doesn’t matter whether a command, Claude, or you created it. Close the Claude Code sessions running in your working directory, because a running session can rename or delete the folder again. Then look there for an entry named `<name>.claude-sandbox-quarantine-<hex>`, such as `objects.claude-sandbox-quarantine-1a2b3c4d5e6f`, and restore the folder before you start a new session: + + * **You find that entry** : the folder was renamed, with its contents intact. Move any top-level `HEAD` file or symlink out of your working directory. Then rename the entry back to `objects` or `refs`. + * **You find no such entry** : the folder was deleted, so create it again. + +To keep a new folder from being renamed, move any top-level `HEAD` file or symlink out of your working directory before you start a new session there. With no `HEAD`, leave something in a folder to keep it. Before v2.1.315, a folder could be deleted with its contents. On an earlier version, [update Claude Code](</docs/en/setup#update-claude-code>). ### Bubblewrap fails to start inside a container @@ -738,19 +750,19 @@ ### 0-byte read-only files appear at `.claude` settings paths, and “Yes, and don’t ask again” doesn’t save -On Linux and WSL2, the sandbox holds a write denial on a file that doesn’t exist yet by creating a 0-byte read-only placeholder there while a sandboxed command runs. The sandbox removes the placeholder afterward. A placeholder stays behind in cases such as these: +On Linux and WSL2, the sandbox holds a write denial on a file that doesn’t exist yet by creating a 0-byte read-only placeholder there while a sandboxed command runs. The sandbox removes the placeholder afterward. A placeholder can stay behind in cases such as these: * The session is killed before that cleanup runs, for example by SIGKILL - * The session exits while a sandboxed command is still running, such as a background command + * The session exits while a sandboxed command is still running Later sessions bind the placeholders read-only again on every start, so a settings write such as saving a permission choice fails at a path where a placeholder remains. Run `claude doctor` in your terminal to list the leftover placeholder files. The [`Sandbox mask files left behind at write-deny paths`](</docs/en/errors#stale-sandbox-mask-files-left-by-a-killed-session>) warning names some of them and counts the rest. Delete each file with `rm` while no other Claude Code session is running in that project. Before v2.1.257, Claude Code left the same placeholders behind when a session was killed, without flagging them. ### `git` over SSH fails with the sandbox on -On macOS, `git fetch`, `git pull`, and `git push` against an SSH remote fail inside the sandbox even when the host is allowed. On Linux and WSL2, they work once the host is allowed. Claude Code tunnels git’s SSH connection through the sandbox proxy, and the macOS tunnel can’t authenticate to that proxy. On Linux and WSL2, check these if the connection still fails: +On macOS, `git fetch`, `git pull`, and `git push` against an SSH remote can fail inside the sandbox even when the host is allowed. On Linux and WSL2, they work once the host is allowed. If the connection still fails, check these: * **The host is allowed on port 22** : an `allowedDomains` entry with no port, such as `"git.example.com"`, covers it - * **Your corporate proxy permits port 22** : if your network requires an upstream proxy, the tunnel goes through it too + * **Your corporate proxy permits port 22** : if your network requires an upstream proxy, the connection goes through it too * **The key is readable as a file** : the sandbox can block the `ssh-agent` socket, and a `denyRead` or `credentials` entry for `~/.ssh` hides your key files On macOS, switch the remote to HTTPS, which needs HTTPS credentials such as a personal access token:
modified Run prompts on a schedule View current →
--- a/scheduled-tasks.md +++ b/scheduled-tasks.md @@ -99,7 +99,7 @@ * **Self-paced loop** : while the loop is waiting for its next iteration, press `Esc` on an empty prompt to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a background session you’ve attached to. A `Pending wakeup cancelled` notice confirms that the loop won’t fire again. * **Fixed-interval loop** : to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don’t stop it, or any task you scheduled by asking Claude directly. A loop you don’t cancel ends when seven days elapse. -In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either. +In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. A self-paced loop can also stop when an iteration ends without Claude scheduling the next one. For one extra iteration about 20 minutes later, see [`CLAUDE_CODE_LOOP_KEEPALIVE`](</docs/en/env-vars#variables>). #### Detach without stopping a loop @@ -194,7 +194,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. * In a [background session](</docs/en/agent-view#from-inside-a-session>), a self-paced loop stops if its next wakeup comes due while the session’s process isn’t running, such as after a crash. When the process starts again, the transcript shows a [notice that the wakeup won’t fire](</docs/en/errors#restarted-after-its-next-loop-wakeup-was-due>). To continue the loop, [reply to the session](</docs/en/agent-view#peek-and-reply>) and ask Claude to keep it running. - * 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. + * When you resume with `claude --resume` or `claude --continue`, Claude Code restores tasks scheduled with `CronCreate`, except expired recurring tasks and one-shot tasks whose time has passed. You also lose session-scoped tasks if you exit between turns by choosing `Exit and stop tasks`. A self-paced `/loop` isn’t restored either. To restart a loop that didn’t come back, run `/loop` again. * A restored recurring task doesn’t fire for the runs it missed while the session wasn’t running. Its next run is the first one due after you resume, and jitter applies to that run. * When you resume with `claude --resume` or `claude --continue`, Claude Code doesn’t restart the background Bash commands and monitors that were running when the session ended. If you still need one, ask Claude to start it again. * 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.
modified Security View current →
--- a/security.md +++ b/security.md @@ -35,7 +35,7 @@ ### Core protections * **Permission system** : In Manual mode, sensitive operations require explicit approval - * **Network command approval** : Commands that fetch content from the web such as `curl` and `wget` are not auto-approved by default. In Manual mode they prompt like any other non-read-only Bash command, so you can still approve once or add an explicit allow rule like `Bash(curl *)`. To stop Claude from running them, add them to [`permissions.deny`](</docs/en/permissions#tool-specific-permission-rules>). A deny rule matches the command [as written](</docs/en/permissions#bash-rule-limits>); for network enforcement that doesn’t depend on the command text, see [sandbox network isolation](</docs/en/sandboxing#network-isolation>) + * **Network command approval** : In Manual mode, commands such as `curl` and `wget` prompt you by default, so you can approve once or add an allow rule like `Bash(curl *)`. To stop Claude from running them, add them to [`permissions.deny`](</docs/en/permissions#tool-specific-permission-rules>). A deny rule matches the command [as written](</docs/en/permissions#bash-rule-limits>); for network enforcement that doesn’t depend on the command text, see [sandbox network isolation](</docs/en/sandboxing#network-isolation>) ### Privacy safeguards @@ -50,7 +50,7 @@ ### Additional safeguards * **Network request approval** : In Manual mode, most tools that make network requests require user approval by default - * **Web page summaries** : For most fetches, WebFetch runs a separate model call over the page, and Claude receives that call’s answer instead of the raw page. See [WebFetch tool behavior](</docs/en/tools-reference#webfetch-tool-behavior>) + * **Web page summaries** : For most WebFetch fetches, a separate model call reads the page, and Claude receives that call’s answer instead of the raw page. See [WebFetch tool behavior](</docs/en/tools-reference#webfetch-tool-behavior>) * **Trust verification** : In an interactive session, Claude Code shows the workspace trust dialog when you start it in a folder you haven’t trusted. Servers in a project’s `.mcp.json` have their own approval prompt, and [Project scope](</docs/en/mcp#project-scope>) lists the sessions that skip it * Note: A `-p` session shows neither prompt. [What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) lists what a repository’s files can run there * Note: When you start Claude Code directly in your home directory, trust acceptance is held for the current session only and is not written to disk, so the prompt reappears on each launch. There is no setting to persist it. Start Claude Code from a project subdirectory instead, where trust acceptance is saved per directory @@ -80,9 +80,8 @@ ## Cloud execution security -When you use [cloud sessions](</docs/en/claude-code-on-the-web>), additional security controls are in place. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own infrastructure, where isolation, network egress, and git credentials are your deployment’s responsibility. In Anthropic-hosted environments: +When you use [cloud sessions](</docs/en/claude-code-on-the-web>), additional security controls are in place. By default, a session runs its shell commands and file edits in an isolated, Anthropic-managed VM. Sessions your organization routes to a [self-hosted environment](</docs/en/self-hosted-environments>) run on your own infrastructure, where isolation, network egress, and git credentials are your deployment’s responsibility. In Anthropic-hosted environments: - * **Isolated virtual machines** : Each cloud session runs in an isolated, Anthropic-managed VM * **Network access controls** : Network access is limited by default and can be configured to be disabled or allow only specific domains * **Credential protection** : GitHub credentials are stored encrypted on Anthropic’s servers and never enter the session VM. The VM holds a short-lived credential scoped to that session, and GitHub traffic goes through an [Anthropic proxy](</docs/en/cloud-environments#github-proxy>) that attaches the GitHub credential on the server side. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for how you grant access * **Push restrictions** : The [GitHub proxy](</docs/en/cloud-environments#github-proxy>) rejects branch deletions and pushes of anything other than a branch, such as a tag. GitHub decides which branches a session can update by applying your repository’s branch protection rules and rulesets to the GitHub access you connected. A rule that access can bypass doesn’t block a session’s push
modified Customize sessions in self-hosted environments View current →
--- a/self-hosted-environments-configuration.md +++ b/self-hosted-environments-configuration.md @@ -266,6 +266,7 @@ `CLAUDE_RUNNER_PRIMARY_REPO_REVISION`| Revision of the session’s first git source: branch, SHA, tag, or full reference name. Empty when unspecified. `CLAUDE_RUNNER_REPO_SOURCES`| JSON array of `{url, revision}` for all the session’s git sources, for hooks that route on a secondary repository. Empty when there are no sources. `CLAUDE_RUNNER_CORRELATION_ID`| The correlation ID supplied at session create, echoed back so the hook can map this work order to the request that created the session. Empty when the session has none. +`CLAUDE_RUNNER_META_<LABEL>`| The session’s value for a label you named with [`--hook-label`](</docs/en/self-hosted-environments-reference#orchestrator-cli-flags>). Can be unset. Read label `size` as `"${CLAUDE_RUNNER_META_SIZE:-}"`. `CLAUDE_RUNNER_CLIENT_PLATFORM`| The client surface that created the session, such as `web_claude_ai`, `desktop_app`, `ios`, or `scheduled_trigger`, for adoption analytics. Unset when the session has no recorded or recognized surface, and for pre-warming requests; check it with `[ -n "${CLAUDE_RUNNER_CLIENT_PLATFORM:-}" ]`, which stays safe under `set -u`. `CLAUDE_RUNNER_SPAWN_REASON`| Why Anthropic sent this spawn request, such as `runner_lost` or `resumed`. Unset when the request carries no well-formed reason, so read it as `"${CLAUDE_RUNNER_SPAWN_REASON:-}"`. Requires Claude Code v2.1.318 or later on the orchestrator @@ -714,7 +715,7 @@ * **Where they land** : the runner writes each supplied hook script to a reserved `hooks/.ccr-launcher/` subdirectory of the session’s config directory and registers the scripts in a separate settings file it passes to the session with `--settings`, leaving the seeded `settings.json` and your own scripts at `hooks/<name>` untouched. The runner recreates the reserved subdirectory for each session and doesn’t seed host content at `~/.claude/hooks/.ccr-launcher/` into sessions. * **Who authors them** : the control plane populates the scripts from fixed constants in its own deployment, never from per-session or third-party input. - * **What still governs them** : hooks delivered through `--settings` enter the ordinary merged hook configuration, not the managed tier, so your managed settings still apply. `disableAllHooks` disables them, and they are not among the categories [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) keeps loaded. + * **What still governs them** : the [managed settings Claude Code applies](</docs/en/managed-settings#how-claude-code-combines-managed-sources>). If you set [`disableAllHooks`](</docs/en/settings-reference#disableallhooks>) there, the supplied hooks don’t run. They aren’t among the categories [`allowManagedHooksOnly`](</docs/en/settings-reference#allowmanagedhooksonly>) keeps loaded. When a person starts their own session, Claude Code downloads the [skills enabled for their claude.ai account](</docs/en/skills#skills-in-cowork-and-cloud-sessions>) into that session’s config directory. A [cloud scheduled task](</docs/en/routines>) run doesn’t get its owner’s skills, and a session that sends model requests to Bedrock or Agent Platform doesn’t download any. For a skill those sessions need, add it to your runner image or, outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) thread, commit it to the repository’s `.claude/skills/`. Outside [Claude Tag](<https://claude.com/docs/claude-tag/overview>) sessions, a session in a self-hosted environment runs with [auto memory](</docs/en/memory#auto-memory>) off by default. For instructions that should carry across sessions, use the `CLAUDE.md` in your runner image or in the repository. The runner’s snapshot of the host’s `~/.claude/` leaves out the `projects/` directory. Auto memory’s default storage location is under that directory. If you put memory files there, the runner doesn’t seed them into sessions, and they don’t turn auto memory on. @@ -742,7 +743,7 @@ * **`--capacity 1`, the default, with the built-in checkout**: the session starts in the first repository in its list of repositories. That repository’s `.claude/settings.json` takes effect as project settings and its `.mcp.json` loads, and the other repositories’ don’t. * **A`--capacity` above one, or a `checkout` hook**: the session starts in a per-session directory that contains the checkouts. No repository’s `.claude/settings.json` takes effect as project settings, no repository’s `.mcp.json` loads, and [`$CLAUDE_PROJECT_DIR`](</docs/en/hooks#reference-scripts-by-path>) in a hook command is that directory, not a checkout. -Each repository’s `CLAUDE.md` loads wherever the session starts. Outside a project thread, its skills load too. The runner passes every repository to Claude Code as an [additional directory](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>), so Claude Code also reads the `enabledPlugins` and `extraKnownMarketplaces` keys from each repository’s `.claude/settings.json`. To run a hook or apply a permission rule in every session, put it in `~/.claude/settings.json` on the runner host. The runner seeds the host file into every session, wherever the session starts. Write a path in a `Read` or `Edit` rule as a `//` absolute or `~/` home-relative [pattern](</docs/en/permissions#read-and-edit>), because other patterns anchor at the settings source or the current directory. +Each repository’s `CLAUDE.md` loads wherever the session starts. Outside a project thread, its skills load too. The runner passes every repository to Claude Code as an [additional directory](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>), so outside a project thread, Claude Code also reads the `enabledPlugins` and `extraKnownMarketplaces` keys from each repository’s `.claude/settings.json`. If you start the runner with [`--trust-workspace false`](</docs/en/self-hosted-environments-reference#runner-cli-flags>), Claude Code skips both keys. Skipping `enabledPlugins` requires Claude Code v2.1.323 or later. To run a hook or apply a permission rule in every session, put it in `~/.claude/settings.json` on the runner host. The runner seeds the host file into every session, wherever the session starts. Write a path in a `Read` or `Edit` rule as a `//` absolute or `~/` home-relative [pattern](</docs/en/permissions#read-and-edit>), because other patterns anchor at the settings source or the current directory. ### Repository-committed permission rules
modified Deploy self-hosted environments to production View current →
--- a/self-hosted-environments-deploy.md +++ b/self-hosted-environments-deploy.md @@ -617,7 +617,7 @@ * **Clone in the image** : build the clone into your runner image at that path. Every fresh container then starts with the warm clone without reusing a disk. * **Clone on a persistent volume** : on runners you pre-lock to one user’s account with [`--lock-to-account`](</docs/en/self-hosted-environments-reference#runner-cli-flags>), point `--base-dir` at a persistent volume, so the disk only ever serves that account. A pre-locked runner never picks up Claude Tag channel sessions, so this option doesn’t apply to runners that serve them. -What the reuse path does and doesn’t guarantee: +To use a clone outside `--base-dir`, pass its real path to [`--repository-folder`](</docs/en/self-hosted-environments-reference#runner-cli-flags>) at `--capacity 1`, such as `--repository-folder acme/api=/volumes/warm/api`. The runner resets the clone’s tracked files for each session. Give each runner its own copy, at the same path on every runner. Start each runner on a fresh copy, or pre-lock a fixed-fleet runner with `--lock-to-account`. What the reuse path does and doesn’t guarantee: * **Clone depth** : build the clone without `--depth`, with or without `--single-branch`. The runner never passes `--depth` when it fetches into a clone with an `origin` remote, even if you set [`CLAUDE_RUNNER_FETCH_DEPTH`](</docs/en/self-hosted-environments-reference#environment-variable-only-settings>). With a full clone, each session downloads only the commits the clone lacks. With a shallow clone, a session on a branch that forked before the clone’s oldest commit downloads that branch’s whole history. * **Tracked changes reset, untracked files persist** : at `--capacity 1`, each session starts from a hard reset that wipes the previous session’s tracked modifications, but the runner never runs `git clean`, so untracked files from the locked owner’s earlier sessions stay in the tree. @@ -800,6 +800,7 @@ * **A session fails to start with`This runner couldn't read`**: the runner asked the git host for a repository with its git credentials and got a not-found answer. The repository doesn’t exist, or those credentials can’t reach the repository. * **If you administer the runner** : give its git credentials read access to the repository, then start a new session. * **If you started the session** : if the repository doesn’t exist, start a new session with the right repository. If the runner can’t reach the repository, ask the runner’s administrator to grant access, then start a new session. + * **A session fails to start with`This runner couldn’t use a folder on its machine`**: check the `[runner:error]` lines in the runner’s log. If the folder is a link to your clone, name the clone with `--repository-folder`. * **Sessions take minutes to start or resume** : one cause is a fresh clone. On a fleet that starts each runner on an empty disk, with no [`checkout` hook](</docs/en/self-hosted-environments-configuration#checkout>), the runner clones the session’s repositories afresh before it starts Claude Code. A session that resumes on an empty disk waits for the same clone again. To skip the fresh clone, supply a pre-warmed checkout. If you already supply one, confirm that the runner uses it. Where the runner makes the clone itself and exits after one session, lower [`CLAUDE_RUNNER_FETCH_DEPTH`](</docs/en/self-hosted-environments-reference#environment-variable-only-settings>) from its default of 50 commits to fetch less history. If you use a hook, it runs in place of the runner’s clone, so look at what your hook does instead. Watch the `claude_code_self_hosted_runner_session_init_duration_seconds` [metric](</docs/en/self-hosted-environments-reference#prometheus-metrics>) to see how long starts take. * **Turns fail with a 401** : when a turn ends with a 401 or 403 from the Anthropic API, the runner fetches a fresh [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/self-hosted-environments-configuration#wrapper-scripts>) from Anthropic and passes it to the session. The failed turn isn’t retried. This token is short-lived, and the runner rotates it over the session’s stdin. When a fetch fails, the runner logs an `inference_token refresh failed` line that says when it will retry, and it keeps retrying for as long as the session runs. If every call starts failing about 30 minutes into a session, a wrapper script has likely severed the session’s stdin, so token rotations can’t reach it; see [Keep stdin and file descriptor 3 attached](</docs/en/self-hosted-environments-configuration#keep-stdin-and-file-descriptor-3-attached>). Before v2.1.274, the runner stopped retrying a failed fetch after a few attempts and waited for the next scheduled one. A failed turn didn’t trigger a fetch, so every turn failed with a 401 until the next scheduled fetch. * **A session shows`The server has refused to renew this session's access to the model`**: the session’s [`CLAUDE_CODE_OAUTH_TOKEN`](</docs/en/self-hosted-environments-configuration#wrapper-scripts>) has expired, and the runner has received HTTP 400 in answer to its requests for a new token. The runner logs `the server has refused to renew the inference_token`. Turns in that session fail. The runner keeps requesting a new token for as long as the session’s process runs:
modified Self-hosted environments reference View current →
--- a/self-hosted-environments-reference.md +++ b/self-hosted-environments-reference.md @@ -39,6 +39,7 @@ `--push-outcome-on-release`| `SELF_HOSTED_RUNNER_PUSH_OUTCOME_ON_RELEASE`| off| On a runner-initiated session end such as a drain or idle release, the runner pushes primary session branches with new commits to `origin` before deleting the workspace. Best-effort; adds 30 seconds to the shutdown budget. Requires git 2.29 or later to resume from them. Restrict push access to `claude/*` refs; see [Resumed sessions lose unpushed work](</docs/en/self-hosted-environments-deploy#resumed-sessions-lose-unpushed-work>). A `checkout` hook’s repositories aren’t pushed; snapshot those from the [`post-session` hook](</docs/en/self-hosted-environments-configuration#post-session>). `--release-idle-session-min <n>`| `SELF_HOSTED_RUNNER_SESSION_IDLE_MS`| `0`| Release a session slot after N minutes of inactivity once a turn finishes or the session waits for the user’s action. [Some sessions don’t count as idle](</docs/en/self-hosted-environments-deploy#some-sessions-don%E2%80%99t-count-as-idle>), so pair with `--kill-session-after-min`. A finished background task keeps the session busy for at most the `SELF_HOSTED_RUNNER_BG_RESULT_GRACE_MS` window. To delay a release, set [`--hold-idle-file`](</docs/en/self-hosted-environments-deploy#keep-an-idle-session-while-its-processes-run>). `0` disables. `--remove-session-state [bool]`| `SELF_HOSTED_RUNNER_REMOVE_SESSION_STATE`| off| Remove a session’s per-session directories under `<base-dir>/_sessions/` when the session ends on this runner, whatever the outcome. [Reuse a pre-warmed checkout](</docs/en/self-hosted-environments-deploy#reuse-a-pre-warmed-checkout>) describes what they hold and who can read them when they stay. The removal is best-effort: the per-session directories stay in place when the runner is killed or reaches its drain deadline before cleanup runs. With the flag on, a failed or interrupted session’s debug log isn’t kept on disk. Requires Claude Code v2.1.268 or later. +`--repository-folder <owner>/<repo>=<folder>`| `SELF_HOSTED_RUNNER_REPOSITORY_FOLDER`| unset| At `--capacity 1`, use `<folder>` as the clone of a repository that no `checkout` hook prepares. Repeatable; comma-separated in the variable. See [Reuse a pre-warmed checkout](</docs/en/self-hosted-environments-deploy#reuse-a-pre-warmed-checkout>). Requires Claude Code v2.1.328 or later. `--retire-at <epoch-seconds>`| `SELF_HOSTED_RUNNER_RETIRE_AT`| unset| Retire the runner at an absolute Unix timestamp in seconds, for infrastructure that kills the runner at a known time; [Runner lifecycle](</docs/en/self-hosted-environments#runner-lifecycle>) describes the release sequence and how to size the margin. Values before 2001 or after the year 5138 are rejected by the flag and ignored by the environment variable. `--server-auto-mode-lists <mode>`| `SELF_HOSTED_RUNNER_SERVER_AUTO_MODE_LISTS`| `no-allow`| Which of the [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) classifier rule lists that the control plane sends with a session may reach that session: `all`, `no-allow`, or `none`. See Auto mode rule lists for what each value applies. An invalid value stops the runner at startup. Requires Claude Code v2.1.295 or later. `--session-stop-grace-sec <n>`| `SELF_HOSTED_RUNNER_SESSION_STOP_GRACE_MS`| `5`| How long to wait for the Claude process to exit cleanly after a session ends, before force-killing it. Raise the value if the child’s own `SessionEnd` hooks need more time. @@ -79,6 +80,7 @@ ---|---|--- `--hook-concurrency <n>`| `4`| Maximum `spawn-runner` hooks running in parallel. Also caps how many spawn requests are claimed per poll. The orchestrator checks for new spawn requests only after every hook it started has finished, so one slow hook delays that orchestrator’s next hooks. `--hook-timeout <sec>`| `60`| Terminate the hook’s process tree after this many seconds. The timeout plus its 5-second kill grace must stay below `--expected-spawn-seconds`; the orchestrator enforces this at startup. +`--hook-label <label>=<values>`| unset| Pass a session’s [`--metadata`](</docs/en/cli-reference#cli-flags>) label to the hook as `CLAUDE_RUNNER_META_<LABEL>`. List allowed values as `size=small,large` or `cpus=1..64`. A spawn request with another value [blocks the session from spawning](</docs/en/self-hosted-environments-configuration#the-spawn-runner-hook>). Fixed-fleet runners ignore labels and can take the session. Repeat per label, identically on every replica. Requires `--min-idle 0` and Claude Code v2.1.328 or later. `--expected-spawn-seconds <sec>`| `120`| Expected p99 time from when the orchestrator receives a spawn request to when the runner registers, including any wait for capacity on your platform. The server enforces a range of 10 to 3600. Sent on every poll as the server-side lease: if no runner registers before it elapses, the session is re-offered with a fresh order ID. All replicas must share this value. `--min-idle <n>`| `0`| Keep at least N idle session slots free by spawning standby runners proactively. `0` disables pre-warming. Pair with the runner’s `--exit-if-unused-min` so surplus standby runners reclaim themselves. `--shutdown-drain-sec <n>`| `0`| On `SIGTERM`, stop polling for spawn requests and give running `spawn-runner` hooks and any unanswered poll up to this many seconds to finish before stopping what’s left. At `0`, stop immediately. Maximum `3600`, which the orchestrator enforces at startup. To choose a value, see [Size `--shutdown-drain-sec` and the orchestrator’s stop timeout](</docs/en/self-hosted-environments-configuration#size-shutdown-drain-sec-and-the-supervisors-stop-timeout-for-the-orchestrator>). Requires Claude Code v2.1.299 or later. @@ -167,12 +169,14 @@ `claude_code_self_hosted_orchestrator_queue_pending_sessions`| Spawn requests claimable right now `claude_code_self_hosted_orchestrator_queue_backing_off_sessions`| Spawn requests in retry backoff after a retryable hook failure `claude_code_self_hosted_orchestrator_queue_circuit_broken_sessions`| Sessions blocked from spawning. Each stays blocked until a user sends it a new message or an Owner retries it from the environment’s **Activity** tab. The count can stay above zero after you fix the cause. Alert if above zero. +`claude_code_self_hosted_orchestrator_sessions_given_up_total{cause}`| Times Anthropic gave up starting a runner for a session, by cause: `lease_expiry`, `retries_exhausted`, or `hook_declined`. Use `SUM` across instances. Requires Claude Code v2.1.328 or later. `claude_code_self_hosted_orchestrator_pool_pending_sessions`| Total sessions waiting on a runner for this environment. Environment-wide aggregate, identical on every orchestrator instance: use `MAX` rather than `SUM` across instances. `claude_code_self_hosted_orchestrator_pool_active_sessions`| Sessions currently assigned to an alive runner in this environment. Environment-wide aggregate, identical on every orchestrator instance: use `MAX` rather than `SUM` across instances. `claude_code_self_hosted_orchestrator_spawn_hooks_total{result}`| Cumulative `spawn-runner` hook outcomes: `ok`, `retryable`, `non_retryable`. Counts orchestrator hook invocations, not session children the runners spawn: not comparable to `sessions_started_total`, since capacity above one, warm pools, and runners spawned again for the same session all diverge the two. `claude_code_self_hosted_orchestrator_spawn_hook_duration_seconds`| Histogram of hook durations `claude_code_self_hosted_orchestrator_warm_hints_dispatched_total`| Standby spawn requests dispatched since process start `claude_code_self_hosted_orchestrator_session_queue_wait_seconds`| Histogram of seconds each session waited in the queue before the orchestrator claimed it for spawn, recorded from the queue-wait timestamp the control plane sends with each session’s spawn request. Use for p50/p99 queue-time alerting. Pre-warming spawns aren’t sampled. +`claude_code_self_hosted_orchestrator_session_queue_wait_by_reason_seconds{reason}`| Histogram of queue waits by [spawn reason](</docs/en/self-hosted-environments-configuration#find-out-why-a-spawn-request-was-sent>), such as `resumed`. Requires Claude Code v2.1.328 or later. `claude_code_self_hosted_orchestrator_clock_skew_seconds`| Local-minus-server clock skew; diagnostic, present once measured `claude_code_self_hosted_orchestrator_scm_connector_connected`| `1` when the SCM connector’s WebSocket is open; `0` while dialing or backing off. Absent when `--scm-connector-host` isn’t set. `claude_code_self_hosted_orchestrator_scm_connector_requests_forwarded_total`| Cumulative HTTP requests proxied to the configured SCM host since process start. Absent when `--scm-connector-host` isn’t set.
modified Test self-hosted environments end to end View current →
--- a/self-hosted-environments-testing.md +++ b/self-hosted-environments-testing.md @@ -176,7 +176,7 @@ ### Long-lived CI host -Run `claude auth login` once interactively on the machine that executes the script, using a dedicated user account for automation. Claude Code stores the token in the OS keychain on macOS, or in `~/.claude/.credentials.json` on Linux and Windows. On a macOS host whose Keychain can’t be written, as is typical in an SSH session where the login Keychain stays locked, Claude Code stores the token in `~/.claude/.credentials.json` there too. See [Credential management](</docs/en/authentication#credential-management>). The CLI refreshes the short-lived access token automatically on each invocation, but the underlying refresh-token grant is capped at 30 days from the initial login, so re-run `claude auth login` interactively on that host every 30 days. +Run `claude auth login` once interactively on the machine that executes the script, using a dedicated user account for automation. Claude Code stores the token in the OS keychain on macOS, or in `~/.claude/.credentials.json` on Linux and Windows. On a macOS host whose Keychain can’t be written, as is typical in an SSH session where the login Keychain stays locked, Claude Code stores the token in `~/.claude/.credentials.json` there too. See [Credential management](</docs/en/authentication#credential-management>). The CLI refreshes the short-lived access token automatically, but the underlying refresh-token grant is capped at 30 days from the initial login. Re-run `claude auth login` interactively on that host before the login’s [earliest end date](</docs/en/authentication#check-when-a-stored-login-ends>). ### Ephemeral CI runners
modified Configure server-managed settings View current →
--- a/server-managed-settings.md +++ b/server-managed-settings.md @@ -148,7 +148,7 @@ ### Settings precedence -Server-managed settings and [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) both occupy the highest tier in the Claude Code [settings hierarchy](</docs/en/settings#settings-precedence>). A key you set here takes precedence over the same key in a user’s own settings files or in a `--settings` value, apart from the [exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>). Within the managed tier, Claude Code by default uses the first source that delivers at least one policy key, checking server-managed settings first and then endpoint-managed settings, apart from the exception keys covered next. [How Claude Code combines managed sources](</docs/en/managed-settings#precedence-within-the-managed-tier>) has the full ranking, the carve-out for the control keys, and the opt-in that applies every source. If the selected source is an MDM policy or managed settings file whose [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings, the helper’s output replaces that source as the only managed configuration for the run. Claude Code doesn’t consult a `policyHelper` configured in MDM or file-based settings while server-managed settings deliver a policy key. If a later fetch finds the server-managed settings removed, Claude Code runs that helper right away instead of at the next launch. The [`policyHelper`](</docs/en/settings-reference#policyhelper>) entry covers what happens when that run fails. If you clear your server-managed configuration in the admin console with the intent of falling back to an endpoint-managed plist or registry policy, be aware that cached settings persist on client machines until the next successful fetch, and the keys that apply only at the next launch, such as `model`, stay in effect until each client relaunches. Run `/status` to see which managed source is active. +Server-managed settings and [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) both occupy the highest tier in the Claude Code [settings hierarchy](</docs/en/settings#settings-precedence>). A key you set here takes precedence over the same key in a user’s own settings files or in a `--settings` value, apart from the [exceptions to managed settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>). Users’ allow rules [merge with yours](</docs/en/settings#lists-merge-instead-of-overriding>). To lock the list, see [What a developer can change](</docs/en/managed-settings#what-a-developer-can-change>). Within the managed tier, Claude Code by default uses the first source that delivers at least one policy key, checking server-managed settings first and then endpoint-managed settings, apart from the exception keys covered next. [How Claude Code combines managed sources](</docs/en/managed-settings#precedence-within-the-managed-tier>) has the full ranking, the carve-out for the control keys, and the opt-in that applies every source. If the selected source is an MDM policy or managed settings file whose [`policyHelper`](</docs/en/settings-reference#policyhelper>) supplies managed settings, the helper’s output replaces that source as the only managed configuration for the run. Claude Code doesn’t consult a `policyHelper` configured in MDM or file-based settings while server-managed settings deliver a policy key. If a later fetch finds the server-managed settings removed, Claude Code runs that helper right away instead of at the next launch. The [`policyHelper`](</docs/en/settings-reference#policyhelper>) entry covers what happens when that run fails. If you clear your server-managed configuration in the admin console with the intent of falling back to an endpoint-managed plist or registry policy, be aware that cached settings persist on client machines until the next successful fetch, and the keys that apply only at the next launch, such as `model`, stay in effect until each client relaunches. Run `/status` to see which managed source is active. ### Per-key exceptions across managed sources
modified Settings files and precedence View current →
--- a/settings.md +++ b/settings.md @@ -34,7 +34,7 @@ * **Managed** : your organization deploys it. You don’t create or edit it. * **Shared project** : a project that already uses Claude Code may have one committed. If not, create it at `.claude/settings.json` in the project folder. - * **User** and **Project local** : create them yourself, or let Claude Code create them. It writes `~/.claude/settings.json` the first time you change an option in the `/config` menu that it stores in user settings, such as the theme, and `.claude/settings.local.json` the first time you give a standing approval on a permission prompt, such as “Yes, and don’t ask again” for a Bash command. A few `/config` options, including **Show tips** , save to `.claude/settings.local.json` instead of the user file. + * **User** and **Project local** : create them yourself, or let Claude Code create them. It writes `~/.claude/settings.json` when you save a user setting, such as the theme. It writes `.claude/settings.local.json` when you give a standing approval on a permission prompt, such as “Yes, and don’t ask again” for a Bash command. On Windows, `~/.claude` means `%USERPROFILE%\.claude`. To keep the home-directory files somewhere else, set [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>); Claude Code then stores your settings, session history, and plugins there instead. @@ -80,7 +80,7 @@ Run `/config` inside Claude Code and open the **Config** tab. It lists a short set of personal options such as theme, editor mode, and verbose output, not every settings key. Select an option to change it; Claude Code saves it for you: * **Most options** : `~/.claude/settings.json` - * **A few options, such as Show tips** : `.claude/settings.local.json` + * **Output style** : `.claude/settings.local.json` * **The[global config options](</docs/en/settings-reference#global-config-settings>)**: `~/.claude.json` To set one option without the menu, pass `key=value`, such as `/config verbose=true`. @@ -243,7 +243,7 @@ ## Settings in cloud sessions -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: +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. That changes which settings reach it: * **Cloud threads in a project** : in a cloud thread in a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>), none of a repository’s `.claude/settings.json` permission rules, hooks, or `env` apply, however many repositories the project has. [What threads pick up from your repositories](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>) lists what to use instead. * **Shared project settings** (`.claude/settings.json`): read in a session with one repository outside a project’s threads, because the file is part of the clone and the session starts inside it. Commit a setting there to apply it in those sessions.
modified All settings View current →
Show diff (161 lines)
--- a/settings-reference.md +++ b/settings-reference.md @@ -76,7 +76,7 @@ `disabledMcpjsonServers`| Reject specific servers from a project’s [`.mcp.json`](</docs/en/mcp#project-scope>)| MCP| Any file `disableMobileSimulatorTools`| Block Claude’s tools in the [desktop](</docs/en/desktop>) iOS Simulator pane| Tools| Managed `disableRemoteControl`| Turn off [Remote Control](</docs/en/remote-control>) everywhere it can start| Remote, desktop, and notifications| Any file -`disableRemotePreviewScripts`| Turn off scripts in the [desktop](</docs/en/desktop#preview-html-files-in-ssh-and-wsl-sessions>) app’s HTML previews in SSH and WSL sessions| Remote, desktop, and notifications| Managed +`disableRemotePreviewScripts`| Turn off scripts in the Browser pane’s HTML previews in the [desktop](</docs/en/desktop#preview-html-files-in-ssh-and-wsl-sessions>) app’s SSH and WSL sessions| Remote, desktop, and notifications| Managed `disableSideloadFlags`| Reject the CLI flags that sideload [plugins](</docs/en/plugins/overview>), [subagents](</docs/en/sub-agents>), and [MCP servers](</docs/en/mcp>)| Enterprise and managed settings| Managed `disableSkillShellExecution`| Stop [skills](</docs/en/skills>) and custom commands from running inline shell| Plugins and skills| Any file `disableWorkflows`| Turn [dynamic workflows](</docs/en/workflows>) off for everyone; use `enableWorkflows` for yourself| Hooks and automation| Any file @@ -1058,7 +1058,7 @@ * **Scope** : `Any file`. `auto` and `bypassPermissions` don’t take effect from project or local settings, so set them in `~/.claude/settings.json` instead. Before v2.1.257, `bypassPermissions` took effect from any file. For conversations the VS Code extension starts, Claude Code reads only user, managed, and `--settings` values. * **Type** : string, one of: - * `"default"`: Claude Code runs only reads without asking + * `"default"`: Claude Code runs file reads inside your working directories and [some other actions](</docs/en/permission-modes#available-modes>) without asking * `"acceptEdits"`: Claude Code also runs file edits and common filesystem commands such as `mkdir` and `mv` without asking * `"plan"`: Claude Code reads and plans but blocks edits until you approve a plan * `"auto"`: Claude Code runs without routine prompts; before actions such as shell commands and network requests run, a background classifier checks that they align with your request @@ -1820,7 +1820,7 @@ `onExtractNoMatch`| `"warn"`, `"deny"`, or `"error"`; default `"warn"`. On an entry with `decode`, only `"warn"` is accepted| What happens when `extract` matches nothing. `warn` passes the variable through unmasked, `deny` unsets it inside the sandbox, and `error` stops sandbox setup until you fix the configuration. Requires v2.1.224 or later `decode`| the string `"jwt"`| Verify the whole value is a JWT and replace it with a structurally valid fake token, so code inside the sandbox that decodes the token keeps working; the proxy substitutes the whole real token on egress. A value that doesn’t verify passes through unmasked with a warning. Requires v2.1.224 or later `maskClaims`| array of strings, at least one claim name; requires `decode`| Mask only the named top-level payload claims inside the decoded JWT and rebuild the token around the modified payload, so the other claims stay readable. When no named claim matches, the variable passes through unmasked with a warning. Requires v2.1.224 or later -`injectHosts`| array of strings, each a host that `sandbox.network.allowedDomains` also admits| Narrow the hosts where the sandbox proxy substitutes the real value. When unset, the proxy substitutes it on requests to every host in `sandbox.network.allowedDomains`. Write an IPv6 destination as the bare compressed address, such as `"::1"`, not the bracketed form; see [IPv6 destinations in `injectHosts`](</docs/en/sandboxing#ipv6-destinations-in-injecthosts>) +`injectHosts`| array of strings, each a host that `sandbox.network.allowedDomains` also admits| List the hosts where the sandbox proxy substitutes the real value. For most variables with no `injectHosts`, the proxy substitutes the real value on requests to every host in `sandbox.network.allowedDomains`. Write an IPv6 destination as the bare compressed address, such as `"::1"`, not the bracketed form; see [IPv6 destinations in `injectHosts`](</docs/en/sandboxing#ipv6-destinations-in-injecthosts>) This masks only the password inside `DATABASE_URL`, unsets the variable if the pattern matches nothing, and masks a JWT in `SERVICE_JWT` while leaving every claim except `api_key` readable: @@ -1895,7 +1895,7 @@ Each named variable must be a whole-value `mask` entry in `sandbox.credentials.envVars`, without `extract` or `decode`, and can fill only one slot across all pairs. These rules also apply: - * The proxy re-signs requests on the hosts listed in the access key ID entry’s `injectHosts` + * The proxy can re-sign requests on the hosts listed in the access key ID entry’s `injectHosts` * When `sessionTokenVar` is set, the proxy sends the real token as `x-amz-security-token` on re-signed requests * Naming any of the conventional variables in a pair replaces the automatic pairing @@ -3384,11 +3384,11 @@ ### `attribution.sessionUrl` -Choose whether Claude Code appends the claude.ai session link when it commits or opens a pull request from a [cloud](</docs/en/claude-code-on-the-web>) or [Remote Control](</docs/en/remote-control>) session. Claude Code adds the link as a `Claude-Session` trailer on commits and as a link in pull request descriptions. Set it to `false` to omit the link. - - * **Scope** : `Any file` - * **Type** : Boolean - * `true`: Claude Code appends the claude.ai session link when it commits or opens a pull request from a cloud or Remote Control session +Choose whether Claude Code tells Claude to add the claude.ai session link to commits and pull requests from a [cloud](</docs/en/claude-code-on-the-web>) or [Remote Control](</docs/en/remote-control>) session. The setting covers a `Claude-Session` trailer on commits and a URL in pull request descriptions. Set it to `false` to omit the link. + + * **Scope** : `Any file` + * **Type** : Boolean + * `true`: Claude Code tells Claude to add the link * `false`: Claude Code omits the link * **Default** : `true` @@ -3728,7 +3728,7 @@ ] } -An empty array blocks every channel plugin. This key takes effect once channels pass the `channelsEnabled` gate for the account: on Team and Enterprise plans, and on Console accounts with managed settings, that means `channelsEnabled: true`. See [Restrict which channel plugins can run](</docs/en/channels#restrict-which-channel-plugins-can-run>). +An empty array blocks every channel plugin unless a user loads it with [`--dangerously-load-development-channels`](</docs/en/channels#restrict-which-channel-plugins-can-run>). This key takes effect once channels pass the `channelsEnabled` gate for the account: on Team and Enterprise plans, and on Console accounts with managed settings, that means `channelsEnabled: true`. See [Restrict which channel plugins can run](</docs/en/channels#restrict-which-channel-plugins-can-run>). ### `blockedMarketplaces` @@ -4252,9 +4252,9 @@ Allowlist the MCP servers people can add. Claude Code blocks any server that doesn’t match an entry wherever it’s defined, including plugin servers, servers a user passes with `--mcp-config`, and servers from claude.ai. Built-in servers such as Claude in Chrome, the `ide` server Claude Code connects to in a running [VS Code](</docs/en/vs-code#the-built-in-ide-mcp-server>) or [JetBrains](</docs/en/jetbrains#the-built-in-ide-mcp-server>) IDE, and servers the CLI itself configures are exempt from the allowlist, and the denylist still applies to them. On Claude Code v2.1.268 or later, a [Claude Tag](</docs/en/claude-tag>) session’s Slack tools are also exempt from the allowlist, and the denylist still applies to them. In-process `type: "sdk"` servers are exempt from both lists; the [app that started the session](</docs/en/mcp#how-connectors-reach-claude-code>) registers them. Servers your organization delivers are also exempt from the allowlist, and the denylist still applies to them. The exemption covers every `managedMcpServers` entry, and any [`managed-mcp.json`](</docs/en/managed-mcp#exclusive-control-with-managed-mcp-json>) entry whose values use [no `${VAR}` expansion outside `env`](</docs/en/managed-mcp#how-allowlists-and-denylists-apply-to-the-managed-set>). See [How a server is evaluated](</docs/en/managed-mcp#how-a-server-is-evaluated>) for the full check order. Before v2.1.259, servers from `managed-mcp.json` had to match too. - * **Scope** : `Any file`. Entries from every file merge into one allowlist unless `allowManagedMcpServersOnly` is set. Deploy it in managed settings to enforce it. + * **Scope** : `Any file`. For servers users add, entries from every file merge into one allowlist unless `allowManagedMcpServersOnly` is set. To keep users from adding entries, deploy both keys in managed settings. * **Type** : array of objects, each with exactly one key. Use `serverName`, a string limited to letters, numbers, hyphens, and underscores; `serverCommand`, an array of the command and its arguments matched exactly; or `serverUrl`, a URL pattern with `*` wildcards - * **Default** : unset, so every server is allowed; an empty array blocks every server users add + * **Default** : unset, so every server is allowed; an empty merged list blocks every server users add This example allows only the stdio server that the listed `npx` command starts: @@ -4351,8 +4351,8 @@ * **Scope** : `Any file`. In a folder whose trust dialog you haven’t accepted, Claude Code honors it from user settings, managed settings, and `--settings` and ignores it in the shared project file, both in the session and for `claude mcp list` and `claude mcp get`; [Project server approvals and workspace trust](</docs/en/mcp#project-server-approvals-and-workspace-trust>) says when an untracked `.claude/settings.local.json` counts too. * **Type** : Boolean * `true`: Claude Code approves every MCP server defined in project `.mcp.json` files without a prompt - * `false`: Claude Code asks you to approve each server. In a trusted folder, a `false` in a higher-precedence file overrides a `true` in a lower one; in a folder you haven’t trusted, a `true` in any honored file is enough - * **Default** : unset, so Claude Code asks you to approve each server + * `false`: interactive terminal sessions ask you to approve each [pending](</docs/en/mcp#server-status>) server. See [Project scope](</docs/en/mcp#project-scope>) for some sessions that connect it without asking and how to keep it out. In a trusted folder, a `false` in a higher-precedence file overrides a `true` in a lower one; in a folder you haven’t trusted, a `true` in any honored file is enough + * **Default** : unset, so interactive terminal sessions ask the same way settings.json @@ -4643,7 +4643,7 @@ * **Type** : Boolean * `true`: Claude can send a push notification to your phone when it decides one is worth sending * `false`: Claude doesn’t send those notifications - * **Default** : `false` + * **Default** : unset, so Claude Code uses the value saved to your account, or `false` if none is saved settings.json @@ -4734,7 +4734,7 @@ ### `disableRemoteControl` -Turn off [Remote Control](</docs/en/remote-control>): Claude Code then refuses `claude remote-control`, the `--remote-control` flag, auto-start, and the in-session toggle, and reports that your organization’s policy disabled it. Place it in [managed settings](</docs/en/managed-settings>) for per-device MDM enforcement. +Turn off [Remote Control](</docs/en/remote-control>): Claude Code then refuses `claude remote-control`, the `--remote-control` flag, auto-start, and the in-session toggle. Place it in [managed settings](</docs/en/managed-settings>) for per-device MDM enforcement. * **Scope** : `Any file` * **Type** : Boolean @@ -4750,11 +4750,11 @@ ### `disableRemotePreviewScripts` -Keep scripts from running when people [preview an HTML file](</docs/en/desktop#preview-html-files-in-ssh-and-wsl-sessions>) from an SSH or WSL session in the desktop app. External browsing in the Browser pane is unaffected. The desktop app reads this key; the terminal CLI ignores it. Requires Claude Desktop v5.1231.0 or later. Earlier versions ignore the key: to stop the scripts there, also set `disableBrowserExternalNavigation`, which turns off external browsing too. +Keep scripts from running when people [preview an HTML file](</docs/en/desktop#preview-html-files-in-ssh-and-wsl-sessions>) in the desktop app’s Browser pane from an SSH or WSL session. External browsing in that pane is unaffected. The desktop app reads this key; the terminal CLI ignores it. Requires Claude Desktop v5.1231.0 or later. Earlier versions ignore the key: to stop the scripts there, also set `disableBrowserExternalNavigation`, which turns off external browsing too. * **Scope** : `Managed`. The desktop app doesn’t read the key from the remote machine or the WSL distribution. * **Type** : Boolean; only the JSON Boolean `true` takes effect - * `true`: HTML previews in SSH and WSL sessions don’t run scripts + * `true`: in SSH and WSL sessions, HTML previews in the Browser pane don’t run scripts * `false`: the key doesn’t turn scripts off * **Default** : unset, so the key has no effect @@ -4792,7 +4792,7 @@ * **Scope** : `Any file`. Claude Code also reads a value left in `~/.claude.json` by older versions. * **Type** : Boolean - * **Default** : `false` + * **Default** : unset, so Claude Code uses the value saved to your account settings.json @@ -5222,7 +5222,7 @@ ### `disableBrowserExternalNavigation` -Turn off external browsing in the desktop app’s [Browser pane](</docs/en/desktop#browse-external-sites>) for people and Claude alike. Localhost dev server previews keep working. HTML previews in SSH and WSL sessions still open, but they [don’t run scripts](</docs/en/desktop#turn-off-scripts-in-ssh-and-wsl-previews-for-your-organization>). The desktop app reads this key; the terminal CLI ignores it. +Turn off external browsing in the desktop app’s [Browser pane](</docs/en/desktop#browse-external-sites>) for people and Claude alike. Localhost dev server previews keep working. The Browser pane’s HTML previews in SSH and WSL sessions still open, but they [don’t run scripts](</docs/en/desktop#turn-off-scripts-in-ssh-and-wsl-previews-for-your-organization>). The desktop app reads this key; the terminal CLI ignores it. * **Scope** : `Managed` * **Type** : Boolean; only the JSON Boolean `true` takes effect @@ -5434,12 +5434,12 @@ ### `parentSettingsBehavior` -Choose whether Claude Code applies managed settings supplied by an embedding host process, such as the Agent SDK or an IDE extension, when an admin-deployed managed tier is also present. With `"first-wins"`, Claude Code drops the host-supplied settings; with `"merge"`, it applies them under the admin tier through a restrictive-only filter. Set `"merge"` when a host needs to pass its own restrictions to the sessions it launches, for example Claude Desktop delivering a gateway’s egress allowlist. +Choose whether Claude Code applies managed settings supplied by an embedding host process, such as the Agent SDK or an IDE extension, when an admin-deployed managed tier is also present. Set `"merge"` when a host needs to pass its own restrictions to the sessions it launches, for example Claude Desktop delivering a gateway’s egress allowlist. * **Scope** : `Managed`. Claude Code reads it from the highest-priority admin-controlled managed source. * **Type** : string, one of: * `"first-wins"`: Claude Code drops the host-supplied settings when an admin-deployed managed tier is present - * `"merge"`: Claude Code applies the host-supplied settings under the admin tier through a restrictive-only filter + * `"merge"`: Claude Code applies the host-supplied settings under the admin tier through a filter that keeps restrictive keys. Unless you [set the `allowManaged*Only` locks](</docs/en/claude-apps-gateway#restrict-parent-settings>), permission allow rules and sandbox allowlists pass too * **Default** : `"first-wins"` managed-settings.json @@ -5448,7 +5448,7 @@ "parentSettingsBehavior": "merge" } -This key has no effect when no admin-deployed managed tier exists: the host’s settings then apply as the only managed tier, still filtered to restrictive values. For the filter’s limits and how the managed sources interact, see [Parent settings from embedding hosts](</docs/en/managed-settings#parent-settings-from-embedding-hosts>) and [Restrict parent settings](</docs/en/claude-apps-gateway#restrict-parent-settings>). +This key has no effect when no admin-deployed managed tier exists: the host’s settings then apply as the only managed tier, still filtered. For the filter’s limits and how the managed sources interact, see [Parent settings from embedding hosts](</docs/en/managed-settings#parent-settings-from-embedding-hosts>) and [Restrict parent settings](</docs/en/claude-apps-gateway#restrict-parent-settings>). ### `policyHelper`
modified Extend agents with skills View current →
--- a/skills.md +++ b/skills.md @@ -17,7 +17,7 @@ ## Use skills with the Agent SDK -Set the `skills` option on `query()` to control which skills Claude can invoke in the session. When omitted, discovered skills are enabled and the Skill tool is available, matching CLI behavior. Pass `"all"` to let Claude invoke every discovered skill, a list of skill names to allow only those, or `[]` to let Claude invoke none. For example, to let Claude invoke only two named skills: +Set the `skills` option on `query()` to control which skills Claude can invoke in the main conversation. When omitted, discovered skills are enabled and the Skill tool is available, matching CLI behavior. Pass `"all"` to let Claude invoke every discovered skill, a list of skill names to allow only those, or `[]` to let Claude invoke none. For example, to let Claude invoke only two named skills: Python @@ -29,7 +29,7 @@ ### Set up skills in a session -When you set `skills`, the SDK adds the Skill tool to `allowedTools` automatically. If you also pass an explicit `tools` list, include `"Skill"` in that list so Claude can invoke skills. Once configured, Claude automatically discovers skills from the filesystem and invokes them when relevant to the user’s request. The following example enables every discovered skill in a session and pre-approves the tools that skills commonly need. The example sets `cwd` to the process’s current working directory, so run it from inside a project that has a `.claude/skills/` directory in the current directory or any parent up to the repository root: +When you set `skills`, the SDK adds the skills you enable to `allowedTools` automatically. If you also pass an explicit `tools` list, include `"Skill"` in that list so Claude can invoke skills. Once configured, Claude automatically discovers skills from the filesystem and invokes them when relevant to the user’s request. The following example enables every discovered skill in a session and pre-approves the tools that skills commonly need. The example sets `cwd` to the process’s current working directory, so run it from inside a project that has a `.claude/skills/` directory in the current directory or any parent up to the repository root: Python @@ -81,7 +81,7 @@ * **Plugin skills** : `plugin:skill` * **Name clashes in`additionalDirectories` or `add_dirs`**: a skill in one of those directories gets a [prefixed name](</docs/en/skills#how-a-skill-gets-its-command-name>) when its name clashes with an enterprise, personal, or project skill, or one in a directory added earlier. List it by that name. With a `verify` skill in `../api` and `../web`, added in that order, and no other `verify` skill, list them as `verify` and `web:verify`. Requires Claude Code v2.1.309 or later -The list takes exact skill names only. If an entry can’t work as an exact name, `query()` rejects the list before the session starts. See Invalid skill name error for the name rules and the error each SDK raises. The model doesn’t see unlisted skills and the Skill tool rejects them, while their files remain on disk and stay reachable through Read and Bash. Restricting the list doesn’t restrict dispatch by name. To let Claude invoke every discovered skill, pass `skills: "all"` rather than a wildcard. +The list takes exact skill names only. If an entry can’t work as an exact name, `query()` rejects the list before the session starts. See Invalid skill name error for the name rules and the error each SDK raises. The model doesn’t see unlisted skills and the Skill tool rejects them, while their files remain on disk and stay reachable through Read and Bash. Restricting the list doesn’t restrict subagents or dispatch by name. To let Claude invoke every discovered skill, pass `skills: "all"` rather than a wildcard. ## Commands in Agent SDK sessions
modified Create custom subagents View current →
--- a/sub-agents.md +++ b/sub-agents.md @@ -110,7 +110,7 @@ Use the code-improver agent to suggest improvements in this project -Claude delegates to your new subagent, which scans the codebase and returns improvement suggestions. In the transcript, the delegation appears as a tool call row showing the subagent’s name followed by a short task description, such as `code-improver(Suggest code improvements)`.If Claude can’t find the new subagent, restart Claude Code and try again. This happens only when `~/.claude/agents/` didn’t exist before the session started, because a running session doesn’t detect a newly created `agents` directory. +Claude delegates to your new subagent, which scans the codebase and returns improvement suggestions. In the transcript, the delegation appears as a tool call row showing the subagent’s name followed by a short task description, such as `code-improver(Suggest code improvements)`.If Claude can’t find the new subagent, restart Claude Code and try again. You now have a subagent you can use in any project on your machine to analyze codebases and suggest improvements. You can also write subagent files by hand, define them via CLI flags, or distribute them through plugins. The following sections cover all configuration options. @@ -182,9 +182,8 @@ Subagent files use YAML frontmatter for configuration, followed by the system prompt in Markdown: -Claude Code watches `~/.claude/agents/` and `.claude/agents/`. When you add or edit a subagent file on disk, or ask Claude to write one for you, Claude Code detects the change within a few seconds and the next delegation uses the updated definition, with no restart needed.Three cases still need a restart: - - * The watcher covers only directories that existed when the session started, so after creating a scope’s first agent file in a new `agents` directory, restart to load it. +Claude Code watches `~/.claude/agents/` and `.claude/agents/`. When you add or edit a subagent file on disk, or ask Claude to write one for you, Claude Code detects the change within a few seconds and the next delegation uses the updated definition, with no restart needed.Some cases still need a restart: + * Claude Code doesn’t watch `.claude/agents/` inside directories added with `--add-dir` or `/add-dir`, so after adding or editing a subagent there, restart to load the change. * Sessions started with `--disable-slash-commands` don’t watch these directories at all. @@ -200,7 +199,7 @@ You are a code reviewer. When invoked, analyze the code and provide specific, actionable feedback on quality, security, and best practices. -The frontmatter defines the subagent’s metadata and configuration. The body becomes the system prompt that guides the subagent’s behavior. Subagents receive only this system prompt plus basic environment details like the working directory, not the Claude Code system prompt. In [non-interactive mode](</docs/en/headless>), pass [`--append-subagent-system-prompt`](</docs/en/cli-reference#cli-flags>) to append your text to the end of every subagent’s system prompt, nested subagents included, apart from a forked subagent, which reuses the conversation’s own prompt. Requires Claude Code v2.1.205 or later. If your text is too long to pass on the command line, save it to a file and pass the path with `--append-subagent-system-prompt-file` instead. The file flag requires Claude Code v2.1.261 or later. A subagent starts in the main conversation’s current working directory. Within a subagent, `cd` commands don’t persist between Bash or PowerShell tool calls and don’t affect the main conversation’s working directory. To give the subagent an isolated copy of the repository instead, set `isolation: worktree`. A subagent with `isolation: worktree` runs its Bash and PowerShell commands inside its worktree. A command whose working directory resolves to your main checkout instead, for example because the worktree directory was removed while the subagent was running, fails with an error. This working-directory check covers the whole repository containing the directory you launched Claude Code from. When your session runs in a linked [worktree](</docs/en/worktrees>) of its own, the check also covers the main checkout that worktree is linked from. For Bash commands, Claude Code also checks the command itself in two ways: +The frontmatter defines the subagent’s metadata and configuration. The body becomes the system prompt that guides the subagent’s behavior. Subagents receive this system prompt plus basic environment details like the working directory, not the Claude Code system prompt. In [non-interactive mode](</docs/en/headless>), pass [`--append-subagent-system-prompt`](</docs/en/cli-reference#cli-flags>) to append your text to the end of every subagent’s system prompt, nested subagents included, apart from a forked subagent, which reuses the conversation’s own prompt. Requires Claude Code v2.1.205 or later. If your text is too long to pass on the command line, save it to a file and pass the path with `--append-subagent-system-prompt-file` instead. The file flag requires Claude Code v2.1.261 or later. A subagent starts in the main conversation’s current working directory. Within a subagent, `cd` commands don’t persist between Bash or PowerShell tool calls and don’t affect the main conversation’s working directory. To give the subagent an isolated copy of the repository instead, set `isolation: worktree`. A subagent with `isolation: worktree` runs its Bash and PowerShell commands inside its worktree. A command whose working directory resolves to your main checkout instead, for example because the worktree directory was removed while the subagent was running, fails with an error. This working-directory check covers the whole repository containing the directory you launched Claude Code from. When your session runs in a linked [worktree](</docs/en/worktrees>) of its own, the check also covers the main checkout that worktree is linked from. For Bash commands, Claude Code also checks the command itself in two ways: * It blocks a command that redirects git into the main checkout. * It refuses a command when it can’t verify from the command text that any git the command runs stays inside the worktree, for example when the command name is computed at runtime. @@ -337,7 +336,13 @@ #### When a subagent has no `effort` field or parameter -On the main conversation’s model, the subagent runs at the level you pick in the session, such as with `/effort`, or set with `--effort`. On another model, [that level doesn’t apply](</docs/en/model-config#effort-level-of-subagents-and-teammates>). To choose its level, set the `effort` field. +A subagent other than a fork, forked skill, or teammate runs at the first of these that applies to it: + + 1. The level in `CLAUDE_CODE_EFFORT_LEVEL`, if you set it + 2. The `effort` set for the subagent that spawned it, or a level set only for the current turn, such as a [skill’s `effort`](</docs/en/skills#frontmatter-reference>) + 3. The level in [`CLAUDE_CODE_SUBAGENT_EFFORT`](</docs/en/env-vars#variables>), if you set it + +With none of these, a subagent on the main conversation’s model runs at the level you pick in the session, such as with `/effort`, or set with `--effort`. On another model, [that level doesn’t apply](</docs/en/model-config#effort-level-of-subagents-and-teammates>). To choose its level, set the `effort` field. ### Control subagent capabilities @@ -352,11 +357,12 @@ * `EndConversation`, which can end only the main conversation; see [EndConversation tool behavior](</docs/en/tools-reference#endconversation-tool-behavior>) * `EnterPlanMode` * `ExitPlanMode`, unless the subagent’s `permissionMode` is `plan` + * `propose_skills` * `ScheduleWakeup` * `WaitForMcpServers` * `Workflow` -The second filter applies to subagents running in the background. Apart from `Agent` and `ExitPlanMode`, which follow the first filter’s conditions wherever the subagent runs, a background subagent keeps every MCP tool but only these built-in tools: `Read`, `Grep`, `Glob`, `LSP`, `Bash`, `PowerShell`, `Edit`, `Write`, `NotebookEdit`, `WebFetch`, `WebSearch`, `TodoWrite`, `Skill`, `ToolSearch`, `EnterWorktree`, `ExitWorktree`, `Monitor`, `TaskStop`, `SendMessage`, and `Artifact`, plus [`SubagentHandback`](</docs/en/tools-reference>) for a subagent that reports through it. Claude Code removes every other built-in tool from a background subagent, whether inherited or listed in the `tools` field, so the same definition can resolve to different tools in the foreground and the background. The removal reports no error unless it leaves the `tools` list [resolving to nothing](</docs/en/errors#agent-would-be-spawned-with-zero-tools>). Before v2.1.280, background subagents couldn’t use `LSP`. [`ListAgents`](</docs/en/cross-session-messaging>) follows these filters like any built-in tool: a foreground subagent inherits it in sessions where cross-session messaging is enabled, and a background subagent doesn’t keep it. Teammates in [agent teams](</docs/en/agent-teams>) additionally keep the task tools and cron tools: `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, `CronCreate`, `CronDelete`, and `CronList`. In a [session without the Task tools](</docs/en/tools-reference#task-tool-availability>), Claude Code doesn’t provide the task tools to subagents either, even when the subagent runs a different model. An in-process teammate follows your session the same way. To find out whether a split-pane teammate has the task tools, see [Task tool availability](</docs/en/tools-reference#task-tool-availability>). +The second filter applies to subagents running in the background. `Agent` and `ExitPlanMode` follow the first filter’s conditions wherever the subagent runs. A background subagent keeps every MCP tool, and [`SubagentHandback`](</docs/en/tools-reference>) if it reports through that tool. It also keeps `Read`, `Grep`, `Glob`, `LSP`, `Bash`, `PowerShell`, `Edit`, `Write`, `NotebookEdit`, `WebFetch`, `WebSearch`, `TodoWrite`, `Skill`, `ToolSearch`, `EnterWorktree`, `ExitWorktree`, `Monitor`, `TaskStop`, `SendMessage`, `Artifact`, `ListPlugins`, `ListSkills`, `SearchPlugins`, and `SearchSkills`. Don’t rely on other built-in tools in a background subagent: Claude Code removes most of them, whether inherited or listed in the `tools` field. The removal reports no error unless it leaves the `tools` list [resolving to nothing](</docs/en/errors#agent-would-be-spawned-with-zero-tools>). Before v2.1.280, background subagents couldn’t use `LSP`. [`ListAgents`](</docs/en/cross-session-messaging>) follows these filters like any built-in tool: a foreground subagent inherits it in sessions where cross-session messaging is enabled, and a background subagent doesn’t keep it. Teammates in [agent teams](</docs/en/agent-teams>) additionally keep the task tools and cron tools: `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, `CronCreate`, `CronDelete`, and `CronList`. In a [session without the Task tools](</docs/en/tools-reference#task-tool-availability>), Claude Code doesn’t provide the task tools to subagents either, even when the subagent runs a different model. An in-process teammate follows your session the same way. To find out whether a split-pane teammate has the task tools, see [Task tool availability](</docs/en/tools-reference#task-tool-availability>). #### Restrict which tools a subagent can use @@ -761,7 +767,7 @@ * When a subagent finishes successfully, Claude Code removes its row immediately and, except in [screen reader mode](</docs/en/accessibility>), shows `/tasks to see subagents` in the footer for 30 seconds. During those 30 seconds, run [`/tasks`](</docs/en/commands>) and press `Enter` on the subagent to open its transcript. Before v2.1.232, Claude Code kept the row for 30 seconds after the subagent finished, the same as a failed one, and showed no footer hint. * When a subagent fails or you stop it, Claude Code keeps its row for 30 seconds. To clear the row sooner, select it and press `x`. -A background subagent that completes stays listed in [`/tasks`](</docs/en/commands>), marked done and sorted below running work, for the same 30 seconds as the footer hint. Its detail view stays open when the subagent finishes. Subagents that fail or that you stop leave the list. Before v2.1.208, a completed subagent left the list the moment it finished and its detail view closed. +A background subagent that completes stays listed in [`/tasks`](</docs/en/commands>), marked done and sorted below running work, for 30 seconds, or longer if you messaged it. Its detail view stays open when the subagent finishes. Subagents that fail or that you stop leave the list. Before v2.1.208, a completed subagent left the list the moment it finished and its detail view closed. You can reopen the transcripts of some subagents that have left the list. Run `/tasks` in the terminal. If a detail view opens, press the key it labels `go back`. Then open the **Earlier in this session** row and press `Enter` on a subagent. Requires Claude Code v2.1.319 or later. ### Subagent names @@ -837,7 +843,7 @@ By default, a subagent can spawn subagents of its own, up to three layers below the main conversation. At the depth limit, Claude Code withholds the `Agent` tool from every subagent except a fork, so a subagent at the limit does its delegated work itself and returns one summary. A fork at the limit keeps `Agent` in its inherited tool list, but the tool returns an error instead of spawning. Nested subagents suit a delegated task that itself splits into parallel subtasks, such as a reviewer subagent that dispatches a verifier per finding. By default the spawning subagent waits for each nested subagent’s report: * **Interactive terminal session** : only the top-level subagent’s summary returns to you, because a subagent that launches background subagents waits for their results before it finishes. - * **`claude -p` and the Agent SDK**: the spawning subagent waits while fork mode is on. If you turn fork mode off, nested subagents start in the background instead. The spawning subagent doesn’t wait for a background nested subagent, which reports to your main conversation if it outlasts the spawning subagent. + * **`claude -p` and the Agent SDK**: the spawning subagent waits only for a foreground nested subagent. A background nested subagent reports to your main conversation if it outlasts the spawning subagent. To change the limit, set [`CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`](</docs/en/env-vars>) to the number of subagent layers you want below your main conversation. For example, this entry in [`settings.json`](</docs/en/settings>) caps nesting at two layers: @@ -882,7 +888,7 @@ Each subagent invocation creates a new instance rather than continuing an earlier one. To continue an existing subagent’s work instead of starting over, ask Claude to resume it. Resumed subagents retain their full conversation history, including all previous tool calls, results, and reasoning. If the subagent spawned background subagents of its own, that history includes the results they delivered while it ran. Before v2.1.304, a subagent that Claude messaged or resumed right after it finished could forget its most recent work. * When a subagent completes, Claude receives its agent ID. - * The built-in Explore and Plan agents are one-shot and return no agent ID, so Claude can’t resume them. Use `general-purpose` or a custom subagent when you need to continue the work. + * For work you’ll continue later, use `general-purpose` or a custom subagent. The built-in Explore and Plan agents can finish without giving Claude an ID to resume them with. * When a subagent stops at its `maxTurns` limit, Claude Code marks the returned output as partial, and Claude can resume the subagent to continue its work. Claude uses the `SendMessage` tool with the agent’s ID or name as the `to` field to resume it. `SendMessage` doesn’t require [agent teams](</docs/en/agent-teams>) to be enabled; only structured team-protocol messages such as `shutdown_request` and `plan_approval_response` do. Beyond subagents and teammates, in sessions where cross-session messaging is enabled, Claude can use the same tool to message [your other Claude Code sessions](</docs/en/cross-session-messaging>), on this machine or [beyond it](</docs/en/cross-session-messaging#message-sessions-on-other-machines>). To resume a subagent, ask Claude to continue the previous work:
modified Subagents in the SDK View current →
--- a/subagents.md +++ b/subagents.md @@ -37,7 +37,7 @@ prompt="Review the authentication module for security issues", options=ClaudeAgentOptions( # Auto-approve these tools - allowed_tools=["Read", "Grep", "Glob", "Agent"], + allowed_tools=["Read", "Grep", "Glob", "Agent", "Bash(npm test *)"], agents={ "code-reviewer": AgentDefinition( # description tells Claude when to use this subagent @@ -83,7 +83,7 @@ prompt: "Review the authentication module for security issues", options: { // Auto-approve these tools - allowedTools: ["Read", "Grep", "Glob", "Agent"], + allowedTools: ["Read", "Grep", "Glob", "Agent", "Bash(npm test *)"], agents: { "code-reviewer": { // description tells Claude when to use this subagent @@ -129,7 +129,7 @@ ---|---|---|--- `description`| `string`| Yes| Natural language description of when to use this agent `prompt`| `string`| Yes| The agent’s system prompt defining its role and behavior -`tools`| `string[]`| No| Array of allowed tool names. If omitted, inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>) +`tools`| `string[]`| No| Array of allowed tool names; listing one doesn’t [pre-approve](</docs/en/agent-sdk/permissions#allow-and-deny-rules>) it. If omitted, inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>) `disallowedTools`| `string[]`| No| Array of tool names to remove from the agent’s tool set. MCP server-level patterns are also accepted: `mcp__server` or `mcp__server__*` removes every tool from that server, and `mcp__*` removes every MCP tool from any server `model`| `string`| No| Model override for this agent. Accepts an alias such as `'fable'`, `'opus'`, `'sonnet'`, `'haiku'`, `'inherit'`, or a full model ID. `'inherit'` uses the model of the agent that spawned this one. When you omit `model`, Claude Code picks the model in the [subagent model order](</docs/en/sub-agents#choose-a-model>) `skills`| `string[]`| No| List of skill names to preload into the agent’s context at startup. At most the [first 32 distinct names](</docs/en/sub-agents#preload-skills-into-subagents>) in the list are preloaded. Unlisted skills remain invocable through the Skill tool @@ -369,7 +369,11 @@ ## Resume subagents -You can resume a subagent to continue where it left off rather than starting fresh. A resumed subagent retains its full conversation history, including all previous tool calls, results, and reasoning. When a subagent stops at its `maxTurns` limit, Claude Code marks the output in the Agent tool result as partial, so Claude knows the run is unfinished. When a subagent completes, the Agent tool result includes a text block containing `agentId: <id>`. The built-in [`Explore` and `Plan` agents](</docs/en/sub-agents#built-in-subagents>) are one-shot and don’t return an `agentId`, so use a custom agent or `general-purpose` when you need to resume. To resume a subagent programmatically: +You can resume a subagent to continue where it left off rather than starting fresh. A resumed subagent retains its full conversation history, including all previous tool calls, results, and reasoning. When a subagent stops at its `maxTurns` limit, Claude Code marks the output in the Agent tool result as partial, so Claude knows the run is unfinished. + +### Resume a subagent from your code + +When a subagent completes, the Agent tool result includes a text block containing `agentId: <id>`. The built-in [`Explore` and `Plan` agents](</docs/en/sub-agents#built-in-subagents>) can leave the ID out of that text, so use a custom agent or `general-purpose` when you need to resume. To resume a subagent programmatically: 1. **Capture the session ID** : extract `session_id` from messages during the first query 2. **Extract the agent ID** : parse `agentId` from the Agent tool result text @@ -503,9 +507,9 @@ Use the `tools` field to limit what a subagent can do: * **Omit`tools`**: the subagent gets every [tool available to subagents](</docs/en/sub-agents#available-tools>) - * **List tools** : the subagent gets only those. A code reviewer that should never edit files, for example, gets `["Read", "Grep", "Glob"]` - -A tool you leave out isn’t in the subagent’s session at all: Claude works without it, with no permission prompt or error. This example creates a read-only analysis agent that can examine code but can’t modify files or run commands. + * **List tools** : the subagent gets those. With [`memory`](</docs/en/sub-agents#enable-persistent-memory>) enabled, it also gets Read, Write, and Edit. A code reviewer that shouldn’t edit files, for example, gets `["Read", "Grep", "Glob"]` + +This example creates a read-only analysis agent that can examine code but can’t modify files or run commands. Python
modified Configure your terminal for Claude Code View current →
--- a/terminal-config.md +++ b/terminal-config.md @@ -25,6 +25,7 @@ * If the keymap already has bindings and none of them is a Terminal `shift-enter`, Claude Code first backs it up to a copy in the same directory, such as `keymap.json.1a2b3c4d.bak`, then merges the Shift+Enter binding into your keymap, keeping your other keybindings and comments * If Claude Code can’t read or parse the keymap, can’t back it up, or can’t verify the merged result, it [leaves the file unchanged and prints the keybinding block to add yourself](</docs/en/errors#terminal-setup-left-your-zed-keymap-unchanged>) + * If the keymap is a symlink, [add the keybinding yourself](</docs/en/errors#terminal-setup-left-your-zed-keymap-unchanged>) If you are running inside tmux, Shift+Enter also requires the tmux configuration below even when the outer terminal supports it. To bind newline to a different key, or to swap behavior so Enter inserts a newline and Shift+Enter submits, map the `chat:newline` and `chat:submit` actions in your [keybindings file](</docs/en/keybindings>). @@ -38,7 +39,7 @@ * VS Code -Open Settings → Profiles → Keyboard and check “Use Option as Meta Key”.If you accepted Claude Code’s first-run terminal setup prompt, this is already done. That prompt runs `/terminal-setup` for you, which enables Option as Meta and turns off the audible bell in your Apple Terminal profile.In [screen reader mode](</docs/en/accessibility>), `/terminal-setup` leaves the bell setting unchanged so the terminal bell stays audible. If an earlier run turned the bell off, turn it back on under Settings → Profiles → Advanced → “Audible bell”. +Open Settings → Profiles → Keyboard and check “Use Option as Meta Key”.`/terminal-setup` and the first-run terminal setup prompt enable this setting only on macOS 26 and earlier. Both also turn off your profile’s audible bell.In [screen reader mode](</docs/en/accessibility>), `/terminal-setup` leaves the bell setting unchanged so the terminal bell stays audible. If an earlier run turned the bell off, turn it back on under Settings → Profiles → Advanced → “Audible bell”. Open Settings → Profiles → Keys → General and set Left Option key and Right Option key to “Esc+”.Running `/terminal-setup` in iTerm2 enables “Applications in terminal may access clipboard” under Settings → General → Selection so the `/copy` command can write to your system clipboard. The command detects iTerm2 even when run from inside tmux. Restart iTerm2 for the change to take effect. @@ -290,7 +291,7 @@ ### How Claude treats pasted text -When you submit, Claude sees the content behind each `[Pasted text #N]` placeholder marked as text you pasted from somewhere else rather than typed. Claude is told that a paste can contain instructions you didn’t write, and to follow instructions inside it only where the message you typed asks it to. In sessions that don’t [fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), pastes aren’t marked. +When you submit, Claude sees the content behind each `[Pasted text #N]` placeholder marked as text you pasted from somewhere else rather than typed. Claude is told that a paste can contain instructions you didn’t write, and to follow instructions inside it only where the message you typed asks it to. Pastes can reach Claude unmarked, such as in your [first session after an install](</docs/en/env-vars#first-session-after-an-install-or-upgrade>). ### Delete and restore a collapsed paste
modified Enterprise deployment overview View current →
--- a/third-party-integrations.md +++ b/third-party-integrations.md @@ -55,7 +55,7 @@ ### Configure security policies -Security teams can configure managed permissions for what Claude Code is and is not allowed to do, which cannot be overwritten by local configuration. [Learn more](</docs/en/security>). To limit which of these deployment options a managed machine may use, set [`allowedProviders`](</docs/en/settings-reference#allowedproviders>) in managed settings. For example, `["bedrock"]` allows Amazon Bedrock and nothing else; a Bedrock fleet that also enables the Mantle endpoint lists `"mantle"` too. The entry says which endpoint variables also need a managed `env` pin. Requires Claude Code v2.1.285 or later. +Security teams can configure managed permissions for what Claude Code is and is not allowed to do. [Learn more](</docs/en/security>). To limit which of these deployment options a managed machine may use, set [`allowedProviders`](</docs/en/settings-reference#allowedproviders>) in managed settings. For example, `["bedrock"]` allows Amazon Bedrock and nothing else; a Bedrock fleet that also enables the Mantle endpoint lists `"mantle"` too. The entry says which endpoint variables also need a managed `env` pin. Requires Claude Code v2.1.285 or later. With Desktop signed in to claude.ai, a Cowork session on the user’s machine counts as [`"anthropic"`](</docs/en/settings-reference#allowedproviders>). If you leave it out of this list in an MDM policy or managed settings file, that session is refused. With it in, sessions sent to Anthropic directly also pass this list.
modified Tools reference View current →
--- a/tools-reference.md +++ b/tools-reference.md @@ -8,35 +8,42 @@ `Artifact`| Publishes an HTML or Markdown file to claude.ai as an [artifact](</docs/en/artifacts>): a private, interactive page. You can share it with a public link, or inside your organization on Team and Enterprise plans, where public sharing requires an Owner to [enable it](</docs/en/artifacts#control-public-sharing>). Requires a Pro, Max, Ultra, Team, or Enterprise plan and `/login` authentication; see [Availability](</docs/en/artifacts#availability>)| Yes `AskUserQuestion`| Asks multiple-choice questions to gather requirements or clarify ambiguity. Questions stay open until you answer them by default. See AskUserQuestion tool behavior| No `Bash`| Executes shell commands in your environment. See Bash tool behavior| Yes -`CronCreate`| Schedules a recurring or one-shot prompt within the current session. Tasks are session-scoped and restored on `--resume` or `--continue` if unexpired. See [session-scoped scheduled tasks](</docs/en/scheduled-tasks>)| No +`CronCreate`| Schedules a recurring or one-shot prompt within the current session. See [session-scoped scheduled tasks](</docs/en/scheduled-tasks>)| No `CronDelete`| Cancels a session-scoped scheduled task by ID| No `CronList`| Lists all session-scoped scheduled tasks| No `Edit`| Makes targeted edits to specific files. See Edit tool behavior| Yes `EndConversation`| Ends the session, in rare cases of sustained abusive input or when you ask Claude to end the session and then confirm. See EndConversation tool behavior| No `EnterPlanMode`| Switches to plan mode to design an approach before coding| No -`EnterWorktree`| Creates an isolated [git worktree](</docs/en/worktrees>) and switches into it, or switches into an existing worktree. See EnterWorktree tool behavior| Yes +`EnterWorktree`| Creates an isolated [git worktree](</docs/en/worktrees>) and switches into it, or switches into an existing worktree. See EnterWorktree tool behavior| Some worktrees `ExitPlanMode`| Presents a plan for approval and exits plan mode| Yes `ExitWorktree`| Exits a worktree session and returns to the original directory. Not available to subagents that already run in their own working directory, such as with [`isolation: worktree`](</docs/en/sub-agents#supported-frontmatter-fields>). Removed or refused once [`permissions.blockWritesOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockwritesoutsideworkingdirectories>) is on| No `Glob`| Finds files based on pattern matching. Absent by default on macOS, Linux, and WSL. See Glob tool behavior| No `Grep`| Searches for patterns in file contents. Absent by default on macOS, Linux, and WSL. See Grep tool behavior| No `ListAgents`| Lists the agents Claude can message with `SendMessage`: subagents in the session, [agent team](</docs/en/agent-teams>) teammates, your other local Claude Code sessions, and, while this session is connected to [Remote Control](</docs/en/remote-control>), your [cloud sessions](</docs/en/claude-code-on-the-web>) and your Remote Control sessions on other machines. Backs the `/list-agents` command. See [cross-session messaging](</docs/en/cross-session-messaging>). Requires Claude Code v2.1.224 or later, and appears only in sessions where [cross-session messaging is enabled](</docs/en/cross-session-messaging#availability>). Teammate rows and the first line showing this session’s own name require v2.1.239 or later| No `ListMcpResourcesTool`| Lists resources exposed by connected [MCP servers](</docs/en/mcp>), leaving out [MCP Apps UI resources](</docs/en/mcp#reference-mcp-resources>), which are pages for a host application to render| No +`ListPlugins`| Lists the [plugins enabled for your claude.ai account](</docs/en/plugins/loading#synced-plugins>). Requires a [cloud session](</docs/en/claude-code-on-the-web>) or the [desktop app](</docs/en/desktop>). Not available on [third-party providers](</docs/en/third-party-integrations>)| No +`ListSkills`| Lists the [skills enabled for your claude.ai account](</docs/en/skills#how-synced-skills-behave>). Available in the same sessions as `ListPlugins`| No `LSP`| Code intelligence via language servers: jump to definitions, find references, report type errors and warnings. See LSP tool behavior| No `Monitor`| Runs a command in the background and feeds each output line back to Claude, so it can react to log entries, file changes, or polled status mid-conversation. Can also open a WebSocket and treat each incoming message as an event. See Monitor tool| Yes `NotebookEdit`| Modifies Jupyter notebook cells. See NotebookEdit tool behavior| Yes `PowerShell`| Executes PowerShell commands natively. See PowerShell tool for availability| Yes +`propose_skills`| Shows a card of proposed skills for you to review and save to your claude.ai account. Available in some cloud sessions, such as cloud [Cowork](<https://claude.com/docs/cowork/overview>) sessions| No `PushNotification`| Sends a desktop notification from a local session, and a phone push with [Remote Control](</docs/en/remote-control>) or in a [cloud session](</docs/en/claude-code-on-the-web>). Push delivery runs through Anthropic-hosted infrastructure, which is not accessible from Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry| No `Read`| Reads the contents of files. See Read tool behavior| No `ReadMcpResourceTool`| Reads a specific MCP resource by URI| No `RemoteTrigger`| Creates, updates, runs, and lists [cloud scheduled tasks](</docs/en/routines>), formerly routines, on claude.ai. Backs the `/schedule` command. The [`RemoteTrigger` input reference](</docs/en/agent-sdk/typescript#remotetrigger>) documents every action and the organization policies that remove the tool. Cloud scheduled tasks live on claude.ai and require a Pro, Max, Ultra, Team, or Enterprise plan. This tool is therefore not accessible from Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry| No `ReportFindings`| Reports code-review findings as a structured list, with a file, summary, and failure scenario per finding, so Claude Code can render them instead of printing them as text. Claude calls it when active code-review instructions tell it to. A finding can also carry an optional `category` slug, such as `correctness` or `test-coverage`, shown next to the file location in the rendered list| No `ScheduleWakeup`| Reschedules the next iteration of a [self-paced `/loop`](</docs/en/scheduled-tasks#let-claude-choose-the-interval>). Claude calls this at the end of each iteration to pick when the next one runs, between one minute and one hour out; you don’t call it directly. To end the loop instead, Claude calls it with `stop: true`, which cancels the pending wakeup. The pending wakeup appears in `session_crons` in [Stop hook input](</docs/en/hooks#stop-input>)| No +`SearchPlugins`| Searches your claude.ai plugin catalog. Available in the same sessions as `ListPlugins`| No +`SearchSkills`| Searches claude.ai skills. Available in the same sessions as `ListPlugins`| No `SendFeedback`| Drafts a feedback report about Claude Code, covering a product problem or Claude’s own behavior in the session, and queues it on your machine for you to review. Claude Code sends nothing until you choose to send the draft. See SendFeedback tool behavior. Requires Claude Code v2.1.238 or later| No `SendMessage`| Sends a message to another agent: an [agent team](</docs/en/agent-teams>) teammate, a [subagent it resumes](</docs/en/sub-agents#resume-subagents>) by agent ID or name, or one of your other Claude Code sessions, on this machine or beyond it. Messaging other sessions requires Claude Code v2.1.224 or later. [Cross-session messaging](</docs/en/cross-session-messaging>) covers which sessions Claude can reach, [what a message looks like when it arrives](</docs/en/cross-session-messaging#what-a-message-looks-like>), and [how Claude gets a notice when another session goes idle](</docs/en/cross-session-messaging#get-a-notice-when-another-session-goes-idle>). Claude can include an optional `summary` input, typically 5-10 words, that Claude Code shows as a one-line preview. When Claude omits it on a [plain-text message](</docs/en/cross-session-messaging#limitations>), Claude Code uses the first line of the message as the summary. Claude Code truncates a summary longer than 200 characters with an ellipsis| No `SendUserFile`| Sends files from the session to you with an optional caption, so a generated report, diagram, screenshot, or built artifact reaches your device instead of only being mentioned in the transcript. The optional `display` input controls presentation: `render` opens the file inline in the client, `attach` shows a download card only, and when unset the client decides by file type. Available when a [Remote Control](</docs/en/remote-control>) client is connected or in a [cloud session](</docs/en/claude-code-on-the-web>). Delivery runs through Anthropic-hosted infrastructure, so the tool is not available on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry| No `ShareOnboardingGuide`| Uploads `ONBOARDING.md` and returns a share link teammates can open in Claude Code. Called from `/team-onboarding` after the guide is written. Available to claude.ai subscribers on Team and Enterprise plans| Yes `Skill`| Executes a [skill](</docs/en/skills#control-who-invokes-a-skill>) within the main conversation. Can prompt for skills that set `allowed-tools`, `disallowed-tools`, or `hooks`| Some skills `SubagentHandback`| Delivers a subagent’s final report to whichever conversation receives that subagent’s result. Provided only in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), to subagents that the Agent tool runs locally other than [forks](</docs/en/sub-agents#fork-the-current-conversation>), and available in the terminal CLI, IDE extensions, cloud sessions, and the Agent SDK; the classifier reviews the report before it’s delivered. Requires Claude Code v2.1.271 or later| No +`SuggestPluginInstall`| Shows a [card of suggested plugins](</docs/en/claude-code-on-the-web#plugin-suggestions-in-the-conversation>) you can add. Available in the same sessions as `ListPlugins`| No +`SuggestSkills`| Shows a card of claude.ai skills you can add. Available in the same sessions as `ListPlugins`| No `TaskCreate`| Creates a new task in the task list. Provided by default only on the models listed under Task tool availability, and on other models when you opt in| No `TaskGet`| Retrieves full details for a specific task. Provided by default only on the models listed under Task tool availability, and on other models when you opt in| No `TaskList`| Lists all tasks with their current status. Provided by default only on the models listed under Task tool availability, and on other models when you opt in| No @@ -86,7 +93,7 @@ To cap how many turns a subagent runs, set `maxTurns` in the [subagent definition](</docs/en/sub-agents#supported-frontmatter-fields>). When the subagent reaches the limit, Claude Code marks the returned result as partial output, and Claude can [resume the subagent](</docs/en/sub-agents#resume-subagents>) to continue. Which tools a non-fork subagent can use depends on the `tools` and `disallowedTools` fields in the [subagent definition](</docs/en/sub-agents>): * **Neither field set** : the subagent inherits every [tool available to subagents](</docs/en/sub-agents#available-tools>). - * **`tools` only**: the subagent gets only the listed tools. + * **`tools` only**: the subagent gets the listed tools. With [`memory`](</docs/en/sub-agents#enable-persistent-memory>) enabled, it also gets Read, Write, and Edit. * **`disallowedTools` only**: the subagent gets every parent tool except the listed ones. * **Both set** : `disallowedTools` takes precedence. A tool listed in both is removed.
modified Troubleshoot installation and login View current →
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -48,7 +48,7 @@ On Windows, the install command prints script text and nothing installs| Run the complete install command `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). `unable to get local issuer certificate`| Configure corporate CA certificates -`OAuth error` or `403 Forbidden`| Fix authentication +`OAuth error`, `That doesn't look like the full code`, or `403 Forbidden`| Fix authentication `Claude Code access has not been granted for this account`| Get a role that includes Claude Code `Unable to connect to Anthropic services` during setup| See [Unable to connect to Anthropic services](</docs/en/errors#unable-to-connect-to-anthropic-services>) in the Error reference `Could not load the default credentials` or `Could not load credentials from any providers`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials @@ -590,7 +590,7 @@ When installing Claude Code in a Docker container, installing as root into `/` can cause hangs. **Solutions:** - 1. **Set a working directory** before running the installer. When run from `/`, the installer scans the entire filesystem, which causes excessive memory usage. Setting `WORKDIR` limits the scan to a small directory: + 1. **Set a working directory** before running the installer: WORKDIR /tmp RUN curl -fsSL https://claude.ai/install.sh | bash @@ -815,9 +815,9 @@ If the browser doesn’t open automatically during login, press `c` to copy the OAuth URL to your clipboard, then paste it into a browser manually. This also works when the URL wraps across lines in a narrow or SSH terminal and can’t be clicked directly. -### OAuth error: Invalid code - -If you see `OAuth error: Invalid code. Please make sure the full code was copied`, the login code expired or was truncated during copy-paste. **Solutions:** +### That doesn’t look like the full code + +If you see `That doesn't look like the full code`, copy the whole login code from the browser, including the `#` in the middle, and paste it again. If you see `OAuth error: Invalid code. Please make sure the full code was copied`, the login code expired or was truncated during copy-paste. **Solutions:** * Press Enter to retry and complete the login quickly after the browser opens * Type `c` to copy the full URL if the browser doesn’t open automatically
modified Agent SDK reference - TypeScript View current →
--- a/typescript.md +++ b/typescript.md @@ -525,7 +525,7 @@ `sessionStoreFlush`| `'batched' | 'eager'`| `'batched'`| _Alpha._ Flush mode for `sessionStore`. Ignored when `sessionStore` is not set `settings`| `string | Settings`| `undefined`| Inline [settings](</docs/en/settings>) object, a settings file path, or an inline JSON string. Populates the flag-settings layer in the [precedence order](</docs/en/settings#settings-precedence>). Change at runtime with `applyFlagSettings()` `settingSources`| `SettingSource``[]`| CLI defaults (all sources)| Control which filesystem settings to load. Pass `[]` to disable user, project, and local settings. [Endpoint-managed policy](</docs/en/managed-settings#delivery-mechanisms>) loads regardless; server-managed settings are fetched when the session authenticates with an organization credential on an [eligible configuration](</docs/en/server-managed-settings#platform-availability>). See [Use Claude Code features](</docs/en/agent-sdk/claude-code-features#what-settingsources-does-not-control>) -`skills`| `string[] | 'all'`| `undefined`| Skills available to the session. Pass `'all'` to enable every discovered skill, or a list of skill names. Pass exact names only. On Agent SDK v0.3.221 or later, the SDK rejects malformed and wildcard-form names with an error before starting the Claude Code process. When set, the SDK adds the Skill tool to `allowedTools` automatically. If you also pass `tools`, include `'Skill'` in that list. See [Skills](</docs/en/agent-sdk/skills>) +`skills`| `string[] | 'all'`| `undefined`| Limits the main agent’s skills. Pass `'all'` to enable every discovered skill, or a list of skill names. Pass exact names only. On Agent SDK v0.3.221 or later, the SDK rejects malformed and wildcard-form names with an error before starting the Claude Code process. If you also pass `tools`, include `'Skill'` in that list. See [Skills](</docs/en/agent-sdk/skills>) `spawnClaudeCodeProcess`| `(options: SpawnOptions) => SpawnedProcess`| `undefined`| Custom function to spawn the Claude Code process. Use to run Claude Code in VMs, containers, or remote environments `stderr`| `(data: string) => void`| `undefined`| Callback for stderr output `strictMcpConfig`| `boolean`| `false`| Use the servers passed in `mcpServers` and ignore project `.mcp.json`, user settings, plugin-provided MCP servers, and [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>) @@ -1189,7 +1189,7 @@ 2. Project settings (`.claude/settings.json`) 3. User settings (`~/.claude/settings.json`) -Programmatic options such as `agents`, `allowedTools`, and `settings` override user, project, and local filesystem settings. If a managed policy setting and a programmatic option set the same key, the managed value applies, with exceptions such as an `effortLevel` passed to `applyFlagSettings()`. +Permission rules you pass in `allowedTools` or `settings` [add to](</docs/en/settings#lists-merge-instead-of-overriding>) these files’ rules. For most single values, Claude Code takes the one in `settings` over these files. If a managed policy setting and a programmatic option set the same key, the managed value applies, with exceptions such as an `effortLevel` passed to `applyFlagSettings()`. ### `PermissionMode` @@ -1198,7 +1198,7 @@ | "acceptEdits" // Auto-accept file edits | "bypassPermissions" // Bypass permission checks; explicit ask rules still prompt | "plan" // Planning mode - Claude explores and plans - | "dontAsk" // Don't prompt for permissions, deny if not pre-approved + | "dontAsk" // Deny calls that would otherwise prompt | "auto"; // A model classifier reviews actions such as shell commands and network requests ### `CanUseTool` @@ -1645,6 +1645,7 @@ deferred_tool_use?: { id: string; name: string; input: Record<string, unknown> }; terminal_reason?: TerminalReason; result_index?: number; + credential_expires_at?: string; fast_mode_state?: FastModeState; fast_mode_disabled_reason?: FastModeDisabledReason; origin?: SDKMessageOrigin; @@ -1675,6 +1676,7 @@ resume_reason?: string; terminal_reason?: TerminalReason; result_index?: number; + credential_expires_at?: string; fast_mode_state?: FastModeState; fast_mode_disabled_reason?: FastModeDisabledReason; origin?: SDKMessageOrigin; @@ -1698,6 +1700,7 @@ * `total_cost_usd`: cumulative estimated cost in USD, covering the same calls as `modelUsage` and reset at the same points. A call that resumes a session also counts the [totals restored from the session’s earlier calls](</docs/en/agent-sdk/cost-tracking#accumulate-costs-across-multiple-calls>). It is an estimate, not a billing statement. See [Track cost and usage](</docs/en/agent-sdk/cost-tracking>) for accuracy caveats. * `queued_turn_count`: the number of messages you sent with `origin: { kind: "human" }` that are still waiting when Claude Code produced the result. See `queued_turn_count` for what `0` and an absent field tell you. * `result_index`: where this result falls in the run’s delivery order, counting from 0 across every result the process writes. Present on both arms. A result whose write fails still consumes its number, so a gap in the sequence means a result was lost. Requires Agent SDK v0.3.268 or later. + * `credential_expires_at`: the stored claude.ai login’s latest expected end, as an ISO 8601 timestamp. The login can end up to three days earlier. Absent for other credentials or when no date is known. Requires Agent SDK v0.3.318 or later. * `startup_failure_reason`: why Claude Code refused to start, on the `error_during_execution` result it writes before exiting on a known startup failure. See `startup_failure_reason` for the values and which failures carry it. Requires Agent SDK v0.3.274 or later. * `terminal_reason`: why the loop ended. One of `"completed"`, `"max_turns"`, `"tool_deferred"`, `"aborted_streaming"`, `"aborted_tools"`, `"hook_stopped"`, `"stop_hook_prevented"`, `"background_requested"`, `"blocking_limit"`, `"rapid_refill_breaker"`, `"prompt_too_long"`, `"image_error"`, `"model_error"`, `"api_error"`, `"malformed_tool_use_exhausted"`, `"budget_exhausted"`, `"structured_output_retry_exhausted"`, `"tool_deferred_unavailable"`, or `"turn_setup_failed"`. * `fast_mode_state`: one of `"on"`, `"off"`, or `"cooldown"`. @@ -3323,7 +3326,7 @@ durable?: boolean; }; -Schedules a prompt to run on a 5-field cron schedule in local time. Set `recurring` to `false` to fire once at the next match. Jobs are session-scoped by default, and resuming with `--resume` or `--continue` restores jobs that haven’t expired. See [Session-scoped scheduled tasks](</docs/en/scheduled-tasks>). Setting `durable` to `true` requests persistence to `.claude/scheduled_tasks.json` so the job survives restarts. Durable scheduling isn’t available in every session: when it isn’t, Claude Code accepts `durable: true` but creates the job session-only. Read the output’s `durable` field to see whether the job persisted. +Schedules a prompt to run on a 5-field cron schedule in local time. Set `recurring` to `false` to fire once at the next match. Jobs are session-scoped by default. See [Session-scoped scheduled tasks](</docs/en/scheduled-tasks>). Setting `durable` to `true` requests persistence to `.claude/scheduled_tasks.json` so the job survives restarts. Durable scheduling isn’t available in every session: when it isn’t, Claude Code accepts `durable: true` but creates the job session-only. Read the output’s `durable` field to see whether the job persisted. ### CronDelete
modified Handle approvals and user input View current →
--- a/user-input.md +++ b/user-input.md @@ -28,10 +28,10 @@ The callback fires in two cases: - 1. **Tool needs approval** : Claude wants to use a tool that isn’t auto-approved by a [permission rule](</docs/en/agent-sdk/permissions>) or permission mode. Check `tool_name` for the tool (e.g., `"Bash"`, `"Write"`). + 1. **Tool needs approval** : Claude makes a call that the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) hasn’t already approved or denied. Check `tool_name` for the tool (for example, `"Bash"`, `"Write"`). 2. **Claude asks a question** : Claude calls the `AskUserQuestion` tool. Check if `tool_name == "AskUserQuestion"` to handle it differently. If you specify a `tools` array, include `AskUserQuestion` for this to work. For more information, see Handle clarifying questions. -**An earlier step can allow or deny a call before`canUseTool` runs.** The [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) checks deny rules, the permission mode, and allow rules before your callback.To run your checks on calls that a rule or the permission mode already allowed, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which runs for those calls and can allow, deny, or modify them. +**An earlier step can allow or deny a call before`canUseTool` runs.** The [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) checks deny rules, the permission mode, and allow rules before your callback.To check calls that run without your callback, such as file reads inside your [working directories](</docs/en/permissions#working-directories>), use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which can allow, deny, or modify them. You can also use the [`PermissionRequest` hook](</docs/en/agent-sdk/hooks#available-hooks>) to send external notifications (Slack, email, push) when Claude is waiting for approval.
modified Voice dictation View current →
--- a/voice-dictation.md +++ b/voice-dictation.md @@ -39,7 +39,7 @@ ## Hold to record -Hold mode is push-to-talk: recording runs while you hold the key and stops when you release it. This is the default mode. Hold `Space` to start recording. Claude Code detects a held key by watching for rapid key-repeat events from your terminal, so there is a brief warmup before recording begins. The footer shows `keep holding…` during warmup, then `listening…` once recording is active. While recording, the prompt cursor becomes a bar that rises and falls with your microphone level, unless you have [`prefersReducedMotion`](</docs/en/settings-reference#prefersreducedmotion>) turned on. The first couple of key-repeat characters type into the input during warmup and are removed automatically when recording activates. A single `Space` tap still types a space, since hold detection only triggers on rapid repeat. Holding or tapping `Space` starts dictation only where the keypress would otherwise type into the prompt. In the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), `Space` pages through the conversation, and in [vim mode](</docs/en/interactive-mode#vim-editor-mode>) outside INSERT it is a command. A rebound modifier combination like `meta+k` never types text, so it starts dictation from those places too. +Hold mode is push-to-talk: recording runs while you hold the key and stops when you release it. This is the default mode. Hold `Space` to start recording. Claude Code detects a held key by watching for rapid key-repeat events from your terminal, so there is a brief warmup before recording begins. The footer shows `keep holding…` during warmup, then `listening…` once recording is active. While recording, the prompt cursor becomes a bar that rises and falls with your microphone level, unless you have [`prefersReducedMotion`](</docs/en/settings-reference#prefersreducedmotion>) turned on. The first couple of key-repeat characters type into the input during warmup and are removed automatically when recording activates. A single `Space` tap still types a space, since hold detection only triggers on rapid repeat. To skip the warmup, switch to tap mode with `/voice tap`, or rebind to a modifier combination like `meta+k`. Modifier combos start recording on the first keypress. @@ -49,7 +49,7 @@ # hold space, speak "use the new token validation helper" > refactor the auth middleware to use the new token validation helper▮ -By default, when you release the key, Claude Code inserts the transcript and waits for you to press `Enter`. Set `"autoSubmit": true` in the `voice` settings object to send the prompt automatically when you release the key, as long as the transcript is at least three words long. +By default, when you release the key, Claude Code inserts the transcript and waits for you to press `Enter`. Set `"autoSubmit": true` in the `voice` settings object to send the prompt automatically when you release the key, as long as the transcript is at least three words long. Holding or tapping `Space` starts dictation only where the keypress would otherwise type into the prompt. In the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), `Space` pages through the conversation, and in [vim mode](</docs/en/interactive-mode#vim-editor-mode>) outside INSERT it is a command. To dictate from either place, rebind to a modifier combination like `meta+k`. ## Tap to record and send @@ -118,12 +118,12 @@ Common issues when voice dictation does not activate or record: - * **`Unknown command: /voice`** : `/voice` is available only while a claude.ai account is your active sign-in. If you aren’t signed in with one, run `/login`. If `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, an `apiKeyHelper` setting, or a third-party provider is in use, it takes precedence over a claude.ai sign-in, so remove it and restart Claude Code. - * **`Voice mode requires a Claude.ai account`** : Claude Code couldn’t find a usable claude.ai sign-in when you ran `/voice` or started recording. Run `/login` to sign in again. + * **`/voice needs a Claude subscription` or `/voice isn't available with <provider>`**: `/voice` is available only while a claude.ai account is your active sign-in. If you aren’t signed in with one, run `/login`. If `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, an `apiKeyHelper` setting, or a third-party provider is in use, it takes precedence over a claude.ai sign-in, so remove it and restart Claude Code. + * **`Voice mode needs a Claude.ai account`** : Claude Code couldn’t find a usable claude.ai sign-in when you ran `/voice` or started recording. Run `/login` to sign in again. * **`Voice mode is disabled by your organization's policy`** : an administrator policy for your organization turns off voice dictation. Contact your organization administrator to confirm whether voice dictation is available for your organization. * **`Microphone access is denied`** : grant microphone permission to your terminal in system settings. On macOS, go to System Settings → Privacy & Security → Microphone and enable your terminal app, then run `/voice` again. On Windows, go to Settings → Privacy & security → Microphone and turn on microphone access for desktop apps, then run `/voice` again. If your terminal isn’t listed in the macOS settings, see Terminal not listed in macOS Microphone settings. - * **`Voice mode requires SoX for audio recording` on Linux**: the native audio module could not load and no fallback is installed. Install SoX with the command shown in the error message, for example `sudo apt-get install sox`. - * **`Voice mode requires a microphone, but SoX could not open an audio capture device`** : SoX is installed, but the host has no audio capture device, for example a headless server or a container. Run Claude Code on a machine with a microphone. As of v2.1.195, Claude Code on Linux reports this message in that situation; earlier versions asked you to install SoX even when it was already installed. + * **`Voice mode needs SoX to record` on Linux**: install SoX with the command shown in the error message, for example `sudo apt-get install sox`. + * **`Voice mode needs a microphone, and SoX couldn't open one`** : SoX is installed, but the host has no audio capture device, for example a headless server or a container. Run Claude Code on a machine with a microphone. * **`Voice mode could not find a working audio recorder in WSL`** : WSLg routes audio through PulseAudio rather than an ALSA device, so SoX needs its PulseAudio backend installed explicitly. Run `sudo apt install sox libsox-fmt-pulse`. Installing `sox` alone pulls in the ALSA backend, which cannot record on WSL because there is no `/dev/snd` device. * **`Voice input is failing repeatedly and has been paused`** : voice dictation hit three failures within 10 seconds. Claude Code pauses dictation until 10 seconds have passed since the first of those failures. This usually means the microphone or audio stack on this host can’t capture audio, for example a headless server, a remote shell with no audio passthrough, or a denied microphone permission. Confirm a working input device, fix the underlying cause from the entries above, then trigger voice again. Before v2.1.202, only start-up failures counted toward the pause. * **Nothing happens when holding`Space` in hold mode**: watch the prompt input while you hold. If spaces keep accumulating, voice dictation is likely off; run `/voice hold` to enable it. If only one or two spaces appear and then nothing, voice dictation is on but hold detection is not triggering. Hold detection requires your terminal to send key-repeat events, so it can’t detect a held key if key-repeat is disabled at the OS level. Switch to tap mode with `/voice tap` to avoid the key-repeat requirement.
modified Get started with Claude Code in the cloud View current →
--- a/web-quickstart.md +++ b/web-quickstart.md @@ -1,6 +1,6 @@ Cloud sessions are available on Pro, Max, Ultra, and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats. -A cloud session runs Claude Code on cloud infrastructure instead of your machine, Anthropic-managed by default. This quickstart starts one from [claude.ai/code](<https://claude.ai/code>) in your browser. You can also start one from the Claude mobile app, the Desktop app, or your terminal with `claude --cloud`. Claude clones the GitHub repository you select into an isolated virtual machine, makes changes, and pushes a branch for you to review. Sessions persist across devices, so a task you start on your laptop is ready to review from your phone later. Each session counts toward your plan’s usage limits alongside the rest of your Claude and Claude Code usage, and there’s no separate charge for the cloud VM. Cloud sessions work well for: +A cloud session runs Claude Code on cloud infrastructure, Anthropic-managed by default. This quickstart starts one from [claude.ai/code](<https://claude.ai/code>) in your browser. You can also start one from the Claude mobile app, the Desktop app, or your terminal with `claude --cloud`. Claude clones the GitHub repository you select into an isolated virtual machine, makes changes, and pushes a branch for you to review. Sessions persist across devices, so a task you start on your laptop is ready to review from your phone later. Each session counts toward your plan’s usage limits alongside the rest of your Claude and Claude Code usage, and there’s no separate charge for the cloud VM. Cloud sessions work well for: * **Parallel tasks** : run several independent tasks at once, each in its own session and branch, without managing multiple worktrees * **Repos you don’t have locally** : Claude clones the repo fresh every session, so you don’t need it checked out @@ -108,7 +108,7 @@ Select a repository and branch -From [claude.ai/code](<https://claude.ai/code>) or the Code tab in the Claude mobile app, click the repository selector below the input box and choose a repository for Claude to work in. You can add multiple repositories to work across them in one session.At claude.ai/code, to start Claude from a feature branch instead of the default, change the branch in the control after the repository selector. +From [claude.ai/code](<https://claude.ai/code>) or the Code tab in the Claude mobile app, click the repository selector below the input box and choose a repository for Claude to work in. You can add multiple repositories to work across them in one session.At claude.ai/code, to start Claude from a feature branch instead of the default, change the branch in the control after the repository selector. To start without a repository at claude.ai/code, select **No repository** in the repository selector. 2 @@ -159,8 +159,8 @@ After Claude pushes its changes to a branch, the **Changes** card in the panel beside the chat shows the lines added and removed across the session, for example `+42 -18`. Click those counts to open the diff view. - * You can also click **Changes** in the session’s title bar, or in the bar’s **⋮** menu. - * To show the panel when it’s hidden, click the **Show session rail** icon in the session’s title bar, or in the bar’s **⋮** menu. + * To show the panel when it’s hidden, click **Activity panel** or **Show session rail** in the session’s title bar, or **Show session rail** in the bar’s **⋮** menu. + * You can also [open **Changes** as a pane](</docs/en/desktop#arrange-your-workspace>). The diff compares the session’s changes against its base branch by default. To compare against a different branch, select **Compare against** and pick one. Against the base branch, the diff can [leave out changes that aren’t pushed yet](</docs/en/claude-code-on-the-web#troubleshoot-a-missing-file-in-the-diff-view>).
modified Run parallel sessions with worktrees View current →
--- a/worktrees.md +++ b/worktrees.md @@ -67,7 +67,7 @@ ## How Claude Code enforces isolation -While a session is isolated in a worktree, Claude Code blocks the tool calls the checks below define. The same rules apply whether you started the session with `--worktree`, Claude entered a worktree with `EnterWorktree`, or you resumed a worktree session. The same enforcement covers every subagent Claude spawns from the isolated session. It applies whether the session is interactive or runs in the [background](</docs/en/agent-view#how-file-edits-are-isolated>). Subagents that run in their own worktree carry the same checks. Their version history is under [Write subagent files](</docs/en/sub-agents#write-subagent-files>). Claude Code applies four checks: +While a session is isolated in a worktree, Claude Code blocks the tool calls the checks below define. The same rules apply whether you started the session with `--worktree`, Claude entered a worktree with `EnterWorktree`, or you resumed a worktree session. The same enforcement covers every subagent Claude spawns from the isolated session. It applies whether the session is interactive or runs in the [background](</docs/en/agent-view#how-file-edits-are-isolated>). Subagents that run in their own worktree carry the same checks. Claude Code applies four checks: * **File edits** : Claude Code blocks an `Edit`, `Write`, or `NotebookEdit` that targets a path in the main checkout. To change a file in the main checkout, edit it yourself or start an interactive session there. * **Command working directory** : Claude Code blocks a Bash, PowerShell, or Monitor command whose working directory resolves to the main checkout, or whose working directory it can’t verify stays outside it.