Changes on
57 changes detected
--- a/admin.md
+++ b/admin.md
@@ -56,7 +56,7 @@
* **The guard protects what you manage.** A user’s mod can’t change what your managed hooks receive or decide, the system prompt, your managed `CLAUDE.md` and other managed instructions, what any mod reads as settings, or the tools and descriptions of your managed MCP servers.
* **Everything else is allowed.** The guard adds no other restrictions. A user’s mod can still read and write files, start processes, make network requests, rewrite tool calls and prompts, deny a tool call, approve one that would otherwise prompt, and draw in the interface, all with that user’s permissions.
* **Deny rules and your managed hooks take precedence.** Where the guard loads, a user’s mod can’t approve a call that a `deny` rule refuses, whichever settings file holds the rule. A block from a `PreToolUse` hook in managed settings is final too. Both apply to Claude’s tool calls. Neither applies to a mod’s own [`$.fs` and `$.process` calls](</docs/en/plugins/mods/api#reach-files-processes-and-the-network>): with `Read(.env)` denied, a mod can still read that file with `$.fs.read` or start a program that does. To limit those calls, keep the mod from loading or handle the call in a policy mod.
- * **Other permission checks can be overridden.** A user’s mod that approves tool calls can approve a call that an `ask` rule would prompt for, or that a `PreToolUse` hook outside managed settings blocked. In auto mode, a call the mod approves runs without a classifier check.
+ * **Other permission checks can be overridden.** A user’s mod that approves tool calls can approve a call that an `ask` rule would prompt for, or that a `PreToolUse` hook outside managed settings blocked. In auto mode, a call the mod approves runs without a classifier check. For the prompts a mod’s `tool.check` approval doesn’t skip, see [Extend permissions with hooks](</docs/en/permissions#extend-permissions-with-hooks>).
The guard’s source is public in the [`mods/sec-default` directory of the Claude Code repository](<https://github.com/anthropics/claude-code/tree/main/mods/sec-default>).
@@ -71,7 +71,10 @@
* **Settings hooks keep working.** Command, HTTP, prompt, and agent hooks in settings files and in plugins’ `hooks/hooks.json` run as before, alongside mods. Nothing about them is deprecated.
* **Deny rules take precedence where the guard loads.** A user’s mod can’t approve a call that a `deny` rule refuses, unless you set `allowModsToOverrideDenyRules`.
* **Managed hooks run first.** A `PreToolUse` hook in managed settings runs before any mod sees the tool call, and its block is final. If a mod then rewrites the call, your managed hooks run again on the rewritten call, so a block still applies. `PreToolUse` hooks from other settings files and from plugins run after the last mod, so a mod that returns its own result in place of running the tool keeps those from running. See [The order mods run in](</docs/en/plugins/mods/events#the-order-mods-run-in>).
- * **Network policy covers`$.http.fetch`.** If your organization turns off web fetching, or nonessential network traffic is turned off for the session, Claude Code refuses a network request that a mod makes with `$.http.fetch`. The policy doesn’t cover a program the mod starts with `$.process.run`. That program reaches the network with the user’s own access.
+ * **Network policy covers`$.http.fetch`.**
+ * **Your organization’s policy doesn’t allow WebFetch** : Claude Code also refuses every mod’s `$.http.fetch` request. See [WebFetch availability](</docs/en/tools-reference#webfetch-availability>).
+ * **You set[`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](</docs/en/env-vars>)**: a mod that you or your users install can still make these requests. The variable stops only the [mods built into Claude Code](</docs/en/plugins/mods/overview#mods-built-into-claude-code>), plus any `$.http.fetch` request that carries the session’s Anthropic credentials. Before v2.1.288, the variable stopped every mod’s `$.http.fetch` request.
+Neither covers a program the mod starts with `$.process.run`, which reaches the network with the user’s own access.
* **Plugin controls cover mods.** A mod is a plugin, so the [settings that restrict what users can install](</docs/en/plugins/org#restrict-what-users-can-install>), such as `strictKnownMarketplaces`, decide whether it can be installed at all.
* **Mods can’t change the permission prompt.** A mod can restyle much of Claude Code’s interface, but not the permission prompt, so it can’t change what a prompt shows. A mod can still approve or deny a tool call before the prompt appears, as Know what happens by default describes.
* **Trust prompts come first.** In an interactive session in a directory the user hasn’t trusted yet, no mod loads until they answer the trust prompt.
--- a/agent-loop.md
+++ b/agent-loop.md
@@ -169,7 +169,7 @@
Claude determines which tools to call based on the task, but you control whether those calls are allowed to execute. You can auto-approve specific tools, block others entirely, or require approval for everything. Three options work together to determine what runs:
- * **`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. 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. 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`.
* **`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.
@@ -247,7 +247,7 @@
`"default"`| Tool calls that need approval and aren’t covered by allow rules trigger your `canUseTool` callback; no callback means deny| Interactive applications with a custom approval callback
`"acceptEdits"`| Auto-approves file edits and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.); other Bash commands follow default rules| You trust Claude’s edits and want faster iteration, such as during prototyping or when working in an isolated directory
`"plan"`| Claude explores and plans without editing your source files; file edits are never auto-approved and prompt through your `canUseTool` callback| You want Claude to propose changes without executing them, such as during code review or when you need to approve changes before they’re made
-`"dontAsk"`| Never prompts. Tools pre-approved by [permission rules](</docs/en/settings-reference#permission-settings>) run, and so do calls that need no approval in `default` mode, such as file reads inside your working directories; every call that would otherwise prompt is denied. `AskUserQuestion`, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) are denied even if you’ve allowed them| You want a fixed, explicit tool surface for a headless agent and prefer a hard deny over silent reliance on `canUseTool` being absent
+`"dontAsk"`| Never prompts. Tools pre-approved by [permission rules](</docs/en/settings-reference#permission-settings>) run, and so do calls that need no approval in `default` mode, such as file reads inside your working directories; every call that would otherwise prompt is denied. `AskUserQuestion`, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), and [reads from network paths](</docs/en/permissions#network-paths>) are denied even if you’ve allowed them| You want a fixed, explicit tool surface for a headless agent and prefer a hard deny over silent reliance on `canUseTool` being absent
`"auto"`| Uses a model classifier to review actions such as shell commands and network requests, allowing or blocking each one it reviews. See [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) for availability and the decision order| Autonomous agents that still want safety guardrails on tool use
`"bypassPermissions"`| Runs all allowed tools without asking, except tools matched by an explicit [`ask` rule](</docs/en/settings-reference#permission-settings>), connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and tools that require user interaction. The [cross-session messaging safeguards](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) still apply. See [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for the precedence order. In the TypeScript SDK, also requires `allowDangerouslySkipPermissions: true` in `options`. Can’t be used when running as root on Unix. Use only in isolated environments where the agent’s actions can’t affect systems you care about| CI, containers, or other isolated environments
Show diff (162 lines)
--- a/agent-view.md
+++ b/agent-view.md
@@ -126,7 +126,7 @@
Shape| What it means
---|---
`✻` or animated `✽`| The session process is running, or the session needs your input
-`∙`| The process has exited. You can still peek at the row, and when you reply or attach, Claude restarts from where it left off
+`∙`| The process has exited. You can still peek at the row, and when you reply or attach, Claude restarts it from its saved conversation
`✢`| A [`/loop`](</docs/en/scheduled-tasks>) session sleeping between iterations. The row shows its run count and a countdown
The `#N` or `!N` label that can appear at the right edge of a row is a link to the session’s pull request or merge request, not part of the state icon. The terminal tab title shows the awaiting-input count while agent view is open: `2 awaiting input · claude agents` when sessions need input, or `claude agents` when none do. To read session state from a script or another program, use `claude agents --json` rather than the files under `~/.claude/jobs/`. While agent view is open, Claude Code also sends a notification through your configured [terminal notification channel](</docs/en/terminal-config#get-a-terminal-bell-or-notification>) when a local background session starts needing your input, finishes, or fails. Sessions that run on a schedule, such as [`/loop`](</docs/en/scheduled-tasks>) sessions, notify only when they need your input. Notifications use the same [`preferredNotifChannel` setting](</docs/en/settings-reference#preferrednotifchannel>) as the rest of Claude Code and fire the [`Notification` hook](</docs/en/hooks#notification>) with the `agent_needs_input` or `agent_completed` type. Background sessions don’t need any terminal open to keep working. A separate supervisor process runs them, so you can close agent view, close your shell, or start a new interactive session and your dispatched work keeps going. Session state persists on disk through auto-updates and supervisor restarts. Sessions are also preserved when your machine sleeps. Their processes resume on wake and the supervisor reconnects to them instead of treating the time gap as idle. Shutting down still stops running sessions; see Sessions show as failed or stopped after shutdown for how to recover them. A session that was mid-response when the machine slept can come back unresponsive. When you open a session that has stopped responding, the supervisor restarts its process and the session continues the interrupted response from where it left off.
@@ -200,7 +200,7 @@
Attach to a session
-Press `Enter` or `→` on a selected row to attach. Agent view is replaced by the full interactive session. When you attach, Claude posts a short recap of what happened while you were away. While attached, the session behaves like any other Claude Code session: [commands](</docs/en/commands>), keyboard shortcuts, and features all work, with the exceptions below. While you’re attached, `/install-github-app` and the [`/mcp`](</docs/en/mcp>) settings list work normally, since a human at the terminal can complete their dialogs. When nobody is attached, these commands can’t open their dialogs, so the session appears under `Needs input` in agent view with a row such as `open this session to manage MCP servers`, and the transcript reply says the same. Attach and run the command again to continue; the needs-input row clears when you attach. `/mcp reconnect <server>`, `/mcp enable`, and `/mcp disable` work without attaching either way. Attached sessions always render in [fullscreen mode](</docs/en/fullscreen>), regardless of your `tui` setting, because a background session has no terminal scrollback to append to. Scroll with `PgUp`, `PgDn`, or the mouse wheel, and press `Ctrl+O` for transcript mode. Your terminal’s native scroll and tmux copy mode show only the current viewport, the same as when you run any fullscreen application. Press `←` on an empty prompt, or run `/exit`, to detach and return to agent view, whether you opened the session from agent view or with `claude attach <id>` from your shell. `←` also detaches while the [`/btw` overlay](</docs/en/interactive-mode#side-questions-with-%2Fbtw>) is open. Requires Claude Code v2.1.257 or later. A side question that’s still answering keeps running while you’re away. The next time you attach, the overlay reopens with it, or with its answer. On Windows, if you press `←` within about half a second of attaching, Claude Code shows `Ambiguous ←, press again to detach`, because in that window the terminal can redeliver a press from before you attached. Press `←` again to detach. `Ctrl+Z` also detaches but goes back to where you started instead: agent view if you attached from there, or your shell if you ran `claude attach`. Use `Ctrl+Z` when a dialog has focus and isn’t responding to `←`. `Ctrl+C` keeps its standard interrupt behavior while attached: it cancels a running response or `!` shell command rather than detaching. Pressing `Ctrl+C` twice on an empty prompt detaches, the same as in any session. Detaching never stops a background session: `←`, `Ctrl+Z`, `/exit`, and double `Ctrl+C` or double `Ctrl+D` all leave it running. To end a session from inside it, run `/stop`.
+Press `Enter` or `→` on a selected row to attach. Agent view is replaced by the full interactive session. When you attach, Claude posts a short recap of what happened while you were away. While attached, the session behaves like any other Claude Code session: [commands](</docs/en/commands>), keyboard shortcuts, and features all work, with the exceptions below. While you’re attached, `/install-github-app` and the [`/mcp`](</docs/en/mcp>) settings list work normally, since a human at the terminal can complete their dialogs. When nobody is attached, these commands can’t open their dialogs, so the session appears under `Needs input` in agent view with a row such as `open this session to manage MCP servers`, and the transcript reply says the same. Attach and run the command again to continue; the needs-input row clears when you attach. `/mcp reconnect <server>`, `/mcp enable`, and `/mcp disable` work without attaching either way. Attached sessions always render in [fullscreen mode](</docs/en/fullscreen>), regardless of your `tui` setting, because a background session has no terminal scrollback to append to. Scroll with `PgUp`, `PgDn`, or the mouse wheel, and press `Ctrl+O` for transcript mode. Your terminal’s native scroll and tmux copy mode show only the current viewport, the same as when you run any fullscreen application. An attached session doesn’t [report its status to your terminal](</docs/en/terminal-config#see-session-status-in-your-terminal>). Press `←` on an empty prompt, or run `/exit`, to detach and return to agent view, whether you opened the session from agent view or with `claude attach <id>` from your shell. `←` also detaches while the [`/btw` overlay](</docs/en/interactive-mode#side-questions-with-%2Fbtw>) is open. Requires Claude Code v2.1.257 or later. A side question that’s still answering keeps running while you’re away. The next time you attach, the overlay reopens with it, or with its answer. On Windows, if you press `←` within about half a second of attaching, Claude Code shows `Ambiguous ←, press again to detach`, because in that window the terminal can redeliver a press from before you attached. Press `←` again to detach. `Ctrl+Z` also detaches but goes back to where you started instead: agent view if you attached from there, or your shell if you ran `claude attach`. Use `Ctrl+Z` when a dialog has focus and isn’t responding to `←`. `Ctrl+C` keeps its standard interrupt behavior while attached: it cancels a running response or `!` shell command rather than detaching. Pressing `Ctrl+C` twice on an empty prompt detaches. Detaching never stops a background session: `←`, `Ctrl+Z`, `/exit`, and double `Ctrl+C` or double `Ctrl+D` all leave it running. If you detach while a `/loop` is waiting for its next iteration, the loop keeps running and that iteration starts on schedule without you. To stop the loop before you detach, see [Stop a loop](</docs/en/scheduled-tasks#stop-a-loop>). To end a session from inside it, run `/stop`.
####
@@ -214,14 +214,15 @@
* 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.
* Press `Ctrl+C` twice to exit to your shell.
-When Claude Code can’t reopen the conversation, it exits and prints a `claude --resume` command that resumes it. [Claude’s task list](</docs/en/interactive-mode#task-list>) moves to the background session with the conversation, so the checklist is intact when you return to that row. The row you pressed `←` from also keeps a bold, undimmed name after you move the selection with the arrow keys or the mouse, so you can tell which session you came from. If a tool is running when you press `←`, Claude Code waits for it to finish before backgrounding, and Claude continues the response in the background session. Press `←` again to background immediately instead of waiting. When in-flight work can’t carry over to the background session, Claude Code shows the `Background this session?` dialog first, the same as with `/background`. After about ten seconds, Claude Code backgrounds the session without waiting any longer, except in cases such as these:
+When Claude Code can’t reopen the conversation, it exits and prints a `claude --resume` command that resumes it. [Claude’s task list](</docs/en/interactive-mode#task-list>) moves to the background session with the conversation, so the checklist is intact when you return to that row. The row you pressed `←` from also keeps a bold, undimmed name after you move the selection with the arrow keys or the mouse, so you can tell which session you came from. If a tool is running when you press `←`, Claude Code waits for it to finish before backgrounding, and Claude continues the response in the background session. Press `←` again to background immediately instead of waiting. When in-flight background work can’t carry over to the background session, Claude Code shows the `Background this session?` dialog first, the same as with `/background`. After about ten seconds, Claude Code backgrounds the session without waiting any longer, except in cases such as these:
* **Foreground subagents are still running** : Claude Code keeps waiting so the work of the [foreground subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) Claude started carries over, and shows `Still backgrounding after the current tool`. Press `←` again to background without waiting, which restarts those subagents from the beginning.
- * **A permission prompt or question is waiting for your answer** : while a permission prompt or a question Claude asked waits, Claude Code keeps waiting and shows `Still backgrounding after the current tool — a question is waiting for your answer.`
+ * **A permission prompt or question is waiting for your answer** : while a permission prompt or a question Claude asked waits, Claude Code keeps waiting and shows `Still backgrounding after the current tool — a question is waiting for your answer.` If your answer lets the turn continue, such as **Yes** on a permission prompt, Claude Code backgrounds the session when the current tool finishes.
* **You type into the prompt input** : Claude Code cancels the switch, because unsent text stays in your terminal’s input box and wouldn’t move to the background session. It shows `Backgrounding cancelled — you have unsent text in the input. Send it or clear it, then press ← again.`
+ * **You stop the turn** : Claude Code cancels the switch and shows `Backgrounding cancelled — the turn was stopped.` For example, the turn stops when you [interrupt Claude with `Esc`](</docs/en/interactive-mode#general-controls>) or select **No** [without a comment](</docs/en/permissions#add-a-comment-when-you-answer-a-permission-prompt>) on a permission prompt from the main conversation, or press `Esc` on a question Claude asks there. Press `←` again to background the session.
* **A queued message can’t move** : messages you [queued while Claude was working](</docs/en/interactive-mode#queue-messages-while-claude-works>) move to the background session with the conversation. When one of them can’t, the session stays in the foreground and Claude Code shows a notice such as `Cannot open agents — 1 queued message can't move to the background. Press ← again once Claude has read it.`
-Pressing `←` creates the session’s row even when the conversation has no messages yet, so `→` still returns to it. You can turn this shortcut off for foreground sessions with the [`leftArrowOpensAgents`](</docs/en/settings-reference#leftarrowopensagents>) setting in `/config`.
+When Claude Code backgrounds the session, either after about ten seconds or after you press `←` again, it stops a shell command that Claude is still running in the foreground. Claude Code doesn’t show the `Background this session?` dialog for that command. In the background session, Claude has no record that the command started, so Claude may run the command again. To keep the command running when the session moves, press `Ctrl+B` to [turn it into a background command](</docs/en/interactive-mode#background-bash-commands>) while Claude Code is still waiting. Pressing `←` creates the session’s row even when the conversation has no messages yet, so `→` still returns to it. You can turn this shortcut off for foreground sessions with the [`leftArrowOpensAgents`](</docs/en/settings-reference#leftarrowopensagents>) setting in `/config`.
###
@@ -389,7 +390,7 @@
What carries over when you background
-Backgrounding starts a fresh process that resumes from the saved conversation, and in-flight work moves to it: running background shell commands, backgrounded subagents, dynamic workflows, scheduled tasks you created with [`/loop`](</docs/en/scheduled-tasks>), and Claude’s [automatic replies to artifact comments](</docs/en/artifacts#let-claude-reply-to-comments-on-its-own>) all carry over and keep running there. A subagent moves together with everything it started, so it carries over only when all of that work can move too. To stop in-flight work instead of carrying it over, set the [`CLAUDE_DISABLE_ADOPT=1`](</docs/en/env-vars#variables>) environment variable; Claude Code then asks you to confirm before backgrounding. When a [dynamic workflow](</docs/en/workflows>) still has subagents running, Claude Code asks before backgrounding with the `Background this session?` dialog, which says how many subagents would restart. Choose `Stay` to let them finish first. If you confirm, Claude Code replays the run in the background session: subagents that were still running start over from the beginning, so the tokens they used so far are spent again. See [Resume after a pause](</docs/en/workflows#resume-after-a-pause>) for which completed subagents return their saved results and which run again. Claude Code stops work that can’t carry over, such as a running [monitor](</docs/en/tools-reference#monitor-tool>), and stops a backgrounded subagent that owns a monitor along with it. When any such work is running, Claude Code shows the `Background this session?` dialog so you can confirm before it stops the work. Once in the background, the session can start new subagents, monitors, and background commands, and those keep running across later detach and reattach. Configuration flags from the original launch carry through to the backgrounded session, so its MCP servers, settings, and fallback model remain in effect:
+Backgrounding starts a fresh process that resumes from the saved conversation, and in-flight background work moves to it: running background shell commands, backgrounded subagents, dynamic workflows, scheduled tasks you created with [`/loop`](</docs/en/scheduled-tasks>), and Claude’s [automatic replies to artifact comments](</docs/en/artifacts#let-claude-reply-to-comments-on-its-own>) all carry over and keep running there. A subagent moves together with everything it started, so it carries over only when all of that work can move too. To stop in-flight background work instead of carrying it over, set the [`CLAUDE_DISABLE_ADOPT=1`](</docs/en/env-vars#variables>) environment variable; Claude Code then asks you to confirm before backgrounding. When a [dynamic workflow](</docs/en/workflows>) still has subagents running, Claude Code asks before backgrounding with the `Background this session?` dialog, which says how many subagents would restart. Choose `Stay` to let them finish first. If you confirm, Claude Code replays the run in the background session: subagents that were still running start over from the beginning, so the tokens they used so far are spent again. See [Resume after a pause](</docs/en/workflows#resume-after-a-pause>) for which completed subagents return their saved results and which run again. Claude Code stops background work that can’t carry over, such as a running [monitor](</docs/en/tools-reference#monitor-tool>), and stops a backgrounded subagent that owns a monitor along with it. When any such work is running, Claude Code shows the `Background this session?` dialog so you can confirm before it stops the work. Once in the background, the session can start new subagents, monitors, and background commands, and those keep running across later detach and reattach. Configuration flags from the original launch carry through to the backgrounded session, so its MCP servers, settings, and fallback model remain in effect:
* `--mcp-config` and `--strict-mcp-config`
* `--settings`
@@ -399,7 +400,7 @@
* `--fallback-model`
* `--allow-dangerously-skip-permissions`
-Directories you added during the session with [`/add-dir`](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) also carry through. Carrying `--allow-dangerously-skip-permissions` keeps `bypassPermissions` reachable in the backgrounded session, but it doesn’t grant anything new: the mode still requires the one-time interactive acceptance described in Permission mode, model, and effort.
+Directories you added during the session with [`/add-dir`](</docs/en/permissions#additional-directories-grant-file-access-not-configuration>) also carry through. Carrying `--allow-dangerously-skip-permissions` keeps `bypassPermissions` reachable in the backgrounded session, but it doesn’t grant anything new: the mode still needs your [acceptance of the bypass disclaimer](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) on record.
###
@@ -586,7 +587,7 @@
claude agents --permission-mode plan --model opus --effort high
-`--effort` here accepts the same values as the [top-level `--effort` flag](</docs/en/cli-reference#cli-flags>), including `ultracode`. `--agent` sets the [subagent](</docs/en/sub-agents>) used when a dispatch prompt doesn’t name one, either with `@name` or as the first word. It defaults to the [`agent` setting](</docs/en/settings-reference#agent>) if one is set, otherwise the built-in catch-all `claude` agent. Naming a subagent in the dispatch input overrides both. `claude agents` also accepts `--dangerously-skip-permissions` as shorthand for `--permission-mode bypassPermissions`, and `--allow-dangerously-skip-permissions` to make `bypassPermissions` available in each dispatched session’s `Shift+Tab` cycle without starting in that mode. Both match the [top-level CLI flags](</docs/en/cli-reference>). Pass `--restricted` to start every session you dispatch from the view in [restricted mode](</docs/en/cli-reference#cli-flags>), as if each were launched with the top-level `--restricted` flag. Requires Claude Code v2.1.248 or later. The active defaults appear in the footer below the dispatch input. Claude Code refuses `claude --bg --permission-mode bypassPermissions` until you’ve accepted the bypass disclaimer by running `claude --dangerously-skip-permissions` once interactively, since that mode lets a session you aren’t watching act without approval. Passing `--dangerously-skip-permissions` or `--permission-mode bypassPermissions` to `claude agents` shows the same disclaimer when you haven’t accepted it before, and accepting applies `bypassPermissions` to the sessions you launch from the view. Passing `--allow-dangerously-skip-permissions` shows the same disclaimer too, and accepting makes `bypassPermissions` available in the `Shift+Tab` cycle of those sessions without starting them in it.
+`--effort` here accepts the same values as the [top-level `--effort` flag](</docs/en/cli-reference#cli-flags>), including `ultracode`. `--agent` sets the [subagent](</docs/en/sub-agents>) used when a dispatch prompt doesn’t name one, either with `@name` or as the first word. It defaults to the [`agent` setting](</docs/en/settings-reference#agent>) if one is set, otherwise the built-in catch-all `claude` agent. Naming a subagent in the dispatch input overrides both. `claude agents` also accepts `--dangerously-skip-permissions` as shorthand for `--permission-mode bypassPermissions`, and `--allow-dangerously-skip-permissions` to make `bypassPermissions` available in each dispatched session’s `Shift+Tab` cycle without starting in that mode. Both match the [top-level CLI flags](</docs/en/cli-reference>). Pass `--restricted` to start every session you dispatch from the view in [restricted mode](</docs/en/cli-reference#cli-flags>), as if each were launched with the top-level `--restricted` flag. Requires Claude Code v2.1.248 or later. The active defaults appear in the footer below the dispatch input. A background session started in `bypassPermissions` mode needs your [acceptance of the bypass disclaimer](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) on record, since that mode lets a session you aren’t watching act without approval. Passing `--dangerously-skip-permissions` or `--permission-mode bypassPermissions` to `claude agents` shows the same disclaimer when you haven’t accepted it before, and accepting applies `bypassPermissions` to the sessions you launch from the view. Passing `--allow-dangerously-skip-permissions` shows the same disclaimer too, and accepting makes `bypassPermissions` available in the `Shift+Tab` cycle of those sessions without starting them in it.
####
@@ -594,7 +595,7 @@
What persists across restarts
-The permission mode, model, and effort you chose for a background session, along with the configuration flags it carries, all persist when the supervisor later stops and restarts its process. A session you launched with `claude --bg --dangerously-skip-permissions` or `claude --bg --permission-mode bypassPermissions` stays in `bypassPermissions` after that restart. A model or effort you changed mid-session with `/model` or `/effort` is kept too. If the session took its effort from your settings rather than from `--effort` or `/effort`, Claude Code reads your settings again each time it starts a process for the session. After you edit the saved effort in `settings.json`, the change reaches sessions you background with `←` or `/bg`, and their later restarts. The saved effort is the [`effortLevel`](</docs/en/settings-reference#effortlevel>) key or a [`modelSettings`](</docs/en/settings-reference#modelsettings>) entry. Claude Code also keeps a name you set with [`/rename`](</docs/en/commands>) or `Ctrl+R` across that restart, so you can still run [`claude --resume <name>`](</docs/en/sessions#name-your-sessions>) to reach the session. A prompt you stashed with [`Ctrl+S`](</docs/en/interactive-mode#general-controls>) while attached is kept with the session too. Reopen the session after its process was stopped or restarted, and press `Ctrl+S` to restore the stashed text. Pasted content in the stash doesn’t survive the restart.
+The permission mode, model, and effort you chose for a background session, along with the configuration flags it carries, all persist when the supervisor later stops and restarts its process. A model or effort you changed mid-session with `/model` or `/effort` is kept too. If the session took its effort from your settings rather than from `--effort` or `/effort`, Claude Code reads your settings again each time it starts a process for the session. After you edit the saved effort in `settings.json`, the change reaches sessions you background with `←` or `/bg`, and their later restarts. The saved effort is the [`effortLevel`](</docs/en/settings-reference#effortlevel>) key or a [`modelSettings`](</docs/en/settings-reference#modelsettings>) entry. Claude Code also keeps a name you set with [`/rename`](</docs/en/commands>) or `Ctrl+R` across that restart, so you can still run [`claude --resume <name>`](</docs/en/sessions#name-your-sessions>) to reach the session. A prompt you stashed with [`Ctrl+S`](</docs/en/interactive-mode#general-controls>) while attached is kept with the session too. Reopen the session after its process was stopped or restarted, and press `Ctrl+S` to restore the stashed text. Pasted content in the stash doesn’t survive the restart.
###
@@ -635,16 +636,16 @@
`claude attach <id|name>`| Attach to a session in this terminal
`claude logs <id|name>`| Print the session’s recent output
`claude stop <id>`| Stop a session. Also accepts `claude kill`
-`claude respawn <id>`| Restart a session, running or stopped, e.g. to pick up an updated Claude Code binary. The restarted session resumes its saved conversation; when none is on disk, it runs its original prompt again as a new conversation
+`claude respawn <id>`| Restart a session, running or stopped, for example to pick up an updated Claude Code binary. A session that has a saved conversation resumes it
`claude respawn --all`| Restart every running session, e.g. to move all sessions onto an updated Claude Code binary at once
`claude rm <id>`| Remove a session from the list, along with a worktree Claude created for it when that’s safe to delete; see What deleting a session removes. The conversation transcript stays on your local machine and remains available through `claude --resume`
`claude rm <id> --discard-unpushed <commit>@<worktree-id>`| Delete a session whose delete was refused over unpushed commits, discarding the worktree along with its branch and commits. Pass the exact value that refusal printed; see What deleting a session removes. Requires v2.1.260 or later
`claude rm <id> --force-remove-worktree <worktree-id>`| Delete a session whose delete was refused because git or the `WorktreeRemove` hook couldn’t remove its worktree, deleting the worktree directory anyway and leaving its branch in the repository. Pass the exact value that refusal printed; see What deleting a session removes. Requires v2.1.268 or later
`claude daemon status`| Print the supervisor’s state, version, socket directory, and worker count
`claude daemon logs`| Follow the supervisor’s log file, `~/.claude/daemon.log`, printing new lines as they arrive until you press `Ctrl+C`
-`claude daemon stop --any`| Stop the supervisor process and the background sessions it hosts. Pass `--keep-workers` to leave background sessions running so the next supervisor reconnects to them. The next `claude agents` or `claude --bg` starts a fresh supervisor
-
-`claude attach` and `claude logs` can take part of a session’s name in place of the ID, as in `claude logs "auth refactor"`. Passing a name requires Claude Code v2.1.290 or later.
+`claude daemon stop --any`| Stop the supervisor process and the background sessions it hosts. Pass `--keep-workers` to leave background sessions running for the next supervisor to reconnect to. The next `claude agents` or `claude --bg` starts a fresh supervisor
+
+`claude attach` and `claude logs` can take part of a session’s name in place of the ID, as in `claude logs "auth refactor"`. `claude attach` opens a session by name only while its process is running, so pass the ID instead to restart a stopped session. Passing a name requires Claude Code v2.1.290 or later.
###
@@ -700,6 +701,7 @@
* **Finished or waiting for your next message, and unattached for about an hour** : the supervisor stops the process to free resources. A session that ended its turn by asking you a question counts as waiting for your next message. The conversation stays on disk, and the next time you attach or reply, the session resumes where it left off. Pin a session with `Ctrl+T` to keep its process running.
* **Exited unexpectedly while the supervisor is running** : the supervisor restarts the process. Ending a session you backgrounded yourself with `←` or `/background`, for example with `kill`, marks it stopped instead of restarting it. For sessions that ended with a shutdown, see Sessions show as failed or stopped after shutdown.
* **After an auto-update** : the supervisor restarts itself onto the new version and moves idle sessions over in the background. Sessions that are working, waiting on you, or attached aren’t interrupted.
+ * **The supervisor itself stops** , for example because its process was ended from outside Claude Code: on macOS and Linux, each session’s process waits about a minute for a new supervisor to reconnect to it, and stops if none does. Run `claude agents` in your shell within that minute to start a new supervisor and keep your sessions running. If the minute passes first, the sessions stop, but their saved conversations stay on disk: attach or reply to a session and it restarts from its saved conversation, as described under Sessions show as failed or stopped after shutdown.
When a session’s process stops or restarts, the background shell commands, dynamic workflows, and background subagents Claude started in it carry over to its next process; running monitors and shell commands a subagent started stop with the process. Deleting the session stops everything it carried over. To stop all of it with the process instead, set [`CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF`](</docs/en/env-vars#variables>) to `1`. The supervisor and its sessions authenticate with the same stored credentials as your interactive sessions. For which settings and shell variables reach a session, including `PATH`, see Settings and provider. For gateway endpoints, see LLM gateway.
@@ -718,7 +720,7 @@
`~/.claude/jobs/<id>/state.json`| Per-session state shown in agent view. Read it through `claude agents --json` instead of parsing the file
`~/.claude/jobs/<id>/tmp/`| Per-session scratch directory. Claude’s `Write` and `Edit` calls here don’t prompt for permission. Removed when the session is deleted
-Each background session has the `CLAUDE_JOB_DIR` environment variable set to its `~/.claude/jobs/<id>` directory, so shell commands the session runs can write temporary files to `$CLAUDE_JOB_DIR/tmp` without colliding with parallel sessions. To inspect this state without reading the files directly, run `claude daemon status`. It reports whether the supervisor is reachable, its process ID and version, the socket directory, and how many background sessions are live. The command also warns when the running supervisor is on a different version than the `claude` you invoked, which happens after an update the supervisor hasn’t restarted into yet. The warning shows both versions and tells you to run `claude daemon stop --any` to pick up the new version. When Claude Code is installed as an OS service, the suggested command is `claude daemon stop` without the flag. Sessions survive that version mismatch intact: an older Claude Code version that updates a session’s `state.json` preserves fields it doesn’t recognize and keeps the session listed. The session list in `roster.json` follows the same rule, so sessions started by the newer version stay reachable and keep accepting input after the supervisor restarts.
+Each background session has the `CLAUDE_JOB_DIR` environment variable set to its `~/.claude/jobs/<id>` directory, so shell commands the session runs can write temporary files to `$CLAUDE_JOB_DIR/tmp` without colliding with parallel sessions. To inspect this state without reading the files directly, run `claude daemon status`. It reports whether the supervisor is reachable, its process ID and version, the socket directory, and how many background sessions are live. The command also warns when the running supervisor is on a different version than the `claude` you invoked, which happens after an update the supervisor hasn’t restarted into yet. The warning shows both versions and tells you to run `claude daemon stop --any` to pick up the new version. Sessions survive that version mismatch intact: an older Claude Code version that updates a session’s `state.json` preserves fields it doesn’t recognize and keeps the session listed. The session list in `roster.json` follows the same rule, so sessions started by the newer version stay reachable and keep accepting input after the supervisor restarts.
###
@@ -756,9 +758,9 @@
Backgrounding shows a `Background this session?` dialog
-If you press `←` to background the current session and Claude Code shows a `Background this session?` dialog, the session has in-flight work that backgrounding would stop, restart, or leave running unattended, and Claude Code asks before it does any of those:
-
- * **Work that can’t move** : the session has work that can’t move to the background session, such as a running [monitor](</docs/en/tools-reference#monitor-tool>). The dialog names the work Claude Code would stop and, separately, counts the tasks that carry over.
+If you press `←` to background the current session and Claude Code shows a `Background this session?` dialog, the session has in-flight background work that backgrounding would stop, restart, or leave running unattended, and Claude Code asks before it does any of those:
+
+ * **Work that can’t move** : the session has work that can’t move to the background session, such as a running [monitor](</docs/en/tools-reference#monitor-tool>). The dialog names the background work Claude Code would stop and, separately, counts the tasks that carry over.
* **A workflow with running subagents** : a [dynamic workflow](</docs/en/workflows>) still has subagents running. The workflow itself carries over, but its running subagents restart from the beginning, and the dialog says how many.
* **Automatic artifact replies** : Claude is [replying to comments on an artifact on its own](</docs/en/artifacts#let-claude-reply-to-comments-on-its-own>). Those replies continue in the background session, and the dialog says so.
@@ -780,7 +782,7 @@
Shutting down or restarting your machine stops running background sessions. A session that was waiting on your input stays under `Needs input` when you come back. For any other running session, what agent view shows depends on how long ago it last made progress:
- * Within 48 hours, the session shows as failed. Attach or reply to it and it restarts from where it left off.
+ * Within 48 hours, the session shows as failed. Attach or reply to it and it restarts from its saved conversation. To pick the interrupted work back up, send it a reply asking it to continue.
* Past 48 hours, such as after the machine was off for days, the session shows as stopped with `ended while the background service was off`. Press `Enter` on the row and the footer shows `Press enter again to resume this session (it ended while the background service was off), or ctrl+x to delete it.` Press `Enter` on the same row again to resume its saved conversation. A reply, or `claude attach <id>`, resumes it without that footer prompt.
When [transcript cleanup](</docs/en/settings-reference#cleanupperioddays>) has removed a stopped session’s saved conversation, Claude Code refuses to open the row: the message says there is nothing to resume. `claude rm <id>` deletes the row, except in the kept cases described above, and `claude respawn <id>` runs its original prompt again. See [This session’s saved conversation is no longer on disk](</docs/en/errors#this-sessions-saved-conversation-is-no-longer-on-disk>). Sleep alone doesn’t stop sessions. Sessions are preserved across sleep and the supervisor reconnects to them on wake.
@@ -837,7 +839,7 @@
claude daemon stop --any --keep-workers
-The new supervisor reconnects to the running sessions. Without `--keep-workers`, the command ends the background sessions too. The `--any` flag confirms you want to stop a supervisor that started on demand rather than as an installed service, which is the default. A supervisor that starts but can’t accept connections exits and releases its lock on its own, so the next `claude agents` starts a fresh one without this manual stop. The steps above apply when a running supervisor stalls. If the command instead exits saying the recorded process couldn’t be verified as the supervisor, check the reported process ID: if it’s a supervisor you own, stop it yourself, then delete `~/.claude/daemon.lock` so the next `claude agents` starts fresh. On Windows, if the supervisor doesn’t respond to the stop request, the command prints its process ID. End that process with `taskkill /PID <pid>` to finish the recovery. Background sessions are still preserved when you passed `--keep-workers`.
+Then run `claude agents` in your shell to start the new supervisor. If you do that within about a minute of the stop, it reconnects to the still-running sessions, and their work continues uninterrupted. If you take longer, on macOS and Linux the sessions have stopped on their own by then, and attaching or replying to one restarts it from its saved conversation. Without `--keep-workers`, the command ends the background sessions too. The `--any` flag makes the command stop a supervisor that Claude Code started on demand. A supervisor that starts but can’t accept connections exits and releases its lock on its own, so the next `claude agents` starts a fresh one without this manual stop. The steps above apply when a running supervisor stalls. If the command instead exits saying the recorded process couldn’t be verified as the supervisor, check the reported process ID: if it’s a supervisor you own, stop it yourself, then delete `~/.claude/daemon.lock` so the next `claude agents` starts fresh. On Windows, if the supervisor doesn’t respond to the stop request, the command prints its process ID. End that process with `taskkill /PID <pid>` to finish the recovery. Background sessions are still preserved when you passed `--keep-workers`.
###
@@ -849,7 +851,7 @@
claude daemon stop --any --keep-workers
-The next `claude agents` or `claude --bg` starts a fresh supervisor that reads your stored credentials. If you authenticate with an environment variable such as `ANTHROPIC_API_KEY` rather than `/login`, run that next command from a shell where the variable is set. See the [error reference](</docs/en/errors#could-not-resolve-authentication-method>) for the full list of causes and fixes.
+Within about a minute, run `claude agents` or `claude --bg` in your shell to start a fresh supervisor that reads your stored credentials. If you authenticate with an environment variable such as `ANTHROPIC_API_KEY` rather than `/login`, run that next command from a shell where the variable is set. See the [error reference](</docs/en/errors#could-not-resolve-authentication-method>) for the full list of causes and fixes.
###
@@ -998,7 +1000,7 @@
v2.1.199| A background session whose process exits before it finishes starting on a low-memory host shows `possibly low memory — free some up and retry` in its row status instead of only the bare exit reason. Backgrounding a session with `←` or `/background` carries its `/color` over to the new row.
v2.1.198| Agent view sends a notification through `preferredNotifChannel` when a background session needs input, finishes, or fails, and fires the `Notification` hook with the `agent_needs_input` or `agent_completed` type. `←` and `/exit` inside `claude attach <id>` return to agent view instead of exiting to the shell; `Ctrl+Z` returns to the shell. A background session that isolated its work in a worktree commits, pushes its own isolated branch, never `main` or `master`, and opens a draft pull request when it finishes instead of asking first. `/login` runs in agent view and opens the sign-in dialog. The `Background work is running` exit dialog offers `Move to background and exit`. The exit handoff also covers background subagents, which resume from their transcript on the next wake instead of being reported as failed. `claude --bg` combined with `-p` or `--print` is rejected with an error. The background session host requests macOS Local Network permission on first LAN access instead of failing with `connect: no route to host`.
v2.1.196| A single `←` press backgrounds a foreground session; earlier versions required two presses, with a footer hint and a confirm. `--dangerously-skip-permissions` passed to `claude agents` shows the bypass disclaimer instead of being silently dropped. Interactive sessions you never named carry a default name such as `my-app-3f` in session listings and `claude agents --json`. Background shell commands and dynamic workflows survive the session’s process being stopped, restarted, or updated, including on Windows; set `CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF=1` to turn the handoff off. A transcript misread as empty on restart is renamed with an `.orphaned-` suffix instead of deleted.
-v2.1.195| In-flight work carries over when you background a session on Windows too; set `CLAUDE_DISABLE_ADOPT=1` to stop it instead. The `Completed` group fills the remaining vertical space and the header compacts on short terminals. An older Claude Code version no longer drops newer sessions’ `state.json` fields or hides those sessions from `claude agents`. Attaching to a stopped session switches immediately instead of showing a blank screen for up to five seconds. A supervisor that can’t accept connections exits and releases its lock on its own.
+v2.1.195| In-flight background work carries over when you background a session on Windows too; set `CLAUDE_DISABLE_ADOPT=1` to stop it instead. The `Completed` group fills the remaining vertical space and the header compacts on short terminals. An older Claude Code version no longer drops newer sessions’ `state.json` fields or hides those sessions from `claude agents`. Attaching to a stopped session switches immediately instead of showing a blank screen for up to five seconds. A supervisor that can’t accept connections exits and releases its lock on its own.
v2.1.191| `claude --bg` with an `--agent` name that doesn’t match any of your subagents fails the launch: the session exits immediately with an `--agent '<name>' not found` error instead of running with the default agent.
v2.1.174| Background sessions no longer inherit gateway endpoint variables such as `ANTHROPIC_BASE_URL` from the supervisor’s launch shell; the supervisor supplies a fresh credential snapshot to pre-warmed workers, fixing spurious `Could not resolve authentication method` errors.
v2.1.172| `/model` in the dispatch input sets a session-scoped dispatch model override.
--- a/analytics.md
+++ b/analytics.md
@@ -61,7 +61,7 @@
* **“GitHub app required”** : install the GitHub app to view contribution metrics
* **“Data processing in progress”** : check back in a few days and confirm the GitHub app is installed if data doesn’t appear
-Contribution metrics support GitHub Cloud and GitHub Enterprise Server.
+Contribution metrics cover repositories hosted on github.com. For repositories on [GitHub Enterprise Server](</docs/en/github-enterprise-server>), the analytics dashboard shows usage metrics only.
###
--- a/api.md
+++ b/api.md
@@ -277,11 +277,12 @@
`$.session`| `messages()` returns the transcript as a list of `{ role, text, toolUses }`. Also the working directory, model, and more. [`usage()`](</docs/en/plugins/mods/reference#mods-api-methods>) returns context window use and plan limits.
`$.mcp`| `call` a tool on a connected MCP server
-Files and processes have a few rules of their own:
-
- * **Paths** : a relative path resolves against the session’s working directory
+Files, processes, and requests have a few rules of their own:
+
+ * **Paths** : a relative path resolves against the working directory of the session, or of the subagent whose event the hook is handling
* **`$.fs.list`** : returns one directory’s entries as `{ name, kind, size, isLink }` and isn’t recursive
* **`$.process.run`** : takes an argument list and uses no shell. It resolves to `{ exitCode, stdout, stderr }` whatever the exit code. It rejects if the program can’t start or is still running at the timeout, which is 30 seconds by default, so wrap it in `try` and `catch`.
+ * **`$.http.fetch`** : follows up to five redirects. On a redirect to a different origin, it keeps only the `accept`, `accept-language`, `content-type`, and `user-agent` request headers you set and drops the rest, so a request that depends on another header, such as `Authorization`, can fail after that redirect. The [limits](</docs/en/plugins/mods/reference#limits>) give its timeout and body sizes.
Every one of these calls is itself an event, named for its namespace and method without the `$.`, such as `fs.read` for `$.fs.read`. A mod [earlier in the chain](</docs/en/plugins/mods/events#the-order-mods-run-in>) can observe, rewrite, or refuse your call, which is how an organization restricts what mods reach. A mod can refuse your `$.process.spawn` call after the command has produced output or exited, and nothing the command did is undone. The call then rejects with a message that ends with one of these strings and the refusing mod’s reason:
--- a/authentication.md
+++ b/authentication.md
@@ -92,7 +92,7 @@
You can add users through either method:
- * Bulk invite users from within the Console: Settings -> Members -> Invite
+ * Bulk invite users from the Console’s Members page at [platform.claude.com/settings/members](<https://platform.claude.com/settings/members>): click **Invite**
* [Set up SSO](<https://support.claude.com/en/articles/13132885-setting-up-single-sign-on-sso>)
3
--- a/auto-mode-classifier-billing.md
+++ b/auto-mode-classifier-billing.md
@@ -0,0 +1,55 @@
+In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), a classifier checks actions such as shell commands and network requests before they run. Wherever [server-side checks are on](</docs/en/permission-modes#server-side-classifier-review>), the server performs those checks as part of the session’s own model requests, at no charge. This notice means the server’s checks aren’t reaching your session, so Claude Code is making its own classifier requests instead, and on your account those requests count toward your token usage:
+
+ We're changing auto mode to no longer charge for classifier requests in Claude Code. However, this session isn't eligible.
+
+At the prompt, Claude Code holds the first action it would check that way until you answer. Nothing is broken: auto mode keeps working, and its classifier requests are billed as they were before. The most common cause is an LLM gateway or proxy between Claude Code and the API, and when Claude Code can identify one, the notice names it. Press **Enter** to continue, or see Make the session eligible to keep it from appearing in new sessions.
+
+##
+
+
+
+Respond to the notice
+
+The notice holds the action until you answer it:
+
+ * **Enter** continues: the held action and the rest of the session use Claude Code’s own classifier requests, billed as token usage as before, and the notice doesn’t appear again in that session. When the notice named a gateway, acknowledging it keeps it from reappearing on this machine for 24 hours. When it didn’t, the notice returns the next time a session falls back.
+ * **Esc** or **Ctrl+C** cancels: the held action doesn’t run and the current turn stops, with the session still in auto mode. Nothing is remembered, so the notice appears again before the next checked action.
+
+To stop using auto mode instead, switch permission modes with `Shift+Tab` after you answer. Where the notice can’t wait for an answer, Claude Code reports the same text and the session continues in auto mode, unless a gateway acknowledgment on this machine in the last 24 hours has dismissed it. In [non-interactive mode](</docs/en/headless>) with `-p` it prints the text to stderr, and in `stream-json` output it emits a `system` warning message, which Agent SDK applications can read from the message stream.
+
+##
+
+
+
+Make the session eligible
+
+If a gateway is the cause, ask your company’s admin or your gateway provider to pass requests and replies through unchanged. That means forwarding request headers and body fields as they are, including ones the gateway doesn’t recognize such as the `safeguards` request field, and returning responses and streaming events without dropping keys such as the `safeguard_results` field or rewriting tool-use IDs, as the [gateway compatibility guide](</docs/en/llm-gateway-protocol#feature-pass-through>) describes. A gateway that passes traffic through this way keeps working with this feature and with future ones. New sessions then use the server’s checks again. If you already know that your gateway can’t provide the server’s checks, tell Claude Code not to ask for them there by setting `CLAUDE_CODE_AUTO_MODE_SERVER` to `0` before you start the session, in your shell or in the [`env` settings key](</docs/en/settings-reference#env>):
+
+ export CLAUDE_CODE_AUTO_MODE_SERVER=0
+
+Classifier requests are then always Claude Code’s own, billed the same way, and the notice doesn’t appear. On a direct connection to the Anthropic API, the variable requires Claude Code v2.1.281 or later. Setting `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` while `CLAUDE_CODE_AUTO_MODE_SERVER` is unset turns the server’s checks off as well, except as [Disable pre-release capabilities](</docs/en/llm-gateway-protocol#disable-pre-release-capabilities>) describes. `CLAUDE_CODE_AUTO_MODE_SERVER` is a temporary setting and may be removed in a later release.
+
+##
+
+
+
+Why the notice appears
+
+[Server-side classifier review](</docs/en/permission-modes#server-side-classifier-review>) lists which sessions ask the server for the classifier checks. Pro, Max, and Team plans never show the notice. When it appears, the usual causes are:
+
+ * **An LLM gateway or proxy is in the path** : one that strips or rewrites request headers, drops request fields it doesn’t recognize, or edits responses. The server then never receives the request for checks, or Claude Code never receives the results. When your configuration or the responses identify the gateway, the notice names it.
+ * **Server-side checks haven’t reached your platform, region, or credential yet** : whether a platform or region performs them depends on that platform’s rollout. If you see the notice with no gateway or proxy in the path and it keeps appearing, this is the likely cause. To confirm, contact support or your company’s admin, or report it with `/feedback`.
+
+To check a session that’s in auto mode, run `/status` at the Claude Code prompt: its **Auto mode server** row reads `Enabled` while the server’s checks decide the session’s actions and `Disabled` once the session has fallen back. When a gateway cuts responses short or rewrites the results into a form Claude Code can’t read, you get denials with no verdict in place of this notice; see [Server-side classifier review](</docs/en/permission-modes#server-side-classifier-review>).
+
+##
+
+
+
+Related resources
+
+ * [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): what auto mode is and what it blocks by default
+ * [Server-side classifier review](</docs/en/permission-modes#server-side-classifier-review>): which sessions ask the server to check actions, and the Claude Code version each one requires
+ * [Gateway compatibility guide](</docs/en/llm-gateway-protocol#feature-pass-through>): what breaks when a gateway strips headers or body fields
+ * [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>): the denial you see when the server gives no verdict for an action
+ * [Manage costs effectively](</docs/en/costs>): track token usage and reduce Claude Code costs
--- a/auto-mode-config.md
+++ b/auto-mode-config.md
@@ -323,7 +323,7 @@
Fix a denial with an allow rule, an environment entry, or a retry
-To see what the classifier blocked, find the tool call in the conversation. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. Two other places on screen that report denials leave out the command or URL: the notice near the input box, such as `bash denied by auto mode · [Data Exfiltration] · /permissions`, gives the tool and the reason, and the **Recently denied** tab lists a shell command by the description Claude wrote for it. To capture the exact input of these denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. The text beneath the call tells you whether there is anything to fix. Text that reports a problem with the classifier itself, such as a model that `is temporarily unavailable` or a classifier error, means Claude Code blocked the call without a final verdict from the classifier; see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `[Production Deploy]` or `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do:
+To see what the classifier blocked, find the tool call in the conversation. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. Two other places on screen that report denials leave out the command or URL: the notice near the input box, such as `bash denied by auto mode · [Data Exfiltration] · /permissions`, gives the tool and the reason, and the **Recently denied** tab lists a shell command by the description Claude wrote for it. To capture the exact input of these denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. The text beneath the call tells you whether there is anything to fix. A dim `Not run · auto mode's check had no usable answer` row, or text that reports a problem with the classifier itself, such as `Auto mode could not evaluate this action`, means Claude Code blocked the call without a verdict from the classifier. For a `Not run` row, press `Ctrl+O` to read the full message, then see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) or [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `[Production Deploy]` or `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do:
* A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`.
* A command you want to run without review from now on: add an `allow` rule.
--- a/checkpointing.md
+++ b/checkpointing.md
@@ -118,7 +118,7 @@
Messages sent mid-turn not checkpointed
-When a message you [queue while Claude works](</docs/en/interactive-mode#queue-messages-while-claude-works>) reaches Claude within the running turn, it joins that turn instead of starting a new one. The message appears in the conversation, but Claude Code doesn’t create a checkpoint for it. A queued message that Claude Code sends as part of a new turn gets a checkpoint as usual, including when several queued messages [share that turn](</docs/en/interactive-mode#when-claude-code-sends-what-you-queued>). To undo the edits Claude made after such a message, rewind to the prompt that started the turn. That rewinds the whole turn, including the work Claude did before your message arrived.
+In the rewind menu, a message you [typed while Claude was still working](</docs/en/interactive-mode#queue-messages-while-claude-works>) can be marked **No code restore**. Claude read that message before its turn ended. Checkpoints are taken for prompts that start a turn, so this message has none of its own. The edits Claude made after reading it count toward the prompt that started the turn. You don’t need to do anything about the message itself. To undo the file changes from that part of the session, select the prompt that started the turn and choose **Restore code** or **Restore code and conversation**. That reverts Claude’s file edits from the whole turn, including the ones from before your message arrived. Selecting the marked message still offers **Restore conversation** , which rewinds the conversation to it and leaves your files as they are.
###
modified
Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry
View current →
--- a/claude-apps-gateway.md
+++ b/claude-apps-gateway.md
@@ -225,7 +225,7 @@
Connect developers
-Developers connect from their own laptops with one browser sign-in, using their corporate work account. They don’t need a claude.ai account, an API key, or a subscription, because requests to the model go through the gateway using the organization’s upstream credential. Connection is driven by the [client-side managed settings](</docs/en/claude-apps-gateway-config#client-side-managed-settings>) you push via MDM, so there is no manual setup on the developer side; this section covers what the admin configures. The CLI fingerprints the gateway’s TLS leaf certificate on first connect and pins it per hostname. It checks that pin again during sign-in, on silent session refreshes, and on managed-settings fetches, while inference requests use standard TLS validation without the pin. Requests routed through an HTTPS proxy skip the pin check, so add the gateway host to `NO_PROXY` to keep them direct. Publish the expected SHA-256 fingerprint alongside the gateway URL so developers have something to compare against. The `/login` prompt shows the first 16 characters of the fingerprint as lowercase hexadecimal with no colons. To print the full fingerprint in that form from the certificate file, run:
+Developers connect from their own laptops with one browser sign-in, using their corporate work account. They don’t need a claude.ai account, an API key, or a subscription, because requests to the model go through the gateway using the organization’s upstream credential. Connection is driven by the [client-side managed settings](</docs/en/claude-apps-gateway-config#client-side-managed-settings>) you push via MDM, and this section covers what the admin configures. The CLI fingerprints the gateway’s TLS leaf certificate on first connect and pins it per hostname. It checks that pin again during sign-in, on silent session refreshes, and on managed-settings fetches, while inference requests use standard TLS validation without the pin. Requests routed through an HTTPS proxy skip the pin check, so add the gateway host to `NO_PROXY` to keep them direct. Publish the expected SHA-256 fingerprint alongside the gateway URL so developers have something to compare against. The `/login` prompt shows the first 16 characters of the fingerprint as lowercase hexadecimal with no colons. To print the full fingerprint in that form from the certificate file, run:
openssl x509 -noout -fingerprint -sha256 -in cert.pem | cut -d= -f2 | tr -d : | tr 'A-F' 'a-f'
@@ -237,7 +237,7 @@
Set the gateway URL
-Three keys go in the per-OS [managed settings file](</docs/en/managed-settings#delivery-mechanisms>) you deploy via MDM or directly on disk. `forceLoginMethod` and `forceLoginGatewayUrl` open `/login` directly on the **Cloud gateway** screen with the URL filled in, and `parentSettingsBehavior: "merge"` lets Claude Desktop deliver the gateway’s egress allowlist to the Claude Code sessions it launches, explained in Deliver policy to Claude Desktop sessions:
+Three keys go in the per-OS [managed settings file](</docs/en/managed-settings#delivery-mechanisms>) you deploy via MDM or directly on disk. For a machine with no managed settings, see Set the gateway URL in user settings instead. `forceLoginMethod` and `forceLoginGatewayUrl` open `/login` directly on the **Cloud gateway** screen with the URL filled in, and `parentSettingsBehavior: "merge"` lets Claude Desktop deliver the gateway’s egress allowlist to the Claude Code sessions it launches, explained in Deliver policy to Claude Desktop sessions:
{
"forceLoginMethod": "gateway",
@@ -245,7 +245,25 @@
"parentSettingsBehavior": "merge"
}
-The developer presses Enter to connect. The first-connect TLS fingerprint prompt still appears. Once the file is on a machine, a developer who hasn’t completed the gateway sign-in sees one of the messages described under [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>). Developers who select a cloud provider through an environment variable such as `CLAUDE_CODE_USE_BEDROCK` don’t need the gateway sign-in. A developer can’t set this up manually. The login picker has no gateway option, and `forceLoginGatewayUrl` is ignored in a developer’s own settings files. `forceLoginMethod` alone, without a URL, leaves the developer at a “Contact your IT administrator” message. The login keys belong in the file you push to machines, not in the gateway’s `managed.policies[].cli` block, which only reaches clients that are already connected.
+The developer presses Enter to connect. The first-connect TLS fingerprint prompt still appears. Once the file is on a machine, a developer who hasn’t completed the gateway sign-in sees one of the messages described under [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>). Developers who select a cloud provider through an environment variable such as `CLAUDE_CODE_USE_BEDROCK` don’t need the gateway sign-in. The login picker has no gateway option, and in managed settings `forceLoginMethod` alone, without a URL, leaves the developer at a “Contact your IT administrator” message. The login keys belong in the file you push to machines, not in the gateway’s `managed.policies[].cli` block, which only reaches clients that are already connected.
+
+####
+
+
+
+Set the gateway URL in user settings
+
+On machines with no managed settings, have each developer add `forceLoginMethod` and `forceLoginGatewayUrl` to their own user settings file, `~/.claude/settings.json`. This requires Claude Code v2.1.295 or later on the developer machine. This example names a gateway at `claude-gateway.internal.example.com`:
+
+ {
+ "forceLoginMethod": "gateway",
+ "forceLoginGatewayUrl": "https://claude-gateway.internal.example.com"
+ }
+
+When the developer runs `/login` at the Claude Code prompt, the **Cloud gateway** screen opens on that address and they press Enter to connect. The first-connect TLS fingerprint prompt still appears. These limits apply to keys set this way:
+
+ * **User settings only** : Claude Code reads the two keys from `~/.claude/settings.json`, not from a project’s `.claude/settings.json` or `.claude/settings.local.json`.
+ * **Managed settings turn them off** : once an administrator’s settings reach the machine through a managed settings file, a macOS plist or Windows HKLM policy, or a [policy helper](</docs/en/settings-reference#policyhelper>), Claude Code ignores a gateway named in user settings.
###
--- a/claude-apps-gateway-config.md
+++ b/claude-apps-gateway-config.md
@@ -1435,7 +1435,7 @@
"parentSettingsBehavior": "merge"
}
-`parentSettingsBehavior: "merge"` keeps Claude Desktop’s delivery of the egress allowlist to its embedded Claude Code sessions working; [Deliver policy to Claude Desktop sessions](</docs/en/claude-apps-gateway#deliver-policy-to-claude-desktop-sessions>) explains the mechanism and where the opt-in must sit. To stop developers from bypassing the gateway with a cloud provider variable or an `ANTHROPIC_BASE_URL` of their own, add `"allowedProviders": ["gateway"]` to the same file. Claude Code then refuses every session on the machine that isn’t set up for a Cloud gateway, and admits a gateway only when it is the one `forceLoginGatewayUrl` names or one whose URL the file’s `env` block sets as `ANTHROPIC_BASE_URL`. `claude gateway` refuses to run on a machine that sets the list, so keep the key off the gateway host. See the [`allowedProviders`](</docs/en/settings-reference#allowedproviders>) entry in the settings reference. Requires Claude Code v2.1.285 or later. Deploy the `managed-settings.json` file to each device, typically via your MDM platform. The file path differs by platform. See [where each mechanism stores the policy](</docs/en/managed-settings#where-each-mechanism-stores-the-policy>). By default, a registry policy on Windows or a managed-preferences plist on macOS replaces the `managed-settings.json` file rather than merging with it, apart from the exception keys and cross-source checks above. All three keys in this snippet follow the highest-priority-source rule, so fleets that deliver policy through Group Policy or configuration profiles must put all three in that mechanism instead. For Claude Desktop, set the `bootstrapUrl` key in Claude Desktop’s own [managed configuration](<https://claude.com/docs/third-party/claude-desktop/configuration>) to `<listen.public_url>/user/bootstrap`. The sign-in flow and per-group policy then match the CLI’s once a policy opts in server-side with a `desktop` key; without the opt-in, `/user/bootstrap` returns 404. See Claude Desktop overlay for the server-side half. Claude Code honors [`forceLoginGatewayUrl`](</docs/en/settings-reference#forcelogingatewayurl>), [`gatewayInternalNetworks`](</docs/en/settings-reference#gatewayinternalnetworks>), and the `"gateway"` value of [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) only from a managed source on the machine: `managed-settings.json`, the macOS plist or Windows HKLM registry, or a policy helper. Setting them in a developer’s own `~/.claude/settings.json` or in the gateway payload doesn’t configure the gateway sign-in. Leave `forceLoginMethod` and `forceLoginOrgUUID` out of the payload. Claude Code still reads both keys from the payload for its startup credential check, so a developer who keeps an Anthropic-issued credential on the machine gets the startup exit described under [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) even after they sign in.
+`parentSettingsBehavior: "merge"` keeps Claude Desktop’s delivery of the egress allowlist to its embedded Claude Code sessions working; [Deliver policy to Claude Desktop sessions](</docs/en/claude-apps-gateway#deliver-policy-to-claude-desktop-sessions>) explains the mechanism and where the opt-in must sit. To stop developers from bypassing the gateway with a cloud provider variable or an `ANTHROPIC_BASE_URL` of their own, add `"allowedProviders": ["gateway"]` to the same file. Claude Code then refuses every session on the machine that isn’t set up for a Cloud gateway, and admits a gateway only when it is the one `forceLoginGatewayUrl` names or one whose URL the file’s `env` block sets as `ANTHROPIC_BASE_URL`. `claude gateway` refuses to run on a machine that sets the list, so keep the key off the gateway host. See the [`allowedProviders`](</docs/en/settings-reference#allowedproviders>) entry in the settings reference. Requires Claude Code v2.1.285 or later. Deploy the `managed-settings.json` file to each device, typically via your MDM platform. The file path differs by platform. See [where each mechanism stores the policy](</docs/en/managed-settings#where-each-mechanism-stores-the-policy>). By default, a registry policy on Windows or a managed-preferences plist on macOS replaces the `managed-settings.json` file rather than merging with it, apart from the exception keys and cross-source checks above. All three keys in this snippet follow the highest-priority-source rule, so fleets that deliver policy through Group Policy or configuration profiles must put all three in that mechanism instead. For Claude Desktop, set the `bootstrapUrl` key in Claude Desktop’s own [managed configuration](<https://claude.com/docs/third-party/claude-desktop/configuration>) to `<listen.public_url>/user/bootstrap`. The sign-in flow and per-group policy then match the CLI’s once a policy opts in server-side with a `desktop` key; without the opt-in, `/user/bootstrap` returns 404. See Claude Desktop overlay for the server-side half. Claude Code honors [`forceLoginGatewayUrl`](</docs/en/settings-reference#forcelogingatewayurl>), [`gatewayInternalNetworks`](</docs/en/settings-reference#gatewayinternalnetworks>), and the `"gateway"` value of [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) from a managed source on the machine: `managed-settings.json`, the macOS plist or Windows HKLM registry, or a policy helper. Setting them in the gateway payload doesn’t configure the gateway sign-in. For a developer’s own `~/.claude/settings.json`, see [Set the gateway URL in user settings](</docs/en/claude-apps-gateway#set-the-gateway-url-in-user-settings>). Leave `forceLoginMethod` and `forceLoginOrgUUID` out of the payload. Claude Code still reads both keys from the payload for its startup credential check, so a developer who keeps an Anthropic-issued credential on the machine gets the startup exit described under [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) even after they sign in.
##
--- a/claude-apps-gateway-deploy.md
+++ b/claude-apps-gateway-deploy.md
@@ -115,7 +115,7 @@
Push the gateway URL to developer machines
-Once the gateway is serving, push `forceLoginMethod`, `forceLoginGatewayUrl`, and `parentSettingsBehavior: "merge"` to each developer’s machine through managed settings, via MDM or by writing the per-OS `managed-settings.json` directly. Without this, `/login` shows the standard account picker with no gateway option. Once you deploy the keys, Claude Code stops using a leftover API key or claude.ai login on the machine, so plan the push together with your sign-in instructions. [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) describes the messages developers see. See [where each mechanism stores the policy](</docs/en/managed-settings#where-each-mechanism-stores-the-policy>) for the file paths, and [Client-side managed settings](</docs/en/claude-apps-gateway-config#client-side-managed-settings>) for the Claude Desktop `bootstrapUrl` equivalent.
+Once the gateway is serving, push `forceLoginMethod`, `forceLoginGatewayUrl`, and `parentSettingsBehavior: "merge"` to each developer’s machine through managed settings, via MDM or by writing the per-OS `managed-settings.json` directly. Once you deploy the keys, Claude Code stops using a leftover API key or claude.ai login on the machine, so plan the push together with your sign-in instructions. [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) describes the messages developers see. See [where each mechanism stores the policy](</docs/en/managed-settings#where-each-mechanism-stores-the-policy>) for the file paths, and [Client-side managed settings](</docs/en/claude-apps-gateway-config#client-side-managed-settings>) for the Claude Desktop `bootstrapUrl` equivalent.
###
--- a/cli-reference.md
+++ b/cli-reference.md
@@ -22,13 +22,13 @@
`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 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 session’s name in place of the ID requires Claude Code v2.1.290 or later| `claude attach 7c5dcf5d`
+`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 built-in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) classifier rules as JSON. Use `claude auto-mode config` to see your effective config with 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'`
`claude auto-mode reset`| Restore the default [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) configuration by removing the `autoMode` section from your user settings file. Prompts for confirmation before writing; pass `-y`/`--yes` to skip the prompt. Rules from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag still apply. Requires Claude Code v2.1.212 or later. See [Inspect the defaults and your effective config](</docs/en/auto-mode-config#inspect-the-defaults-and-your-effective-config>)| `claude auto-mode reset --yes`
`claude daemon logs`| Follow the background-session [supervisor’s](</docs/en/agent-view#the-supervisor-process>) log file, `~/.claude/daemon.log`, printing new lines as they arrive until you press `Ctrl+C`| `claude daemon logs`
`claude daemon run`| Run the background-session [supervisor](</docs/en/agent-view#the-supervisor-process>) in the foreground of this terminal, printing its log| `claude daemon run`
`claude daemon status`| Print the background-session [supervisor’s](</docs/en/agent-view#the-supervisor-process>) state, version, socket directory, and worker count for diagnostics. Exits 1 if the supervisor isn’t running| `claude daemon status`
-`claude daemon stop --any`| Stop the background-session [supervisor](</docs/en/agent-view#the-supervisor-process>) and the sessions it hosts. Pass `--keep-workers` to leave background sessions running so the next supervisor reconnects to them. `--any` confirms stopping an on-demand supervisor, which is the default. Use this to recover from an [unresponsive supervisor](</docs/en/agent-view#agent-view-says-the-background-service-did-not-respond>)| `claude daemon stop --any --keep-workers`
+`claude daemon stop --any`| Stop the background-session [supervisor](</docs/en/agent-view#the-supervisor-process>) and the sessions it hosts. Pass `--keep-workers` to leave background sessions running for the next supervisor to reconnect to. `--any` confirms stopping an on-demand supervisor, which is the default. Use this to recover from an [unresponsive supervisor](</docs/en/agent-view#agent-view-says-the-background-service-did-not-respond>)| `claude daemon stop --any --keep-workers`
`claude doctor`| Print read-only installation and settings diagnostics from the terminal without starting a session, including install health, settings-file validation errors, and Remote Control eligibility. For the in-session setup checkup that can also apply fixes, run [`/doctor`](</docs/en/commands#all-commands>)| `claude doctor`
`claude import [source]`| Start an interactive session that runs [`/import`](</docs/en/commands#all-commands>) to bring configuration from other coding agents into Claude Code. Accepts the same `--dry-run` and `--yes` options as the command. Not available on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, or Claude Platform on AWS. Also unavailable when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>). Requires Claude Code v2.1.213 or later| `claude import codex --dry-run`
`claude logs <id|name>`| Print recent output from a [background session](</docs/en/agent-view#manage-sessions-from-the-shell>). Passing part of a session’s name in place of the ID requires Claude Code v2.1.290 or later| `claude logs 7c5dcf5d`
@@ -62,7 +62,7 @@
`--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`
-`--allowedTools`, `--allowed-tools`| Tools that execute without prompting for permission. 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"`
+`--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"`
`--append-system-prompt`| Append custom text to the end of the default system prompt| `claude --append-system-prompt "Always use TypeScript"`
@@ -75,7 +75,7 @@
`--channels`| (Research preview) MCP servers whose [channel](</docs/en/channels>) notifications Claude should listen for in this session. Space-separated list of `plugin:<name>@<marketplace>` entries. Requires Anthropic authentication through claude.ai or a Console API key| `claude --channels plugin:my-notifier@my-marketplace`
`--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#resume-a-session>); 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`
+`--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`
`--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='!1p'`. The filter binds only in the `=` form; a space-separated filter enables debug mode without filtering| `claude --debug='mcp,startup'`
@@ -104,7 +104,7 @@
`--max-turns`| Limit the number of agentic turns (print mode only). Exits with an error when the limit is reached. 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`
`--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>`. In an interactive session, if another live session on this machine already uses the name, Claude Code applies [a variant of it](</docs/en/sessions#name-your-sessions>) instead.
+`--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>`.
[`/rename`](</docs/en/commands>) changes the name mid-session and also shows it on the prompt bar| `claude -n "my-feature-work"`
`--no-chrome`| Disable [Chrome browser integration](</docs/en/chrome>) for this session| `claude --no-chrome`
--- a/code-review.md
+++ b/code-review.md
@@ -245,11 +245,11 @@
Section| What it shows
---|---
PRs reviewed| Daily count of pull requests reviewed over the selected time range
-Cost weekly| Weekly spend on Code Review
+Code Review cost| Code Review spend so far this month
Feedback| Count of review comments that were auto-resolved because a developer addressed the issue
-Repository breakdown| Per-repo counts of PRs reviewed and comments resolved
-
-Dashboard cost figures are estimates for monitoring activity. For invoice-accurate spend, refer to your Anthropic bill.
+Repository breakdown| Per-repo counts of PRs reviewed, comments resolved, and review runs, with estimated cost and a per-PR view
+
+The Code Review cost card shows an amount only when the current month is selected. Cost figures in analytics can differ from your invoice. Repository breakdown costs are estimated at list price, before any discounts or credits, and cover only reviews that Claude posted on a pull request. For invoice-accurate spend, refer to your Anthropic bill.
##
@@ -263,7 +263,7 @@
* **After every push** : runs on each push, multiplying cost by the number of pushes
* **Manual** : no reviews on open or push, so cost accrues only from reviews someone requests
-In Once after PR creation or Manual mode, commenting `@claude review always` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. In After every push mode, pushes already trigger reviews, so the subscription doesn’t change per-push cost. Commenting `@claude review` runs a single review without subscribing to future pushes. Claude reviews a pull request from a fork only when someone comments `@claude review`, so a fork pull request never accrues per-push cost in any mode. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. Monitor spend via the weekly cost chart in analytics or the per-repo average cost column in admin settings.
+In Once after PR creation or Manual mode, commenting `@claude review always` opts the PR into push-triggered reviews, so additional cost accrues per push after that comment. In After every push mode, pushes already trigger reviews, so the subscription doesn’t change per-push cost. Commenting `@claude review` runs a single review without subscribing to future pushes. Claude reviews a pull request from a fork only when someone comments `@claude review`, so a fork pull request never accrues per-push cost in any mode. Costs appear on your Anthropic bill regardless of whether your organization uses Amazon Bedrock or Google Cloud’s Agent Platform for other Claude Code features. To set a monthly spend cap for Code Review, go to [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>) and configure the limit for the Claude Code Review service. To monitor spend, use the analytics dashboard.
##
--- a/commands.md
+++ b/commands.md
@@ -51,7 +51,7 @@
`/compact [instructions]`| Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary. See [how compaction handles rules, skills, and memory files](</docs/en/context-window#what-survives-compaction>)
`/config [key=value ...]`| Open the [Settings](</docs/en/settings>) interface to adjust theme, model, [output style](</docs/en/output-styles>), and other preferences. Pass one or more `key=value` pairs to set a setting directly without opening the interface, for example `/config thinking=false`, `/config theme=dark`, or `/config model=sonnet`. The `key=value` form also works in non-interactive mode (`-p`) and from the Claude mobile app via [Remote Control](</docs/en/remote-control>). The `key=value` form can’t turn on a setting that needs your confirmation in the panel, such as [`autoContinueAtUsageLimit`](</docs/en/interactive-mode#turn-automatic-continue-off>), though it can turn one off. Run `/config --help` to list the keys it accepts. Alias: `/settings`
`/context [all]`| Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings. When the conversation exceeds the context window, the output includes a [warning](</docs/en/errors#context-exceeds-the-token-limit>) showing how far over the limit you are and which command frees space. In [fullscreen mode](</docs/en/fullscreen>), `/context` collapses the per-item breakdown to keep the grid visible. Pass `all` to expand it
-`/copy [N]`| Copy the last assistant response to clipboard. Pass a number `N` to copy the Nth-latest response: `/copy 2` copies the second-to-last. When code blocks are present, shows an interactive picker to select individual blocks or the full response. Press `w` in the picker to write the selection to a file instead of the clipboard, which is useful over SSH
+`/copy [N]`| Copy the last assistant response to clipboard. Pass a number `N` to copy the Nth-latest response: `/copy 2` copies the second-to-last. When code blocks or blockquotes are present, shows an interactive picker to select individual blocks or the full response. Press `w` in the picker to write the selection to a file instead of the clipboard, which is useful over SSH
`/cost`| Alias for `/usage`
`/dataviz [request]`| **[Skill](</docs/en/skills#bundled-skills>).** Design guidance for charts, graphs, and dashboards. Claude picks the chart form for the data, assigns color by role, validates the palette for colorblind safety and contrast with a bundled script, and applies mark, interaction, and accessibility rules. Uses a brand-neutral placeholder palette that you replace with your own
`/debug [description]`| **[Skill](</docs/en/skills#bundled-skills>).** Enable debug logging for the current session and troubleshoot issues by reading the session debug log. Debug logging is off by default unless you started with `claude --debug`, so running `/debug` mid-session starts capturing logs from that point forward. Optionally describe the issue to focus the analysis
@@ -106,7 +106,7 @@
`/reload-skills`| Re-scan [skill](</docs/en/skills>) and command directories so skills added or changed on disk during the session become available without restarting. Reports how many skills are available and how many were added or removed
`/remote-control`| Make this session available for [Remote Control](</docs/en/remote-control>) from claude.ai. Running it while signed out prints that Remote Control requires a claude.ai subscription and tells you how to sign in; before v2.1.206 it reported `Unknown command: /remote-control`. Alias: `/rc`
`/remote-env`| Choose the default [cloud environment](</docs/en/cloud-environments#select-an-environment-from-the-cli>) for cloud sessions you start from the CLI
-`/rename [name]`| Rename the current session and show the name on the prompt bar. Without a name, auto-generates one from conversation history. Also available in non-interactive mode (`-p`); requires Claude Code v2.1.205 or later. From every rename surface, including claude.ai and the desktop app, Claude Code replaces control and invisible characters in the new name with spaces and caps the name at 200 characters. If the name is empty once invisible characters are removed, Claude Code rejects it and shows `That name is empty once invisible characters are removed. Usage: /rename <name>`. The character replacement and length cap require Claude Code v2.1.221 or later. If another live session on this machine already uses a name you pass, Claude Code applies [a variant of it](</docs/en/sessions#name-your-sessions>) instead
+`/rename [name]`| Rename the current session and show the name on the prompt bar. Without a name, auto-generates one from conversation history. Also available in non-interactive mode (`-p`); requires Claude Code v2.1.205 or later. From every rename surface, including claude.ai and the desktop app, Claude Code replaces control and invisible characters in the new name with spaces and caps the name at 200 characters. If the name is empty once invisible characters are removed, Claude Code rejects it and shows `That name is empty once invisible characters are removed. Usage: /rename <name>`. The character replacement and length cap require Claude Code v2.1.221 or later
`/resume [session]`| Resume a conversation by ID or name, or open the session picker. [Background sessions](</docs/en/agent-view>) appear in the picker marked with `bg`. Resuming one that is still running, from the picker or by ID or name, [opens that session](</docs/en/sessions#resume-a-running-background-session>): your current conversation moves to the background and this terminal attaches to the running one. Press `←` on an empty prompt to return to agent view, which also lists the conversation you left. Before v2.1.285, Claude Code refused and told you to open the session with `claude attach` or stop it first. Alias: `/continue`
`/review [low|medium|high|xhigh|max|ultra] [--fix] [--comment] [--max-findings n|all|default] [pr#|branch|path]`| Alias of [`/code-review`](</docs/en/code-review#review-a-diff-locally>): reviews the current diff, or a PR number, branch, or path you pass, such as `/review 1234`, and takes the same effort levels and flags. With no level given, the review reuses the last `low` through `max` level you typed; see [Review a diff locally](</docs/en/code-review#review-a-diff-locally>) for the exact rules. For a deep cloud review, use [`/code-review ultra`](</docs/en/ultrareview>). Before v2.1.223, `/review` was a separate command that ran a single-pass, read-only review of a GitHub pull request by number, listing open PRs to pick from when run with no argument; from v2.1.186 through v2.1.201, it ran the same multi-agent engine as `/code-review medium`
`/rewind`| Rewind the conversation and/or code to a previous point, or summarize from a selected message. See [checkpointing](</docs/en/checkpointing>). Aliases: `/checkpoint`, `/undo`
--- a/components.md
+++ b/components.md
@@ -176,7 +176,7 @@
}
}
-Save the script at `scripts/format.sh` and make it executable. Load the plugin and ask Claude to edit a file. A `PostToolUse` hook that exits 0 shows nothing in the transcript, so confirm it ran with [debug logging](</docs/en/hooks#debug-hooks>) or by what the script itself changes. Hooks in `hooks/hooks.json` and in the `hooks` manifest key both load. For every event and its payload, see [Hook events](</docs/en/hooks#hook-events>). To write hooks as JavaScript functions that run inside Claude Code and can draw in its interface, list a module file under a `modules` key in the same `hooks/hooks.json`. A plugin with one is a mod. See [Create a mod](</docs/en/plugins/mods/create>).
+Save the script at `scripts/format.sh` and make it executable. Load the plugin and ask Claude to edit a file. A `PostToolUse` hook that exits 0 shows nothing in the transcript, so confirm it ran with [debug logging](</docs/en/hooks#debug-hooks>) or by what the script itself changes. Hooks in `hooks/hooks.json` and in the `hooks` manifest key both load. For every event and its payload, see [Hook events](</docs/en/hooks#hook-events>). When another enabled plugin has the same name, one of the two registers its `hooks/hooks.json` hooks and the other’s are left out. See [Hooks when two enabled plugins share a name](</docs/en/plugins/loading#hooks-when-two-enabled-plugins-share-a-name>) for which one, and for the note in `/plugin` that tells you. To write hooks as JavaScript functions that run inside Claude Code and can draw in its interface, list a module file under a `modules` key in the same `hooks/hooks.json`. A plugin with one is a mod. See [Create a mod](</docs/en/plugins/mods/create>).
####
--- a/corporate-launcher.md
+++ b/corporate-launcher.md
@@ -1,4 +1,4 @@
-Some organizations require every process on a workstation to start through a mandatory launcher. The launcher applies the sandbox, network controls, or credential injection that the company’s security posture depends on, and a binary that starts without it is a policy violation. `CLAUDE_CODE_PROCESS_WRAPPER` starts every process Claude Code launches from its own binary through your launcher: the background service, every session it hosts in [agent view](</docs/en/agent-view>), and Claude Code’s relaunches after an update. Set it to your launcher’s absolute path, and Claude Code runs the launcher with the Claude Code command as its arguments. A launcher that wraps the `claude` command on your `PATH` can’t reach the background service or the sessions it hosts, because they start from the binary’s direct path without looking up `claude`.
+Some organizations require every process on a workstation to start through a mandatory launcher. The launcher applies the sandbox, network controls, or credential injection that the company’s security posture depends on, and a binary that starts without it is a policy violation. `CLAUDE_CODE_PROCESS_WRAPPER` starts every process Claude Code launches from its own binary through your launcher: the [background service](</docs/en/agent-view#the-supervisor-process>), every session it hosts in [agent view](</docs/en/agent-view>), and Claude Code’s relaunches after an update. Set it to your launcher’s absolute path, and Claude Code runs the launcher with the Claude Code command as its arguments. A launcher that wraps the `claude` command on your `PATH` can’t reach the background service or the sessions it hosts, because they start from the binary’s direct path without looking up `claude`.
`CLAUDE_CODE_PROCESS_WRAPPER` requires Claude Code v2.1.208 or later. Earlier versions ignore the variable and start every process unwrapped. The equivalent [`processWrapper` setting](</docs/en/settings-reference#processwrapper>) requires v2.1.210 or later. Earlier versions ignore it as an unknown key, apply no launcher, and report no error.After deploying either form, use the Verify step to confirm the running version applies it.
@@ -27,7 +27,6 @@
The following processes don’t start through the launcher:
- * An [installed background service](</docs/en/agent-view#the-supervisor-process>) whose unit was written before the launcher was configured: `launchd` or `systemd` starts that process from its unit file. `/status` and `claude daemon status` warn while the running service and the configured launcher don’t match, and the sessions the service spawns still start through the launcher once the service restarts with the variable in its settings.
* A session you start yourself in a terminal, which runs however you invoked it. To cover these sessions, put a script named `claude` in a directory earlier on `PATH` that runs your launcher with the real binary; don’t replace the managed symlink. The background service and its sessions start without a `PATH` lookup, so the two launchers don’t stack there.
* The first process of a `claude-cli://` deep link, which the operating system’s protocol handler starts directly. Everything that session starts in the background afterward runs through the launcher. To close this path entirely, [prevent handler registration](</docs/en/deep-links#registration-and-supported-platforms>) with the `disableDeepLinkRegistration` setting.
* The relaunch that `--worktree` combined with `--tmux` performs: the terminal multiplexer starts that pane, not Claude Code’s binary.
@@ -86,7 +85,7 @@
Restart the background service and your sessions
-A running background service and any open `claude` sessions read the variable once at startup, so they keep launching unwrapped processes until restarted. Run `claude daemon stop --any` to stop the on-demand service; the next command that needs it, such as `claude agents`, starts a wrapped one. An [installed service](</docs/en/agent-view#the-supervisor-process>) takes `claude daemon stop` without `--any`. Then restart your open `claude` sessions.On machines you can’t restart by hand, the first session started after the settings push retires a leftover unwrapped on-demand service automatically. A machine where no new session starts keeps its unwrapped service until one does, and an installed service always needs the restart in this step.
+A running background service and any open `claude` sessions read the variable once at startup, so they keep launching unwrapped processes until restarted. Run `claude daemon stop --any` to stop the on-demand service. The next command that needs it, such as `claude agents`, starts a wrapped one. Then restart your open `claude` sessions.On machines you can’t restart yourself, the first session started after the settings push retires a leftover unwrapped on-demand service automatically. A machine where no new session starts keeps its unwrapped background service until one does.
4
--- a/costs.md
+++ b/costs.md
@@ -77,6 +77,21 @@
When the usage request fails
When the request for your plan limits fails, most often because the usage endpoint is rate limited, `/usage` shows the last usage bars it loaded on this machine within the past 60 minutes, along with a `Showing last-known usage` note stating how long ago that data was fetched. Press `r` to retry; a successful retry replaces the last-known bars with fresh data. Without a snapshot from the past 60 minutes, `/usage` reports that the usage endpoint is rate limited and offers the same retry shortcut. Before v2.1.208, a rate-limited request in a session that hadn’t loaded usage yet always showed the error with no bars.
+
+###
+
+
+
+Read the token count beside the spinner
+
+While Claude works in the main conversation, the line beside the spinner can end with an elapsed time and a token count, as in `Deciphering… (10m 27s · ↓ 5.5k tokens)`. It is a live, approximate count of the output the current turn has produced so far. The arrow beside the count points down while output arrives or tools run.
+
+ * **What it covers** : output the turn generates, such as the text and tool calls Claude streams back, its thinking, and the output of subagents that run in the [foreground](</docs/en/sub-agents#run-subagents-in-foreground-or-background>)
+ * **What it leaves out** : what Claude Code sends to the model, so your prompt, the conversation history, and the rest of your context don’t move it
+ * **When it resets** : at the start of each turn, and when Claude Code [compacts the conversation](</docs/en/prompt-caching#compacting-the-conversation>)
+ * **When it stays hidden** : until output starts arriving, when the row is too narrow to fit it, and in [screen reader mode](</docs/en/accessibility>)
+
+It won’t match the `Usage by model` output figures in the `/usage` Session block, which add up the whole session rather than one turn. It also differs from the token count [verbose mode adds](</docs/en/statusline#notifications-share-the-status-line-row>), because that count measures the size of your context rather than one turn’s output.
###
--- a/cross-session-messaging.md
+++ b/cross-session-messaging.md
@@ -122,7 +122,7 @@
* **Session names** : it leaves out any session name it can’t attribute to a person, so a row left with no name reads `(unnamed session)`.
* **The first line** : it leaves out the line with this session’s own name unless you typed that name at this terminal, with `--name` or with `/rename` and the name, since you launched or last resumed the session.
-When the output lists anything, it ends with a note saying details were withheld. Running `/rename` followed by an unused name at a session’s own keyboard gives that session a name that appears in the output. A session answers to the name you set with the [`/rename`](</docs/en/commands>) command or the [`--name`](</docs/en/cli-reference#cli-flags>) flag. When you don’t set one, Claude Code names the session itself. For an interactive session, that is the name shown in [listings of running sessions](</docs/en/sessions#name-your-sessions>). When you rename a session, or start or resume an interactive one, with a name another live session on this machine already uses, Claude Code leaves the name with the session that already has it and [renames yours to a variant](</docs/en/sessions#name-your-sessions>). Sessions can still share a name, for example when one of them runs an earlier version of Claude Code or the shared name is one Claude Code generated. Unless this session is connected to Remote Control, Claude Code shows each local session’s working directory in the `/list-agents` output, so you can tell same-named sessions apart when they run in different directories. Claude addresses the message in one of two ways, depending on how many live sessions answer to the name:
+When the output lists anything, it ends with a note saying details were withheld. Running `/rename` followed by an unused name at a session’s own keyboard gives that session a name that appears in the output. A session answers to the name you set with the [`/rename`](</docs/en/commands>) command or the [`--name`](</docs/en/cli-reference#cli-flags>) flag. When you don’t set one, Claude Code names the session itself. For an interactive session, that is the name shown in [listings of running sessions](</docs/en/sessions#name-your-sessions>). Unless this session is connected to Remote Control, Claude Code shows each local session’s working directory in the `/list-agents` output, so you can tell same-named sessions apart when they run in different directories. Claude addresses the message in one of two ways, depending on how many live sessions answer to the name:
* **One session answers to the name** : Claude Code delivers the message on the name alone.
* **Several sessions share the name, or Claude Code couldn’t check everywhere your sessions run** : Claude adds a short identifier to each row of its listing and uses the identifier in the address.
--- a/debug-your-config.md
+++ b/debug-your-config.md
@@ -107,7 +107,7 @@
A `settings.json` value seems ignored| The same key is set in `settings.local.json`| `settings.local.json` overrides `settings.json`, and both override `~/.claude/settings.json`. See [settings precedence](</docs/en/settings#settings-precedence>).
Skill doesn’t appear in `/skills`| Skill file is at `.claude/skills/name.md` instead of in a folder| Use a folder with `SKILL.md` inside: `.claude/skills/name/SKILL.md`.
Skill appears in `/skills` but Claude never invokes it| Skill has `disable-model-invocation: true` in its frontmatter, or its description doesn’t match how you phrase the request| Check the badge in `/skills`: a “user-only” label means Claude won’t trigger it on its own. See [skill invocation](</docs/en/skills>).
-Subdirectory `CLAUDE.md` instructions seem ignored| Subdirectory files load on demand, not at session start| See [when subdirectory files load](</docs/en/memory#how-claude-md-files-load>). Before v2.1.288, only the Read tool loaded them.
+Subdirectory `CLAUDE.md` instructions seem ignored| Subdirectory files load on demand, not at session start| To load a subdirectory’s `CLAUDE.md`, ask Claude to read another file in that subdirectory. See [when subdirectory files load](</docs/en/memory#how-claude-md-files-load>).
Subagent ignores `CLAUDE.md` instructions| The built-in Explore and Plan agents skip `CLAUDE.md`. A custom subagent loads it the same way the main conversation does, unless its definition sets [`omitClaudeMd`](</docs/en/sub-agents#supported-frontmatter-fields>)| For Explore or Plan, restate the instruction in your delegating prompt. For a subagent that sets `omitClaudeMd`, remove the field. For any other custom subagent, put critical instructions in the agent file body, which becomes the agent’s system prompt. See [what loads at startup](</docs/en/sub-agents#what-loads-at-startup>).
Cleanup logic never runs at session end| No `SessionEnd` hook configured| Add a `SessionEnd` hook in `settings.json`. See the [hook events list](</docs/en/hooks#hook-events>).
MCP servers in `.mcp.json` never load| File is under `.claude/`, or its servers sit under a top-level `servers` key, as in VS Code’s `mcp.json`, instead of `mcpServers`| Project MCP config goes at the repository root as `.mcp.json`, not inside `.claude/`, with servers under the `mcpServers` key. See [MCP configuration](</docs/en/mcp>).
--- a/dependencies.md
+++ b/dependencies.md
@@ -185,7 +185,7 @@
* **Plugin with its own repository** : the install fails with a message containing `Dependency "secrets-vault@your-marketplace" has no git tag satisfying`.
* **Plugin referenced by a relative path** : the install uses the marketplace’s current copy instead, and the constraint is checked when the plugin loads. If that copy is outside the range, the dependent plugin stays disabled and `claude plugin list` shows `Requires "secrets-vault@your-marketplace" ~2.1.0, installed 3.0.0`.
-For a plugin the marketplace references by a relative path, a marketplace you added as a local folder path also resolves constraints against that folder’s git tags, when the folder is a git repository. This requires Claude Code v2.1.196 or later. A local folder that isn’t a git repository has no tags, so Claude Code installs the dependency from the folder’s current contents instead.
+For a plugin the marketplace references by a relative path, a marketplace you added as a local folder path also resolves constraints against that folder’s git tags, when the folder is a git repository. A local folder that isn’t a git repository has no tags, so Claude Code installs the dependency from the folder’s current contents instead.
###
--- a/desktop.md
+++ b/desktop.md
@@ -390,7 +390,12 @@
Work in parallel with sessions
-Click **\+ New session** in the sidebar, or press **Cmd+N** on macOS or **Ctrl+N** on Windows, to work on multiple tasks in parallel. Press **Ctrl+Tab** and **Ctrl+Shift+Tab** to cycle through sessions in the sidebar. For Git repositories, select the **worktree** option next to the branch name to give the session its own isolated copy of your project using [Git worktrees](</docs/en/worktrees>). To view two sessions at once, hold **Cmd** on macOS or **Ctrl** on Windows and click a session in the sidebar. The session opens in a second pane alongside the one you already have open. While the split is active, clicking another sidebar session replaces whichever pane has focus. Press **Cmd+\** on macOS or **Ctrl+\** on Windows to close the focused pane and return to a single session. Worktrees are stored in `<project-root>/.claude/worktrees/` by default. You can change this to a custom directory in Settings → Claude Code under “Worktree location”. You can also set a branch prefix that gets prepended to every worktree branch name, which is useful for keeping Claude-created branches organized. To remove a worktree when you’re done, hover over the session in the sidebar and click the archive icon. To have sessions archive themselves when their pull request merges or closes, turn on **Auto-archive after PR merge or close** in Settings → Claude Code. Auto-archive only applies to local sessions that have finished running. To include gitignored files like `.env` in new worktrees, create a [`.worktreeinclude` file](</docs/en/worktrees#copy-gitignored-files-into-worktrees>) in your project root.
+Click **\+ New session** in the sidebar, or press **Cmd+N** on macOS or **Ctrl+N** on Windows, to work on multiple tasks in parallel. Press **Ctrl+Tab** and **Ctrl+Shift+Tab** to cycle through sessions in the sidebar. For Git repositories, select the **worktree** option next to the branch name to give the session its own isolated copy of your project using [Git worktrees](</docs/en/worktrees>). To view two sessions at once, hold **Cmd** on macOS or **Ctrl** on Windows and click a session in the sidebar. The session opens in a second pane alongside the one you already have open. While the split is active, clicking another sidebar session replaces whichever pane has focus. Press **Cmd+\** on macOS or **Ctrl+\** on Windows to close the focused pane and return to a single session. Worktrees are stored in `<project-root>/.claude/worktrees/` by default. You can change this to a custom directory:
+
+ * **Local sessions** : set **Worktree location** in **Settings > Claude Code**
+ * **SSH sessions** : set **Worktree folder** on the SSH connection
+
+You can also set a **Branch prefix** in **Settings > Claude Code**. Desktop prepends it to every worktree branch name, which is useful for keeping Claude-created branches organized. To remove a worktree when you’re done, hover over the session in the sidebar and click the archive icon. To have sessions archive themselves when their pull request merges or closes, turn on **Auto-archive after PR merge or close** in **Settings > Claude Code**. Auto-archive only applies to local sessions that have finished running. To include gitignored files like `.env` in new worktrees, create a [`.worktreeinclude` file](</docs/en/worktrees#copy-gitignored-files-into-worktrees>) in your project root. See [What worktrees share with the main checkout](</docs/en/worktrees#what-worktrees-share-with-the-main-checkout>) for where a worktree session reads project settings, hooks, and skills.
Session isolation requires [Git](<https://git-scm.com/downloads>). Most Macs include Git by default. Run `git --version` in Terminal to check; if it prints a version number, Git is installed. If you run into Git errors, ask Claude in the [Cowork tab](<https://claude.com/product/cowork>) to help troubleshoot your setup.
@@ -741,8 +746,23 @@
* **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.
+ * **Worktree folder** : a folder on the remote machine, such as `~/worktrees`, where new sessions create their worktrees. Leave empty to use the remote machine’s default.
Once added, the connection appears under **SSH** in the environment dropdown. Select it to start a session on that machine. Claude runs on the remote machine with access to its files and tools. The remote machine must run Linux or macOS. Desktop installs Claude Code on the remote machine automatically the first time you connect. Once connected, SSH sessions support permission modes, connectors, plugins, and MCP servers.
+
+####
+
+
+
+Choose where SSH session worktrees go
+
+Unless your organization restricts which folders sessions may use, new SSH sessions create their worktrees in the first of these that is set:
+
+ 1. **Worktree folder** on the SSH connection
+ 2. [`worktree.location`](</docs/en/settings-reference#worktree-location>) in `~/.claude/settings.json` on the remote machine
+ 3. `<project-root>/.claude/worktrees/`, the default
+
+Each project gets its own subfolder in the folder you set, so with `~/worktrees` a worktree’s path is `~/worktrees/<project>-<id>/<worktree-name>`. If the folder you set is inside the project, Desktop ignores it for that project and uses the default. To set **Worktree folder** on a connection you added earlier or one your organization manages, hover over it in the environment dropdown and click the gear icon. The field requires Claude Desktop v1.44121.0 or later. If your organization restricts which folders sessions may use, Desktop hides the field and keeps worktrees inside the project.
####
@@ -787,7 +807,7 @@
Pre-configure SSH connections for your team
-Administrators can distribute SSH connections to team members by setting `sshConfigs` in [managed settings](</docs/en/managed-settings>). Connections defined this way appear in each user’s environment dropdown automatically and are shown as managed, so users can select them but can’t edit or delete them in the app. The following example pre-configures a single connection:
+Administrators can distribute SSH connections to team members by setting `sshConfigs` in [managed settings](</docs/en/managed-settings>). Connections defined this way appear in each user’s environment dropdown automatically and are shown as managed. Users can select them and set their own **Worktree folder** for them, but can’t edit anything else or delete them in the app. The following example pre-configures a single connection:
{
"sshConfigs": [
@@ -841,7 +861,7 @@
In Enterprise organizations that have HIPAA enabled, the **Desktop** toggle is off by default and an [Owner](</docs/en/server-managed-settings#access-control>) can turn it on. Applying the [HIPAA configuration](</docs/en/hipaa-setup>) turns it off, even if it was on, so an Owner has to turn it on afterward. **Cloud sessions** and **Remote Control** are also off by default, and an Owner can’t turn them on once the organization has the HIPAA configuration applied.
-The OpenTelemetry form for Cowork under **Monitoring** in the admin console’s [Data and privacy settings](<https://claude.ai/admin-settings/data-privacy-controls>) applies to Cowork sessions only. In a Cowork session on this machine, the desktop app passes that collector to Claude Code as `OTEL_*` environment variables, so the form takes effect even though Claude Code in that session never fetches admin-console settings.To export telemetry from Code tab sessions, set `CLAUDE_CODE_ENABLE_TELEMETRY` and the `OTEL_*` variables in the `env` block of your Claude Code managed settings, as shown in [administrator configuration for monitoring](</docs/en/monitoring-usage#administrator-configuration>). Local, cloud, and SSH sessions each read managed settings from different sources. For the hosts a cloud session can reach, see [network access](</docs/en/cloud-environments#network-access>). For the `service.name` that Code tab sessions report, see [service information](</docs/en/monitoring-usage#service-information>).
+The OpenTelemetry form for Cowork under **Monitoring** in the admin console’s [Data and privacy settings](<https://claude.ai/admin-settings/data-privacy-controls>) applies to Cowork sessions only. In a Cowork session on this machine, the desktop app passes that collector to Claude Code as `OTEL_*` environment variables, so the form takes effect even though Claude Code in that session never fetches admin-console settings.To export telemetry from Code tab sessions, set `CLAUDE_CODE_ENABLE_TELEMETRY` and the `OTEL_*` variables in the `env` block of your Claude Code managed settings, as shown in [administrator configuration for monitoring](</docs/en/monitoring-usage#administrator-configuration>). Local, cloud, and SSH sessions each read managed settings from different sources. For the hosts a cloud session can reach, see [network access](</docs/en/cloud-environments#network-access>). For the `service.name` that Code tab sessions report, see [service information](</docs/en/monitoring-usage#service-information>).To find out which remote machine an SSH session ran on, see [Attribute telemetry to Desktop SSH sessions](</docs/en/monitoring-usage#attribute-telemetry-to-desktop-ssh-sessions>).
###
@@ -859,7 +879,7 @@
`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. The value must be the JSON boolean `true`; the string `"true"` is ignored.
-`sshConfigs`| pre-configure SSH connections that appear in the environment dropdown. Users cannot edit or delete managed connections.
+`sshConfigs`| pre-configure SSH connections that appear in the environment dropdown. Users can’t delete managed connections or edit anything but their own **Worktree folder**.
`sshHostAllowlist`| restrict SSH sessions to hosts whose resolved hostname matches one of these patterns. Read from managed settings only.
`disableDesktopLocalSessions`| set to `true` to turn off Code sessions that run on the device, leaving SSH sessions to other hosts and cloud sessions available. The value must be the JSON boolean `true`. Read from managed settings only. Requires Claude Desktop v1.37937.0 or later.
`disableSshSavedPasswords`| set to `true` to stop Desktop from offering to remember SSH passwords and from using or showing the ones it saved earlier. Turning it on doesn’t delete them. Read from managed settings only. Requires Claude Desktop v1.49585.0 or later.
--- a/env-vars.md
+++ b/env-vars.md
@@ -174,7 +174,7 @@
`CLAUDE_AGENT_SDK_MCP_NO_PREFIX`| Set to `1` to skip the `mcp__<server>__` prefix on tool names from SDK-created MCP servers. Tools use their original names. SDK usage only
`CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`| Stall timeout in milliseconds for subagents. Also covers [workflow agents](</docs/en/workflows#when-an-agent-stalls-and-restarts>) on Claude Code v2.1.286 or later. Default `600000` (10 minutes); if you raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` while the stream watchdog is on, the default rises with it, as [Handle slow or stalled API responses](</docs/en/agent-sdk/typescript#handle-slow-or-stalled-api-responses>) describes
`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`| Set the percentage (1-100) of the auto-compact window at which auto-compaction triggers. Use lower values like `50` to compact earlier; the variable can’t raise the threshold, so values above the default percentage are ignored. It applies only in sessions that [compact before the model’s context limit](</docs/en/model-config#context-window-and-auto-compaction>). Applies to both main conversations and subagents
-`CLAUDE_AUTO_BACKGROUND_TASKS`| Set to `1` to force-enable automatic backgrounding of long-running agent tasks. When enabled, subagents are moved to the background after running for approximately two minutes. Also enables [automatic backgrounding of long MCP tool calls](</docs/en/mcp#automatic-backgrounding-of-long-tool-calls>) in non-interactive mode on Claude Code v2.1.212 or later
+`CLAUDE_AUTO_BACKGROUND_TASKS`| Set to `1` to force-enable automatic backgrounding of long-running agent tasks. When enabled, a [subagent](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) moves to the background after running for approximately two minutes. If Claude queued a tool call such as a file edit behind the subagent, the subagent finishes in the foreground before that call starts. Also enables [automatic backgrounding of long MCP tool calls](</docs/en/mcp#automatic-backgrounding-of-long-tool-calls>) in non-interactive mode on Claude Code v2.1.212 or later
`CLAUDE_AX_PREPARK_MS`| In [screen reader mode](</docs/en/accessibility>), how many milliseconds Claude Code waits before it writes a new or changed line. Default `0`, so Claude Code doesn’t wait. Before v2.1.287, the default was `50`. Claude Code caps the wait at `5000`. Requires Claude Code v2.1.233 or later
`CLAUDE_AX_SCREEN_READER`| Set to `1` to render screen-reader friendly output: flat text without decorative borders or animations. Set to `0` to force screen-reader mode off even when [`axScreenReader`](</docs/en/settings-reference#axscreenreader>) is `true`. The [`--ax-screen-reader`](</docs/en/cli-reference#cli-flags>) flag takes precedence. Requires Claude Code v2.1.181 or later
`CLAUDE_AX_STARTUP_QUIET_MS`| In [screen reader mode](</docs/en/accessibility>), how many milliseconds Claude Code holds the first interface render after the startup confirmation line, so your screen reader can speak the line in full before new output interrupts it. Default `3000`. Set `0` to render immediately. Claude Code caps the hold at `600000` (10 minutes). Your first keystroke ends the hold early. Requires Claude Code v2.1.217 or later
@@ -220,7 +220,7 @@
`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`| Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut
`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT`| Set to `1` to stop Claude Code from treating an [Amazon Bedrock](</docs/en/amazon-bedrock>) streaming response with a missing or empty `Content-Type` header as Amazon Bedrock’s binary event stream. By default, Claude Code assumes a gateway dropped the header from an otherwise unmodified response, so it decodes the body and streaming keeps working. Set this only for a gateway that also re-emits the stream as server-sent events; Claude Code then reads the header-less body as server-sent events instead. Requires Claude Code v2.1.239 or later
`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>) running background shell commands, dynamic workflows, and, as of v2.1.198, background subagents when the [supervisor](</docs/en/agent-view#the-supervisor-process>) stops, restarts, or updates that session’s process, instead of handing them to the session’s next process. Affects only that handoff: backgrounding a session with `←` or [`/background`](</docs/en/agent-view#from-inside-a-session>) still carries in-flight work over, and `CLAUDE_DISABLE_ADOPT` turns off both. Requires Claude Code v2.1.196 or later
+`CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF`| Set to `1` to stop a [background session’s](</docs/en/agent-view>) running background shell commands, dynamic workflows, and, as of v2.1.198, background subagents when the [supervisor](</docs/en/agent-view#the-supervisor-process>) stops, restarts, or updates that session’s process, instead of handing them to the session’s next process. 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, and `CLAUDE_DISABLE_ADOPT` turns off both. 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_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`| 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>). For hosts that embed Claude Code and supply their own browser guidance. Requires Claude Code v2.1.257 or later
@@ -249,7 +249,7 @@
`CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK`| Set to `1` to turn off the [automatic model switch when a safety classifier flags a request](</docs/en/model-config#automatic-model-fallback>), the behavior the [`switchModelsOnFlag`](</docs/en/settings-reference#switchmodelsonflag>) setting controls
`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>)
+`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_UNKNOWN_MODEL_WINDOW_ENFORCEMENT`| Set to `1` to skip proactive [auto-compaction](</docs/en/costs#reduce-token-usage>) when Claude Code doesn’t recognize the model ID, such as an [LLM gateway](</docs/en/llm-gateway>) alias. Without this variable, Claude Code compacts at the context window it assumes for the ID. `CLAUDE_CODE_MAX_CONTEXT_TOKENS` can correct the assumed window instead; see [Correct the window for a gateway or custom model ID](</docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id>) for when each variable applies. Requires Claude Code v2.1.223 or later
`CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL`| Set to `1` to disable virtual scrolling in [fullscreen rendering](</docs/en/fullscreen>) and render every message in the transcript. Use this if scrolling in fullscreen mode shows blank regions where messages should appear
@@ -273,7 +273,7 @@
`CLAUDE_CODE_EXIT_AFTER_STOP_DELAY`| Time in milliseconds to wait after the query loop becomes idle before automatically exiting. Useful for automated workflows and scripts using SDK mode
`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS`| Set to `1` to enable [agent teams](</docs/en/agent-teams>). Agent teams are experimental and disabled by default
`CLAUDE_CODE_EXTRA_BODY`| JSON object to merge into the top level of every API request body. Useful for passing provider-specific parameters that Claude Code doesn’t expose directly. A value exported in your shell also applies to the [background sessions](</docs/en/agent-view>) you dispatch with `claude agents` or `--bg`. Before v2.1.206, background sessions ignored a shell-exported value and used whatever copy the background supervisor process inherited
-`CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS`| Override the default token limit for file reads. Useful when you need to read larger files in full
+`CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS`| Override the default token limit for [file reads](</docs/en/tools-reference#large-files>), which is 25,000 tokens. Useful when you need to read larger files in full. A read that Claude makes with the `allow_large` parameter can go past this limit when the context window has room
`CLAUDE_CODE_FORCE_SESSION_PERSISTENCE`| Set to `1` to force transcript persistence, prompt history, and `claude agents` registration even when this `claude` was launched from inside another Claude Code session. Use when an inherited `CLAUDE_CODE_CHILD_SESSION` value, for example from a `screen` session or a background launcher first started by Claude Code’s Bash tool, causes a genuine top-level session to be misclassified as nested. As of v2.1.178, Claude Code detects the tmux case automatically and ignores the inherited marker, so tmux no longer needs this variable. Also honored on v2.1.169 and earlier; has no effect on v2.1.170 and v2.1.171, where the nested-session detection it overrides was removed
`CLAUDE_CODE_FORCE_STRIKETHROUGH`| Set to `1` to force strikethrough rendering for `~~text~~` in Claude’s responses when your terminal supports it but is not auto-detected, such as over SSH without `TERM_PROGRAM` forwarded. Without this, undetected terminals show the literal `~~` markers instead of rendering the text as strikethrough. Requires Claude Code v2.1.186 or later
`CLAUDE_CODE_FORCE_SYNC_OUTPUT`| Set to `1` to force-enable DEC private mode 2026 [synchronized output](<https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036>) when your terminal supports it but is not auto-detected. Useful for emulators such as Emacs `eat` that implement BSU/ESU but do not reply to the capability probe. Has no effect under tmux. Unlike `CLAUDE_CODE_NO_FLICKER`, which switches to [fullscreen rendering](</docs/en/fullscreen>), this doesn’t change the renderer
@@ -407,7 +407,7 @@
`CLAUDE_ENABLE_BYTE_WATCHDOG`| Set to `1` to force-enable the byte-level streaming idle watchdog, or set to `0` to force-disable it. `0` also turns off the [first-byte deadline](</docs/en/network-config#streaming-idle-watchdogs>) on the connections where that deadline runs. When unset, the watchdog is enabled by default for direct Anthropic API and [Claude Platform on AWS](</docs/en/claude-platform-on-aws>) connections, and for streaming responses on [gateway](</docs/en/gateways>) connections reached through `ANTHROPIC_BASE_URL` or `ANTHROPIC_AWS_BASE_URL`; before v2.1.222 it didn’t run on those gateway connections, so the event-level watchdog could report a stall there even while keep-alive pings were arriving. For timeouts and how the timers interact, see [Streaming idle watchdogs](</docs/en/network-config#streaming-idle-watchdogs>)
`CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK`| Set to `1` to enable the byte-level streaming idle watchdog on Amazon Bedrock `vnd.amazon.eventstream` responses, which also enables the [first-byte deadline](</docs/en/network-config#streaming-idle-watchdogs>) on Bedrock streaming requests. Off by default. Configure the timeout with `CLAUDE_STREAM_IDLE_TIMEOUT_MS`
`CLAUDE_ENABLE_STREAM_WATCHDOG`| Set to `0` to force-disable the event-level streaming idle watchdog, or set to `1` to force-enable it. When unset, the watchdog is on by default for all providers. Before v2.1.196, the unset default was server-controlled on the direct Anthropic API and off on other providers. Configure the timeout with `CLAUDE_STREAM_IDLE_TIMEOUT_MS`; for the other stall timers that run alongside this one, see [Streaming idle watchdogs](</docs/en/network-config#streaming-idle-watchdogs>)
-`CLAUDE_ENV_FILE`| Path to a shell script whose contents Claude Code runs before each Bash command in the same shell process, so exports in the file are visible to the command. Use to persist virtualenv or conda activation across commands. Also populated dynamically by [SessionStart](</docs/en/hooks#persist-environment-variables>), [Setup](</docs/en/hooks#setup>), [CwdChanged](</docs/en/hooks#cwdchanged>), and [FileChanged](</docs/en/hooks#filechanged>) hooks
+`CLAUDE_ENV_FILE`| Path to a shell script whose contents Claude Code runs before each Bash command in the same shell process, so exports in the file are visible to the command. Use to persist virtualenv or conda activation across commands. PowerShell commands receive its variables too, in v2.1.296 or later, under the conditions in [Persisted variables in PowerShell commands](</docs/en/hooks#persisted-variables-in-powershell-commands>). Also populated dynamically by [SessionStart](</docs/en/hooks#persist-environment-variables>), [Setup](</docs/en/hooks#setup>), [CwdChanged](</docs/en/hooks#cwdchanged>), and [FileChanged](</docs/en/hooks#filechanged>) hooks
`CLAUDE_JOB_DIR`| Set by Claude Code in each [background session](</docs/en/agent-view>) to that session’s `~/.claude/jobs/<id>` directory. Shell commands that the session runs inherit it. Write scratch files to [`$CLAUDE_JOB_DIR/tmp`](</docs/en/agent-view#where-state-is-stored>). Claude’s `Write` and `Edit` calls there don’t prompt for permission, and the directory is removed when the session is deleted
`CLAUDE_PID`| Claude Code sets this to its own process ID in the subprocesses it spawns: Bash and PowerShell tool commands and hook commands. On Linux, the Bash tool’s shell integration uses it to refuse a `pkill` pattern that would match the Claude Code process itself; see [the error reference](</docs/en/errors#pkill-pattern-matches-the-claude-code-process>). Read it from your own scripts to identify or signal the parent Claude Code process deliberately. Requires Claude Code v2.1.214 or later
`CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX`| Prefix for auto-generated [Remote Control](</docs/en/remote-control>) session names when no explicit name is provided. Defaults to your machine’s hostname, producing names like `myhost-graceful-unicorn`. The `--remote-control-session-name-prefix` CLI flag sets the same value for a single invocation
--- a/errors.md
+++ b/errors.md
@@ -27,6 +27,7 @@
`Connection lost while your computer was asleep`| Automatic retries
`<model> is temporarily unavailable, so auto mode cannot determine the safety of...`| Server errors
`Auto mode could not evaluate this action and is blocking it for safety`| Server errors
+`Not run · auto mode's check had no usable answer`| Server errors
`Auto mode classifier transcript exceeded context window`| Server errors
`Agent aborted: auto mode classifier request refused by the safety safeguard`| Server errors
`The server-side auto mode classifier gave no verdict`| Server errors
@@ -253,6 +254,7 @@
`Marketplace "<name>" is already added from a different source`| Plugin errors
`"<name>" is another spelling of "<reserved>", a reserved marketplace name`| Plugin errors
`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>" 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
@@ -299,6 +301,7 @@
`Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)`| Tool errors
`The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)`| Tool errors
`Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes`| Tool errors
+`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
`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
@@ -565,7 +568,7 @@
<model> is temporarily unavailable, so auto mode cannot determine the safety of <tool> right now. Wait a moment and then try this action again.
-When Claude Code can determine the failure category, it names the category in parentheses after `temporarily unavailable`, for example `<model> is temporarily unavailable (rate-limited), so auto mode cannot determine the safety of <tool> right now`. The categories are `(rate-limited)`, `(overloaded)`, `(server error)`, `(timed out)`, and `(connection failed)`. If `(timed out)` or `(connection failed)` repeats, check your connection; see Unable to connect to API. Before v2.1.229, the message never named a category and read `Wait briefly and then try this action again`. When no category fits, the message appears with no category in parentheses; more than one failure produces that form. On [Amazon Bedrock](</docs/en/amazon-bedrock>), including the [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), it also appears when your AWS account can’t invoke the model named in the message, and that failure repeats on every retry until your account is granted access to the model. **What to do:**
+In an interactive session, a dim `Not run · auto mode's check had no usable answer` row appears under the tool call instead of this message. Press `Ctrl+O` to read the message in the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>). The denials under The server returned no safety verdict show the same row. Before v2.1.296, the message appeared under the call as a red error. When Claude Code can determine the failure category, it names the category in parentheses after `temporarily unavailable`, for example `<model> is temporarily unavailable (rate-limited), so auto mode cannot determine the safety of <tool> right now`. The categories are `(rate-limited)`, `(overloaded)`, `(server error)`, `(timed out)`, and `(connection failed)`. If `(timed out)` or `(connection failed)` repeats, check your connection; see Unable to connect to API. Before v2.1.229, the message never named a category and read `Wait briefly and then try this action again`. When no category fits, the message appears with no category in parentheses; more than one failure produces that form. On [Amazon Bedrock](</docs/en/amazon-bedrock>), including the [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>), it also appears when your AWS account can’t invoke the model named in the message, and that failure repeats on every retry until your account is granted access to the model. **What to do:**
* Retry after a few seconds; Claude sees the same message and usually retries on its own. A transient failure is unrelated to [auto mode eligibility](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>); you don’t need to change settings
* If retries keep failing, continue with read-only tasks and come back to the blocked action later
@@ -1658,7 +1661,7 @@
Connection to api.anthropic.com timed out after 10 seconds
A proxy is configured via HTTPS_PROXY. Check that it allows connections to the host above.
-Claude Code sends the check through the same [proxy configuration](</docs/en/network-config>) as API requests and gives each probe 10 seconds. When the failed probe went through a proxy, the message names the environment variable that configured it, such as `HTTPS_PROXY`. Before v2.1.222, the check used a different proxy transport with no timeout: behind a proxy URL with the `https://` scheme, it could stall on `Checking connectivity...` indefinitely and then fail even though API requests through the same proxy succeed. Claude Code skips this check when a [managed settings file, MDM policy, or policy helper](</docs/en/managed-settings>) sets [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) to `"gateway"`, or sets [`forceLoginGatewayUrl`](</docs/en/settings-reference#forcelogingatewayurl>) without `forceLoginMethod`. With either configuration, Claude Code opens the sign-in step on the **Cloud gateway** screen rather than an Anthropic sign-in method. Claude Code also skips the check when a managed settings source on the machine exists but can’t be read, since that source may hold the gateway configuration. Before v2.1.247, Claude Code ran the check under this configuration too, and exited with this error when Anthropic’s endpoints were unreachable. **What to do:**
+Claude Code sends the check through the same [proxy configuration](</docs/en/network-config>) as API requests and gives each probe 10 seconds. When the failed probe went through a proxy, the message names the environment variable that configured it, such as `HTTPS_PROXY`. Before v2.1.222, the check used a different proxy transport with no timeout: behind a proxy URL with the `https://` scheme, it could stall on `Checking connectivity...` indefinitely and then fail even though API requests through the same proxy succeed. Claude Code skips this check when a [managed settings file, MDM policy, or policy helper](</docs/en/managed-settings>) sets [`forceLoginMethod`](</docs/en/settings-reference#forceloginmethod>) to `"gateway"`, or sets [`forceLoginGatewayUrl`](</docs/en/settings-reference#forcelogingatewayurl>) without `forceLoginMethod`. With either configuration, Claude Code opens the sign-in step on the **Cloud gateway** screen rather than an Anthropic sign-in method. Claude Code also skips the check when a managed settings source on the machine exists but can’t be read, since that source may hold the gateway configuration. Before v2.1.247, Claude Code ran the check under this configuration too, and exited with this error when Anthropic’s endpoints were unreachable. Claude Code also skips the check on a machine with no managed settings when your own `~/.claude/settings.json` [names a gateway](</docs/en/claude-apps-gateway#set-the-gateway-url-in-user-settings>) with `forceLoginMethod` and `forceLoginGatewayUrl`. Before v2.1.295, Claude Code ran the check in that case. **What to do:**
* If the message names a proxy variable, check that its value points at the right proxy and ask your network team to allow HTTPS connections through it to the host in the message. See [Network configuration](</docs/en/network-config>).
* Work through the checks in Unable to connect to API. The `curl` test and firewall guidance there apply to this check too.
@@ -3272,7 +3275,7 @@
No conversation found with session ID: <session-id>
-Claude Code exits with code 1 after showing the message. Claude Code [searches the current project first, then every other project on this machine](</docs/en/sessions#resume-a-session>) for the ID. Before v2.1.223, the lookup stopped at the current project directory and its git worktrees, so resume from the directory the session last worked in. Common causes:
+Claude Code exits with code 1 after showing the message. Claude Code [searches the current project first, then every other project on this machine](</docs/en/sessions#where-the-session-picker-looks>) for the ID. Before v2.1.223, the lookup stopped at the current project directory and its git worktrees, so resume from the directory the session last worked in. Common causes:
* **Mistyped ID** : for a non-interactive run, the ID is the `session_id` field of the [`--output-format json` output](</docs/en/headless#get-structured-output>)
* **Deleted transcript** : Claude Code removes transcripts after the [retention period](</docs/en/sessions#where-transcripts-are-stored>), 30 days by default, following the [retention sweep rules](</docs/en/claude-directory#cleaned-up-automatically>)
@@ -4040,6 +4043,23 @@
+File is not valid UTF-8
+
+Claude used the Edit or NotebookEdit tool on a file whose bytes don’t decode as UTF-8, and Claude Code refused the change. Nothing was written, so the file is as it was. Those tools save the whole file back as UTF-8, which would have turned every byte they couldn’t decode into the replacement character `U+FFFD`. The message appears in the tool result:
+
+ File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary. This tool saves the whole file as UTF-8, which would replace every byte it cannot decode with U+FFFD. Nothing was written. Make the change with a shell command that reads and writes the file in its own encoding, or ask the user whether to convert the file to UTF-8 first.
+
+A file that is meant to be UTF-8 gets this message too when it contains even one invalid byte sequence, because the check covers the file’s bytes as a whole. **What to do:**
+
+ * To keep the file in its current encoding, let Claude make the change with a shell command that reads and writes the file in that encoding, as the message tells it to
+ * To keep editing the file with the Edit tool, convert it to UTF-8, or fix the invalid bytes in a file that is meant to be UTF-8, then ask Claude to make the edit again
+
+Before v2.1.296, Edit and NotebookEdit applied such an edit and saved every byte they couldn’t decode as `U+FFFD`. On those versions, update Claude Code.
+
+###
+
+
+
The source file is not valid UTF-8 text
Claude tried to publish an [artifact](</docs/en/artifacts>) from a file whose bytes don’t decode as text, or whose text already contains the replacement character `U+FFFD`, so Claude Code refused the publish before uploading anything. The message appears in the Artifact tool result and names the first position to fix:
@@ -4718,7 +4738,7 @@
Paths that Claude Code refuses this way include:
* UNC shares such as `\\server\share`
- * Automount paths such as `/net/<host>`, unless you launched Claude Code from a directory under that host’s automount
+ * Automount paths such as `/net/<host>`, unless you launched Claude Code from a directory under that host’s automount. Reads under that automount still go through the [network path check](</docs/en/permissions#network-paths>).
* Local paths that reach a network location through a symbolic link or junction
Mapped drive letters and `\\wsl$` paths don’t count as network paths. **What to do:**
--- a/github-enterprise-server.md
+++ b/github-enterprise-server.md
@@ -17,7 +17,7 @@
Claude Security| ✅ Supported| Available in public beta for Enterprise plans at [claude.ai/security](<https://claude.ai/security>)
Teleport sessions| ✅ Supported| Move sessions between cloud and terminal with `--teleport`
Plugin marketplaces| ✅ Supported| Credential requirements differ by surface. See Plugin marketplaces on GHES
-Contribution metrics| ✅ Supported| Delivered via webhooks to the [analytics dashboard](</docs/en/analytics>)
+Contribution metrics| ❌ Not supported| Requires repositories hosted on github.com. The [analytics dashboard](</docs/en/analytics>) still shows usage metrics for work in GHES repositories
GitHub Actions| ✅ Supported| Requires manual workflow setup; `/install-github-app` is github.com only
GitHub MCP server| ❌ Not supported| The GitHub MCP server does not work with GHES instances
@@ -55,9 +55,9 @@
5
-Enable features
-
-Go to [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) and enable [Code Review](</docs/en/code-review#set-up-code-review>) and [contribution metrics](</docs/en/analytics#enable-contribution-metrics>) for your GHES repositories using the same configuration as github.com.
+Enable Code Review
+
+Go to [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>) and enable [Code Review](</docs/en/code-review#set-up-code-review>) for your GHES repositories using the same configuration as github.com.
###
@@ -65,7 +65,7 @@
GitHub App permissions
-The manifest configures the GitHub App with the permissions and webhook events below, which together cover cloud sessions, Code Review, Claude Security, plugin marketplaces, and contribution metrics:
+The manifest configures the GitHub App with the permissions and webhook events below, which together cover cloud sessions, Code Review, Claude Security, and plugin marketplaces:
Permission| Access| Used for
---|---|---
@@ -274,6 +274,6 @@
* [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>): run Claude Code sessions on cloud infrastructure
* [Code Review](</docs/en/code-review>): automated PR reviews
* [Plugin marketplaces](</docs/en/plugins/host-marketplace>): build and distribute plugin catalogs
- * [Analytics](</docs/en/analytics>): track usage and contribution metrics
+ * [Analytics](</docs/en/analytics>): track Claude Code usage across your organization
* [Managed settings](</docs/en/settings>): organization-wide policy configuration
* [Network configuration](</docs/en/network-config>): firewall and IP allowlist requirements
--- a/headless.md
+++ b/headless.md
@@ -287,7 +287,7 @@
Auto-approve tools
-Use `--allowedTools` to let Claude use certain tools without prompting. Listing `Read` and `Edit` lets Claude read and edit files without asking for permission. Listing `Bash` does the same for shell commands, except in a run that starts in [auto mode](</docs/en/permission-modes#how-auto-mode-evaluates-actions>), where Claude Code drops a bare `Bash` entry as a broad allow rule and auto mode evaluates each command instead. This example runs a test suite and fixes failures with those three tools listed:
+Use `--allowedTools` to let Claude use certain tools without prompting. Listing `Read` and `Edit` lets Claude read and edit files without asking for permission, apart from reads from [network paths](</docs/en/permissions#network-paths>). Listing `Bash` does the same for shell commands, except in a run that starts in [auto mode](</docs/en/permission-modes#how-auto-mode-evaluates-actions>), where Claude Code drops a bare `Bash` entry as a broad allow rule and auto mode evaluates each command instead. This example runs a test suite and fixes failures with those three tools listed:
claude -p "Run the test suite and fix any failures" \
--allowedTools "Bash,Read,Edit"
@@ -295,7 +295,7 @@
To set a baseline for the whole session instead of listing individual tools, pass a [permission mode](</docs/en/permission-modes>). A run where nothing sets a permission mode takes the [built-in starting permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>), which can be `auto`, so pass the one you want:
* **`auto`** : pass `--permission-mode auto` to have a classifier review most actions instead of you
- * **`dontAsk`** : Claude Code denies every call that would otherwise prompt, which is useful for locked-down CI runs. Actions that need no approval in Manual mode still run, such as file reads in your working directories and the [read-only command set](</docs/en/permissions#read-only-commands>), and so do actions your `--allowedTools` entries or `permissions.allow` rules cover. `AskUserQuestion`, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), and MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) are denied even when an allow rule matches
+ * **`dontAsk`** : Claude Code denies every call that would otherwise prompt, which is useful for locked-down CI runs. Actions that need no approval in Manual mode still run, such as file reads in your working directories and the [read-only command set](</docs/en/permissions#read-only-commands>), and so do actions your `--allowedTools` entries or `permissions.allow` rules cover. `AskUserQuestion`, connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), and [reads from network paths](</docs/en/permissions#network-paths>) are denied even when an allow rule matches
* **`acceptEdits`** : Claude writes files without prompting, and Claude Code auto-approves common filesystem commands such as `mkdir`, `touch`, `mv`, and `cp`. The [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply. Apart from the read-only command set, other shell commands and network requests still need an `--allowedTools` entry or a `permissions.allow` rule. See [what `acceptEdits` auto-approves](</docs/en/permission-modes#auto-approve-file-edits-with-acceptedits-mode>) for the full list
This example applies lint fixes with `acceptEdits` as the baseline:
@@ -357,7 +357,7 @@
Continue conversations
-Use `--continue` to continue the most recent conversation, or `--resume` with a session ID to continue a specific conversation. On Claude Code v2.1.257 or later, when you pass `--continue`, Claude Code opens a [background session](</docs/en/sessions#resume-a-session>) that has finished, but not one that is still running. This example runs a review, then sends follow-up prompts:
+Use `--continue` to continue the most recent conversation, or `--resume` with a session ID to continue a specific conversation. On Claude Code v2.1.257 or later, when you pass `--continue`, Claude Code opens a [background session](</docs/en/sessions#where-the-session-picker-looks>) that has finished, but not one that is still running. This example runs a review, then sends follow-up prompts:
# First request
claude -p "Review this codebase for performance issues"
@@ -371,7 +371,7 @@
session_id=$(claude -p "Start a review" --output-format json | jq -r '.session_id')
claude -p "Continue that review" --resume "$session_id"
-You can run the two commands from different directories: Claude Code [finds the session by its ID](</docs/en/sessions#resume-a-session>) in any project on this machine. Before v2.1.223, Claude Code looked for the ID only in the current project directory and its git worktrees, so you had to run both commands from the same directory. In place of the session ID, you can pass `--resume` the absolute path to a session’s `.jsonl` [transcript file](</docs/en/sessions#where-transcripts-are-stored>), and Claude Code continues the conversation stored in that file.
+You can run the two commands from different directories: Claude Code [finds the session by its ID](</docs/en/sessions#where-the-session-picker-looks>) in any project on this machine. In place of the session ID, you can pass `--resume` the absolute path to a session’s `.jsonl` [transcript file](</docs/en/sessions#where-transcripts-are-stored>), and Claude Code continues the conversation stored in that file.
##
--- a/hooks.md
+++ b/hooks.md
@@ -427,7 +427,7 @@
Auto-approve specific tools
-By default, the agent may prompt for permission before using certain tools. This example auto-approves read-only filesystem tools (Read, Glob, Grep) by returning `permissionDecision: 'allow'`, letting them run without user confirmation while leaving all other tools subject to normal permission checks:
+By default, the agent may prompt for permission before using certain tools. This example auto-approves read-only filesystem tools (Read, Glob, Grep) by returning `permissionDecision: 'allow'`, letting them run without user confirmation, apart from reads from [network paths](</docs/en/permissions#network-paths>), while leaving all other tools subject to normal permission checks:
Python
--- a/hooks-guide.md
+++ b/hooks-guide.md
@@ -588,7 +588,7 @@
With `"deny"`, Claude Code cancels the tool call and feeds `permissionDecisionReason` back to Claude. On `PreToolUse`, Claude Code handles each `permissionDecision` value as follows:
- * `"allow"`: skip the interactive permission prompt. Deny and ask rules, including enterprise managed deny lists, still apply, as do prompts for MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) and for connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code
+ * `"allow"`: skip the interactive permission prompt. Deny and ask rules, including enterprise managed deny lists, still apply, as do prompts for reads from [network paths](</docs/en/permissions#network-paths>), for MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), and for connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code
* `"deny"`: cancel the tool call and send the reason to Claude
* `"ask"`: show the permission prompt to the user as normal
@@ -897,7 +897,7 @@
Hooks and permission modes
-`PreToolUse` hooks fire before any permission-mode check, in every [permission mode](</docs/en/permission-modes>), including `dontAsk`. A hook that returns `permissionDecision: "deny"` blocks the tool even in `bypassPermissions` mode or with `--dangerously-skip-permissions`. This lets you enforce policy that users can’t bypass by changing their permission mode. The reverse is not true: a hook returning `"allow"` doesn’t bypass deny rules from settings, and it can’t suppress the prompt for MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) or for connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code. Hooks in settings files and in a plugin’s `hooks/hooks.json` can tighten restrictions but not loosen them past what permission rules allow. A [mod](</docs/en/plugins/mods/overview>) you install that handles `tool.check` can approve a call that your `PreToolUse` hook blocked, unless the hook is in managed settings. [Extend permissions with hooks](</docs/en/permissions#extend-permissions-with-hooks>) lists which rules hold over a mod.
+`PreToolUse` hooks fire before any permission-mode check, in every [permission mode](</docs/en/permission-modes>), including `dontAsk`. A hook that returns `permissionDecision: "deny"` blocks the tool even in `bypassPermissions` mode or with `--dangerously-skip-permissions`. This lets you enforce policy that users can’t bypass by changing their permission mode. The reverse is not true: a hook returning `"allow"` doesn’t bypass deny rules from settings, and it can’t suppress the prompt for reads from [network paths](</docs/en/permissions#network-paths>), for MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), or for connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code. Hooks in settings files and in a plugin’s `hooks/hooks.json` can tighten restrictions but not loosen them past what permission rules allow. A [mod](</docs/en/plugins/mods/overview>) you install that handles `tool.check` can approve a call that your `PreToolUse` hook blocked, unless the hook is in managed settings. [Extend permissions with hooks](</docs/en/permissions#extend-permissions-with-hooks>) lists which rules hold over a mod.
###
@@ -967,22 +967,36 @@
Your hook prints valid JSON, but the decision doesn’t take effect and no error appears in the transcript. Check which cause applies:
- * **Extra output before the JSON** : something else writes to stdout first, usually an unconditional `echo` in your shell profile, so the output no longer starts with `{` and Claude Code doesn’t parse it as JSON. The cause and fix follow this list.
- * **A field at the wrong level** : compare each field’s placement against the [JSON output](</docs/en/hooks#json-output>) format. For example, `permissionDecision` belongs inside `hookSpecificOutput`, not at the top level.
-
-When Claude Code runs a shell-form command hook, one without `args`, it spawns `sh -c` on macOS and Linux, Git Bash on Windows, or PowerShell when Git Bash isn’t installed by default. This shell is non-interactive, but Git Bash and some configurations, such as `BASH_ENV` pointing at `~/.bashrc`, still source your profile. If that profile contains unconditional `echo` statements, the output gets prepended to your hook’s JSON:
+ * **Extra output before the JSON** : something else writes to stdout first, usually an unconditional `echo` in your shell profile, so the output no longer starts with `{`. See Shell profile output before the JSON.
+ * **A field at the wrong level** : compare each field’s placement against the [JSON output](</docs/en/hooks#json-output>) format. For example, `permissionDecision` belongs inside `hookSpecificOutput`, not at the top level. See Fields at the wrong level.
+
+####
+
+
+
+Shell profile output before the JSON
+
+Hooks run in non-interactive shells, but Git Bash and some configurations, such as `BASH_ENV` pointing at `~/.bashrc`, still source your profile, and anything the profile prints reaches stdout ahead of your hook’s JSON:
Shell ready on arm64
{"decision": "block", "reason": "Not allowed"}
-The combined output no longer starts with `{`, so Claude Code treats all of stdout as plain text and ignores the JSON. On exit 0 nothing is reported in the transcript; the parse attempt is recorded only in the [debug log](</docs/en/hooks#debug-hooks>). To fix this, wrap echo statements in your shell profile so they only run in interactive shells:
+Unless the hook is [async](</docs/en/hooks#how-async-hooks-execute>), Claude Code reads output that doesn’t start with `{` as plain text, so your JSON is ignored. Because the hook exited 0, the transcript shows no error either. To check for this cause, start Claude Code with `claude --debug`, trigger the hook, and search the [debug log](</docs/en/hooks#debug-hooks>) for `Hook output does not start with {`. To fix it, wrap the `echo` statements in your profile so they run only in interactive shells:
# In ~/.zshrc or ~/.bashrc
if [[ $- == *i* ]]; then
echo "Shell ready"
fi
-The `$-` variable contains shell flags, and `i` means interactive. Hooks run in non-interactive shells, so the echo is skipped. When your hook returns `permissionDecision` or `additionalContext` at the top level instead of inside `hookSpecificOutput`, the JSON still parses, and Claude Code ignores the misplaced fields without reporting an error. To see which fields it ignored, start Claude Code with `claude --debug` and search the [debug log](</docs/en/hooks#debug-hooks>) for `Hook JSON output had unrecognized keys`.
+The `$-` variable contains shell flags, and `i` means interactive. Hooks run in non-interactive shells, so the echo is skipped.
+
+####
+
+
+
+Fields at the wrong level
+
+When your hook returns `permissionDecision` or `additionalContext` at the top level instead of inside `hookSpecificOutput`, the JSON still parses, and Claude Code ignores the misplaced fields without reporting an error. To see which fields it ignored, start Claude Code with `claude --debug` and search the [debug log](</docs/en/hooks#debug-hooks>) for `Hook JSON output had unrecognized keys`.
###
@@ -997,7 +1011,7 @@
* **Blocking error** : on most events you see the message that came with the block, for example `Blocked: rm commands are not allowed`. On a few events, such as `ConfigChange` and `Elicitation`, you see no message. [Exit code 2](</docs/en/hooks#exit-code-2>) covers where the message comes from.
* **Non-blocking error** : you see a `<hook name> hook error` notice with a short explanation, such as the first line of stderr after `Failed with non-blocking status code:`, or a JSON validation or parse message. The action went ahead.
-To look up the outcome for a specific exit code and stdout, including the per-event exceptions, see [Exit code output](</docs/en/hooks#exit-code-output>) in the reference. For full execution details including hook exit codes, stdout, and stderr, read the debug log. Start Claude Code with `claude --debug-file /tmp/claude.log` to write to a known path, then `tail -f /tmp/claude.log` in another terminal. If you started without that flag, run `/debug` mid-session to enable logging and find the log path.
+To look up the outcome for a specific exit code and stdout, including the per-event exceptions, see [Exit code output](</docs/en/hooks#exit-code-output>) in the reference. For full execution details, including hook exit codes, stdout, and stderr, read the [debug log](</docs/en/hooks#debug-hooks>). Start Claude Code with `claude --debug-file /tmp/claude.log` to write to a known path, then `tail -f /tmp/claude.log` in another terminal. If you started without that flag, run `/debug` mid-session to enable logging and find the log path.
##
--- a/host-marketplace.md
+++ b/host-marketplace.md
@@ -134,9 +134,9 @@
Users without a git-host account can add a marketplace you serve as a `marketplace.json` URL or from a shared directory, but they can install only the plugins whose entry sources they can also reach. An entry that points at a private `github` repository still fails at install for them, because Claude Code fetches it with the same non-interactive `git` it uses for a git-hosted marketplace. These entry sources need no git account:
* **`archive`** : a zip downloaded over HTTPS. Users need neither `git` nor an account, only network access to the URL. Requires Claude Code v2.1.224 or later. Pin each archive with `sha256` so Claude Code refuses a changed download. To send credentials with the download, see Authenticate archive downloads.
- * **A public git repository** : Claude Code clones a public `url` or `git-subdir` source over HTTPS without credentials when the entry gives an `https://` URL. For a `github` source, or a `git-subdir` source written as `owner/repo`, users without a GitHub SSH key set `CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`.
-
-For a team on one network, a `directory` marketplace on a shared filesystem also works without git accounts. Users need only read access to the path.
+ * **A public git repository** : Claude Code clones a public `url` or `git-subdir` source over HTTPS without credentials when the entry gives an `https://` URL. For a `github` source, or a `git-subdir` source written as `owner/repo`, tell users without a GitHub SSH key to set `CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`.
+
+Keep `CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1` in your instructions even if `claude plugin install` succeeds without it from the shell on a machine with no SSH key. For a `github` source, that command can fall back to HTTPS on its own, printing `SSH not configured, cloning via HTTPS`. Installs from `/plugin` inside a session and plugin updates don’t fall back, so without the variable they fail for users who have no GitHub SSH key. For a team on one network, a `directory` marketplace on a shared filesystem also works without git accounts. Users need only read access to the path.
###
--- a/interactive-mode.md
+++ b/interactive-mode.md
@@ -14,7 +14,7 @@
Shortcut| Description| Context
---|---|---
-`Ctrl+C`| Interrupt, or clear input| Interrupts a running operation. If nothing is running, the first press clears the prompt input and a second press exits Claude Code
+`Ctrl+C`| Interrupt, or clear input| Interrupts a running operation. If nothing is running, the first press clears the prompt input and a second press exits Claude Code. Press `Up` while the prompt is still empty to bring the cleared draft back, which requires Claude Code v2.1.288 or later
`Ctrl+X Ctrl+K`| Stop all running [background subagents](</docs/en/sub-agents#run-subagents-in-foreground-or-background>) in this session, and turn off [artifact auto-replies](</docs/en/artifacts#let-claude-reply-to-comments-on-its-own>) for the rest of it. Press twice within 3 seconds to confirm. You can press it while a background subagent’s permission prompt is open| Subagent control
`Ctrl+D`| Exit Claude Code session| The first press shows a confirmation hint and a second press within 800ms exits. When the prompt has text, `Ctrl+D` deletes the character after the cursor instead
`Ctrl+G` or `Ctrl+X Ctrl+E`| Open in default text editor| Edit your prompt or custom response in your default text editor. `Ctrl+X Ctrl+E` is the readline-native binding. Turn on **Show last response in external editor** in `/config` to prepend Claude’s previous reply as `#`-commented context above your prompt; Claude Code strips the comment block when you save
@@ -430,7 +430,7 @@
Take back what you queued
-Press `Up` from the first line of the input box to take back the queued messages and commands. Claude Code removes them from the queue and puts them in the input box, one per line, ahead of any text you had typed. Edit the text and press `Enter` to queue it again as one entry, or clear the input box to drop it. Claude Code takes back queued shell commands only when the input box is empty and you have nothing else queued, and it switches the input box to shell mode when it does. Otherwise it leaves them in the queue, listed with their `!` prefix, and runs them after the turn ends.
+Press `Up` from the first line of the input box to take back the queued messages and commands. Claude Code removes them from the queue and puts them in the input box, one per line, ahead of any text you had typed. Edit the text and press `Enter` to queue it again as one entry, or clear the input box to drop it. Claude Code takes back queued shell commands only when the input box is empty and you have nothing else queued, and it switches the input box to shell mode when it does. Otherwise it leaves them in the queue, listed with their `!` prefix, and runs them after the turn ends. If you take back queued text while `←` [waits to background the session](</docs/en/agent-view#switch-sessions-without-leaving-the-terminal>), the text stays in the input box and Claude Code cancels the switch. If you take it back at the moment the session moves, the text disappears with the foreground screen: it wasn’t sent. Each message you took back is saved as its own entry in command history. To recover one, reopen the session and press `Up` on an empty prompt with nothing queued.
##
--- a/llm-gateway-connect.md
+++ b/llm-gateway-connect.md
@@ -279,7 +279,7 @@
Slack, cloud sessions, and Remote Control
-[Claude Code in Slack](</docs/en/slack>) and [cloud sessions](</docs/en/claude-code-on-the-web>) aren’t part of a gateway deployment. Gateway variables set in a cloud session’s environment configuration are not applied. If your traffic must stay on the gateway, don’t enable these surfaces for those users. [Remote Control](</docs/en/remote-control>) and [voice dictation](</docs/en/voice-dictation>) both rely on a claude.ai identity: Remote Control to pair a live session with your account, and voice dictation to reach the claude.ai transcription endpoint. They are unavailable while `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or an `apiKeyHelper` is active. Remote Control is also disabled while `ANTHROPIC_BASE_URL` points at a non-Anthropic host, so signing in with claude.ai isn’t enough on its own. Before v2.1.196, a non-Anthropic base URL didn’t block Remote Control. To restore either feature, log in with claude.ai and unset the gateway variables that feature checks. The Remote Control section of `claude doctor` names what is currently blocking Remote Control.
+[Claude Code in Slack](</docs/en/slack>) and [cloud sessions](</docs/en/claude-code-on-the-web>) aren’t part of a gateway deployment. Gateway variables set in a cloud session’s environment configuration are not applied. If your traffic must stay on the gateway, don’t enable these surfaces for those users. [Remote Control](</docs/en/remote-control>) and [voice dictation](</docs/en/voice-dictation>) both rely on a claude.ai identity: Remote Control to pair a live session with your account, and voice dictation to reach the claude.ai transcription endpoint. They are unavailable while `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or an `apiKeyHelper` is active. Remote Control is also disabled while `ANTHROPIC_BASE_URL` points at a non-Anthropic host, so signing in with claude.ai isn’t enough on its own. To restore either feature, log in with claude.ai and unset the gateway variables that feature checks. The Remote Control section of `claude doctor` names what is currently blocking Remote Control.
* Voice dictation: unset the gateway credential
* Remote Control: unset the gateway credential and `ANTHROPIC_BASE_URL`
--- a/loading.md
+++ b/loading.md
@@ -74,7 +74,13 @@
Plugins shared through a repository
-To share a plugin through a repository, list it under `enabledPlugins` in `.claude/settings.json` or place it under `.claude/skills/`. Claude Code doesn’t scan a project’s `.claude/plugins/` directory. A cloud session doesn’t add the marketplaces a repository lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>), because that requires the workspace trust dialog, which a cloud session never shows. A project-scope skills-directory plugin loads only from the `.claude/skills/` of the session’s [primary working directory](</docs/en/permissions#working-directories>), and only after you accept the [workspace trust dialog](</docs/en/permissions#what-runs-before-you-trust-a-folder>) for that folder. It doesn’t [search parent directories up to the repository root](</docs/en/skills#discovery-from-parent-and-nested-directories>) the way plain skills and commands do. If you launch from a subdirectory, a plugin at the repository root doesn’t load. Launch from the repository root instead, or [move the session there with `/cd`](</docs/en/permissions#move-the-session-to-another-directory>) on v2.1.246 or later. A project-scope plugin is checked into the repository and reaches every collaborator who clones it. Because that content comes from the repository rather than from you, it loads only after the same trust check that applies to project allow rules in `.claude/settings.json`. Trusting a parent folder or running with `-p` isn’t enough. Components that run code are restricted further:
+To share a plugin through a repository, list it under `enabledPlugins` in `.claude/settings.json` or place it under `.claude/skills/`. Claude Code doesn’t scan a project’s `.claude/plugins/` directory. A cloud session doesn’t add the marketplaces a repository lists under [`extraKnownMarketplaces`](</docs/en/settings-reference#extraknownmarketplaces>), because that requires the workspace trust dialog, which a cloud session never shows. If a plugin in your repository’s `.claude/skills/` doesn’t load, check where you started the session and whether you trusted the folder:
+
+ * **In a subdirectory** : a plugin at the repository root doesn’t load. Claude Code reads the `.claude/skills/` of the session’s [primary working directory](</docs/en/permissions#working-directories>) and, unlike plain skills and commands, doesn’t [search parent directories](</docs/en/skills#discovery-from-parent-and-nested-directories>) for plugins. Launch from the repository root instead, or [move the session there with `/cd`](</docs/en/permissions#move-the-session-to-another-directory>) on v2.1.246 or later
+ * **From the desktop app, in a worktree** : the plugin loads from the main checkout’s `.claude/skills/` rather than the worktree’s. See [What worktrees share with the main checkout](</docs/en/worktrees#what-worktrees-share-with-the-main-checkout>)
+ * **In a folder you haven’t trusted** : the plugin loads only after you accept the [workspace trust dialog](</docs/en/permissions#what-runs-before-you-trust-a-folder>) for that folder
+
+A project-scope plugin is checked into the repository and reaches every collaborator who clones it. Because that content comes from the repository rather than from you, it loads only after the same trust check that applies to project allow rules in `.claude/settings.json`. Trusting a parent folder or running with `-p` isn’t enough. Components that run code are restricted further:
* MCP servers it declares go through the [same per-server approval](</docs/en/mcp>) as a project `.mcp.json`
* MCP servers it declares as an [MCP bundle](</docs/en/plugins/manifest-reference#mcpservers>), a `.mcpb` or `.dxt` file, or from a file outside the plugin directory are skipped. Declare them inline or in a `.mcp.json` inside the plugin directory
@@ -397,6 +403,14 @@
+Hooks when two enabled plugins share a name
+
+When you install and enable two plugins with the same manifest name from different marketplaces, both appear as enabled in `/plugin`, but the hooks of one of them are left out. One plugin per name registers the hooks in its `hooks/hooks.json`, and one plugin per name loads a [hooks module](</docs/en/plugins/mods/overview>). When your organization’s managed settings turn on one of the copies, that copy holds the name. Otherwise the copy Claude Code loads first holds it. To see which copy holds the name, run `/plugin` in your session and open the **Errors** tab. A note there for the copy whose hooks were left out names the copy that holds the name, and the left-out copy’s details show the same note. For `hooks/hooks.json` hooks the note begins `Its hooks.json hooks do not run`, and for a hooks module it begins `Its hooks module does not load`. The note requires Claude Code v2.1.296 or later. To run the left-out copy’s hooks instead, disable or uninstall the copy that holds the name, then run `/reload-plugins` in your session. The reload registers the remaining copy’s hooks and clears the note. When the copy that holds the name is one your managed settings turn on, you can’t disable it, and the other copy’s hooks stay off while both are installed.
+
+###
+
+
+
Keep a session-only plugin from loading
To keep a `--plugin-dir` plugin from shadowing anything, or to turn one off when a parent process passes the flag for you, set its id to `false` in any settings file. For a plugin whose manifest name is `hello-plugin`, the entry is `"enabledPlugins": {"hello-plugin@inline": false}`. A disabled session-only plugin doesn’t shadow, so the marketplace or skills-directory copy loads instead.
--- a/marketplace-reference.md
+++ b/marketplace-reference.md
@@ -35,6 +35,7 @@
* **Another spelling of a reserved name** : a name that differs from a reserved name only by a trailing dot, or by a symbol other than an underscore in place of a hyphen, so `claude.code.plugins` counts as `claude-code-plugins`. Adding the marketplace fails with [`is another spelling of "<reserved>", a reserved marketplace name`](</docs/en/errors#marketplace-name-is-another-spelling-of-a-reserved-name>), and a marketplace already registered under one stops loading. This check requires Claude Code v2.1.280 or later.
* **Names Claude Code uses for plugins that don’t come from a marketplace** : `inline` for plugins loaded with [`--plugin-dir`](</docs/en/cli-reference>), `builtin` for built-in plugins, `skills-dir` for plugins auto-loaded from [`.claude/skills/`](</docs/en/skills>), and `synced` for plugins synced from your claude.ai account. `claude-plugin-test` is also reserved. `skills-dir` also appears as `{"source": "skills-dir"}` in `strictKnownMarketplaces` and `blockedMarketplaces`, described under Source values valid only in policy lists.
* **`npm`, `pip`, `uv`, `cargo`, `github`, and `gh`**: reserved in any casing. This check requires Claude Code v2.1.275 or later.
+ * **Member names that every JavaScript object has** : `constructor`, `hasOwnProperty`, `isPrototypeOf`, `propertyIsEnumerable`, `toLocaleString`, `toString`, and `valueOf`. `claude plugin marketplace add` refuses a marketplace that uses one with [`Claude Code reserves this name and cannot register a marketplace under it`](</docs/en/plugins/troubleshooting#claude-code-reserves-this-name>). This check requires Claude Code v2.1.296 or later.
* **Names starting with`claudeai-`**: reserved for marketplaces hosted on claude.ai. `claude plugin marketplace add` refuses any other marketplace that uses one with `Cannot add marketplace "<name>": names starting with "claudeai-" are reserved for marketplaces hosted on claude.ai`.
* **The download folder of a registered GitHub marketplace,`<owner>-<repo>`**: Claude Code downloads a marketplace added from a `github` source such as `acme/x-tools` through a folder named `acme-x-tools`, whatever that marketplace’s own `name` is. While that marketplace is registered under a name other than `acme-x-tools`, `claude plugin marketplace add` refuses a different marketplace named `acme-x-tools` after downloading it, and reports `Can't use the marketplace name "acme-x-tools"`. This check requires Claude Code v2.1.290 or later.
--- a/monitoring-usage.md
+++ b/monitoring-usage.md
@@ -418,6 +418,32 @@
+Attribute telemetry to Desktop SSH sessions
+
+To see which remote machine a [Desktop SSH session](</docs/en/desktop#ssh-sessions>) ran on, name each machine in a custom attribute. Metrics and events don’t name the machine a session ran on. On each remote machine, add `OTEL_RESOURCE_ATTRIBUTES` to the `env` block that turns telemetry on, in the [managed settings file the session reads](</docs/en/desktop#managed-settings>). Write the name out in each machine’s file. Claude Code doesn’t expand the value, so `host.name=$(hostname)` arrives as those characters. The following example names the machine `build-7`:
+
+ {
+ "env": {
+ "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
+ "OTEL_METRICS_EXPORTER": "otlp",
+ "OTEL_LOGS_EXPORTER": "otlp",
+ "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc",
+ "OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.example.com:4317",
+ "OTEL_RESOURCE_ATTRIBUTES": "host.name=build-7"
+ }
+ }
+
+When nothing else sets the variable, `host.name` arrives in the resource block, in Desktop SSH sessions and in the CLI on that machine. For where else custom attributes appear, see Multi-team organization support. If the name doesn’t arrive, check for one of these causes:
+
+ * **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 a login file** : only login shells read a file such as `/etc/profile`. A value you `export` there reaches Claude Code that you start from a login shell. It doesn’t reach a Desktop SSH session, because Desktop doesn’t start Claude Code through a login shell.
+ * **A value has a space inside it** : Claude Code then copies none of the keys onto events or datapoints and reports no error. 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>) names each 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
Set these environment variables before running `claude`. Each scenario below shows a complete configuration, and each variable is described under Common configuration variables. To confirm a configuration took effect, check your backend for the `claude_code.session.count` metric after starting a session; the Quick start covers logs-only verification and what to check when nothing arrives. For console debugging with a 1-second export interval:
@@ -1606,15 +1632,15 @@
All metrics and events are exported with the following resource attributes:
- * `service.name`: `claude-code` for terminal sessions, `claude-code-desktop` for sessions started from the Code tab in the [Claude Desktop app](</docs/en/desktop>)
- * `service.version`: Current Claude Code version, or the Desktop app version for Code tab sessions
+ * `service.name`: `claude-code` for terminal sessions, `claude-code-desktop` for local sessions started from the Code tab in the [Claude Desktop app](</docs/en/desktop>)
+ * `service.version`: Current Claude Code version, or the Desktop app version for local Code tab sessions
* `os.type`: Operating system type (for example, `linux`, `darwin`, `windows`)
* `os.version`: Operating system version string
* `host.arch`: Host architecture (for example, `amd64`, `arm64`)
* `wsl.version`: WSL version number (only present when running on Windows Subsystem for Linux)
* Meter Name: `com.anthropic.claude_code`
-If your collector pipelines or dashboards filter on `service.name = claude-code`, add `claude-code-desktop` to the filter to also capture telemetry from Code tab sessions.
+If your collector pipelines or dashboards filter on `service.name = claude-code`, add `claude-code-desktop` to the filter to also capture telemetry from local Code tab sessions.
##
--- a/network-config.md
+++ b/network-config.md
@@ -145,7 +145,7 @@
Set network variables in settings, not the shell
-The supervisor is one process shared by every terminal. It inherits the environment of whichever shell starts it first, and an OS-installed supervisor receives no shell environment at all. If you export a proxy, CA path, or mTLS variable only in your shell, it reaches background agents when that shell happened to cold-start the supervisor, and silently doesn’t when a different shell did. Put the same variables in the `env` block of `~/.claude/settings.json` or [managed settings](</docs/en/settings>) instead. Every variable on this page can be set there, and settings are the only configuration that reaches every background session on every machine.
+The supervisor is one process shared by every terminal. It inherits the environment of whichever shell starts it first. If you export a proxy, CA path, or mTLS variable only in your shell, it reaches background agents when that shell happened to cold-start the supervisor, and silently doesn’t when a different shell did. Put the same variables in the `env` block of `~/.claude/settings.json` or [managed settings](</docs/en/settings>) instead. Every variable on this page can be set there, and settings are the only configuration that reaches every background session on every machine.
###
@@ -155,7 +155,7 @@
Some organizations require every Claude Code process to start through a corporate launcher that applies sandboxing, network controls, or credential injection. The supervisor and its workers start Claude Code from a fixed path rather than by looking up `claude` on `PATH`, so every background agent bypasses a wrapper you place earlier on `PATH`. Set the [`processWrapper`](</docs/en/settings-reference#processwrapper>) setting to prefix the supervisor, its workers, and the other background processes listed under [What the launcher covers](</docs/en/corporate-launcher#what-the-launcher-covers>) with your launcher. The equivalent [`CLAUDE_CODE_PROCESS_WRAPPER`](</docs/en/env-vars>) environment variable takes precedence when both are set, and it is subject to the same rule: deliver it through managed settings or `~/.claude/settings.json`, not a shell export. [Run Claude Code behind a corporate launcher](</docs/en/corporate-launcher>) covers the contract the launcher must satisfy, what it does and doesn’t reach, and how to roll it out.
-An already-running supervisor keeps the launch configuration it started with. After deploying the launcher setting, run [`claude daemon stop --any`](</docs/en/agent-view#the-supervisor-process>) so the next `claude agents` or `--bg` starts a supervisor that honors it. An installed service takes `claude daemon stop` without `--any`.
+An already-running supervisor keeps the launch configuration it started with. After deploying the launcher setting, run [`claude daemon stop --any`](</docs/en/agent-view#the-supervisor-process>) so the next `claude agents` or `--bg` starts a supervisor that honors it.
##
--- a/permission-modes.md
+++ b/permission-modes.md
@@ -14,7 +14,7 @@
`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`| Reads and pre-approved tools; anything that would prompt is denied| Locked-down CI and scripts
+`dontAsk`| File reads inside your working directories and pre-approved tools; anything that would prompt is denied| 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"`. Writes to protected paths are never auto-approved except in `bypassPermissions` mode and in plan-mode sessions where bypass permissions are available, meaning interactive terminal sessions started in a way that puts `bypassPermissions` in the mode cycle. 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`.
@@ -376,7 +376,7 @@
The first read outside the working directories
-While [`permissions.blockReadsOutsideWorkingDirectories`](</docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories>) is off, file reads 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 non-interactive `-p` runs or background sessions; reads there run as before. 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 every later session and every permission mode. To let Claude read such a path later, add its directory with `/add-dir` or remove the setting.
@@ -438,16 +438,18 @@
Each action goes through a fixed decision order. The first matching step wins:
1. Actions matching your [allow, ask, or deny rules](</docs/en/permissions#manage-permissions>) resolve immediately, with these exceptions:
- * Writes to protected paths route to the classifier even when an allow rule matches
+ * Writes to protected paths route to the classifier even when an allow rule matches. When the protected path is the file that a symlinked settings file points to, the write can prompt you instead, as the protected paths list describes
* No allow rule approves `rm` and `rmdir` removals targeting a critical path
* MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>) prompt you directly even when an allow rule matches, and so do connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code
* A shell command that carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>) also routes to the classifier even when an allow rule matches, because a rule approves the command, not its hosts
* 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
* In a session with server-side classifier review, read-only 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
+ * A read from a [network path](</docs/en/permissions#network-paths>) prompts you
3. Everything else goes to the classifier, apart from critical-path removals under their default handling. The connector tools and `requiresUserInteraction` MCP tools that prompt you directly in step 1 never reach the classifier either, so neither an org-required approval nor a consent step is auto-approved
4. If the classifier blocks, Claude receives the reason. In most sessions the reason names the rule the classifier matched, such as `[Data Exfiltration]`, rather than giving a written explanation; see [Review denials](</docs/en/auto-mode-config#review-denials>)
@@ -479,7 +481,7 @@
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. 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>), plus actions matching your `permissions.allow` rules and calls approved by a [PreToolUse hook](</docs/en/permissions#extend-permissions-with-hooks>). 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` while this mode is active. 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. `rm` and `rmdir` removals targeting a critical path, such as `rm -rf /` and `rm -rf ~`, are denied even when an allow rule matches them or a `PreToolUse` hook allows them. [Cloud sessions](</docs/en/claude-code-on-the-web>) ignore `defaultMode: "dontAsk"`; see bypassPermissions for details. Set it at startup with the flag:
+If you set `dontAsk` mode, Claude Code auto-denies every tool call that would otherwise prompt you. 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>), plus actions matching your `permissions.allow` rules and calls approved by a [PreToolUse hook](</docs/en/permissions#extend-permissions-with-hooks>). 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` while this mode is active. 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. `rm` and `rmdir` removals targeting a critical path, such as `rm -rf /` and `rm -rf ~`, are denied even when an allow rule matches them or a `PreToolUse` hook allows them. A read from a [network path](</docs/en/permissions#network-paths>) is denied the same way. [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
@@ -507,7 +509,12 @@
* **If you accept** : Claude Code sets `skipDangerousModePermissionPrompt` to `true` in `~/.claude/settings.json`, so later sessions skip the dialog. To see the dialog again, remove the key from that file or set it to `false`. The [`skipDangerousModePermissionPrompt` reference](</docs/en/settings-reference#skipdangerousmodepermissionprompt>) lists the other settings files where you or your organization can set it.
* **If you decline** : Claude Code exits.
-In [non-interactive mode](</docs/en/headless>) no dialog is shown, and a [background session](</docs/en/agent-view>) started with `--bg` is refused until you’ve accepted the dialog in an interactive session. On Linux and macOS, Claude Code refuses to start in this mode when running as root or under `sudo`:
+In [non-interactive mode](</docs/en/headless>) no dialog is shown. A [background session](</docs/en/agent-view>) honors your acceptance when it’s recorded in user or managed settings:
+
+ * With no acceptance recorded, `claude --bg --permission-mode bypassPermissions` is refused until you accept the dialog in an interactive session.
+ * With `skipDangerousModePermissionPrompt` set only in `.claude/settings.local.json`, the background session starts with the bypass request ignored and pins the notice `Bypass permissions was requested at launch and ignored · if that was you, ~/.claude/settings.json needs "skipDangerousModePermissionPrompt": true`. To get bypass honored, add that key to `~/.claude/settings.json`, then start a new background session.
+
+On Linux and macOS, Claude Code refuses to start in this mode when running as root or under `sudo`:
--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons
@@ -566,6 +573,7 @@
* `.devcontainer.json`
* `.ripgreprc`, `pyrightconfig.json`
* `.mcp.json`, `.claude.json`
+ * The file that your user, project, or local [settings file](</docs/en/settings#settings-files-and-who-they-affect>) points to when the settings file is itself a symbolic link, for example into a dotfiles repository. In the modes that route protected-path writes to the classifier, a write to this file prompts you instead, even when an allow rule matches. If the file’s own path is also that of a settings file, such as `.claude/settings.json` in another folder, the write goes to the classifier as other protected-path writes do
##
@@ -585,10 +593,12 @@
* The filesystem root
* Top-level directories, meaning any direct child of the root, such as `/usr`, `/etc`, or `/data`
- * Your home directory
- * Windows drive roots and their top-level directories, such as `C:\` and `C:\Windows`
+ * Your home directory. On Windows, its 8.3 short name counts too, such as `C:\Users\LONGNA~1`
+ * Windows drive roots and their top-level directories, such as `C:\` and `C:\Windows`. Spellings such as `\\?\C:\` and `\\localhost\C$` count as `C:\`
* Your working directory and its parents
* Your additional working directories and their parents, but only when the removal is a glob under one of them, such as `rm -rf <dir>/*`. `rm -rf <dir>` on the directory itself doesn’t trigger this check
+
+The checks on the home directory’s 8.3 short name and on the `\\?\C:\` and `\\localhost\C$` spellings require Claude Code v2.1.292 or later.
###
@@ -607,6 +617,7 @@
A target that is only the output of a command substitution, when the `rm` is recursive| `rm -rf "$(pwd)"`| Claude Code can’t check the target before the command runs
A trailing command substitution after a critical path| `rm -rf ~/$(cmd)`| Claude Code checks the path that would remain if the substitution expanded empty, here your home directory
A target that is only backslashes| `rm -rf "\\"`| Git Bash on Windows reads a lone backslash as the current drive’s root, so the check applies on every platform
+A Windows path that names a volume by GUID instead of a drive letter| `rm -rf '\\?\Volume{GUID}\work\build'`| The path doesn’t say which drive it’s on, so it could be a critical path. Requires Claude Code v2.1.292 or later
Some targets that end in `/*` or `/*/`| `rm -rf logs/*/*`, `rm -rf logs/*/`, `cd logs && rm -rf a/*`| Claude Code can’t tell before the command runs which directories they reach
To turn off the check on a target that is only command substitution output, set [`CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT=1`](</docs/en/env-vars#variables>) in the environment that launches Claude Code.
--- a/permissions.md
+++ b/permissions.md
@@ -41,7 +41,7 @@
Allow rules
-Check `allow` rules (from `allowed_tools` and settings.json). If a rule matches, the tool is approved. A call the tool approves on its own is resolved at this step too, with no rule needed: for example a file read inside your working directories or a [read-only Bash command](</docs/en/permissions#read-only-commands>).`rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>) are never approved by an allow rule. Whether they then reach your callback depends on the permission mode: in an Agent SDK session in `auto` mode, for example, Claude Code denies them by default without calling it. The [Critical paths](</docs/en/permission-modes#critical-paths>) mode table lists what each mode does with them.
+Check `allow` rules (from `allowed_tools` and settings.json). If a rule matches, the tool is approved. A call the tool approves on its own is resolved at this step too, with no rule needed: for example a file read inside your working directories or a [read-only Bash command](</docs/en/permissions#read-only-commands>).`rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>) are never approved by an allow rule. Whether they then reach your callback depends on the permission mode: in an Agent SDK session in `auto` mode, for example, Claude Code denies them by default without calling it. The [Critical paths](</docs/en/permission-modes#critical-paths>) mode table lists what each mode does with them.An allow rule doesn’t approve a read from a [network path](</docs/en/permissions#network-paths>).
6
@@ -52,7 +52,7 @@
If you pass a `canUseTool` callback in a configuration where the TypeScript SDK expects the evaluation order to auto-approve calls before the callback is consulted, the SDK emits a Node.js process warning once when the query is constructed. The warning’s code is `CLAUDE_SDK_CAN_USE_TOOL_SHADOWED`. Two configurations trigger it:
* `permissionMode: 'bypassPermissions'`, which auto-approves every call that reaches the permission mode step apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>)
- * Each bare `allowedTools` entry such as `"Read"`, which auto-approves that whole tool before the callback is consulted, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>)
+ * Each bare `allowedTools` entry such as `"Read"`, which auto-approves that whole tool before the callback is consulted, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) and [reads from network paths](</docs/en/permissions#network-paths>)
Entries with a specifier such as `Bash(ls *)` and the `acceptEdits` mode don’t trigger it, and allow rules coming from settings files aren’t visible to the check. Listen with `process.on('warning', ...)` and match the code to log or suppress it. To gate every tool call regardless of mode and rules, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead. This page focuses on **allow and deny rules** and **permission modes**. For the other steps:
@@ -69,14 +69,14 @@
Option| Effect
---|---
-`allowed_tools=["Read", "Grep"]`| `Read` and `Grep` are auto-approved. Other tools not listed here still exist, and calls to them that need approval fall through to the permission mode and `canUseTool`.
+`allowed_tools=["Read", "Grep"]`| `Read` and `Grep` are auto-approved, apart from [reads from network paths](</docs/en/permissions#network-paths>). Other tools not listed here still exist, and calls to them that need approval fall through to the permission mode and `canUseTool`.
`disallowed_tools=["Bash"]`| The `Bash` tool definition is removed from the request. Claude does not see the tool and cannot attempt it.
`disallowed_tools=["Bash(rm *)"]`| `Bash` stays available. Calls matching `rm *` [as written](</docs/en/permissions#bash-rule-limits>) are denied in every permission mode, including `bypassPermissions`. Other `Bash` calls, including `/bin/rm`, fall through to the permission mode.
`disallowed_tools=["*"]`| Every tool definition is removed from the request. Tool-name globs are supported in deny rules: `"*"` matches every tool and `"mcp__*"` matches every MCP tool across all servers.
Allow rules accept tool-name globs only after a literal `mcp__<server>__` prefix. The server segment must be glob-free so the rule names a specific server you configured: `mcp__puppeteer__*` matches every tool from the `puppeteer` server, and `mcp__github__get_*` matches its `get_` tools. An unanchored entry like `allowed_tools=["*"]` or `allowed_tools=["mcp__*"]` is ignored with a startup warning and does not auto-approve anything. Scoped rules for `Read` and `Edit` take a path pattern. `Edit(path)` rules govern all built-in tools that write files, including `Write` and `NotebookEdit`; a `Write(path)` rule is never matched by the file permission checks. Use `//path` for an absolute filesystem path: a deny rule of `Edit(//secrets/**)` blocks writes anywhere under `/secrets` on disk. With a single leading slash, `Edit(/secrets/**)` anchors at the rule’s source instead. For rules passed through `allowed_tools` or `disallowed_tools`, that means the session’s working directory, so the rule doesn’t block `/secrets` on disk. See [Read and Edit rules](</docs/en/permissions#read-and-edit>) for the four anchor forms and how rules from settings files resolve.
-**Auto-approved tools never reach`canUseTool`.** A tool call approved at any earlier step, by `acceptEdits` or `bypassPermissions`, or by an allow rule, skips your `canUseTool` callback, so permission checks you put there are silently bypassed for that tool.An allow rule never auto-approves `AskUserQuestion`, MCP tools marked [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>), connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), or `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>). In `dontAsk` mode Claude Code denies these calls without invoking the callback. In other modes the first three reach the callback. Depending on the [permission mode](</docs/en/permission-modes#critical-paths>), a critical-path removal reaches the callback too or Claude Code denies it without calling it, as it does by default for an Agent SDK session in `auto` mode.Coverage depends on the entry’s form: a bare name like `Read` or `mcp__github__get_issue` auto-approves every call to that tool apart from the exceptions above, while a scoped rule like `Bash(npm test *)` auto-approves only matching calls, and other `Bash` calls that need approval still fall through to the callback. For checks that must run on every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>): hooks run before every other step, and a hook deny applies even in `bypassPermissions` mode.
+**Auto-approved tools never reach`canUseTool`.** A tool call approved at any earlier step, by `acceptEdits` or `bypassPermissions`, or by an allow rule, skips your `canUseTool` callback, so permission checks you put there are silently bypassed for that tool.An allow rule never auto-approves `AskUserQuestion`, MCP tools marked [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>), connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), or `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>). In `dontAsk` mode Claude Code denies these calls without invoking the callback. In other modes the first three reach the callback. Depending on the [permission mode](</docs/en/permission-modes#critical-paths>), a critical-path removal reaches the callback too or Claude Code denies it without calling it, as it does by default for an Agent SDK session in `auto` mode.Coverage depends on the entry’s form: a bare name like `Read` or `mcp__github__get_issue` auto-approves every call to that tool apart from those exceptions and [reads from network paths](</docs/en/permissions#network-paths>), while a scoped rule like `Bash(npm test *)` auto-approves only matching calls, and other `Bash` calls that need approval still fall through to the callback. For checks that must run on every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>): hooks run before every other step, and a hook deny applies even in `bypassPermissions` mode.
For a locked-down agent, pair `allowedTools` with `permissionMode: "dontAsk"`:
@@ -85,7 +85,7 @@
permissionMode: "dontAsk"
};
-Listed tools are approved, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>), and every other call that would prompt is denied instead. Calls that need no approval in `default` mode run whether or not you list them, such as [read-only Bash commands](</docs/en/permissions#read-only-commands>), tools like `Agent` that don’t ask before running, and file reads inside your working directories. To put a tool out of Claude’s reach entirely, add its bare name to `disallowedTools`.
+Listed tools are approved, apart from the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) and [reads from network paths](</docs/en/permissions#network-paths>), and every other call that would prompt is denied instead. Calls that need no approval in `default` mode run whether or not you list them, such as [read-only Bash commands](</docs/en/permissions#read-only-commands>), tools like `Agent` that don’t ask before running, and file reads inside your working directories. To remove a tool from the request entirely, add its bare name to `disallowedTools`.
**`allowed_tools` does not constrain `bypassPermissions`.** `allowed_tools` pre-approves the tools you list. Other unlisted tools are not matched by any allow rule and fall through to the permission mode, where `bypassPermissions` approves them. Setting `allowed_tools=["Read"]` alongside `permission_mode="bypassPermissions"` still approves every tool, including `Bash`, `Write`, and `Edit`. If you need `bypassPermissions` but want specific tools blocked, use `disallowed_tools`.
@@ -115,7 +115,7 @@
Mode| Description| Tool behavior
---|---|---
`default`| Standard permission behavior| No mode-based auto-approvals; calls that need approval and match no allow rule trigger your `canUseTool` callback
-`dontAsk`| Deny instead of prompting| Any call that would otherwise prompt is denied. Calls approved by `allowed_tools` or rules run, and so do calls that need no approval in `default` mode; connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) and tools that require user interaction are denied even if you’ve pre-approved them, as are `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>). `canUseTool` is never called
+`dontAsk`| Deny instead of prompting| Any call that would otherwise prompt is denied. Calls approved by `allowed_tools` or rules run, and so do calls that need no approval in `default` mode; connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) and tools that require user interaction are denied even if you’ve pre-approved them, as are [reads from network paths](</docs/en/permissions#network-paths>) and `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>). `canUseTool` is never called
`acceptEdits`| Auto-accept file edits| File edits and filesystem operations (`mkdir`, `rm`, `mv`, etc.) are automatically approved
`bypassPermissions`| Bypass permission checks| Tools run without permission prompts, except for the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). Use with caution
`plan`| Planning mode| Claude explores and plans without editing your source files; file edits are never auto-approved and prompt through your `canUseTool` callback
@@ -254,7 +254,7 @@
Don’t ask mode (`dontAsk`)
-Converts any permission prompt into a denial, without calling `canUseTool`. Tools pre-approved by `allowed_tools`, `settings.json` allow rules, or a hook run as normal, and so do calls that need no approval in `default` mode, such as file reads inside your working directories and calls to `Agent`. Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), tools that require user interaction, and `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>) are denied even when an allow rule matches. A `PreToolUse` hook allow doesn’t clear a critical-path removal either. **Use when:** you want a fixed, explicit tool surface for a headless agent and prefer a hard deny over silent reliance on `canUseTool` being absent.
+Converts any permission prompt into a denial, without calling `canUseTool`. Tools pre-approved by `allowed_tools`, `settings.json` allow rules, or a hook run as normal, and so do calls that need no approval in `default` mode, such as file reads inside your working directories and calls to `Agent`. Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), tools that require user interaction, [reads from network paths](</docs/en/permissions#network-paths>), and `rm` and `rmdir` removals targeting a [critical path](</docs/en/permission-modes#critical-paths>) are denied even when an allow rule matches. A `PreToolUse` hook allow doesn’t clear a critical-path removal or a read from a network path either. **Use when:** you want a fixed, explicit tool surface for a headless agent and prefer a hard deny over silent reliance on `canUseTool` being absent.
####
--- a/python.md
+++ b/python.md
@@ -522,6 +522,55 @@
for session in list_sessions(directory="/path/to/project"):
if session.tag == "needs-review":
print(session.summary)
+
+###
+
+
+
+`fork_session()`
+
+Copies a session’s transcript into a new session so you can take the conversation in another direction while the original stays unchanged. To branch from an earlier point in the conversation, pass `up_to_message_id`. Synchronous.
+
+ def fork_session(
+ session_id: str,
+ directory: str | None = None,
+ up_to_message_id: str | None = None,
+ title: str | None = None,
+ ) -> ForkSessionResult
+
+####
+
+
+
+Parameters
+
+Parameter| Type| Default| Description
+---|---|---|---
+`session_id`| `str`| required| UUID of the session to fork
+`directory`| `str | None`| `None`| Project directory path. When omitted, searches all project directories
+`up_to_message_id`| `str | None`| `None`| Copy the transcript up to and including the message with this UUID, such as a `uuid` from `get_session_messages()`. When omitted, copies the whole transcript
+`title`| `str | None`| `None`| Title for the fork. When omitted, the SDK derives one from the original session, followed by `(fork)`
+
+Returns a `ForkSessionResult` whose `session_id` is the new session’s UUID. Pass it as `resume` to continue the fork. The fork doesn’t include the original session’s [file checkpoints](</docs/en/agent-sdk/file-checkpointing>), so you can’t rewind it to a checkpoint captured before the fork. `fork_session()` raises:
+
+ * `ValueError`: `session_id` or `up_to_message_id` is not a valid UUID
+ * `ValueError`: the session has no messages, or `up_to_message_id` matches no message in the transcript
+ * `FileNotFoundError`: the session cannot be found
+
+####
+
+
+
+Example
+
+Fork the most recent session under a new title, then resume the fork. The original session keeps its own history.
+
+ from claude_agent_sdk import fork_session, list_sessions
+
+ sessions = list_sessions(directory="/path/to/project", limit=1)
+ if sessions:
+ forked = fork_session(sessions[0].session_id, title="Try the OAuth approach")
+ print(forked.session_id) # pass as ClaudeAgentOptions(resume=...) to continue the fork
##
@@ -911,7 +960,7 @@
Property| Type| Default| Description
---|---|---|---
`tools`| `list[str] | ToolsPreset | None`| `None`| Tools configuration. Use `{"type": "preset", "preset": "claude_code"}` for Claude Code’s default tools
-`allowed_tools`| `list[str]`| `[]`| Tools to auto-approve without prompting. This does not restrict Claude to only these tools. If you name one of the [task-tracking tools](</docs/en/agent-sdk/todo-tracking#model-availability>) here, Claude Code also opts the session in. Other unlisted tools fall through to `permission_mode` and `can_use_tool`. Use `disallowed_tools` to block tools. See [Permissions](</docs/en/agent-sdk/permissions#allow-and-deny-rules>)
+`allowed_tools`| `list[str]`| `[]`| Tools to auto-approve without prompting, apart from reads from [network paths](</docs/en/permissions#network-paths>). This does not restrict Claude to only these tools. If you name one of the [task-tracking tools](</docs/en/agent-sdk/todo-tracking#model-availability>) here, Claude Code also opts the session in. Other unlisted tools fall through to `permission_mode` and `can_use_tool`. Use `disallowed_tools` to block tools. See [Permissions](</docs/en/agent-sdk/permissions#allow-and-deny-rules>)
`system_prompt`| `str | SystemPromptPreset | SystemPromptCustom | SystemPromptFile | None`| `None`| System prompt configuration. Pass a string for a custom prompt, `{"type": "preset", "preset": "claude_code"}` for Claude Code’s system prompt with optional `"append"`, `{"type": "custom", "prompt": "..."}` for a custom prompt that can also set `"snapshot"`, or `{"type": "file", "path": "..."}` to load a large prompt from disk. See `SystemPromptPreset`, `SystemPromptCustom`, and `SystemPromptFile`
`mcp_servers`| `dict[str, McpServerConfig] | str | Path`| `{}`| MCP server configurations or path to config file
`strict_mcp_config`| `bool`| `False`| When `True`, use only the servers passed in `mcp_servers` and ignore project `.mcp.json`, user settings, plugin-provided MCP servers, and [claude.ai connectors](</docs/en/mcp#use-mcp-servers-from-claude-ai>). Maps to the CLI `--strict-mcp-config` flag
@@ -1805,7 +1854,7 @@
* `terminal_reason`: why the query loop ended, such as `"completed"`, `"max_turns"`, `"api_error"`, `"aborted_streaming"`, or `"aborted_tools"`. A value of `"aborted_streaming"` or `"aborted_tools"` means the turn was aborted before completing. Common causes are `interrupt()` and a permission callback returning `PermissionResultDeny` with `interrupt=True`. `None` on CLI versions that predate the field, on results from local commands such as `/voice` or `/usage`, which bypass the query loop, or on synthesized error results emitted when the session fails fatally. Mirrors the TypeScript SDK’s [`SDKResultMessage.terminal_reason`](</docs/en/agent-sdk/typescript#sdkresultmessage>), which lists the full set of values.
* `origin`: origin of the user message that triggered this turn. In [streaming input mode](</docs/en/agent-sdk/streaming-vs-single-mode>), check this to tell the result of your own prompt, where `origin` is `None` or `{"kind": "human"}`, from the result of an injected turn such as a background-task notification. Requires Python Agent SDK 0.2.137 or later.
-The `usage` dict covers the main agent loop only and excludes subagent and other nested or auxiliary model calls. In [streaming input mode](</docs/en/agent-sdk/streaming-vs-single-mode>), the values are per-turn. Prefer `model_usage` for token and cost accounting. The `usage` dict contains the following keys when present:
+When several background tasks finish close together, Claude Code can answer their notifications in one turn rather than one turn each. You still receive one `ResultMessage` per notification, in order, each with an `origin` whose `kind` is `"task-notification"`. All but the last have `num_turns` set to `0` and an empty `result`, and the last one carries the turn that answers them all. The `usage` dict covers the main agent loop only and excludes subagent and other nested or auxiliary model calls. In [streaming input mode](</docs/en/agent-sdk/streaming-vs-single-mode>), the values are per-turn. Prefer `model_usage` for token and cost accounting. The `usage` dict contains the following keys when present:
Key| Type| Description
---|---|---
--- a/reference.md
+++ b/reference.md
@@ -156,6 +156,8 @@
`agent.offer`| A subagent type is offered to Claude| `{ isOffered: false }` to withhold it
`agent.spawn`| A subagent or an [agent team](</docs/en/agent-teams>) teammate is about to start. For a teammate, `e.isTeammate` is `true`.| `next({ ...e, model })` to choose its model, or `{ deny: reason }`
+When Claude resumes a subagent with the [`SendMessage`](</docs/en/sub-agents#resume-subagents>) tool, your `agent.spawn` hook doesn’t run again. To refuse the `SendMessage` calls that resume a subagent, match that tool in a [`tool.call`](</docs/en/plugins/mods/events#guard-or-change-a-tool-call>) hook.
+
###
@@ -186,6 +188,8 @@
---|---|---
[`plugin.register`](</docs/en/plugins/mods/admin#enforce-a-policy-with-a-mod-of-your-own>)| A hooks module is about to load. `e.uses` lists its events, mods API calls, environment variables, and state, as `claude plugin validate` prints them. Each call is written without the `$.` prefix, such as `fs.read`.| `{ refuse: reason }`
`engine.create`| The mods API is being built for this mod| A changed mods API, to add a namespace. A mod outside the `user` tier can also withhold one.
+
+When another mod’s hook calls a method on a namespace you added in `engine.create`, your method’s `$` calls run in that hook’s context until every hook on that event returns. For example, a relative path resolves against that hook’s working directory, and `$.prompt.submit` rejects while the turn is waiting on that hook. Calls your method makes after that run in your mod’s own context.
###
@@ -343,6 +347,10 @@
`$.process.run` timeout| 30 seconds by default, 10 minutes at most
`$.model.complete` `maxTokens`| 1024 by default, up to 64,000 or the model’s output limit
`$.fs.read` and `$.fs.write`| 4 MiB for one file
+A `$.http.fetch` request body| 4 MiB, counted in characters. A call with a larger body rejects.
+A `$.http.fetch` response body| 4 MiB. `text` holds the first 4 MiB and the rest isn’t read. When the `Content-Length` header declares more, the call rejects instead, with a reason that ends `is over the 4194304-byte limit`, except when the last request after any redirects uses the `HEAD` method. The `HEAD` exemption requires Claude Code v2.1.296 or later.
+One `$.http.fetch` call, redirects and body included| 30 seconds
+Redirects one `$.http.fetch` call follows| 5
A hook’s `drop` reason or `config.set` `deny` reason| 4,096 characters. The end of a longer reason is cut, and the drop or deny still applies. The cut requires Claude Code v2.1.292 or later, and on earlier versions the hook [fails](</docs/en/plugins/mods/events#handle-a-hook-that-fails>) instead.
Text in one tree| The first 100,000 characters are drawn
A `Code`’s `language` or `path`, a `Select` option’s `value`, or a `Client`’s `module`| 10,000 characters. If one is longer, Claude Code [draws its own version of the site](</docs/en/plugins/mods/interface#build-a-tree-from-elements>).
--- a/routines.md
+++ b/routines.md
@@ -54,7 +54,7 @@
Select repositories
-Add one or more GitHub repositories for Claude to work in. Each repository is cloned at the start of a run, starting from the default branch. Claude creates `claude/`-prefixed branches for its changes.
+Add one or more GitHub repositories for Claude to work in. Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes.
4
@@ -323,7 +323,7 @@
Repositories and branch permissions
-Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. If your GitHub connection is missing or expired when a run is due, the routine skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the routine resumes on its own. After 72 hours without a connection, the routine turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to a branch prefixed with `claude/` unless your prompt directs it to push to another branch. To control which branches a run can push to, use branch protection rules or rulesets on GitHub. For runs on Anthropic-managed infrastructure, and for self-hosted runs that push through [Anthropic’s git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), GitHub applies them to the GitHub access you connected, so a rule that access can bypass doesn’t block a run’s push. A self-hosted run that pushes with the git credentials your deployment provides is checked against those instead. See [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>).
+Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. On Team and Enterprise plans, an [Owner](</docs/en/server-managed-settings#access-control>) of your Claude organization has to turn on each method before you can use it; see [Connect GitHub](</docs/en/web-quickstart#connect-github>). If your GitHub connection is missing or expired when a run is due, the routine skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the routine resumes on its own. After 72 hours without a connection, the routine turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. If a GitHub pull request event triggers the run and the pull request’s repository is the first repository in the routine, that repository starts from the pull request’s head commit instead. Claude pushes its work to a branch prefixed with `claude/` unless your prompt directs it to push to another branch. To control which branches a run can push to, use branch protection rules or rulesets on GitHub. For runs on Anthropic-managed infrastructure, and for self-hosted runs that push through [Anthropic’s git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), GitHub applies them to the GitHub access you connected, so a rule that access can bypass doesn’t block a run’s push. A self-hosted run that pushes with the git credentials your deployment provides is checked against those instead. See [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>).
###
--- a/sandboxing.md
+++ b/sandboxing.md
@@ -167,6 +167,7 @@
* `rm` or `rmdir` commands that target a [critical path](</docs/en/permission-modes#critical-paths>) still go through the regular permission flow
* Content-scoped [ask rules](</docs/en/permissions>) like `Bash(git push *)` still force a prompt even for sandboxed commands
* A bare `Bash` ask rule, or the equivalent `Bash(*)` form, is skipped for commands that run sandboxed; it still applies to commands that fall back to the regular permission flow. In [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>), the rule isn’t skipped: it prompts for sandboxed commands too, including read-only ones
+ * [Monitor tool](</docs/en/tools-reference#monitor-tool>) commands aren’t approved automatically, though they still run in the sandbox. To skip the prompt, add an [allow rule](</docs/en/permissions#bash>) that matches the command, such as `Bash(npm run *)`
Auto-allow mode works independently of your permission mode setting, with three exceptions: [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>), an auto mode command that carries per-command allowed domains, and [server-side classifier review](</docs/en/permission-modes#how-the-classifier-evaluates-actions>) of sandboxed commands in auto mode. Even if you’re not in “accept edits” mode, sandboxed Bash commands run automatically when auto-allow is enabled. This means Bash commands that modify files within the sandbox boundaries execute without prompting, even in Manual mode, where the file edit tools would prompt.In plan mode, auto-allow doesn’t widen approvals; see [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) for how Claude Code gates commands while you plan.
--- a/self-hosted-environments-configuration.md
+++ b/self-hosted-environments-configuration.md
@@ -192,8 +192,8 @@
# privileges. -c commit.gpgsign=false also leaves these rescue commits
# unsigned under --configure-git.
# Repo-local credential.helper and pushurl still apply, and on a runner
- # before v2.1.280 so does core.sshCommand; if the hook holds credentials
- # the session didn't, see the note below the script.
+ # before v2.1.280 so does core.sshCommand; see the note below the script
+ # before you give this push a credential.
g() { git -c core.fsmonitor=false -c core.hooksPath=/dev/null \
-c commit.gpgsign=false "$@"; }
for ws in $CLAUDE_RUNNER_WORKSPACE_PATHS; do
@@ -204,7 +204,7 @@
g push -q origin "HEAD:refs/heads/rescue/$CLAUDE_RUNNER_SESSION_ID" || true
done
-The `GIT_ALLOW_PROTOCOL` line in the script limits git to HTTPS, HTTP, and SSH remotes. If the runner’s environment already sets a non-empty `GIT_ALLOW_PROTOCOL` list of its own, the script keeps that list. The hook pushes with whatever git credentials are available in its own environment on the runner host. Under the [no-credentials-in-the-image posture](</docs/en/self-hosted-environments-deploy#configure-git>), including when the built-in clone goes through the Anthropic git proxy, there are none, so mint a short-lived push credential inside the hook before pushing: exchange the session token the hook receives in `CLAUDE_CODE_SESSION_ACCESS_TOKEN` with your own token service, verifying it as [Verify session identity](</docs/en/self-hosted-environments-identity>) describes. When the hook holds a credential the session didn’t, replace `origin` with an operator-supplied URL and pass `-c credential.helper=` plus your own helper. Git configuration inside lifecycle hooks describes what session-written configuration can still affect.
+The `GIT_ALLOW_PROTOCOL` line in the script limits git to HTTPS, HTTP, and SSH remotes. If the runner’s environment already sets a non-empty `GIT_ALLOW_PROTOCOL` list of its own, the script keeps that list. The hook pushes with whatever git credentials are available in its own environment on the runner host. Under the [no-credentials-in-the-image posture](</docs/en/self-hosted-environments-deploy#configure-git>), including when the built-in clone goes through the Anthropic git proxy, there are none, so mint a short-lived push credential inside the hook before pushing: exchange the session token the hook receives in `CLAUDE_CODE_SESSION_ACCESS_TOKEN` with your own token service, verifying it as [Verify session identity](</docs/en/self-hosted-environments-identity>) describes. Treat any credential your hook gives git as one a session can obtain, and mint it so that it can do no more than this push. Git in your hook reads configuration files that a session can write, and a credential helper or filter driver named in one of them runs with your hook’s privileges. Settings in those files can also change where a push goes, whatever remote you name. For the git settings the runner fixes in your hook and the ones it leaves to those files, see Git configuration inside lifecycle hooks.
####
--- a/self-hosted-environments-deploy.md
+++ b/self-hosted-environments-deploy.md
@@ -188,6 +188,8 @@
With the Anthropic git proxy, also called Anthropic-managed git, the runner image needs no SSH keys, credential helper, `.netrc`, or other git credentials for the session itself. Instead, the runner asks Anthropic to serve git for its sessions. For a user’s session that Anthropic serves, the runner’s clone and the session’s own fetches and pushes go through Anthropic, which uses the GitHub OAuth token stored for the session’s creator. How Anthropic serves git for a session covers bot and agent sessions. The git proxy is off unless you turn it on. A runner that reaches your git host with its own credentials doesn’t need it, and its git works with any git host. In exchange, the git proxy limits what the runner supports and changes what it needs:
* **github.com only** : Anthropic serves a session only when all of its repositories are on github.com, and the git proxy doesn’t support GitHub Enterprise Server yet. On a runner with the git proxy, a session with a repository on another git host fails to start.
+ * **Credentials for the session’s repositories only** : Anthropic supplies git credentials for the repositories that are part of the session, not for other repositories on the same git host. A private submodule, a dependency that your package manager fetches with git, or a plugin marketplace in another repository gets no credential from Anthropic. Ask the people who create sessions to [add every repository](</docs/en/web-quickstart#start-a-task>) a session needs when they create it.
+ * **Branch pushes only** : a push that deletes a branch fails, and so does a push to any other kind of ref, such as a tag. For which branches a push can update, see [GitHub proxy](</docs/en/cloud-environments#github-proxy>).
* **Connected GitHub accounts** : the person who created a user session must have connected GitHub on claude.ai, or the session doesn’t start.
* **`--capacity 1`** : the git proxy requires one session per runner process, so run more replicas for parallelism. Turn the Anthropic git proxy on lists the requirements.
* **Replaced global git config** : the runner deletes and replaces the global git config of the user it runs as. Run it as a dedicated user or in a container.
--- a/session-storage.md
+++ b/session-storage.md
@@ -347,7 +347,7 @@
* [`renameSession()`](</docs/en/agent-sdk/typescript#renamesession>)
* [`tagSession()`](</docs/en/agent-sdk/typescript#tagsession>)
* [`deleteSession()`](</docs/en/agent-sdk/typescript>)
- * [`forkSession()`](</docs/en/agent-sdk/typescript>)
+ * [`forkSession()`](</docs/en/agent-sdk/typescript#forksession>)
* [`listSubagents()`](</docs/en/agent-sdk/typescript>)
* [`getSubagentMessages()`](</docs/en/agent-sdk/typescript>)
--- a/sessions.md
+++ b/sessions.md
@@ -269,7 +269,7 @@
Claude Code stores sessions under `~/.claude/projects/<encoded-cwd>/*.jsonl`. If you set the `CLAUDE_CONFIG_DIR` environment variable, look under `$CLAUDE_CONFIG_DIR/projects/` instead.To find your session’s directory, replace every non-alphanumeric character in the absolute working directory with `-`: `/Users/me/proj` becomes `-Users-me-proj`. For a working directory whose converted name exceeds 200 characters, Claude Code [truncates the name and appends a hash](</docs/en/sessions#where-transcripts-are-stored>), so match the first 200 characters of the converted name when you list `projects/`.If you set [`CLAUDE_CODE_PROJECT_DIR_NAME`](</docs/en/sessions#name-the-project-directory-yourself>) beside `CLAUDE_CONFIG_DIR`, look under that name in `projects/` instead. Requires TypeScript Agent SDK v0.3.234 or later, or Python Agent SDK v0.2.140 or later.You can resume from any working directory:
- * **Cross-directory lookup** : Claude Code searches beyond the current project directory to find the ID; see [Resume a session](</docs/en/sessions#resume-a-session>) for the exact lookup order and how duplicate copies are handled.
+ * **Cross-directory lookup** : Claude Code searches beyond the current project directory to find the ID; see [Resume a session](</docs/en/sessions#where-the-session-picker-looks>) for the exact lookup order and how duplicate copies are handled.
* **Same machine only** : the session file still needs to exist on the current machine.
Before v2.1.223, the lookup was scoped to the current project directory and its git worktrees; SDK versions that bundle an older CLI still behave this way.
@@ -393,7 +393,7 @@
Session files are local to the machine that created them. To resume a session on a different host (CI workers, ephemeral containers, serverless), pick the approach that fits:
* **Pass a session store.** Attach a [`sessionStore` / `session_store` adapter](</docs/en/agent-sdk/session-storage>) so the SDK mirrors transcripts to your own backend and another host can resume them. The store lookup key derives from the working directory, so resume from a `cwd` matching the original run’s.
- * **Move the session file.** Persist `~/.claude/projects/<encoded-cwd>/<session-id>.jsonl` from the first run and restore it inside any directory under `~/.claude/projects/` on the new host before calling `resume`. Claude Code searches beyond the current project directory to find the ID; see [Resume a session](</docs/en/sessions#resume-a-session>) for the exact lookup order and how duplicate copies are handled. Before v2.1.223, the lookup was scoped to the current project directory and its git worktrees; SDK versions that bundle an older CLI still behave this way.
+ * **Move the session file.** Persist `~/.claude/projects/<encoded-cwd>/<session-id>.jsonl` from the first run and restore it inside any directory under `~/.claude/projects/` on the new host before calling `resume`. Claude Code searches beyond the current project directory to find the ID; see [Resume a session](</docs/en/sessions#where-the-session-picker-looks>) for the exact lookup order and how duplicate copies are handled. Before v2.1.223, the lookup was scoped to the current project directory and its git worktrees; SDK versions that bundle an older CLI still behave this way.
* **Don’t rely on session resume.** Capture the results you need (analysis output, decisions, file diffs) as application state and pass them into a fresh session’s prompt. This is often more robust than shipping transcript files around.
Both SDKs expose functions for enumerating sessions on disk and reading their messages: [`listSessions()`](</docs/en/agent-sdk/typescript#listsessions>) and [`getSessionMessages()`](</docs/en/agent-sdk/typescript#getsessionmessages>) in TypeScript, [`list_sessions()`](</docs/en/agent-sdk/python#list_sessions>) and [`get_session_messages()`](</docs/en/agent-sdk/python#get_session_messages>) in Python. Use them to build custom session pickers, cleanup logic, or transcript viewers. Both SDKs also expose functions for looking up and mutating individual sessions: [`get_session_info()`](</docs/en/agent-sdk/python#get_session_info>), [`rename_session()`](</docs/en/agent-sdk/python#rename_session>), and [`tag_session()`](</docs/en/agent-sdk/python#tag_session>) in Python, and [`getSessionInfo()`](</docs/en/agent-sdk/typescript#getsessioninfo>), [`renameSession()`](</docs/en/agent-sdk/typescript#renamesession>), and [`tagSession()`](</docs/en/agent-sdk/typescript#tagsession>) in TypeScript. Use them to organize sessions by tag or give them human-readable titles.
--- a/settings.md
+++ b/settings.md
@@ -83,7 +83,7 @@
* **When the file stays with`.claude/settings.json` instead**: outside a git repository, when the repository root is your home directory, on Windows, or when the repository root or its `.git` or `.claude` entry isn’t owned by your user.
* **Paths in the file don’t anchor at the repository root** : a permission rule that starts with `/` or a relative sandbox path [anchors at the session’s primary working directory](</docs/en/permissions#read-and-edit>) instead.
-Before v2.1.211, Claude Code kept the file in the starting directory. It still reads a file an earlier version left there alongside the root file; where both set the same key, the root’s value applies, and permission rules from both files apply. The Agent SDK’s [`resolveSettings()`](</docs/en/agent-sdk/typescript#resolvesettings>) helper always reads the file from the starting directory. Claude Code reads the shared `.claude/settings.json` from the session’s [primary working directory](</docs/en/permissions#working-directories>), so to use a file committed at the repository root, start Claude Code there. After you [move the session with `/cd`](</docs/en/permissions#move-the-session-to-another-directory>), Claude Code reads both project files from the new directory instead, placing the local file by the same rules. Reading them from the directory you moved to requires Claude Code v2.1.246 or later.
+Before v2.1.211, Claude Code kept the file in the starting directory. It still reads a file an earlier version left there alongside the root file; where both set the same key, the root’s value applies, and permission rules from both files apply. The Agent SDK’s [`resolveSettings()`](</docs/en/agent-sdk/typescript#resolvesettings>) helper always reads the file from the starting directory. Claude Code reads the shared `.claude/settings.json` from the session’s [primary working directory](</docs/en/permissions#working-directories>), so to use a file committed at the repository root, start Claude Code there. After you [move the session with `/cd`](</docs/en/permissions#move-the-session-to-another-directory>), Claude Code reads both project files from the new directory instead, placing the local file by the same rules. Reading them from the directory you moved to requires Claude Code v2.1.246 or later. For a worktree session that you start from the desktop app, see [What worktrees share with the main checkout](</docs/en/worktrees#what-worktrees-share-with-the-main-checkout>).
###
@@ -313,7 +313,7 @@
Two things keep a key in `.claude/settings.json` from applying for everyone who clones it:
- * **Claude Code ignores the key in a repository file.** Look for `User, local, or managed`, `User or managed`, `Managed`, or `Global config` in the Scope column of the [settings index](</docs/en/settings-reference#settings-index>). Those keys never apply from the shared file, apart from a few that a repository file can still switch off. Each of those entries says so on its Scope line. `Global config` keys apply only from `~/.claude.json`. Inside the `env` key, the telemetry export variables never apply from the shared file either, apart from a few off values; see [Variables Claude Code ignores in `env`](</docs/en/settings-reference#variables-claude-code-ignores-in-env>).
+ * **Claude Code ignores the key in a repository file.** Look for `User, local, or managed`, `User or managed`, `User`, `Managed`, or `Global config` in the Scope column of the [settings index](</docs/en/settings-reference#settings-index>). Those keys never apply from the shared file, apart from a few that a repository file can still switch off. Each of those entries says so on its Scope line. `Global config` keys apply only from `~/.claude.json`. Inside the `env` key, the telemetry export variables never apply from the shared file either, apart from a few off values; see [Variables Claude Code ignores in `env`](</docs/en/settings-reference#variables-claude-code-ignores-in-env>).
* **The key waits for trust.** `permissions.allow` rules, `permissions.additionalDirectories`, `extraKnownMarketplaces`, and most [`env`](</docs/en/settings-reference#env>) values apply only after each teammate [trusts the folder](</docs/en/permissions#project-allow-rules-and-workspace-trust>). Until then they still see prompts and don’t get plugins from a marketplace the file declares. `deny` and `ask` rules apply right away.
####
Show diff (141 lines)
--- a/settings-reference.md
+++ b/settings-reference.md
@@ -57,7 +57,7 @@
`claudeMdExcludes`| Skip specific [CLAUDE.md](</docs/en/memory#exclude-specific-claude-md-files>) files when memory loads| Memory and context| Any file
`cleanupPeriodDays`| Choose how many days Claude Code keeps [transcripts](</docs/en/data-usage#data-retention>) before deleting them| Privacy and telemetry| Any file
`companyAnnouncements`| Show your organization’s announcements at startup| Interface and terminal| Any file
-`copyFullResponse`| Make [`/copy`](</docs/en/commands>) copy the full response without showing the code block picker| Global config settings| Global config
+`copyFullResponse`| Make [`/copy`](</docs/en/commands>) copy the full response without showing the picker| Global config settings| Global config
`copyOnSelect`| Turn off automatic copying of text you select with the mouse in [fullscreen rendering](</docs/en/fullscreen#use-the-mouse>) and agent view| Global config settings| Global config
`crossSessionInbound`| Choose whether Claude Code delivers [messages from your other sessions](</docs/en/cross-session-messaging#control-inbound-messages>), shows a notice without delivering them, or refuses them| Agents, sessions, and worktrees| Any file
`defaultShell`| Choose whether Bash or PowerShell runs the shell commands you type with the [`!` prefix](</docs/en/interactive-mode#shell-mode-with-prefix>)| Interface and terminal| Any file
@@ -103,7 +103,7 @@
`fileCheckpointingEnabled`| Turn off or on the file snapshots that [`/rewind`](</docs/en/checkpointing>) restores| Memory and context| Any file
`fileSuggestion`| Supply [`@` file autocomplete](</docs/en/interactive-mode#quick-commands>) from your own command| Interface and terminal| Any file
`footerLinksRegexes`| Make issue or review IDs in output into [clickable links](</docs/en/statusline#clickable-links>) below the input box| Interface and terminal| User or managed
-`forceLoginGatewayUrl`| Set the [gateway URL](</docs/en/claude-apps-gateway#set-the-gateway-url>) the login screen connects to| Authentication and providers| Managed
+`forceLoginGatewayUrl`| Set the [gateway URL](</docs/en/claude-apps-gateway#set-the-gateway-url>) the login screen connects to| Authentication and providers| User or managed
`forceLoginMethod`| [Restrict login](</docs/en/authentication#restrict-login-to-your-organization>) to claude.ai, Claude Console, or a [cloud gateway](</docs/en/claude-apps-gateway>)| Authentication and providers| Any file
`forceLoginOrgUUID`| [Pin claude.ai logins to your organization](</docs/en/authentication#restrict-login-to-your-organization>); only a managed source enforces it| Authentication and providers| Any file
`forceRemoteSettingsRefresh`| Block startup until [server-managed settings](</docs/en/server-managed-settings>) are freshly fetched| Enterprise and managed settings| Managed
@@ -250,6 +250,7 @@
`worktree`| Configure how Claude Code creates git [worktrees](</docs/en/worktrees>)| Agents, sessions, and worktrees| Any file
`worktree.baseRef`| Branch new [worktrees](</docs/en/worktrees>) from the remote default branch or your local HEAD| Agents, sessions, and worktrees| Any file
`worktree.bgIsolation`| Let background sessions edit the working copy without a [worktree](</docs/en/worktrees>)| Agents, sessions, and worktrees| Any file
+`worktree.location`| Choose where [Desktop SSH sessions](</docs/en/desktop#ssh-sessions>) create their worktrees on a remote machine| Agents, sessions, and worktrees| User
`worktree.sparsePaths`| Check out only the directories you need in each [worktree](</docs/en/worktrees>)| Agents, sessions, and worktrees| Any file
`worktree.symlinkDirectories`| Symlink large directories into each [worktree](</docs/en/worktrees>) instead of duplicating them| Agents, sessions, and worktrees| Any file
`wslInheritsWindowsSettings`| Have WSL read [managed settings](</docs/en/managed-settings>) from the Windows policy chain| Enterprise and managed settings| Managed
@@ -1188,7 +1189,7 @@
* `"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
- * `"dontAsk"`: Claude Code auto-denies every call that would otherwise prompt; reads, other actions that need no approval, and pre-approved tools still run
+ * `"dontAsk"`: Claude Code auto-denies every call that would otherwise prompt; file reads inside your working directories, other actions that need no approval, and pre-approved tools still run, apart from reads from [network paths](</docs/en/permissions#network-paths>)
* `"bypassPermissions"`: Claude Code runs everything without asking
* `"manual"`: an alias for `"default"`
* **Default** : unset
@@ -1857,7 +1858,7 @@
* An entry in `files` or `envVars` that still has a valid `path` or `name` and a `mode` of `mask` or `deny`, such as one whose `extract` pattern has no capturing group, is degraded to `mode: "deny"` with a warning, so the credential stays blocked, not masked, until you fix the entry. A degraded `files` entry pins [`filesystem.disabled`](</docs/en/sandboxing#disable-filesystem-isolation>) like an explicit `deny` entry, and the warning notes that its read block isn’t enforced if managed settings turn filesystem isolation off.
* An entry with an unknown `mode` or an invalid `path` or `name` is stripped.
- * Each case warns; whether an entry is degraded or stripped, the remaining valid entries are still enforced, and a wholly invalid `credentials` value is dropped while the rest of `sandbox` still applies.
+ * Each case warns; whether an entry is degraded or stripped, the remaining valid entries are still enforced.
Applies in v2.1.191 and later; before v2.1.221, every invalid entry was stripped. For the other managed keys with per-field handling, see [Invalid entries in managed settings](</docs/en/managed-settings#invalid-entries-in-managed-settings>).
@@ -5296,6 +5297,30 @@
Outside a git repository, a [`WorktreeCreate` hook](</docs/en/worktrees#non-git-version-control>) that fails releases the block so the session can edit the working directory in place; that release requires Claude Code v2.1.203 or later.
+###
+
+
+
+`worktree.location`
+
+Choose the folder on a remote machine where [Desktop SSH sessions](</docs/en/desktop#choose-where-ssh-session-worktrees-go>) create their worktrees, instead of `<project-root>/.claude/worktrees/`. Only the desktop app reads this key: `--worktree`, the `EnterWorktree` tool, isolated subagents, and background sessions ignore it. Requires Claude Desktop v1.44121.0 or later.
+
+ * **Scope** : `User`, in `~/.claude/settings.json` on the remote machine
+ * **Type** : string, an absolute path or one that starts with `~/`
+ * **Default** : unset, so worktrees go inside the project
+
+This example sets the folder to `~/worktrees`:
+
+settings.json
+
+ {
+ "worktree": {
+ "location": "~/worktrees"
+ }
+ }
+
+A **Worktree folder** set on the SSH connection in Desktop takes precedence. If your organization restricts which folders sessions may use, Desktop keeps worktrees inside the project.
+
##
@@ -5440,7 +5465,7 @@
`enableArtifact`
-Turn off the [Artifact](</docs/en/artifacts>) tool, which publishes session output as a private web page on claude.ai. When you turn the **Artifacts** row off in `/config`, Claude Code writes this key to your user settings, so you don’t usually edit it by hand. Requires Claude Code v2.1.196 or later.
+Turn off the [Artifact](</docs/en/artifacts>) tool, which publishes session output as a private web page on claude.ai. When you turn the **Artifacts** row off in `/config`, Claude Code writes this key to your user settings, so you don’t usually edit it by hand.
* **Scope** : `Any file`. Every file can turn the tool off, and none can turn it back on.
* **Type** : Boolean
@@ -5557,7 +5582,7 @@
`sshConfigs`
-Add SSH connections to the [Desktop](</docs/en/desktop#pre-configure-ssh-connections-for-your-team>) environment dropdown. Administrators use it to distribute shared connections to a team. Connections you define in managed settings show as managed, so users can select them but can’t edit or delete them in the app.
+Add SSH connections to the [Desktop](</docs/en/desktop#pre-configure-ssh-connections-for-your-team>) environment dropdown. Administrators use it to distribute shared connections to a team. Connections you define in managed settings show as managed. Users can select them and [set their own **Worktree folder**](</docs/en/desktop#choose-where-ssh-session-worktrees-go>) for them, but can’t edit anything else or delete them in the app.
* **Scope** : `User or managed`. The desktop app reads this key. By default, it reads managed connections from [one managed source](</docs/en/managed-settings#how-claude-code-combines-managed-sources>).
* **Type** : array of objects, each with required `id`, `name`, and `sshHost` and optional `sshPort` and `sshIdentityFile`
@@ -5728,7 +5753,7 @@
Restrict which kind of account people can log in with. Set `"claudeai"` to allow only claude.ai accounts, `"console"` to allow only Claude Console accounts, or `"gateway"` to send people to a [cloud gateway](</docs/en/claude-apps-gateway>) instead of a first-party login. Administrators set it in managed settings and pair it with `forceLoginOrgUUID` to keep developers’ claude.ai logins inside one organization. If you set it to `"claudeai"` or `"console"` in any settings file, Claude Code also stops offering the [keyless Console sign-in](</docs/en/authentication#sign-in-without-an-api-key>) in the sessions that file applies to.
- * **Scope** : `Any file`. Claude Code honors `"gateway"` only from a managed source on the machine: `managed-settings.json`, the macOS plist or Windows HKLM registry, or a policy helper. It treats `"gateway"` as unset in user, project, local, HKCU, and server-managed settings, the same rule as `forceLoginGatewayUrl`.
+ * **Scope** : `Any file`. Claude Code honors `"gateway"` from the same sources as `forceLoginGatewayUrl` and treats it as unset everywhere else.
* **Type** : string, one of:
* `"claudeai"`: only claude.ai accounts can log in
* `"console"`: only Claude Console accounts can log in
@@ -5749,9 +5774,9 @@
`forceLoginGatewayUrl`
-Set the gateway URL the `/login` Cloud gateway screen connects to, so people reach your [cloud gateway](</docs/en/claude-apps-gateway>) without typing its address. The screen has no URL field: with this key set, it shows your gateway URL and connects when the person presses Enter; without it, it tells them to contact their IT administrator. Either this key or `forceLoginMethod: "gateway"` makes the machine gateway-only, except for sessions that select a cloud provider with `CLAUDE_CODE_USE_*`. `/login` then opens on the Cloud gateway screen with no login-method picker. See [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) for what happens to a leftover first-party login or API key. Set both keys so the screen connects instead of showing an error.
-
- * **Scope** : `Managed`. Read only from a source on the machine: `managed-settings.json`, the macOS plist or Windows HKLM registry, or a policy helper. Claude Code ignores it in HKCU and server-managed settings.
+Set the gateway URL the `/login` Cloud gateway screen connects to, so people reach your [cloud gateway](</docs/en/claude-apps-gateway>) without typing its address. The screen has no URL field: with this key set, it shows your gateway URL and connects when the person presses Enter; without it, it tells them to contact their IT administrator. In managed settings, either this key or `forceLoginMethod: "gateway"` makes the machine gateway-only, except for sessions that select a cloud provider with `CLAUDE_CODE_USE_*`. `/login` then opens on the Cloud gateway screen with no login-method picker. See [Administrator policy requires a Cloud gateway sign-in](</docs/en/errors#administrator-policy-requires-a-cloud-gateway-sign-in>) for what happens to a leftover first-party login or API key. Set both keys so the screen connects instead of showing an error.
+
+ * **Scope** : `User or managed`. Read from a managed source on the machine: `managed-settings.json`, the macOS plist or Windows HKLM registry, or a policy helper. On a machine with none of those, Claude Code v2.1.295 or later also reads it from [user settings](</docs/en/claude-apps-gateway#set-the-gateway-url-in-user-settings>). Claude Code ignores it in HKCU and server-managed settings.
* **Type** : string, a full URL including the scheme
* **Default** : unset, so the Cloud gateway screen shows an error telling people to contact their IT administrator
@@ -5783,7 +5808,7 @@
"forceLoginOrgUUID": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"]
}
-If a managed source sets an empty array, or a value Claude Code can’t parse, Claude Code blocks every login with a misconfiguration message. See [Restrict login to your organization](</docs/en/authentication#restrict-login-to-your-organization>) for how Claude Code treats Claude Console logins, the other login paths, and environment credentials.
+If a managed source sets an empty array, or a value that isn’t a string or an array of strings, users who sign in with an Anthropic account can’t start Claude Code or complete a login. They see a message that names `forceLoginOrgUUID` and tells them to contact their administrator. A `policyHelper` that emits a value of the wrong type fails its run instead. See [Restrict login to your organization](</docs/en/authentication#restrict-login-to-your-organization>) for how Claude Code treats Claude Console logins, the other login paths, and environment credentials.
###
@@ -6467,12 +6492,12 @@
`copyFullResponse`
-Make [`/copy`](</docs/en/commands>) copy the full response every time, without the picker it otherwise shows when the response contains code blocks. Selecting **Always copy full response** in that picker sets this key to `true`. Appears in `/config` as **Skip the /copy picker**.
+Make [`/copy`](</docs/en/commands>) copy the full response every time, without showing the picker. Selecting **Always copy full response** in that picker sets this key to `true`. Appears in `/config` as **Skip the /copy picker**.
* **Scope** : `Global config`
* **Type** : Boolean
* `true`: `/copy` copies the full response without showing the picker
- * `false`: when the response contains code blocks, `/copy` shows a picker where you choose one code block or the full response
+ * `false`: when the response contains code blocks or blockquotes, `/copy` shows a picker where you choose one block or the full response
* **Default** : `false`
~/.claude.json
--- a/statusline.md
+++ b/statusline.md
@@ -1261,5 +1261,5 @@
Outside [fullscreen rendering](</docs/en/fullscreen>), Claude Code shows notifications on the same row as your status line. In fullscreen rendering, Claude Code gives notifications a row of their own.
* System notifications like MCP server errors and auto-updates display on the right side of the row. Transient notifications such as the context-low warning also cycle through this area.
- * Enabling verbose mode adds a token counter to this area
+ * Enabling verbose mode adds a token counter to this area, showing the size of your context as the last API response reported it, not the [per-turn count beside the spinner](</docs/en/costs#read-the-token-count-beside-the-spinner>)
* On narrow terminals, these notifications may truncate your status line output
--- a/sub-agents.md
+++ b/sub-agents.md
@@ -309,7 +309,7 @@
* **The main conversation’s model belongs to that family** : the subagent runs on the main conversation’s exact model, including any `[1m]` suffix, so it gets the same [extended context](</docs/en/model-config#extended-context>) window as the main conversation.
* **Claude Code can’t tell the main conversation’s model family, on[a provider other than the Anthropic API](</docs/en/third-party-integrations>)**: this can happen with an [application inference profile ARN](</docs/en/amazon-bedrock#iam-configuration>) on Amazon Bedrock that Claude Code hasn’t resolved to a backing model. This case covers only the `opus` alias, and doesn’t apply when you set [`ANTHROPIC_DEFAULT_OPUS_MODEL`](</docs/en/model-config#environment-variables>), since `opus` then resolves to the model you set.
-An alias in `CLAUDE_CODE_SUBAGENT_MODEL` always resolves to the version the alias points to, even when it names the main conversation’s family. Setting `CLAUDE_CODE_SUBAGENT_MODEL` by itself doesn’t change the model the built-in Explore and Plan subagents run on. To change it, see Run every subagent on one model. Before v2.1.251, `CLAUDE_CODE_SUBAGENT_MODEL` came first in this order and overrode both the per-invocation parameter and the frontmatter, including `model: inherit`. Setting the variable to `inherit` is the same as leaving it unset. Before v2.1.196, that value forced subagents onto the main conversation’s model and ignored the other sources. Claude Code checks the per-invocation parameter, frontmatter, and environment variable values against your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist. For a blocked value, it substitutes another model:
+An alias in `CLAUDE_CODE_SUBAGENT_MODEL` always resolves to the version the alias points to, even when it names the main conversation’s family. Setting the variable to `inherit` is the same as leaving it unset. Setting `CLAUDE_CODE_SUBAGENT_MODEL` by itself doesn’t change the model the built-in Explore and Plan subagents run on. To change it, see Run every subagent on one model. Before v2.1.251, `CLAUDE_CODE_SUBAGENT_MODEL` came first in this order and overrode both the per-invocation parameter and the frontmatter, including `model: inherit`. Claude Code checks the per-invocation parameter, frontmatter, and environment variable values against your organization’s [`availableModels`](</docs/en/model-config#restrict-model-selection>) allowlist. For a blocked value, it substitutes another model:
* When the blocked value is a family alias such as `opus`, Claude Code runs the subagent on the newest version of that family the allowlist permits, following the same [substitution rules and provider scope](</docs/en/model-config#restrict-model-selection>) as `/model`. Before v2.1.222, Claude Code ran the subagent on the inherited model for a blocked family alias as well.
* For any other blocked value, on providers where that substitution doesn’t operate, or when the allowlist permits no version of the family, Claude Code runs the subagent on the inherited model instead. If you set `CLAUDE_CODE_SUBAGENT_MODEL`, Claude Code tries that model first, under these same rules.
@@ -499,7 +499,7 @@
`default`| Manual mode: prompts for permission
`acceptEdits`| Auto-accept file edits and common filesystem commands for paths in the working directory or `additionalDirectories`
`auto`| [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): a background classifier reviews commands and protected-directory writes
-`dontAsk`| Auto-deny permission prompts. Explicitly allowed tools still work; `AskUserQuestion`, MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), and connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code are denied even if you’ve allowed them
+`dontAsk`| Auto-deny permission prompts. Explicitly allowed tools still work; `AskUserQuestion`, MCP tools marked [`requiresUserInteraction`](</docs/en/mcp#require-approval-for-a-specific-tool>), [reads from network paths](</docs/en/permissions#network-paths>), and connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>) in sessions where that setting reaches Claude Code are denied even if you’ve allowed them
`bypassPermissions`| [Skip permission prompts](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>). A subagent runs in this mode only when the main conversation does
`plan`| Plan mode (read-only exploration)
@@ -953,7 +953,7 @@
* **System prompt** : the agent’s own prompt plus environment details that Claude Code appends, not the Claude Code system prompt. Custom subagents define theirs in the markdown body or `prompt` field. Built-in agents have predefined prompts.
* **Task message** : the delegation prompt Claude writes when it hands off the work.
* **CLAUDE.md files** : every level of the [CLAUDE.md hierarchy](</docs/en/memory#how-claude-md-files-load>) the main conversation loads, including `~/.claude/CLAUDE.md`, project rules, `CLAUDE.local.md`, managed policy files, and any [`AGENTS.md` files](</docs/en/memory#agents-md>) loaded as project instructions. The built-in Explore and Plan agents skip this. A subagent whose definition sets `omitClaudeMd` loads only the managed policy files, or none at all when the definition comes from managed settings.
- * **Git status** : a snapshot Claude Code reads from your repository when the subagent starts. Absent outside a Git repository or whenever the snapshot is turned off; see [`includeGitInstructions`](</docs/en/settings-reference#includegitinstructions>). Explore and Plan skip it regardless.
+ * **Git status** : a snapshot Claude Code reads from your repository when the subagent starts. For a subagent in [its own worktree](</docs/en/worktrees#isolate-subagents-with-worktrees>) of that repository, the snapshot shows the worktree’s branch, status, and recent commits. Absent outside a Git repository or whenever the snapshot is turned off; see [`includeGitInstructions`](</docs/en/settings-reference#includegitinstructions>). Explore and Plan skip it regardless.
* **Preloaded skills** : full content of any skill named in the agent’s `skills` field. Built-in agents don’t preload skills.
* **Sibling roster** : a [system reminder](</docs/en/glossary#system-reminder>) listing `main` and every other named agent in the session, each a valid `to` value for `SendMessage`. Requires Claude Code v2.1.206 or later. The roster appears only when the subagent’s tools include `SendMessage` and at least one other agent has a name, whether Claude named it when spawning it or it runs as an [agent team](</docs/en/agent-teams>) teammate. It is a snapshot taken when the subagent starts, so agents named later don’t appear.
--- a/terminal-config.md
+++ b/terminal-config.md
@@ -103,6 +103,19 @@
]
}
}
+
+##
+
+
+
+See session status in your terminal
+
+If your terminal implements the OSC 7501 Program Status Protocol, it can show whether each interactive Claude Code session is working, waiting on you, or done, which helps when you run long tasks or several sessions at once. There is nothing to turn on in Claude Code. To find out whether your terminal implements the protocol and where it shows the status, check its documentation. If it does and you see no status for a session, check for each of these causes:
+
+ * **Claude Code version** : status reporting requires Claude Code v2.1.295 or later. Run `claude --version` in your shell to check.
+ * **tmux** : inside tmux, Claude Code checks tmux for support instead of your terminal, and `allow-passthrough` has no effect on that. Start the session outside tmux.
+ * **Background session** : a [background session](</docs/en/agent-view>) doesn’t report its status to your terminal, even while you’re attached to it. Agent view shows its status instead.
+ * **[`CLAUDE_CODE_DISABLE_TERMINAL_TITLE`](</docs/en/env-vars#variables>)** : if you set this variable to `1`, Claude Code doesn’t check for support or report status. Unset it.
##
--- a/tools-reference.md
+++ b/tools-reference.md
@@ -253,13 +253,21 @@
Edit tool behavior
-The Edit tool performs exact string replacement. It takes an `old_string` and a `new_string` and replaces the first with the second. It doesn’t use regex or fuzzy matching. Three checks must pass for an edit to apply. Before any of them, a path matched by a [`Read` deny rule](</docs/en/permissions#tool-specific-permission-rules>) is refused, including creating a new file there. The refusal requires Claude Code v2.1.208 or later.
+The Edit tool performs exact string replacement. It takes an `old_string` and a `new_string` and replaces the first with the second. It doesn’t use regex or fuzzy matching. These checks must pass for an edit to apply. Before any of them, a path matched by a [`Read` deny rule](</docs/en/permissions#tool-specific-permission-rules>) is refused, including creating a new file there. The refusal requires Claude Code v2.1.208 or later.
* **Read-before-edit** : Claude reads the file in the current conversation before editing it, and a read cut short with a `PARTIAL view` notice doesn’t count. Claude Opus 4.6, Claude Haiku 4.5, and older models always require the read. Newer models can edit an unread file when reading it wouldn’t need a permission prompt and the Read tool is available.
* **Match** : `old_string` must appear in the file exactly as written. A single character of whitespace or indentation difference is enough to miss.
* **Uniqueness** : `old_string` must appear exactly once. When it appears more than once, Claude either supplies a longer string with enough surrounding context to pin down one occurrence, or sets `replace_all: true` to replace them all.
-A file that changed on disk after Claude last read it can still be edited when `old_string` matches the current content exactly and unambiguously and Claude Code can read the file without prompting. Matching against the file’s current content keeps this safe, and the result notes that the file carries other changes so Claude re-reads it before edits that depend on surrounding content. In any other case, such as a stale `old_string` or one that matches more than once without `replace_all`, Claude reads the file again before editing. The relaxed handling of unread and changed files requires Claude Code v2.1.208 or later; before that, Claude Code refused any edit to a file it hadn’t read in the conversation or that changed on disk after the read. Viewing a file with Bash also satisfies the read-before-edit requirement when the command is `cat`, `nl`, `bat`, `batcat`, `head`, `tail`, `sed -n 'X,Yp'`, `grep`, `egrep`, `fgrep`, or `rg` on a single file with no pipes or redirects. Piped output and other Bash commands don’t count toward the read-before-edit check. When Claude views a file this way, Claude Code also loads any [subdirectory `CLAUDE.md`](</docs/en/memory#how-claude-md-files-load>) and [path-scoped rules](</docs/en/memory#path-specific-rules>) that apply to that file. See [Read and Edit permission rules](</docs/en/permissions#read-and-edit>) for which Bash commands your `Read` and `Edit` deny rules cover.
+A file that changed on disk after Claude last read it can still be edited when `old_string` matches the current content exactly and unambiguously and Claude Code can read the file without prompting. Matching against the file’s current content keeps this safe, and the result notes that the file carries other changes so Claude re-reads it before edits that depend on surrounding content. In any other case, such as a stale `old_string` or one that matches more than once without `replace_all`, Claude reads the file again before editing. The relaxed handling of unread and changed files requires Claude Code v2.1.208 or later; before that, Claude Code refused any edit to a file it hadn’t read in the conversation or that changed on disk after the read. Claude can also edit a file without a separate Read after it views the file with a Bash command such as `cat` or `grep`. Those commands are `cat`, `nl`, `bat`, `batcat`, `head`, `tail`, `sed -n 'X,Yp'`, `grep`, `egrep`, `fgrep`, and `rg`, each run on one file with no pipes or redirects. A search that prints no matches doesn’t count as a read, nor does any command outside this list. When Claude views a file this way, Claude Code also loads any [subdirectory `CLAUDE.md`](</docs/en/memory#how-claude-md-files-load>) and [path-scoped rules](</docs/en/memory#path-specific-rules>) that apply to that file. See [Read and Edit permission rules](</docs/en/permissions#read-and-edit>) for which Bash commands your `Read` and `Edit` deny rules cover.
+
+###
+
+
+
+Non-UTF-8 files
+
+Claude can’t use NotebookEdit on a file that isn’t valid UTF-8. The same goes for Edit, unless the file starts with a little-endian UTF-16 byte-order mark. When Claude tries, the tool refuses the change and leaves the file untouched. Refused files include non-ASCII text saved in a legacy encoding such as Windows-1252 or Shift-JIS, binary files, and UTF-8 with an invalid byte sequence. The tools refuse because they save the whole file back as UTF-8, which would replace every byte they can’t decode with the replacement character `U+FFFD`. Instead, the [error Claude receives](</docs/en/errors#file-is-not-valid-utf-8>) tells it to make the change with a shell command that keeps the file’s encoding, or to ask you about converting it to UTF-8 first. Claude can still replace such a file with Write, unless the new content contains `U+FFFD`, the character Read shows Claude in place of bytes it can’t decode. That guard stops Claude from writing back the garbled text it read. When Write does replace the file, it saves the new content as UTF-8, so the file’s original encoding is lost.
##
@@ -387,7 +395,7 @@
* `insert`: add a new cell after the target. With no `cell_id`, the new cell goes at the start of the notebook. Requires `cell_type` set to `code` or `markdown`.
* `delete`: remove the target cell.
-Permission rules use the `Edit(...)` path format. A rule like `Edit(notebooks/**)` covers NotebookEdit calls on files in that directory.
+NotebookEdit refuses a notebook file that doesn’t decode as UTF-8, under the same rule as Edit, and writes nothing. Permission rules use the `Edit(...)` path format. A rule like `Edit(notebooks/**)` covers NotebookEdit calls on files in that directory.
##
@@ -444,7 +452,7 @@
* `"shell": "powershell"` on individual [command hooks](</docs/en/hooks#command-hook-fields>): runs that hook in PowerShell. Hooks spawn PowerShell directly, so this works regardless of `CLAUDE_CODE_USE_POWERSHELL_TOOL`.
* `shell: powershell` in [skill frontmatter](</docs/en/skills#frontmatter-reference>): runs `!`command`` blocks in PowerShell. Requires the PowerShell tool to be enabled.
-The same main-session working-directory reset behavior described under the Bash tool section applies to PowerShell commands, including the `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` environment variable. Exit code 1 from `grep`, `rg`, `egrep`, `fgrep`, `findstr`, and `git grep` means no matches. Exit code 1 from `git diff` means differences exist. Neither result is reported to Claude as a command failure. For `robocopy`, exit codes 0 through 7 are informational results, such as files copied or extra files detected. Exit codes of 8 or higher count as failures.
+PowerShell commands follow the same main-session working-directory reset behavior as Bash commands, including the `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` environment variable. PowerShell commands also receive the variables hooks persist through `CLAUDE_ENV_FILE`, under the conditions in [Persisted variables in PowerShell commands](</docs/en/hooks#persisted-variables-in-powershell-commands>). Requires Claude Code v2.1.296 or later. Exit code 1 from `grep`, `rg`, `egrep`, `fgrep`, `findstr`, and `git grep` means no matches. Exit code 1 from `git diff` means differences exist. Neither result is reported to Claude as a command failure. For `robocopy`, exit codes 0 through 7 are informational results, such as files copied or extra files detected. Exit codes of 8 or higher count as failures.
###
@@ -479,13 +487,24 @@
Read tool behavior
-The Read tool takes a file path and returns the contents with line numbers. Claude is instructed to always pass absolute paths. By default, Read returns the file from the start. When a whole-file read exceeds the token limit, Read returns the first page with a `PARTIAL view` notice that tells Claude how much of the file it received and how to read more with `offset` and `limit`. A read that passes an explicit `offset` or `limit` and still exceeds the token limit returns an error. A read with an explicit `limit` stops as soon as the selected lines exceed what the token limit could ever fit and returns an error without loading the rest of the range. The error tells Claude to use a smaller `limit`, or to search for specific content with Grep instead when a single line is that large. Before v2.1.208, Claude Code loaded the whole range into memory before rejecting it, so reading a file with an extremely long single line could run it out of memory. Reading an empty file returns a notice that the file exists but its contents are empty, and an `offset` past the last line returns a notice giving the file’s line count. Before v2.1.208, reading an empty file returned the past-the-end notice instead. Read handles several file types beyond plain text:
+The Read tool takes a file path and returns the contents with line numbers. Claude is instructed to always pass absolute paths. Reading an empty file returns a notice that the file exists but its contents are empty, and an `offset` past the last line returns a notice giving the file’s line count. Before v2.1.208, reading an empty file returned the past-the-end notice instead. Read handles several file types beyond plain text:
* **Images** : PNG, JPG, and other image formats are returned as visual content that Claude can see, not as raw bytes. Claude Code resizes and recompresses large images to fit the model’s image size limits before sending them, so Claude may see a downscaled version of a large screenshot. An image that is still larger than 500KB after that resize is re-encoded as a JPEG at reduced quality with its pixel dimensions unchanged. If Claude misses fine pixel-level detail in a large image, ask it to crop the region of interest first, for example with ImageMagick via Bash.
* **PDFs** : Claude reads short `.pdf` files whole. For PDFs longer than 10 pages, it reads in ranges with a `pages` parameter, such as `"1-5"`, up to 20 pages at a time. Page-range reads render pages with `pdftoppm` from poppler-utils, so install it with `brew install poppler` on macOS or `apt-get install poppler-utils` on Debian and Ubuntu. On Windows and other platforms, install a poppler build that puts `pdftoppm` on your `PATH`. Without it, a page-range read fails with `pdftoppm is not installed`.
- * **Jupyter notebooks** : `.ipynb` files return all cells with their outputs, including code, markdown, and visualizations. Claude Code refuses to read a notebook file over 100 MB; the error tells Claude how to read a portion of the notebook instead, such as a slice of cells, with a shell command.
+ * **Jupyter notebooks** : `.ipynb` files return all cells with their outputs, including code, markdown, and visualizations. A notebook whose cells come to more than 256 KB, or more than the token limit, returns an error instead. Claude Code refuses to read a notebook file over 100 MB; the error tells Claude how to read a portion of the notebook instead, such as a slice of cells, with a shell command.
Read only reads files, not directories. Claude lists directory contents with a shell command such as `ls`.
+
+###
+
+
+
+Large files
+
+Claude can read a text file larger than a single Read call returns. By default one call returns at most 25,000 tokens, or the value you set in [`CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS`](</docs/en/env-vars>), and refuses a whole file over 256 KB, so Claude reads a larger file in pages with `offset` and `limit`. On Claude Code v2.1.296 or later it can instead read the whole file, or a long line range, in one call by setting `allow_large: true` when it needs to, for example because you asked for the entire file. That read is sized against the room left in the session’s [context window](</docs/en/context-window>) instead of the default limits. Images, PDFs, and notebooks keep their limits. What Claude receives when a read goes over the default limits:
+
+ * **Whole file over the token limit** : the first page of the file, with a `PARTIAL view` notice saying how much of the file it received and how to read more with `offset` and `limit`
+ * **Whole file over 256 KB, or an`offset` or `limit` read over the token limit**: an error telling it to read a portion with `offset` and `limit`, or to search for specific content with Grep instead
##
@@ -642,7 +661,7 @@
Write tool behavior
-The Write tool creates a new file or overwrites an existing one with the full content provided. It doesn’t append or merge. Whether Claude must read an existing file in the current conversation before overwriting it depends on the model and the file:
+The Write tool creates a new file or overwrites an existing one with the full content provided. It doesn’t append or merge. Write also overwrites an existing file whose bytes don’t decode and saves the new content as UTF-8, as described under non-UTF-8 files. Whether Claude must read an existing file in the current conversation before overwriting it depends on the model and the file:
* Claude Opus 4.6, Claude Haiku 4.5, and older models always require the read, so a Write to an unread existing file fails with an error.
* Newer models can overwrite a file they never read this session under the same conditions as read-before-edit: reading it wouldn’t need a permission prompt and the Read tool is available.
--- a/troubleshoot.md
+++ b/troubleshoot.md
@@ -76,7 +76,7 @@
`disableAllHooks in managed settings`| Your organization turned off hooks from installed plugins
`only managed plugins and built-in plugins run`| `allowManagedHooksOnly` is set, or `disableAllHooks` is set in a settings file other than managed settings
`installed plugins that are not managed load no hooks module in this mode (--bare)`| You started Claude Code with `--bare`
-`another plugin of that name loads first`| Two plugins share a name. The managed one, or the one loaded first, is used.
+`another plugin of that name loads first`| Another enabled plugin has the same name as your mod and [holds the name](</docs/en/plugins/loading#hooks-when-two-enabled-plugins-share-a-name>), so your hooks module doesn’t load
###
@@ -197,6 +197,14 @@
+`$.agent.register refused: the hooks module that made the call is no longer loaded`
+
+The line starts with your mod’s name, as in `first-mod: $.agent.register refused: the hooks module that made the call is no longer loaded (it was reloaded or removed)`, and the agent isn’t registered. Your mod was reloaded or unloaded before the call. A reload loads a fresh copy of the hooks module, and this call came from code still running in the old copy, such as a hook that hadn’t returned yet. If that hook doesn’t catch the rejection, it fails and Claude Code skips it. To register the agent from the copy that stays loaded, make the call in your [`session.start`](</docs/en/plugins/mods/reference#session>) hook, which runs again in each fresh copy after a reload.
+
+###
+
+
+
`mods that run in the hooks worker are off for this session`
The line reads `hooks: mods that run in the hooks worker are off for this session: it crashed 3 times`. The worker stopped three times and Claude Code couldn’t trace the stops to one mod, so it unloaded every mod that isn’t built in, including mods your organization installs. This line reaches the transcript in every interactive session. Run `/reload-plugins` to load them again.
--- a/troubleshoot-install.md
+++ b/troubleshoot-install.md
@@ -956,7 +956,7 @@
If you see `API Error: 403 Request not allowed` after logging in:
* **Claude Pro/Max users** : verify your subscription is active at [claude.ai/settings](<https://claude.ai/settings>)
- * **Anthropic Console users** : confirm your account has the “Claude Code” or “Developer” role. Admins assign this in the Anthropic Console under Settings → Members.
+ * **Anthropic Console users** : confirm your account has the “Claude Code” or “Developer” role. Admins assign this on the Console’s Members page at [platform.claude.com/settings/members](<https://platform.claude.com/settings/members>).
* **Behind a proxy** : corporate proxies can interfere with API requests. See [network configuration](</docs/en/network-config>) for proxy setup.
###
--- a/typescript.md
+++ b/typescript.md
@@ -474,6 +474,38 @@
+`forkSession()`
+
+Copies a session’s transcript into a new session so you can take the conversation in another direction while the original stays unchanged. To branch from an earlier point in the conversation, pass `upToMessageId`.
+
+ function forkSession(
+ sessionId: string,
+ options?: ForkSessionOptions
+ ): Promise<ForkSessionResult>;
+
+####
+
+
+
+Parameters
+
+Parameter| Type| Default| Description
+---|---|---|---
+`sessionId`| `string`| required| UUID of the session to fork
+`options.dir`| `string`| `undefined`| Project directory path. When omitted, searches all project directories
+`options.upToMessageId`| `string`| `undefined`| Copy the transcript up to and including the message with this `uuid`: a value from `getSessionMessages()`, or a `uuid` you set on a streamed `SDKUserMessage`. When omitted, copies the whole transcript
+`options.title`| `string`| `undefined`| Title for the fork. When omitted, the SDK derives one from the original session, followed by `(fork)`
+
+Returns `{ sessionId }`, the new session’s UUID. Pass it as `resume` to continue the fork. The fork doesn’t include the original session’s [file checkpoints](</docs/en/agent-sdk/file-checkpointing>), so you can’t rewind it to a checkpoint captured before the fork. `forkSession()` throws when:
+
+ * `sessionId` is not a UUID
+ * the session cannot be found, or has no messages
+ * `upToMessageId` matches no message in the transcript
+
+###
+
+
+
`resolveSettings()`
Resolves the effective Claude Code settings for a given directory using the same merge engine as the CLI, without spawning the Claude CLI. Use it to inspect what configuration a `query()` call would see before invoking one.
@@ -559,7 +591,7 @@
`agents`| `Record<string, [`AgentDefinition`](#agentdefinition)>`| `undefined`| Programmatically define subagents
`agentProgressSummaries`| `boolean`| `false`| When `true`, generate one-line progress summaries for subagents and forward them on `task_progress` events via the `summary` field. Applies to foreground and background subagents
`allowDangerouslySkipPermissions`| `boolean`| `false`| Enable bypassing permissions. Required when using `permissionMode: 'bypassPermissions'`, at startup or later through `setPermissionMode()`. See [plan mode](</docs/en/agent-sdk/permissions#plan-mode-plan>) for how it interacts with `permissionMode: 'plan'`
-`allowedTools`| `string[]`| `[]`| Tools to auto-approve without prompting. This does not restrict Claude to only these tools. If you name one of the [task-tracking tools](</docs/en/agent-sdk/todo-tracking#model-availability>) here, Claude Code also opts the session in. Other unlisted tools fall through to `permissionMode` and `canUseTool`. Use `disallowedTools` to block tools. See [Permissions](</docs/en/agent-sdk/permissions#allow-and-deny-rules>)
+`allowedTools`| `string[]`| `[]`| Tools to auto-approve without prompting, apart from reads from [network paths](</docs/en/permissions#network-paths>). This does not restrict Claude to only these tools. If you name one of the [task-tracking tools](</docs/en/agent-sdk/todo-tracking#model-availability>) here, Claude Code also opts the session in. Other unlisted tools fall through to `permissionMode` and `canUseTool`. Use `disallowedTools` to block tools. See [Permissions](</docs/en/agent-sdk/permissions#allow-and-deny-rules>)
`betas`| `SdkBeta``[]`| `[]`| Enable beta features
`canUseTool`| `CanUseTool`| `undefined`| Custom permission function, invoked only when the [permission flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) falls through to a prompt. Not invoked for calls auto-approved by `allowedTools`, allow rules, or `permissionMode`. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). See `CanUseTool` for details
`continue`| `boolean`| `false`| Continue the most recent conversation
@@ -1612,7 +1644,9 @@
* A WebFetch or WebSearch call that Claude Code moved to the background to deliver a `'now'` message: the user message carrying that call’s `tool_result` has `tool_use_result` set to `{ detachedToolCall: true }`. The call is still running, and Claude receives its result once it finishes. No second `tool_result` for that `tool_use_id` follows, so if your application draws a row for each tool call, mark this row as moved to the background when this message arrives. Requires Claude Code v2.1.287 or later.
* An MCP tool whose result contains `resource_link` blocks: `tool_use_result` is an object with a `resourceLinks` array of `SDKMcpResourceLink` entries. Claude receives each link as a line of text in the `tool_result` block, so read `resourceLinks` to render the files the server returned instead of parsing that text. Claude Code omits `resourceLinks` when the result has no links and on results from subagents, keeps at most 50 links per result, and stops adding links once the array reaches 64 KiB of serialized JSON. `resourceLinks` requires Agent SDK v0.3.257 or later.
* An MCP tool that returns `structuredContent`: `tool_use_result` is an object whose `structuredContent` member holds what the server sent and whose `content` member holds the `McpOutput` value. Results from subagents don’t carry `structuredContent`.
- * An MCP tool whose `structuredContent` serializes to more than 1,048,576 characters of JSON: Claude Code leaves `structuredContent` off `tool_use_result` and sets `structuredContentOmitted: true` in its place, so your application can tell a dropped object from a tool that sent none. The other members, such as `content` and `resourceLinks`, stay, and what Claude receives doesn’t change. Tools from [in-process SDK servers](</docs/en/agent-sdk/custom-tools>) and tools whose `tools/list` entry declares an MCP Apps `_meta.ui` resource are exempt and deliver the object whole. Claude Code v2.1.287 or later applies this cap.
+ * An MCP tool whose `structuredContent` serializes to more than 1,048,576 characters of JSON: Claude Code leaves `structuredContent` off `tool_use_result` and sets `structuredContentOmitted: true` in its place, so your application can tell a dropped object from a tool that sent none. The other members, such as `content` and `resourceLinks`, stay, and what Claude receives doesn’t change. Claude Code v2.1.287 or later applies this cap. Two kinds of tool differ:
+ * Tools from [in-process SDK servers](</docs/en/agent-sdk/custom-tools>) are exempt and deliver the object whole.
+ * A tool whose `tools/list` entry declares an MCP Apps `ui://` resource has a limit of 8,388,608 characters on Claude Code v2.1.295 or later, and versions before v2.1.295 exempt it.
###
--- a/vs-code.md
+++ b/vs-code.md
@@ -163,10 +163,11 @@
* **Session titles** : new sessions receive AI-generated titles based on your first message.
* **Rename and archive** : hover over a session to reveal these actions. Rename to give it a descriptive title, or archive to move it to the **Archived sessions** group at the bottom of the list.
-If the conversation is open in another Claude Code process, such as `claude` in a terminal or another VS Code window, a notice appears in place of the prompt box: `This conversation is still open somewhere else. Using it in two places at once can mix up its messages.` To continue here, close the conversation in the other place and then click **Open here anyway**. If you click without closing it, the conversation is open in both places. With `claudeProcessWrapper` set, the extension skips this check and opens the conversation directly. By default, a session with no activity for 14 days moves to **Archived sessions** automatically, unless it is open, unread, or in a group. Automatic archiving requires Claude Code v2.1.265 or later. To change the period or turn it off, open the [Archive Inactive Sessions setting](<vscode://settings/claudeCode.archiveInactiveSessions>) and select a number of days or **Never**. To restore an archived session, expand **Archived sessions** and click **Unarchive session**. To restore every archived session at once, hover over the **Archived sessions** header in the sessions list in the Activity Bar and click its unarchive icon, which requires Claude Code v2.1.277 or later. Before v2.1.257, the action was **Delete session** , which hid a session with no way to restore it. Sessions you deleted then appear under **Archived sessions** after you upgrade. When the conversation you resume ended in plan mode, Claude Code restores plan mode. Requires Claude Code v2.1.246 or later. Claude Code doesn’t restore it in two cases:
+If the conversation is open in another Claude Code process, such as `claude` in a terminal or another VS Code window, a notice appears in place of the prompt box: `This conversation is still open somewhere else. Using it in two places at once can mix up its messages.` To continue here, close the conversation in the other place and then click **Open here anyway**. If you click without closing it, the conversation is open in both places. With `claudeProcessWrapper` set, the extension skips this check and opens the conversation directly. By default, a session with no activity for 14 days moves to **Archived sessions** automatically, unless it is open, unread, or in a group. Automatic archiving requires Claude Code v2.1.265 or later. To change the period or turn it off, open the [Archive Inactive Sessions setting](<vscode://settings/claudeCode.archiveInactiveSessions>) and select a number of days or **Never**. To restore an archived session, expand **Archived sessions** and click **Unarchive session**. To restore every archived session at once, hover over the **Archived sessions** header in the sessions list in the Activity Bar and click its unarchive icon, which requires Claude Code v2.1.277 or later. Before v2.1.257, the action was **Delete session** , which hid a session with no way to restore it. Sessions you deleted then appear under **Archived sessions** after you upgrade. When the conversation you resume ended in plan mode, Claude Code restores plan mode. Requires Claude Code v2.1.246 or later. Claude Code doesn’t restore it in these cases:
* The extension [chooses the starting permission mode](</docs/en/permission-modes#switch-permission-modes>) from `claudeCode.initialPermissionMode` or a pick that carries over from an earlier conversation
* You have `claudeCode.claudeProcessWrapper` configured
+ * A [deny rule](</docs/en/permissions#manage-permissions>) removes the [`ExitPlanMode`](</docs/en/tools-reference>) tool
###
--- a/workflows.md
+++ b/workflows.md
@@ -455,7 +455,7 @@
* Check `/model` before a large run if you usually switch to a smaller model for routine work
* Ask Claude to use a smaller model for stages that don’t need the strongest one when you describe the task
-When your organization’s [`availableModels` allowlist](</docs/en/model-config#restrict-model-selection>) blocks a model the script requests for an agent, that agent runs on a substituted model instead, following the same [substitution rules as subagents](</docs/en/sub-agents#choose-a-model>). The run’s progress view in `/workflows` shows a warning naming both the requested and substituted models.
+When your organization’s [`availableModels` allowlist](</docs/en/model-config#restrict-model-selection>) blocks a model the script requests for an agent, that agent runs on a substituted model instead, following the same [substitution rules as subagents](</docs/en/sub-agents#choose-a-model>).
###
--- a/worktrees.md
+++ b/worktrees.md
@@ -222,7 +222,7 @@
* **Permission approvals** : choosing “Yes, and don’t ask again” for a Bash command in a worktree session saves the rule to the main checkout’s `.claude/settings.local.json`, so it applies in the main checkout and in every other worktree of the repository, and it survives the worktree’s removal. On Windows and in the other cases where Claude Code [doesn’t use the repository root](</docs/en/settings#where-claude-code-looks-for-each-file>), the rule stays with that worktree. Before v2.1.211, an approval granted in a worktree was saved inside that worktree, didn’t apply elsewhere, and was lost when the worktree was removed. See [where approvals are saved](</docs/en/permissions#permission-system>).
* **Untracked skills, agents, and commands** : when the worktree checkout has no `.claude/skills` directory at its root, for example because your `.claude/skills` is gitignored, Claude Code loads the main checkout’s [project skills](</docs/en/skills#where-skills-live>) in the worktree session. In a worktree with its own `.claude/skills` directory, only that copy loads. The same read-through covers `.claude/agents` and `.claude/commands`. For skills, the read-through requires Claude Code v2.1.277 or later.
-All of these apply whether you create the worktree with `--worktree`, with `git worktree add`, or through the [desktop app](</docs/en/desktop#work-in-parallel-with-sessions>).
+All of these apply whether you create the worktree with `--worktree` or with `git worktree add`. In a worktree session that you start from the [desktop app](</docs/en/desktop#work-in-parallel-with-sessions>), Claude Code reads project configuration such as settings, hooks, skills, agents, commands, and [`.mcp.json`](</docs/en/mcp#project-scope>) servers from the main checkout’s root rather than from the worktree. Hook commands run in that root, and `${CLAUDE_PROJECT_DIR}` points at it. To reach the files Claude is working on, read the worktree’s path from the hook’s [`cwd` input field](</docs/en/hooks#common-input-fields>). `CLAUDE.md` files and `.claude/rules/` still load from the worktree.
##