modified How the agent loop works View current →
--- a/agent-loop.md +++ b/agent-loop.md @@ -245,13 +245,13 @@ Mode| Behavior| Use case ---|---|--- `"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 +`"acceptEdits"`| Auto-approves file edits and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.) inside your [working directories](</docs/en/permissions#working-directories>); 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. Edits made with Claude’s file tools go to your `canUseTool` callback even when an allow rule matches them| You want Claude to produce a plan first, such as during code review or before a large change `"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, though a [mod](</docs/en/plugins/mods/overview>) you installed can still approve [some of those calls](</docs/en/permissions#precedence-among-rules-hooks-and-mods>). A few calls, such as [reads from network paths](</docs/en/permissions#network-paths>), are denied even if you’ve allowed them. For the list, see [Don’t ask mode](</docs/en/agent-sdk/permissions#don%E2%80%99t-ask-mode-dontask>)| Headless agents with nobody to approve calls `"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 tool calls without asking for approval, including calls to tools you didn’t list in `allowedTools`. A few calls still go to your `canUseTool` callback, listed under [Bypass permissions mode](</docs/en/agent-sdk/permissions#bypass-permissions-mode-bypasspermissions>). 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 -For interactive applications, use `"default"` with a tool approval callback to surface approval prompts. For autonomous agents on a dev machine, `"acceptEdits"` auto-approves file edits and common filesystem commands (`mkdir`, `touch`, `mv`, `cp`, etc.) while still gating other `Bash` commands behind allow rules. Reserve `"bypassPermissions"` for CI, containers, or other isolated environments. See [Permissions](</docs/en/agent-sdk/permissions>) for full details. +For interactive applications, use `"default"` with a tool approval callback to surface approval prompts. For agents that edit files on a dev machine, use `"acceptEdits"`. Reserve `"bypassPermissions"` for CI, containers, or other isolated environments. See [Permissions](</docs/en/agent-sdk/permissions>) for full details. ###
modified Manage multiple agents with agent view View current →
--- a/agent-view.md +++ b/agent-view.md @@ -961,7 +961,7 @@ Background sessions can’t read Desktop, Documents, or Downloads on macOS -On macOS, the background session host runs as its own process and requests access to protected folders separately from your terminal. If a background session reports `Operation not permitted` when reading `~/Desktop`, `~/Documents`, `~/Downloads`, or another protected location, grant access in System Settings under Privacy & Security > Files and Folders, or enable Full Disk Access for the entry. With the native installer, the entry appears as Claude Code and the grant persists across updates. With other install methods such as Homebrew or npm, the entry shows the binary path and may need to be granted again after updating. +On macOS, the background session host runs as its own process and requests access to protected folders separately from your terminal. If a background session reports `Operation not permitted` when reading `~/Desktop`, `~/Documents`, `~/Downloads`, or another protected location, grant access in System Settings under Privacy & Security > Files and Folders, or enable Full Disk Access for the entry. In either list, look for an entry named Claude Code, or one named for the path or file name of the `claude` binary. That file name can be a version number such as `2.1.316`. If `Operation not permitted` returns after Claude Code updates, look for a new entry, such as one named for the new version. If one is there, grant it access. ### @@ -1028,7 +1028,7 @@ v2.1.296| A prompt or `!` shell command that you enter as the session moves to the background is stopped or left unsent, and its text is kept in prompt history. Before this release, the response or command kept running where you could no longer see it, and a prompt sent right after `←` could run a second time unseen. A prompt typed while `SessionStart` hooks were still running was lost: not sent, and not in prompt history. v2.1.295| `Ctrl+C` at the idle prompt of an attached background session leaves the pending wakeup of a [self-paced `/loop`](</docs/en/scheduled-tasks#let-claude-choose-the-interval>) alone, so pressing it twice detaches and the loop keeps running. `Esc` at that prompt [stops the self-paced loop](</docs/en/scheduled-tasks#stop-a-loop>) and shows a `Pending wakeup cancelled` notice. Before this release, the first `Ctrl+C` could end a self-paced loop without saying so, and `Esc` didn’t stop one that had moved to the background with the session. v2.1.295| On macOS and Linux, when `claude agents` exits while no supervisor is running, it doesn’t start a new one on its own. Running sessions then stop about a minute later unless you run `claude agents` again, and agent view can print a notice saying so as it exits. Before this release, the exiting `claude agents` started a new supervisor. -v2.1.295| On macOS with the native installer, background sessions that restart together after an update run under the same Claude Code entry that holds the protected-folder access you granted. Before this release, those sessions could run under the binary’s own path instead. macOS lists that path as a separate entry, so the folder-access prompts could come back after an update. +v2.1.295| On macOS with the native installer, background sessions that restart together after an update run their host processes from the same `~/.local/share/claude/ClaudeCode.app` folder. Before this release, those processes could run from the binary’s own path instead. macOS can list that path as a separate entry, so the folder-access prompts could come back after an update. v2.1.290| `claude attach` and `claude logs` can take part of a session’s name in place of the ID. v2.1.290| `/model`, `/effort`, `/rename`, and `/usage` sent as a peek reply to a working session run right away. v2.1.290| A peek reply that can’t be delivered is no longer saved for the next restart when it starts with `/`, or when it answers a question with predefined choices while the session’s process is running.
modified Claude Code on Amazon Bedrock View current →
--- a/amazon-bedrock.md +++ b/amazon-bedrock.md @@ -450,7 +450,7 @@ export ANTHROPIC_BEDROCK_SERVICE_TIER=priority -Claude Code sends this as the `X-Amzn-Bedrock-Service-Tier` header on each request. Tier availability varies by model and region. Reserved capacity uses a [provisioned throughput](<https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html>) ARN as the model ID instead of this setting. +Claude Code sends this as the `X-Amzn-Bedrock-Service-Tier` header on every [Invoke API](<https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html>) request from a session that has the variable, except its model access checks. Setting it has no effect on requests to the Mantle endpoint or through a [Claude apps gateway](</docs/en/claude-apps-gateway>). Tier availability varies by model and region. Reserved capacity uses a [provisioned throughput](<https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html>) ARN as the model ID instead of this setting. To cover [background sessions](</docs/en/agent-view#settings-and-provider>) you start from a terminal, set `ANTHROPIC_BEDROCK_SERVICE_TIER` in the [`env`](</docs/en/settings-reference#env>) block of your settings. Those sessions get the value you export only when the shell that started the [supervisor](</docs/en/agent-view#the-supervisor-process>) exported it. ## @@ -482,7 +482,7 @@ Enable Mantle -With AWS credentials already configured, set `CLAUDE_CODE_USE_MANTLE` to route requests to the Mantle endpoint: +With AWS credentials already configured, set `CLAUDE_CODE_USE_MANTLE` and your AWS region: export CLAUDE_CODE_USE_MANTLE=1 export AWS_REGION=us-east-1 @@ -590,8 +590,6 @@ * Specify the model as an [inference profile](<https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html>) ID -Claude Code uses the Amazon Bedrock [Invoke API](<https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html>) and does not support the Converse API. - ### ​ @@ -619,7 +617,7 @@ * If the error names a `bedrock-mantle:` action, grant your IAM identity that action. * If the error names no action and your credentials are valid, your AWS account has not been granted access to the model you requested. Contact your AWS account team to request access. -A `400` that names the model ID means that model is not served on Mantle. Mantle has its own model lineup separate from the standard Amazon Bedrock catalog, so inference profile IDs such as `us.anthropic.claude-sonnet-4-6` will not work. Use a Mantle-format ID, or enable both endpoints so Claude Code routes each request to the endpoint where the model is available. +A `400` that names the model ID means that model isn’t served on Mantle. Mantle has its own model lineup separate from the standard Amazon Bedrock catalog, so inference profile IDs such as `us.anthropic.claude-sonnet-4-6` don’t work. Use a Mantle-format ID, or enable both endpoints so Claude Code sends inference profile IDs to the Invoke API. ##
modified Best practices for Claude Code View current →
--- a/best-practices.md +++ b/best-practices.md @@ -528,7 +528,7 @@ [`claude -p "prompt"`](</docs/en/headless>) runs once and exits, which is how Claude Code ends up in CI jobs, git hooks, and shell loops. In a script you’ll almost always want a few more flags: * [`--bare`](</docs/en/headless#start-faster-with-bare-mode>) skips hooks, skills, plugins, MCP servers, and `CLAUDE.md` files, the repo’s as well as the machine’s, so the run does the same thing wherever it runs. It also never touches your claude.ai login: auth comes from `ANTHROPIC_API_KEY`, an `apiKeyHelper` in the file you pass with `--settings`, or your cloud provider’s credentials. - * `--append-system-prompt`, `--mcp-config`, and `--settings` pass in whatever the run _does_ need, explicitly. + * `--append-system-prompt`, `--mcp-config`, and `--settings` explicitly pass in what the run _does_ need. Hooks you pass with `--settings` [don’t run under `--bare`](</docs/en/headless#start-faster-with-bare-mode>), so don’t use `--bare` for a run that needs them. * `--allowedTools` pre-approves its tools, and [`--permission-mode dontAsk`](</docs/en/permission-modes#allow-only-pre-approved-tools-with-dontask-mode>) refuses anything else that would have prompted. * `--output-format json` gives you a single result object to parse, and `stream-json` with `--verbose` streams events as they happen.
modified Claude apps gateway deployment and operations View current →
--- a/claude-apps-gateway-deploy.md +++ b/claude-apps-gateway-deploy.md @@ -433,6 +433,7 @@ Log: `refresh failed request_id=<id>: invalid_token (…) (at userinfo_no_id_token, …)`, and developers see `Cloud gateway session expired` every `session.ttl_hours`| The IdP accepted the refresh token but returned no id_token with it, so the gateway asked the IdP’s userinfo endpoint for the user’s claims. The IdP rejected the refreshed access token there. The gateway answers `temporarily_unavailable`, so Claude Code keeps the refresh token but can’t renew the session. Gateway versions before v2.1.260 log the same line without the `(at …)` detail.| Set [`oidc.scope_on_refresh: true`](</docs/en/claude-apps-gateway-config#oidc>), available in gateway v2.1.260 or later, so the refresh request asks for `openid` again. Some IdPs, such as Okta, return an id_token on refresh only when asked. On PingFederate, enable **Return ID Token On Refresh Grant** under **Applications > OAuth > OpenID Connect Policy Management** instead. The key doesn’t change PingFederate’s behavior. For other IdPs that still omit it, check whether the userinfo endpoint accepts access tokens issued by a refresh. As a stopgap, raise [`session.ttl_hours`](</docs/en/claude-apps-gateway-config#session>). See Identity provider setup for the deprovisioning tradeoff. A developer signs in, then every request from that session fails with a `431` error| The session token in every request’s `Authorization` header lists the developer’s IdP groups, so for a developer in many groups the headers can total more than the gateway accepts| See Request headers too large after sign-in for which limit applies and what to change Every Amazon Bedrock request returns 502; log shows `Could not load credentials from any providers`| On EC2, IMDSv2’s default hop limit of 1 blocks the instance-metadata request from inside the container. Boot and `/readyz` pass anyway because the AWS SDK resolves instance credentials on the first request, not at client construction| Raise the hop limit with `aws ec2 modify-instance-metadata-options --instance-id <id> --http-put-response-hop-limit 2`, or set it in the launch template. The change applies to every container on the instance. Prefer ECS task roles where available, which read credentials from the ECS container-credentials endpoint and avoid the change entirely, or apply the change on a dedicated gateway instance to limit the exposure. +Log: a warning that contains `upstream <name>: Google issued an access token that expires in <N>s`, on an upstream whose Google credentials file has type `external_account`| Requests succeed until that access token expires, then fail unless the token `credential_source` points to was renewed first.| If a process writes that token to a file, have it write a new one more than five minutes before the old one expires At peak load, responses are slow to start or appear to hang, or fail with a 502 `all upstreams failed` while the upstream is healthy| A replica has more requests open than it sends upstream at once, so the extra requests wait inside the gateway. On a `provider: anthropic` upstream, a request that waits longer than `timeouts.upstream_ttfb_ms` gives up on that upstream, which produces the 502 when no later upstream serves it. The log shows a warning that contains `client requests are open`.| Add replicas, or raise the limit on each replica. See Concurrent upstream requests. On an upstream other than `provider: anthropic`, a turn with a long thinking pause fails. The proxy in front of the gateway logs one request that stays open for about 12.5 minutes, then a run of `504` errors| Claude Code ended a stream that had delivered its first response event and then carried only keepalive pings. It re-sent the request without streaming, and each reply takes longer than the proxy’s timeout.| Raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for your developers. See Long thinking ends in proxy timeouts. On `provider: anthropic`, a turn with a long thinking pause fails. The proxy logs one request open for about 20 minutes, then `502` or `504` errors| Claude Code ended a stream that had delivered its first response event and then carried only keepalive pings. It re-sent the request without streaming, and each reply takes longer than the gateway’s wait on the upstream, `timeouts.upstream_ttfb_ms`, or the proxy’s timeout.| Raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for your developers. See Long thinking on an Anthropic API upstream.
modified Explore the .claude directory View current →
--- a/claude-directory.md +++ b/claude-directory.md @@ -147,7 +147,7 @@ `session-env/`| Per-session environment metadata `tasks/`| Task lists written by the task tools, one directory per list `shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash. -`backups/`| Earlier versions of `~/.claude.json`, copied when Claude Code rewrites the file. Claude Code keeps the five newest, plus a copy of any version it couldn’t parse. +`backups/`| Earlier versions of `~/.claude.json`, copied when Claude Code rewrites the file. Claude Code keeps the five newest copies, plus a copy of any version it couldn’t parse. Past the age cutoff, the last copy that holds your configuration is deleted too. If the current file parses, holds your configuration, and is under 8 MiB, you’re left with a new copy of it. `feedback-bundles/`| Redacted transcript archives written by `/feedback` on third-party providers or when no Anthropic credentials are configured, for sending to your Anthropic account team `feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>) awaiting your review in `/feedback`. Swept after `cleanupPeriodDays` or 30 days, whichever is shorter. When the queue is at its 10-draft limit, Claude Code deletes the oldest draft to make room. `usage-data/`| `report.html` and timestamped report copies written by [`/insights`](</docs/en/costs#analyze-your-usage-patterns>), plus cached per-session analysis data used to build them @@ -293,7 +293,8 @@ `~/.claude/tasks/`| Your [task lists](</docs/en/interactive-mode#task-list>), including any still in use `~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins/loading#synced-plugins>) that Claude Code removed `~/.claude/plugins/installed_plugins.set-aside.<date>.<hash>.json`, `~/.claude/plugins/installed_plugins.unreadable.<date>.<hash>.kept`| The copies of plugin install records that Claude Code dropped or couldn’t read. Nothing reads them back -`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing +`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`| Nothing user-facing +`~/.claude/backups/`| The earlier copies you can [restore `~/.claude.json` from](</docs/en/errors#configuration-error-in-claude-json>) `~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/`| Nothing. Legacy directories not written by current versions. Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your account details, preferences, and installed plugins.
modified Let Claude coordinate ongoing work with Projects View current →
--- a/claude-projects.md +++ b/claude-projects.md @@ -594,7 +594,7 @@ * **“Unable to access your repository”** , reported by a thread when its clone fails: GitHub rejected the clone, the repository wasn’t found under the name the project has, or the branch the thread was asked to start from doesn’t exist. * **“Claude can’t access” a repository** , shown when you save repositories in the **New project** dialog or **Project settings**. The message continues with an install link and a reconnect link. Use the install link if the Claude GitHub App isn’t on that repository, and the reconnect link if it is, since the GitHub App can be installed on GitHub without being linked to the account you connected to Claude. If the message says the GitHub App is suspended or doesn’t include this repository, follow its link to GitHub to fix that. -To fix any of them, click the button the message offers, such as **Install GitHub App** or **Select repositories on GitHub** , then **Check again**. When the block is on the GitHub organization’s side, such as an owner who hasn’t approved the app or an IP allow list that excludes Claude, the message shows a **See how to fix** link instead. If there’s no button, follow Set up GitHub access, then send another message to retry. +To fix GitHub access for “Couldn’t start the session” or “Unable to access your repository”, click the button the message offers, such as **Install on GitHub** or **Select repositories**. If there’s no button, follow Set up GitHub access. After the fix, ask Claude in the project conversation to start a new thread for the same work. ### @@ -633,7 +633,7 @@ Message| What to do ---|--- -”Unable to connect to repository” with “Claude couldn’t reach GitHub to fetch your repository”| Wait a moment, then send another message to retry +”Unable to connect to repository” with “Claude couldn’t reach GitHub to fetch your repository”| Wait a moment, then ask Claude in the project conversation to start a new thread for the same work ”Unable to connect to repository” with “Claude couldn’t access your repository or environment”| Your GitHub account needs push access to the repository, and the environment must still exist. Check both in **Project settings > Environment**, then retry ”Couldn’t show the setup proposal”| The app you have open is older than the **Setup recommendations** Claude sent. Refresh the page or restart the desktop app, or ask Claude to propose the setup again ”The project’s environment was removed”| Choose a different environment in **Project settings > Environment**; the change applies to new threads
modified Claude Tag View current →
--- a/claude-tag.md +++ b/claude-tag.md @@ -44,7 +44,7 @@ * **In channels** : by default, anyone in the paired Slack workspace can tag `@Claude` in a channel, and an Owner can [restrict who can use Claude](</docs/claude-tag/admins/restrict-access#restrict-who-can-use-claude>) to people in your Claude organization or, on Enterprise, to specific roles. Channel work bills by usage to your organization’s usage balance, under a [spend limit](</docs/claude-tag/admins/set-spend-limit>) an Owner sets. * **In group DMs** : the same restriction on who can use Claude applies, and the work bills to your organization’s usage balance. See [Group DMs](</docs/claude-tag/admins/restrict-access#group-dms>). - * **In one-to-one DMs** : a DM from a member who has connected a Claude account runs on that account and bills to that person’s seat. The seat must include Claude Code, or, on the Enterprise plan, be a **Standard** or **Usage-Based Chat** seat held by someone who also has Cowork. A [DM from a member who hasn’t connected a Claude account](</docs/claude-tag/admins/restrict-access#direct-messages-from-members-without-a-claude-account>) can bill to your organization for a limited time. + * **In one-to-one DMs** : a DM from a member who has connected a Claude account runs on that account and bills to that person’s seat. For the DM to work, that person needs either a seat that includes Claude Code or, on the Enterprise plan, Cowork access on a **Standard** seat or a usage-based **Chat** seat. A [DM from a member who hasn’t connected a Claude account](</docs/claude-tag/admins/restrict-access#direct-messages-from-members-without-a-claude-account>) can bill to your organization for a limited time. ##
modified Desktop application View current →
--- a/desktop.md +++ b/desktop.md @@ -92,7 +92,7 @@ Choose a permission mode -Permission modes control how much autonomy Claude has during a session: whether it asks before editing files, running commands, or both. You can switch permission modes at any time using the mode selector in the row under the prompt box. To approve each change yourself, switch to Manual. To set a default mode for new local sessions, add `permissions.defaultMode` to your [settings file](</docs/en/settings#where-settings-live>). The desktop app reads the same settings files as the CLI. A mode you pick in the selector is remembered per folder and takes precedence over `defaultMode` for that folder, except Plan, which applies to the current session only. +Permission modes control how much autonomy Claude has during a session: whether it asks before editing files, running commands, or both. You can switch permission modes at any time using the mode selector in the row under the prompt box. To approve each change yourself, switch to Manual. To set a default permission mode for new local sessions, add `permissions.defaultMode` to your [settings file](</docs/en/settings#where-settings-live>). A mode you pick in a local session is remembered per folder and outranks a `defaultMode` in the project’s `.claude/` settings. A new local session can still start in a `defaultMode` from `~/.claude/settings.json` or managed settings, so check the selector before your first message. If you pick Plan, it applies to this session only. Mode| Settings key| Behavior ---|---|--- @@ -244,6 +244,19 @@ Hide or show the session details panel To hide or show the panel, click **Hide session rail** or **Show session rail** in the session’s title bar, or in the bar’s **⋮** menu. If you still don’t see the panel, check which Code tab layout you have. + +### + +​ + +Minimize a pane + +To keep the Terminal, Browser, or [iOS Simulator](</docs/en/desktop-ios-simulator>) in view at a small size, click **Minimize** in the pane’s header. The button requires Claude Desktop v4.0.0 or later and a Claude account rather than a [third-party provider](</docs/en/third-party-integrations>). The Browser pane has it only in local sessions. The minimized pane sits in the session details panel while that panel is on screen, and floats in a corner of the chat otherwise: + + * **In the panel** : the minimized pane sits below the panel’s cards, where you can’t move or resize it. To float it over the chat instead, hide the panel. + * **In a corner of the chat** : hover over the minimized pane to show its header. Drag the header to move it to another corner. To resize it, drag the corner of the minimized pane nearest the center of the chat. + +To get the full pane back, click **Expand** in the minimized pane’s header. To close the minimized pane instead, click the close button beside **Expand**. ### @@ -1457,9 +1470,9 @@ If your computer sleeps, you lose your network, or you quit Desktop, the task goes on until it finishes, needs you, or reaches one of the limits. Closing the lid counts as sleep. A restart of Desktop or of your computer, including for an update, counts as a quit. Claude Code runs as a process on the remote machine, under a background helper that Desktop installs there, so it doesn’t need your SSH connection to keep running. The behavior in this section requires Claude Desktop v2.31226.0 or later. -If you sign in to Desktop with a Claude account, don’t count on a task to run overnight. Desktop renews that sign-in for the task only while Desktop is running and connected, so the task’s sign-in can expire after you disconnect, and the task then stops. How much time is left when you disconnect varies, and it can be only a few minutes.The work done so far stays on the remote machine, and you can continue with a message when you return.If the task must run through the night: - - * [Keep your computer awake](</docs/en/desktop-scheduled-tasks#how-scheduled-tasks-run>) and online, with the lid open and Desktop running +If you sign in to Desktop with a Claude account, don’t count on a task to run overnight. Desktop renews that sign-in for the task only while Desktop is running, connected, and signed in, so the task’s sign-in can expire after you disconnect, and the task then stops. How much time is left when you disconnect varies, and it can be only a few minutes.The work done so far stays on the remote machine, and you can continue with a message when you return.If the task must run through the night: + + * [Keep your computer awake](</docs/en/desktop-scheduled-tasks#how-scheduled-tasks-run>) and online, with the lid open and Desktop running and signed in * Use a login that works without a prompt, such as a key that your SSH agent holds, for the remote machine and for any jump host on the way. Desktop can then reconnect on its own after a drop. For a task that must run while your computer is asleep or off, start a cloud session instead. @@ -1467,8 +1480,9 @@ * **After sleep or a network loss** : you get the running task back if the process still runs and Desktop can log in without a prompt. If it can’t, send a message. * **After a quit** : the task keeps running, but you lose it when the session opens again unless Desktop can rejoin its process. Check when Desktop can rejoin before you quit. If you lost the task, send a message to continue. -When you come back and the task isn’t done, check for word that Desktop can’t reconnect, an authentication error, or a waiting request: - +When you come back and the task isn’t done, check for Desktop’s sign-in page, word that Desktop can’t reconnect, an authentication error, or a waiting request: + + * **Sign-in page** : sign in. If the task stopped, send a message to continue. On an Enterprise plan, your organization can [sign you out a set number of days after you sign in](<https://support.claude.com/en/articles/13163631-configuring-session-security-settings>), however active you are. With a Claude account, Desktop doesn’t renew the task’s sign-in while you’re signed out, so the task can stop. * **Desktop can’t reconnect** : the session says why, and a notification may say so too. Desktop may need you to log in. * **Authentication error** : the sign-in token or credential may have expired. With a Claude account, send a message to continue. With a third-party provider, see [SSH remote sessions in Claude Desktop on 3P](<https://claude.com/docs/third-party/claude-desktop/ssh-remote-sessions>). * **Waiting request** : answer it
modified Test iOS apps in the simulator View current →
--- a/desktop-ios-simulator.md +++ b/desktop-ios-simulator.md @@ -92,7 +92,7 @@ Grant Claude access to a device -Claude asks for your consent before it controls a device, while building the app or opening a URL on it follows your session’s permission mode. You or your organization can also turn Claude’s access off entirely. +Claude asks for your consent before it controls a device, while building or launching the app or opening a URL on it follows your session’s permission mode. You or your organization can also turn Claude’s access off entirely. ### @@ -100,7 +100,7 @@ Allow a device the first time -The first time Claude uses a simulator, the desktop app asks you to allow it. The consent covers controlling that device and taking screenshots of it, and you give it once per device rather than once per session. Claude’s screenshots of the device are sent to Anthropic and kept under your normal conversation retention settings, so don’t sign in to real accounts on a device Claude uses. After you allow a device, Claude’s actions on it, such as tapping, typing, launching the app, and taking screenshots, run without further prompts. They carry the same trust as you clicking in the pane, and they only touch the simulated device, so the pane doesn’t need the macOS Accessibility and Screen Recording permissions that computer use requires. If you decline, the device still boots and the pane still works for your own taps; only Claude’s access stays off. To change your mind later, click **Let Claude use it** in the pane. +The first time Claude uses a simulator, the desktop app asks you to allow it. The consent covers controlling that device and taking screenshots of it, and you give it once per device rather than once per session. Claude’s screenshots of the device are sent to Anthropic and kept under your normal conversation retention settings, so don’t sign in to real accounts on a device Claude uses. After you allow a device, Claude’s actions on it, such as tapping, typing, and taking screenshots, run without prompts, but you approve launching the app as your permission mode requires. They carry the same trust as you clicking in the pane, and they only touch the simulated device, so the pane doesn’t need the macOS Accessibility and Screen Recording permissions that computer use requires. If you decline, the device still boots and the pane still works for your own taps; only Claude’s access stays off. To change your mind later, click **Let Claude use it** in the pane. ### @@ -108,10 +108,11 @@ Actions that follow your permission mode -Two actions follow your session’s [permission mode](</docs/en/permissions#permission-modes>) instead of the one-time consent: +Three actions follow your session’s [permission mode](</docs/en/permissions#permission-modes>) even after you allow a device: * Opening a URL on the device, for example to test a deep link or load a page in the device’s Safari, because a URL can carry data off the device. * Building the app, because `xcodebuild` runs your project’s build scripts on your Mac. Checking on a build already in progress doesn’t prompt. + * Installing and launching the app, because Claude can run any app it names, not only the one you’re building. ###
modified Environment variables View current →
--- a/env-vars.md +++ b/env-vars.md @@ -121,7 +121,7 @@ `ANTHROPIC_BEDROCK_BASE_URL`| Override the Amazon Bedrock endpoint URL. Use for custom Amazon Bedrock endpoints or when routing through an [LLM gateway](</docs/en/llm-gateway>). See [Amazon Bedrock](</docs/en/amazon-bedrock>) `ANTHROPIC_BEDROCK_MANTLE_BASE_URL`| Override the Amazon Bedrock Mantle endpoint URL. See [Mantle endpoint](</docs/en/amazon-bedrock#use-the-mantle-endpoint>) `ANTHROPIC_BEDROCK_REGION_PREFIX`| Cross-region inference profile prefix (`us`, `eu`, `apac`, `jp`, `au`, or `global`) Claude Code tries first instead of the one derived from the AWS region. Ignored in AWS GovCloud regions. Requires Claude Code v2.1.224 or later. See [Amazon Bedrock](</docs/en/amazon-bedrock#cross-region-inference-profile-prefixes>) -`ANTHROPIC_BEDROCK_SERVICE_TIER`| Amazon Bedrock [service tier](<https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html>) (`default`, `flex`, or `priority`). Sent as the `X-Amzn-Bedrock-Service-Tier` header. See [Amazon Bedrock](</docs/en/amazon-bedrock#service-tiers>) +`ANTHROPIC_BEDROCK_SERVICE_TIER`| Amazon Bedrock [service tier](<https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html>) (`default`, `flex`, or `priority`). See [Amazon Bedrock](</docs/en/amazon-bedrock#service-tiers>) `ANTHROPIC_BETAS`| Comma-separated list of additional `anthropic-beta` header values to include in API requests. Claude Code already sends the beta headers it needs; use this to opt into an [Anthropic API beta](<https://platform.claude.com/docs/en/api/beta-headers>) before Claude Code adds native support. Unlike the [`--betas` flag](</docs/en/cli-reference#cli-flags>), which requires API key authentication, this variable works with all auth methods including Claude.ai subscription `ANTHROPIC_CUSTOM_HEADERS`| Custom headers to add to requests (`Name: Value` format, newline-separated for multiple headers). If a name or value contains a character an HTTP header can’t carry, such as a curly quote or a zero-width space, the request fails with an error that identifies the pair by position. Requires Claude Code v2.1.227 or later. [Invalid request header value](</docs/en/errors#invalid-request-header-value>) lists the exact character set and where the check runs. A value that sets a credential, org or tenant, routing, or API-behavior header, such as `Authorization` or `Host`, counts as a [setting that needs approval](</docs/en/server-managed-settings#environment-variables-and-the-approval-dialog>) when server-managed settings deliver it. From project or local settings, such a value follows the [rules for when `env` values apply](</docs/en/settings-reference#when-claude-code-applies-env-values>) `ANTHROPIC_CUSTOM_MODEL_OPTION`| Model ID to add as a custom entry in the `/model` picker. Use this to make a non-standard or gateway-specific model selectable without replacing built-in aliases. See [Model configuration](</docs/en/model-config#add-a-custom-model-option>) @@ -220,6 +220,7 @@ `CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD`| Set to `1` to skip the check that an [Amazon Bedrock](</docs/en/amazon-bedrock>) streaming response carries the `application/vnd.amazon.eventstream` content-type. Without this variable, when a response carries a different content-type, Claude Code fails the request with an error naming that type, which means a [gateway or proxy is transforming the response](</docs/en/amazon-bedrock#streaming-errors-behind-a-gateway-or-proxy>). Configure the gateway to forward the `Content-Type` header and body unmodified rather than setting this variable. Requires Claude Code v2.1.208 or later `CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF`| Set to `1` to stop a [background session’s](</docs/en/agent-view>) in-flight work when the [supervisor](</docs/en/agent-view#the-supervisor-process>) stops, restarts, or updates that session’s process, instead of handing it to the session’s next process. That work is the session’s running background shell commands, plus background subagents as of v2.1.198. Affects only that handoff: backgrounding a session with `←` or [`/background`](</docs/en/agent-view#from-inside-a-session>) still carries in-flight background work over. Requires Claude Code v2.1.196 or later `CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP`| Set to `1` to stop Claude Code from terminating [background shell commands](</docs/en/interactive-mode#background-bash-commands>) under memory pressure. By default, on macOS and Linux, Claude Code terminates background shells when the operating system reports critical memory pressure and the session has been idle for 30 minutes with no turn or subagent running. Windows has no memory-pressure signal, so this variable has no effect there. Requires Claude Code v2.1.193 or later +`CLAUDE_CODE_DISABLE_BG_STABLE_PATH`| On macOS with the native installer, set to `1` to run each [background session’s](</docs/en/agent-view>) host process from the installed binary, not `~/.local/share/claude/ClaudeCode.app`. macOS may then ask again for permissions such as [folder access](</docs/en/agent-view#background-sessions-can%E2%80%99t-read-desktop-documents-or-downloads-on-macos>), including after each update. Set it in the `env` block of user settings, a managed settings file, or an MDM policy, not your shell. To remove `ClaudeCode.app`, delete it yourself. Requires Claude Code v2.1.295 or later `CLAUDE_CODE_DISABLE_BUNDLED_SKILLS`| Set to `1` to disable the [skills](</docs/en/skills>) and workflows included with Claude Code: bundled skills and workflows are removed entirely, while built-in commands like `/init` stay typable but are hidden from the model. `/doctor` stays typable like the built-in commands; hide it with `DISABLE_DOCTOR_COMMAND` instead. Skills from plugins, `.claude/skills/`, and `.claude/commands/` are unaffected. Equivalent to the [`disableBundledSkills`](</docs/en/settings-reference#disablebundledskills>) setting `CLAUDE_CODE_DISABLE_CFC_PROMPT`| For hosts that embed Claude Code and supply their own browser guidance. Set to `1` to keep the [Claude in Chrome](</docs/en/chrome>) browser tools available while omitting the Chrome section of the system prompt and the `/claude-in-chrome` [bundled skill](</docs/en/skills#bundled-skills>). In VS Code, the extension at v2.1.314 or later also leaves the Claude in Chrome instructions out of a session’s messages. Requires Claude Code v2.1.257 or later `CLAUDE_CODE_DISABLE_CLAUDE_MDS`| Set to `1` to prevent loading any CLAUDE.md memory files into context, including user, project, and auto memory files
modified Error reference View current →
Show diff (236 lines)
--- a/errors.md +++ b/errors.md @@ -47,6 +47,8 @@ `spend limit reached` / `spend limit unavailable`| Usage limits `Not logged in · Please run /login`| Authentication `Couldn't save your login`| Authentication +`Sign in again to take your previous account or API key off the config file.`| Authentication +`Your account or API key may still be in the config file. Run claude auth logout.`| Authentication `Authentication required · Sign in again to continue`| Authentication `Could not resolve authentication method`| Authentication `Invalid API key`| Authentication @@ -74,6 +76,9 @@ `Couldn't verify your organization's policy for remote control`| [Troubleshoot Remote Control](</docs/en/remote-control#couldnt-verify-your-organizations-policy-for-remote-control>) `Remote Control is disabled by your organization's policy`| [Troubleshoot Remote Control](</docs/en/remote-control#remote-control-is-disabled-by-your-organizations-policy>) `Remote Control was turned off by your organization's policy`| [Troubleshoot Remote Control](</docs/en/remote-control#remote-control-was-turned-off-by-your-organizations-policy>) +`Session failed: working folder not found:`| [Troubleshoot Remote Control](</docs/en/remote-control#working-folder-not-found>) +`The program file this Remote Control started from is gone`| [Troubleshoot Remote Control](</docs/en/remote-control#program-file-is-gone>) +`Session failed: spawn error:` followed by an `ENOENT` message| [Troubleshoot Remote Control](</docs/en/remote-control#program-file-is-gone>) `OAuth token revoked` / `OAuth token has expired`| Authentication `Failed to authenticate: OAuth token revoked`| Authentication `Your account does not have access to Claude. Please login again or contact your administrator.`| Authentication @@ -157,6 +162,7 @@ `Request too large for the API's 32MB request limit`| Request errors `Image was too large`| Request errors `API Error: an image in the conversation could not be processed and was removed`| Request errors +`An image in the conversation exceeds the dimension limit for many-image requests`| Request errors `Unable to resize image`| Request errors `Request rejected as unprocessable by the model`| Request errors `PDF too large` / `PDF is password protected` / `pdftoppm is not installed`| Request errors @@ -221,6 +227,8 @@ `Error: --agents takes a JSON object, or a file path only with --print (-p)`| Command-line errors `Error: --agents file not found`| Command-line errors `Error: Settings file exceeds the 2MiB limit`| Command-line errors +`Configuration error in`| Command-line errors +`Claude configuration file at <path> was empty and no backup holds anything: starting with defaults.`| Command-line errors `The current directory no longer exists (it was deleted or moved)` / `Can't read the current directory`| Command-line errors `Temp directory <dir> ... Refusing to use it` / `Claude Code's temporary directory <dir> could not be created`| Command-line errors `ENOSPC: no space left on device, mkdir '<dir>'`| Command-line errors @@ -326,6 +334,7 @@ `cannot contain null bytes (\0)`| Tool errors `Path contains null bytes`| Tool errors `command contains the invisible character U+FEFF (byte order mark) or U+180E (Mongolian vowel separator), and was not run`| Tool errors +`This call was not run. The command was approved before Claude Code restarted`| Tool errors `File is too large to read as an image (the limit is 128MB)`| Tool errors `Cannot read this as an image: <path> is a pipe or a device`| Tool errors `subagent_type is required: the general-purpose agent is not available in this session`| Tool errors @@ -412,11 +421,15 @@ `Not loaded: rename <path>, then restart — its name uses "<name>", a name reserved for the skills synced from your claude.ai account`| Configuration warnings `N skill or command names refused: run with --debug to see which ([names]), rename, then restart`| Configuration warnings `Ignoring N permissions.allow entries from ... this workspace has not been trusted`| Configuration warnings +`Make this change again later: <path> could not be updated, so it applies to this session only`| Configuration warnings `is a network path, which cannot be added as a working directory`| Configuration warnings `Remote managed settings failed to load (<cause>)`| Configuration warnings `Your organization requires remote managed settings to load, but they could not be loaded`| [Enforce fail-closed startup](</docs/en/server-managed-settings#enforce-fail-closed-startup>) `Remote managed settings are still loading`| Configuration warnings `Remote managed settings did not load`| Configuration warnings +`Claude Code couldn't load your organization's settings` / `Claude Code couldn't reach Anthropic to load your organization's settings` / `requires them before a session can start`| Configuration warnings +`Claude Code can't start this session yet`| Configuration warnings +`Your Claude session has expired. Sign in again to continue (claude auth login).`| Configuration warnings `Managed settings were not approved; exiting without applying them.`| Configuration warnings `Your organization's managed settings need your approval, which couldn't be asked for here.`| Configuration warnings `Claude Code can't start: your organization's managed settings block the default model` / `Claude Code can't start: your organization allows only the models listed in "availableModels"`| Configuration warnings @@ -1002,6 +1015,7 @@ * Run `/login` to authenticate with your Claude subscription or Console account * If you expected an environment variable to authenticate you, confirm `ANTHROPIC_API_KEY` is set and exported in the shell where you launched `claude` * For CI or automation where interactive login is not possible, configure an [`apiKeyHelper`](</docs/en/settings-reference#apikeyhelper>) script that fetches a key at startup + * If `claude -p` jobs exit with this message when someone signs in again to the same claude.ai account and organization, update Claude Code where that sign-in runs. Before v2.1.318, Claude Code removed the stored login during that sign-in, before saving the new one. * See [Authentication precedence](</docs/en/authentication#authentication-precedence>) to understand which credential Claude Code uses when several are present If you are prompted to log in repeatedly, see [Not logged in or token expired](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>) for system clock checks and macOS credential-storage recovery steps. @@ -1381,6 +1395,34 @@ * On macOS, unlock the login keychain, then run `/login` again * On other platforms, run `/login` again * If the login still doesn’t save, see [Not logged in or token expired](</docs/en/troubleshoot-install#not-logged-in-or-token-expired>) for the keychain unlock command and other credential-storage recovery steps + +### + +​ + +Sign in again to take your previous account or API key off the config file + +This warning after you sign in means any account you were signed in with before may still be stored in [`~/.claude.json`](</docs/en/claude-directory#ce-claude-json>): + + Sign in again to take your previous account or API key off the config file. + +An API key may still be in `~/.claude.json` too if a Console login created one on Linux or Windows. **What to do:** + + * Run `claude auth login` in your shell to sign in again. Claude Code then retries the save that takes the replaced account or API key off the file. + +### + +​ + +Your account or API key may still be in the config file + +You ran `/logout` or `claude auth logout`, and Claude Code signed this process out but couldn’t confirm that [`~/.claude.json`](</docs/en/claude-directory#ce-claude-json>) no longer holds your account. Either the save didn’t land, or the file couldn’t be read back to check. + + Your account or API key may still be in the config file. Run claude auth logout. + +An API key may still be in `~/.claude.json` too if a Console login created one on Linux or Windows. **What to do:** + + * Run `claude auth logout` in your shell to try the save again. When the save goes through, the command prints `Successfully logged out from your Anthropic account.` ### @@ -2281,6 +2323,7 @@ Image was too large. Double press esc to go back and try again with a smaller image. API Error: 400 ... image dimensions exceed max allowed size API Error: an image in the conversation could not be processed and was removed. + An image in the conversation exceeds the dimension limit for many-image requests (3000px). Run /compact to remove old images from context, or start a new session. The `could not be processed and was removed` line means the API refused an image in the conversation, such as one over the size or dimension limits. If one of these errors keeps coming back, update Claude Code. On older versions, an image error could repeat for reasons such as these: @@ -2292,6 +2335,9 @@ * Resize the image before pasting. The API accepts images up to 8000 pixels on the longest edge for a single image, or 3000 pixels when more than 20 images are in context. * Take a tighter screenshot of the relevant region instead of the full screen + * For the `dimension limit for many-image requests` message, run `/compact` at the Claude Code prompt if the message names it, or start a new session with fewer images + +The `dimension limit for many-image requests` message shows the pixel limit named in the API’s error. ### @@ -3060,6 +3106,45 @@ Claude Code rejects a `--settings` path that isn’t a regular file the same way: a device, FIFO, or socket reports `Error: Cannot use settings file (Not a regular file (device, FIFO, or socket))` followed by the path, and a directory reports an `EISDIR` reason. **What to do:** * Point `--settings` at a regular JSON settings file under 2 MiB. See [Settings](</docs/en/settings>) for the format. + +### + +​ + +Configuration error in ~/.claude.json + +Claude Code couldn’t parse `~/.claude.json`, the file that holds your account details, MCP servers, and per-project state. Your file is unchanged. A [non-interactive](</docs/en/headless>) start such as `claude -p` exits with code 1 each time until you repair the file. When Claude Code finds a [backup](</docs/en/claude-directory#cleaned-up-automatically>), the output names it and prints a `cp` line that copies it back: + + Claude configuration file at /home/user/.claude.json is corrupted: <JSON parser's message> + The corrupted file has been backed up to: /home/user/.claude/backups/.claude.json.corrupted.1793664000000 + A backup file exists at: /home/user/.claude/backups/.claude.json.backup.1793660400000 + You can manually restore it by running: cp -f "/home/user/.claude/backups/.claude.json.backup.1793660400000" "/home/user/.claude.json" + + Configuration error in /home/user/.claude.json: <JSON parser's message> + +**What to do:** + + * **The output has a`cp` line**: run that line in your terminal. On Windows, run it in PowerShell. It replaces the broken file with the backup, an earlier version of `~/.claude.json`. + * **The output has no`cp` line, or the error returns after you run it**: fix the JSON in `~/.claude.json`, copy another `.claude.json.backup.<timestamp>` file from [`~/.claude/backups/`](</docs/en/claude-directory#cleaned-up-automatically>) over it if there is one, or rename it. With no file at `~/.claude.json`, Claude Code starts with default settings and none of what the file held. + +Before v2.1.318, you were left with defaults in `~/.claude.json` after a non-interactive start printed this error, so the next start ran without your configuration. + +### + +​ + +Claude configuration file was empty and no backup holds anything + +This message at startup means the file it names was blank and none of the file’s [`.backup` copies](</docs/en/claude-directory#cleaned-up-automatically>) holds anything. Claude Code started with defaults for what that file holds. Your `settings.json` files and `.mcp.json` are separate files. + + Claude configuration file at /home/user/.claude.json was empty and no backup holds anything: starting with defaults. + +**What to do:** + + * Set up again what you had configured in that file. For example, add your `user` and `local` scope [MCP servers](</docs/en/mcp#mcp-installation-scopes>) with `claude mcp add` from your terminal. + * Sign in again if Claude Code asks you to + +Before v2.1.318, Claude Code reported a blank file with no backup as corrupted. ### @@ -4493,6 +4578,20 @@ * **For a command Claude wrote** : you have nothing to fix. The message tells Claude how to rewrite the command. * **For a skill or command file** : the message follows `No shell command in <name> was run`. See where to find the character and remove it. + +### + +​ + +Command approved before Claude Code restarted was not run + +A shell command you approved didn’t run, and Claude receives this message as the command’s result: + + This call was not run. The command was approved before Claude Code restarted, and Claude Code could not confirm that the shell is back in the directory where it was approved. That directory may be gone or replaced, lie outside the directory where the session started, or be one that Claude Code needs approval to enter or is not allowed to examine. The shell's directory is <directory>. If the command still makes sense, cd to the directory it was meant for and make the call again; it may need approval again. + +The message’s third sentence can instead read `It does not keep track of that directory across a restart in a session that has been in a worktree.` **What to do:** + + * Let Claude continue, and answer the prompt if you’re asked to approve the command again. ### @@ -5666,6 +5765,24 @@ ​ +Claude Code couldn’t load your organization’s settings + +Your session hasn’t started because your organization’s settings, including its [server-managed settings](</docs/en/server-managed-settings>), have to load first and Claude Code couldn’t load them. For example: + + Claude Code couldn't reach Anthropic to load your organization's settings (could not connect). <Organization name> requires them before a session can start. + +If the message is in a dialog titled `Claude Code can't start this session yet`, the dialog closes and the session starts as soon as the settings load. In [non-interactive mode](</docs/en/headless>) and in [background sessions](</docs/en/agent-view>), Claude Code prints the message and exits with status 1 instead. **What to do:** + + * **`could not connect`, or `the reply came from a network proxy, not Anthropic`**: check your network connection, and on a corporate network ask IT to allow HTTPS to `api.anthropic.com/api/claude_code/policy_limits` and `api.anthropic.com/api/claude_code/settings`. Then select **Retry now** , or run your command again. + * **`timed out`, `Anthropic returned an error`, or `Anthropic asked it to retry shortly`**: let the dialog retry, or run your command again later. Check [status.anthropic.com](<https://status.anthropic.com>) if it keeps happening. + * **`still loading`, or `couldn't verify your sign-in with Anthropic yet`**: let the dialog retry, or run your command again. If the sign-in message keeps coming back, sign in again by running `claude auth login` in your shell. + * **`Your Claude session has expired`** : the sign-in stored on this machine is no longer valid, so retrying won’t help. In the dialog, select **Sign in again** to close Claude Code; then, in your shell, run `claude auth login`, which works even while sessions can’t start. + * **`none of the settings the server returned could be applied as written`** : ask your administrator to correct the organization’s [server-managed settings](</docs/en/server-managed-settings#invalid-entries-in-delivered-settings>), then retry. + +### + +​ + Managed settings were not approved Your organization’s [server-managed settings](</docs/en/server-managed-settings>) include settings that need your approval, and you declined the [security approval dialog](</docs/en/server-managed-settings#security-approval-dialogs>), so Claude Code exits without applying them: @@ -6102,6 +6219,20 @@ Before v2.1.309, the warning read `Stale sandbox mask files left by a killed session`. Before v2.1.257, `claude doctor` didn’t flag these files; earlier versions leave the same placeholders behind when a session is killed. +### + +​ + +Make this change again later: ~/.claude.json could not be updated + +This notice on stderr means a change to [`~/.claude.json`](</docs/en/claude-directory#ce-claude-json>), such as a sign-in or an answer to a trust prompt, wasn’t saved to the file: + + Make this change again later: /home/user/.claude.json could not be updated, so it applies to this session only. + +**What to do:** + + * Make the change again in a later session. For example, run `/login` again or answer the trust prompt again. + ## ​
modified Run Claude Code programmatically View current →
--- a/headless.md +++ b/headless.md @@ -32,7 +32,7 @@ claude --bare -p "Summarize README.md" --allowedTools "Read" -In bare mode, Claude Code never reads OAuth credentials or the system keychain. For the Anthropic API, set `ANTHROPIC_API_KEY` in the environment, with a key created in the [Claude Console](<https://platform.claude.com>), or supply an `apiKeyHelper` in the `--settings` JSON. Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry continue to read their own provider credentials as usual. In bare mode Claude has access to the Bash, file read, and file edit tools. Pass any context you need with a flag: +In bare mode, Claude Code never reads OAuth credentials or the system keychain. For the Anthropic API, set `ANTHROPIC_API_KEY` in the environment, with a key created in the [Claude Console](<https://platform.claude.com>), or supply an `apiKeyHelper` in the `--settings` JSON. Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry continue to read their own provider credentials as usual. In bare mode Claude has access to the Bash, file read, and file edit tools. Pass the context you need with a flag: To load| Use ---|--- @@ -42,7 +42,7 @@ [Custom agents](</docs/en/sub-agents#choose-the-subagent-scope>)| `--agents <file-or-json>` A plugin| `--plugin-dir <path>`, `--plugin-url <url>` -Bare mode also limits what happens while the session runs: +Hooks still don’t run in bare mode when you pass them with `--settings`, or in the [`hooks/hooks.json`](</docs/en/plugins/components#hooks>) or [`hooks` manifest key](</docs/en/plugins/manifest-reference#hooks>) of a plugin you load with a flag. Don’t use bare mode for a run that needs them. Bare mode also limits what happens while the session runs: * **MCP servers** : only servers supplied on the command line connect, for example with `--mcp-config`. In an interactive session, Claude Code also skips the automatic IDE connection unless you pass `--ide`. * **System reminders** : Claude gets your prompts and the tool results without the [system reminders](</docs/en/glossary#system-reminder>) Claude Code would add alongside them. For example, Claude isn’t told when a file it read earlier changes on disk, and it doesn’t get the list of available skills, including skills from an `--add-dir` folder.
modified Choose a permission mode View current →
--- a/permission-modes.md +++ b/permission-modes.md @@ -211,7 +211,7 @@ * **Auto** : appears when auto mode is available * **Bypass permissions** : requires the **Allow bypass permissions mode** toggle in Desktop settings on Pro, Max, and Ultra plans; on Team and Enterprise plans, organization policy controls it instead -Cowork doesn’t use these modes. It has its own permission modes, enabled separately, and shows no mode selector at all until a mode beyond its default is enabled for your account. See the [Cowork docs](<https://claude.com/docs/cowork/overview>).For desktop-specific details, see [Choose a permission mode](</docs/en/desktop#choose-a-permission-mode>) in the Desktop guide.**As a default** : set `defaultMode` in [settings](</docs/en/settings#where-settings-live>). The desktop app reads the same settings files as the CLI and applies the permission mode to new local sessions.A mode you pick in the mode selector is remembered per folder and takes precedence over `defaultMode` for that folder. Plan is the exception: picking it applies to the current session only.For where `defaultMode` goes in a settings file, see the example under Start in a different permission mode. +Cowork doesn’t use these modes. It has its own permission modes, enabled separately, and shows no mode selector at all until a mode beyond its default is enabled for your account. See the [Cowork docs](<https://claude.com/docs/cowork/overview>).For desktop-specific details, see [Choose a permission mode](</docs/en/desktop#choose-a-permission-mode>) in the Desktop guide.**As a default** : set `defaultMode` in [settings](</docs/en/settings#where-settings-live>). The desktop app reads the same settings files as the CLI and applies the permission mode to new local sessions.A mode you pick in the mode selector in a local session is remembered per folder and outranks a `defaultMode` in the project’s `.claude/` settings. A new local session can still start in a `defaultMode` from `~/.claude/settings.json` or managed settings, so check the selector before your first message. If you pick Plan, it applies to this session only.For where `defaultMode` goes in a settings file, see the example under Start in a different permission mode. On [claude.ai/code](<https://claude.ai/code>), use the mode dropdown in the row under the prompt box. In the mobile app, tap the **+** button in the prompt box, then **Permission**. Cloud sessions and Remote Control sessions offer different permission modes: @@ -324,7 +324,8 @@ * **A direct connection to the Anthropic API** : in interactive terminal sessions and in `-p`, Agent SDK, [VS Code extension](</docs/en/vs-code>), and [desktop app](</docs/en/desktop>) sessions, whatever your plan or account type, as Anthropic rolls it out. Check your session type against these minimum Claude Code versions: * In interactive terminal sessions, asking the server requires Claude Code v2.1.271 or later on Pro, Max, Ultra, and Team plans. On Enterprise plans and Claude API accounts, those sessions require v2.1.278 or later. - * In `-p`, Agent SDK, VS Code extension, and desktop app sessions, asking the server requires Claude Code v2.1.281 or later + * In `-p` and VS Code extension sessions, asking the server requires Claude Code v2.1.278 or later + * In Agent SDK and desktop app sessions, asking the server requires Claude Code v2.1.281 or later * From v2.1.282, a session that [doesn’t fetch feature flags](</docs/en/env-vars#features-that-need-feature-flag-fetching>), for example because you turned telemetry off, asks the server by default in any kind of session * **A cloud provider, or an LLM gateway or proxy** : on [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, and whenever you point `ANTHROPIC_BASE_URL` at an [LLM gateway or proxy](</docs/en/llm-gateway>), whatever your plan. Asking by default requires Claude Code v2.1.278 or later. * **A signed-in[Claude apps gateway](</docs/en/claude-apps-gateway>) session**: requires Claude Code v2.1.280 or later
modified Configure permissions View current →
Show diff (178 lines)
--- a/permissions.md +++ b/permissions.md @@ -8,25 +8,25 @@ If you load a plugin that contains a [mod](</docs/en/plugins/mods/overview>), see [where a mod’s decisions fit among rules and hooks](</docs/en/permissions#precedence-among-rules-hooks-and-mods>). -When Claude requests a tool, the SDK checks permissions in this order: +When Claude requests a tool, Claude Code checks the call at these steps. Each step can decide the call, send it to your `canUseTool` callback, or pass it on: 1 Hooks -Run [hooks](</docs/en/agent-sdk/hooks>) first. A hook can deny the call outright or pass it on. A hook that returns `allow` doesn’t skip the deny and ask rules below, which are evaluated regardless of the hook result.A `PreToolUse` hook that returns `allow` also can’t approve an `rm` or `rmdir` command whose target Claude Code recognizes as a [critical path](</docs/en/permission-modes#critical-paths>), such as `rm -rf ~`. For what that `allow` does in plan mode, see [Hook approvals in plan mode](</docs/en/permissions#hook-approvals-in-plan-mode>). +Run [hooks](</docs/en/agent-sdk/hooks>). A hook can deny the call outright or pass it on. A hook that returns `allow` doesn’t skip the deny and ask rules below, which are evaluated regardless of the hook result.A `PreToolUse` hook that returns `allow` also can’t approve an `rm` or `rmdir` command whose target Claude Code recognizes as a [critical path](</docs/en/permission-modes#critical-paths>), such as `rm -rf ~`. For what that `allow` does in plan mode, see [Hook approvals in plan mode](</docs/en/permissions#hook-approvals-in-plan-mode>). 2 Deny rules -If a deny rule from `disallowed_tools` or [settings.json](</docs/en/settings-reference#permission-settings>) matches, the call is denied and [`canUseTool`](</docs/en/agent-sdk/user-input>) isn’t called, even in `bypassPermissions` mode and even when a hook returned `allow`.In the TypeScript SDK, if you set the `permission_policy` of a [custom tool](</docs/en/agent-sdk/custom-tools#require-approval-for-specific-tools>) to [`always_deny`](</docs/en/agent-sdk/typescript#mcpservertoolpolicy>), a call to that tool is denied at this step. +If a deny rule from `disallowed_tools` or from a settings file the SDK loads matches, the call is denied and [`canUseTool`](</docs/en/agent-sdk/user-input>) isn’t called. The call is denied this way even in `bypassPermissions` mode and when a hook returned `allow`.In the TypeScript SDK, if you set the `permission_policy` of a [custom tool](</docs/en/agent-sdk/custom-tools#require-approval-for-specific-tools>) to [`always_deny`](</docs/en/agent-sdk/typescript#mcpservertoolpolicy>), a call to that tool is denied at this step. 3 Ask rules -Check `ask` rules from [settings.json](</docs/en/settings-reference#permission-settings>). If an ask rule matches, the call falls through to your [`canUseTool` callback](</docs/en/agent-sdk/user-input>) for confirmation, even in `bypassPermissions` mode.Tools that require user interaction behave the same way: `AskUserQuestion` and MCP tools whose server sets [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>) always fall through to the callback, even when an allow rule matches. In `dontAsk` mode both cases are denied instead, because that mode never prompts. The MCP annotation requires Claude Code v2.1.199 or later.[claude.ai connector](</docs/en/mcp#organization-controls-on-connector-tools>) tools your organization has set to `ask` also leave the flow at this step. Every call falls through to the callback, even in `bypassPermissions` mode and even when an allow rule matches. The callback receives the reason `Your organization requires approval for this tool`. In `dontAsk` mode the call is denied instead, because that mode never prompts.In the TypeScript SDK, if you set a custom tool’s `permission_policy` to [`always_ask`](</docs/en/agent-sdk/custom-tools#require-approval-for-specific-tools>), no allow rule approves its calls, not even an `allowedTools` entry. In `dontAsk` mode Claude Code denies those calls, and in `auto`, `plan`, or `bypassPermissions` mode it [can approve them](</docs/en/agent-sdk/typescript#permission-modes-that-can-approve-an-always_ask-call>) before your callback runs. +Check `ask` rules from [settings.json](</docs/en/settings-reference#permission-settings>). If an ask rule matches, the call falls through to your [`canUseTool` callback](</docs/en/agent-sdk/user-input>) for confirmation, even in `bypassPermissions` mode.Tools that require user interaction behave the same way. `AskUserQuestion` and MCP tools whose server sets [`_meta["anthropic/requiresUserInteraction"]`](</docs/en/mcp#require-approval-for-a-specific-tool>) fall through to the callback, even when an allow rule matches. In `dontAsk` mode both cases are denied instead, because that mode turns each prompt into a denial. The MCP annotation requires Claude Code v2.1.199 or later.[claude.ai connector](</docs/en/mcp#organization-controls-on-connector-tools>) tools your organization has set to `ask` also leave the flow at this step. Every call falls through to the callback, even in `bypassPermissions` mode and even when an allow rule matches. The callback receives the reason `Your organization requires approval for this tool`. In `dontAsk` mode the call is denied instead, because that mode never prompts.In the TypeScript SDK, if you set a custom tool’s `permission_policy` to [`always_ask`](</docs/en/agent-sdk/custom-tools#require-approval-for-specific-tools>), no allow rule approves its calls, not even an `allowedTools` entry. In `dontAsk` mode Claude Code denies those calls, and in `auto`, `plan`, or `bypassPermissions` mode it [can approve them](</docs/en/agent-sdk/typescript#permission-modes-that-can-approve-an-always_ask-call>) before your callback runs. 4 @@ -34,11 +34,11 @@ Apply the active permission mode: - * In `bypassPermissions` mode, Claude Code approves everything that reaches this step except recognized [critical-path removals](</docs/en/permission-modes#critical-paths>) and Bash commands flagged [`Dangerous rm operation not ruled out`](</docs/en/permission-modes#dangerous-rm-operation-not-ruled-out>), which fall through instead. - * To run those removals with no prompt, see [Turn off the critical-path removal prompt](</docs/en/permission-modes#turn-off-the-critical-path-removal-prompt-in-bypasspermissions-mode>). + * In `bypassPermissions` mode, Claude Code approves each call that reaches this step unless it’s one of the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). For which of those actions go to your `canUseTool` callback, see Bypass permissions mode. * In `acceptEdits` mode, Claude Code approves the file operations listed under Accept edits mode. - * In `plan` mode, Claude Code sends file-edit tools to your `canUseTool` callback regardless of allow rules. - * In other modes, the request falls through. + * In `plan` mode, some calls reach your callback, and when auto mode is available, others go to its classifier instead. For more information, see Plan mode. + * In `default` and `dontAsk` mode, the call goes on to the allow rules. + * For `auto` mode, see Auto mode. 5 @@ -77,17 +77,17 @@ `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 and doesn’t 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. +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 and doesn’t auto-approve anything. **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.If calls to a tool in `allowed_tools` still reach your `canUseTool` callback, or are denied in `dontAsk` mode, check whether they’re [reads from network paths](</docs/en/permissions#network-paths>) or among the following calls. No allow rule approves these calls. In `dontAsk` mode, which never prompts, Claude Code denies them without calling `canUseTool`, and in the other permission modes you handle them as each item says: * `AskUserQuestion`, MCP tools marked [`_meta["anthropic/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>): answer them in the callback. [Handle clarifying questions](</docs/en/agent-sdk/user-input#handle-clarifying-questions>) shows how to answer `AskUserQuestion`, and a connector call arrives with the reason `Your organization requires approval for this tool` * Custom tools your application marks [`always_ask`](</docs/en/agent-sdk/custom-tools#require-approval-for-specific-tools>): decide the call in the callback. To stop these calls arriving, [change the policy mid-session](</docs/en/agent-sdk/typescript#mcpsdkserverconfigwithinstance>). In `auto`, `plan`, and `bypassPermissions` mode the call can instead be approved before the callback, in the cases listed under [Permission modes that can approve an `always_ask` call](</docs/en/agent-sdk/typescript#permission-modes-that-can-approve-an-always_ask-call>) - * Recognized `rm` and `rmdir` [critical-path removals](</docs/en/permission-modes#critical-paths>): in `default`, `acceptEdits`, and `bypassPermissions` mode, allow or deny the removal in the callback, where [`decisionReason`](</docs/en/agent-sdk/typescript#canusetool>) starts with `Dangerous rm`. For `auto` and `plan` mode, see [Critical-path removals in each permission mode](</docs/en/permission-modes#critical-path-removals-in-each-permission-mode>). The check that recognizes these removals [can miss some commands](</docs/en/permission-modes#critical-paths>) + * Recognized `rm` and `rmdir` [critical-path removals](</docs/en/permission-modes#critical-paths>): in `default`, `acceptEdits`, and `bypassPermissions` mode, allow or deny the removal in the callback, where [`decisionReason`](</docs/en/agent-sdk/typescript#canusetool>) starts with `Dangerous rm`. For `auto` and `plan` mode, see [Critical-path removals in each permission mode](</docs/en/permission-modes#critical-path-removals-in-each-permission-mode>) * **Bare name** : an entry like `Read` or `mcp__github__get_issue` auto-approves every call to that tool 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>). - * **Scoped rule** : an entry 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. + * **Scoped rule** : an entry like `Bash(npm test *)` auto-approves calls that match it, and other `Bash` calls that need approval fall through to the permission mode. + +To check calls that an allow rule, `acceptEdits`, or `bypassPermissions` approves, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which runs for those calls too. A hook deny applies even in `bypassPermissions` mode. For a locked-down agent, pair `allowedTools` with `permissionMode: "dontAsk"`: @@ -98,9 +98,22 @@ The listed `Read`, `Glob`, and `Grep` calls 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>). Every other call that would prompt is denied instead, though a [mod](</docs/en/plugins/mods/overview>) you installed can still approve [some of those calls](</docs/en/permissions#precedence-among-rules-hooks-and-mods>). Calls that need no approval in `default` mode run whether or not you list them. These include [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 hide a built-in tool from Claude entirely rather than deny its calls, 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`. - -You can also configure allow, deny, and ask rules declaratively in `.claude/settings.json`. These rules are read when the `project` setting source is enabled, which it is for default `query()` options. If you set `setting_sources` (TypeScript: `settingSources`) explicitly, include `"project"` for them to apply. See [Permission settings](</docs/en/settings-reference#permission-settings>) for the rule syntax. +**`allowed_tools` does not constrain `bypassPermissions`.** `allowed_tools` pre-approves the tools you list. In `bypassPermissions` mode, Claude Code approves a call to an unlisted tool unless it’s one of the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>).If you set `allowed_tools=["Read"]` with `permission_mode="bypassPermissions"`, Claude Code still approves calls to tools such as `Bash`, `Write`, and `Edit`. If you need `bypassPermissions` but want specific tools blocked, use `disallowed_tools`. For the calls that still reach your `canUseTool` callback in this mode, see Bypass permissions mode. + +You can also configure allow, deny, and ask rules declaratively in `.claude/settings.json`. These rules are read when the `project` setting source is enabled, which it is for default `query()` options. If you set `setting_sources` (TypeScript: `settingSources`) explicitly, include `"project"` for them to apply. See [Permission settings](</docs/en/settings-reference#permission-settings>) for the rule syntax. For when allow rules in a project’s `.claude/settings.json` apply, see [Project allow rules and workspace trust](</docs/en/permissions#project-allow-rules-and-workspace-trust>). + +### + +​ + +Path patterns in rules + +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`, so write a path rule for any of them as `Edit(path)`. If you write a path rule as `Write(path)` or `NotebookEdit(path)`, it [matches no call](</docs/en/permissions#path-rules-that-never-match>) and has no effect. In `allowed_tools` and `disallowed_tools`, start a path pattern with `//` for an absolute path, or with a single `/` for a path inside the session’s working directory: + + * **`//path`** : with a deny rule of `Edit(//secrets/**)`, Claude Code blocks writes under `/secrets` on disk from Claude’s file tools and from [Bash commands such as `tee` and `> file` redirection](</docs/en/permissions#what-read-and-edit-rules-cover>). A script that Claude runs and that opens files itself can still write under `/secrets`. For enforcement by the operating system, see [Configure the sandboxed Bash tool](</docs/en/sandboxing>). + * **`/path`** : `Edit(/secrets/**)` matches the `secrets` directory inside the working directory. + +For other ways to start a path pattern, see [Read and Edit rules](</docs/en/permissions#read-and-edit>). ## @@ -122,9 +135,9 @@ ---|---|--- `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 without calling `canUseTool`, though a [mod](</docs/en/plugins/mods/overview>) you installed can still approve [some of those calls](</docs/en/permissions#precedence-among-rules-hooks-and-mods>). Calls approved by `allowed_tools` or `settings.json` allow rules run, and so do calls that need no approval in `default` mode. Some calls, such as [reads from network paths](</docs/en/permissions#network-paths>), are denied even when `allowed_tools` or an allow rule matches them. For the list, see Don’t ask mode -`acceptEdits`| Auto-accept file edits| File edits and filesystem operations (`mkdir`, `rm`, `mv`, etc.) are automatically approved +`acceptEdits`| Auto-accept file edits| File edits and filesystem operations (`mkdir`, `rm`, `mv`, etc.) inside your [working directories](</docs/en/permissions#working-directories>) 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>) and, outside a [cloud session](</docs/en/claude-code-on-the-web>), custom tools your application [marks `always_ask`](</docs/en/agent-sdk/custom-tools#require-approval-for-specific-tools>). 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 +`plan`| Planning mode| Claude explores and plans. Edits made with Claude’s file tools go to your `canUseTool` callback even when an allow rule matches them `auto`| Model-classified approvals| A model classifier reviews 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 **Subagent inheritance:** If your main session is in [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>), a subagent whose [`AgentDefinition`](</docs/en/agent-sdk/typescript#agentdefinition>) sets `permissionMode: "acceptEdits"` still runs in plan mode. That subagent’s `Edit` and `Write` calls on your source files still go to your `canUseTool` callback. Plan mode holds for the subagents you define too, so that handing work to one doesn’t get around reviewing the plan first.The subagent inherits `plan`, `acceptEdits`, `auto`, or `bypassPermissions` from the main session, and under a `default`\- or `dontAsk`-mode main session it runs in the mode you set. Even then, Claude Code never applies a `"bypassPermissions"` value, and applies an `"auto"` value only when [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to that subagent. The `bypassPermissions` exception requires Claude Code v2.1.267 or later.Subagents may have different system prompts and less constrained behavior than your main agent, so inheriting `bypassPermissions` grants them full, autonomous system access. The [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>) still apply. @@ -243,13 +256,13 @@ Auto-approves file operations so Claude can edit code without prompting. Other tools (like Bash commands that aren’t filesystem operations) still require normal permissions. **Auto-approved operations:** - * File edits (Edit, Write tools) + * File edits with the Edit, Write, and NotebookEdit tools * Filesystem commands: `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp`, `sed` -Both apply only to paths inside the working directory or `additionalDirectories`. In `acceptEdits` mode, Claude Code doesn’t auto-approve the request when Claude: +Both apply to paths inside the working directory or a directory you add. In Python, add one with `add_dirs`, and in TypeScript with `additionalDirectories`. In `acceptEdits` mode, Claude Code doesn’t auto-approve the request when Claude: * Works on a path outside that scope - * Writes to a protected path + * Writes to a [protected path](</docs/en/permission-modes#protected-paths>) * Removes a path that Claude Code recognizes as a [critical path](</docs/en/permission-modes#critical-paths>) with `rm` or `rmdir` * Runs [`touch`](</docs/en/permission-modes#auto-approve-file-edits-with-acceptedits-mode>) with, for example, an option, a glob, or a `timeout 5` or `LANG=C` prefix @@ -269,7 +282,7 @@ * [Reads from network paths](</docs/en/permissions#network-paths>) * Recognized [critical-path removals](</docs/en/permission-modes#critical-paths>) -If your `PreToolUse` hook returns `allow` for a recognized critical-path removal, a read from a network path, or a call to a tool marked `always_ask`, the call is still denied. The check that recognizes these removals [can miss some commands](</docs/en/permission-modes#critical-paths>). **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. +If your `PreToolUse` hook returns `allow` for a recognized critical-path removal, a read from a network path, or a call to a tool marked `always_ask`, the call is still denied. The check that recognizes these removals [can miss some commands](</docs/en/permission-modes#critical-paths>). **Use when:** you run a headless agent and want a hard deny for each call that would otherwise prompt. #### @@ -279,10 +292,10 @@ Auto-approves tool uses without prompting, except the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>). Hooks still execute and can block operations if needed. On Linux and macOS, Claude Code refuses to start in this mode as root or under `sudo` outside a [recognized sandbox](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>), and the query fails before the first turn. -Use with extreme caution. Claude has full system access in this mode. Only use in controlled environments where you trust all possible operations.`allowed_tools` does not constrain this mode. Every tool is approved, not just the ones you listed. These controls still apply: +Use with extreme caution. Claude has full system access in this mode. Only use in controlled environments where you trust all possible operations.`allowed_tools` doesn’t constrain this mode, and calls to tools you didn’t list are approved too. These controls still apply: * Deny rules, explicit `ask` rules, and hooks are evaluated before the mode check and can still block a tool. - * Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), tools that require user interaction, and recognized [critical-path removals](</docs/en/permission-modes#critical-paths>) still fall through to your `canUseTool` callback. The check that recognizes these removals [can miss some commands](</docs/en/permission-modes#critical-paths>), and you can [turn off the critical-path removal prompt](</docs/en/permission-modes#turn-off-the-critical-path-removal-prompt-in-bypasspermissions-mode>). Outside a [cloud session](</docs/en/claude-code-on-the-web>), calls to custom tools your application [marks `always_ask`](</docs/en/agent-sdk/custom-tools#require-approval-for-specific-tools>) fall through to the callback too. + * Connector tools [your organization set to `ask`](</docs/en/mcp#organization-controls-on-connector-tools>), tools that require user interaction, recognized [critical-path removals](</docs/en/permission-modes#critical-paths>), and Bash commands flagged [`Dangerous rm operation not ruled out`](</docs/en/permission-modes#dangerous-rm-operation-not-ruled-out>) still fall through to your `canUseTool` callback. The check that recognizes critical-path removals [can miss some commands](</docs/en/permission-modes#critical-paths>), and you can [turn off the critical-path removal prompt](</docs/en/permission-modes#turn-off-the-critical-path-removal-prompt-in-bypasspermissions-mode>). Outside a [cloud session](</docs/en/claude-code-on-the-web>), calls to custom tools your application [marks `always_ask`](</docs/en/agent-sdk/custom-tools#require-approval-for-specific-tools>) fall through to the callback too. * The [cross-session messaging safeguards](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>) still apply. #### @@ -291,11 +304,27 @@ Plan mode (`plan`) -Claude explores the codebase and produces a plan without editing your source files. File edits are never auto-approved in plan mode, even when an allow rule matches or a `PreToolUse` hook returns `allow`. They prompt through your `canUseTool` callback instead. While auto mode is available to the session, commands Claude runs during planning don’t reach your callback by default, because the classifier model that [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) uses [reviews them instead](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>). With that review on, the classifier can also approve read-only calls that would otherwise reach your callback, such as a `WebFetch` call with no allow rule. +Claude explores the codebase and produces a plan. During planning, edits made with Claude’s file tools outside [protected paths](</docs/en/permission-modes#protected-paths>) reach your `canUseTool` callback, even when an allow rule matches or a `PreToolUse` hook returns `allow`. [`AskUserQuestion`](</docs/en/agent-sdk/user-input#handle-clarifying-questions>) calls reach your callback too, even when an allow rule names the tool. When [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) is available, Claude Code sends these calls during planning to [auto mode’s classifier](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) for review instead of to your callback, when no allow rule approves them: + + * Shell commands + * Web fetches + * Web searches + * Calls to MCP tools that their server marks read-only + +This review is on by default. To turn it off, set [`useAutoModeDuringPlan`](</docs/en/settings-reference#useautomodeduringplan>) to `false` in the `settings` option you pass to `query()`, or in your user settings. While the review is off, web searches and calls to MCP tools marked read-only reach your callback. For shell commands and web fetches, the table shows whether each call reaches your callback: + +Call during planning| Review on| Review off, or auto mode not available +---|---|--- +A [read-only](</docs/en/permissions#read-only-commands>) shell command, such as `ls`| Runs without reaching your callback| Runs without reaching your callback +Any other shell command that no allow rule approves, except a [critical-path removal](</docs/en/permission-modes#critical-paths>)| Goes to the classifier, which approves or refuses it without your callback| Reaches your callback +A `WebFetch` call to a [preapproved documentation domain](</docs/en/tools-reference#webfetch-tool-behavior>)| Runs without reaching your callback| Runs without reaching your callback +Any other `WebFetch` call that no allow rule approves| Goes to the classifier, which approves or refuses it without your callback| Reaches your callback + +For what happens after the classifier refuses several calls in a row, see [Repeated-block thresholds](</docs/en/permission-modes#repeated-block-thresholds>). In the TypeScript SDK, if you set `allowDangerouslySkipPermissions: true` alongside `permissionMode: 'plan'`, file edits still reach your `canUseTool` callback. To switch a session that starts in plan mode to `bypassPermissions` later with `setPermissionMode()`, you need `allowDangerouslySkipPermissions` set from the start. -Claude may use `AskUserQuestion` to clarify requirements before finalizing the plan. See [Handle approvals and user input](</docs/en/agent-sdk/user-input#handle-clarifying-questions>) for handling these prompts. **Use when:** 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. +**Use when:** you want Claude to produce a plan first, such as during code review or before a large change. ####
modified Agent SDK reference - Python View current →
--- a/python.md +++ b/python.md @@ -1270,7 +1270,7 @@ PermissionMode = Literal[ "default", # Standard permission behavior "acceptEdits", # Auto-accept file edits - "plan", # Planning mode - explore without editing + "plan", # Planning mode - Claude explores and plans "dontAsk", # Deny anything not pre-approved instead of prompting "bypassPermissions", # Bypass permission checks; explicit ask rules still prompt (use with caution) "auto", # A model classifier reviews actions such as shell commands and network requests @@ -1310,7 +1310,12 @@ * `input_data`: The tool’s input parameters * `context`: A `ToolPermissionContext` with additional information -Returns a `PermissionResult` (either `PermissionResultAllow` or `PermissionResultDeny`). The callback is the SDK replacement for the interactive permission prompt: it’s invoked only when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Tool calls already approved by an `allowed_tools` entry, a settings allow rule, or the permission mode, such as `acceptEdits` or `bypassPermissions`, never invoke it. To gate every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>); see [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for which of them reach the callback and what happens in `dontAsk` and `auto` mode. +Returns a `PermissionResult` (either `PermissionResultAllow` or `PermissionResultDeny`). The callback replaces the interactive permission prompt. The SDK calls `can_use_tool` when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Calls approved in either of these ways run without calling `can_use_tool`: + + * A call that an `allowed_tools` entry or a settings allow rule approves + * A call the permission mode approves, such as a file edit in `acceptEdits` mode + +To check those calls, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which runs for them too. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>); see [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for which of them reach the callback and what happens in `dontAsk` and `auto` mode. ### @@ -3774,7 +3779,7 @@ `httpProxyPort`| `int`| `None`| HTTP proxy port for network requests `socksProxyPort`| `int`| `None`| SOCKS proxy port for network requests -The built-in sandbox proxy enforces the network allowlist based on the requested hostname and does not terminate or inspect TLS traffic, so techniques such as [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) can potentially bypass it. See [Sandboxing security limitations](</docs/en/sandboxing#security-limitations>) for details and [Secure deployment](</docs/en/agent-sdk/secure-deployment#traffic-forwarding>) for configuring a TLS-terminating proxy. +The built-in sandbox proxy enforces the network allowlist based on the requested hostname. By default, the proxy doesn’t terminate or inspect TLS traffic, so techniques such as [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) can potentially bypass the allowlist. See [Sandboxing security limitations](</docs/en/sandboxing#security-limitations>) for details and [Secure deployment](</docs/en/agent-sdk/secure-deployment#traffic-forwarding>) for configuring a TLS-terminating proxy. ###
modified Continue local sessions from any device with Remote Control View current →
--- a/remote-control.md +++ b/remote-control.md @@ -546,6 +546,27 @@ ​ +“working folder not found” + +In the terminal running `claude remote-control`, `Session failed: working folder not found:` followed by a quoted path means a session couldn’t start because no folder exists at that path. + + * **The server is still running** : restore the folder and start the session again, or stop the server + * **The server has exited** : run `claude remote-control` again from a folder that exists + +Before v2.1.318, a session that failed this way showed `Session failed: spawn error:` and an `ENOENT` message that named a program file instead of the missing folder. + +### + +​ + +“The program file this Remote Control started from is gone” + +This warning in the terminal running `claude remote-control` means the program file the server started from is missing, and new sessions run the newer version that replaced it. To move the server to that version too, stop it and run `claude remote-control` again. If Claude Code is installed on network storage, restart the server now and follow [Install on network storage](</docs/en/setup#install-on-network-storage>). Otherwise, new sessions start without a restart. When the program file is gone and Claude Code finds no newer version to run, new sessions fail. The terminal shows an error such as `Session failed: spawn error:` followed by an `ENOENT` message. Stop the server, [install Claude Code](</docs/en/setup#install-claude-code>) again if `claude` doesn’t run in your shell, and run `claude remote-control` again. Before v2.1.318, new sessions failed this way even with a newer version installed. + +### + +​ + “Couldn’t reconnect to your Remote Control session” When you resume a conversation with `claude --resume` or `claude --continue`, Claude Code reconnects to the Remote Control session recorded in that conversation. This message means the reconnection failed for a reason that may be temporary, such as a network interruption or a server error, so Claude Code can’t confirm whether the remote session still exists. Run `/remote-control` to retry the connection, or start a new session with `claude --remote-control` to create a new Remote Control session. Your local session keeps running without Remote Control in the meantime.
modified Securely deploying AI agents View current →
--- a/secure-deployment.md +++ b/secure-deployment.md @@ -16,8 +16,8 @@ Claude Code includes several security features that address common concerns. See the [security documentation](</docs/en/security>) for full details. - * **Permissions system** : Every tool and bash command can be configured to allow, block, or prompt the user for approval. Use glob patterns to create rules like “allow all npm commands” or “block any command with sudo”. Organizations can set policies that apply across all users. See [permissions](</docs/en/permissions>). - * **Command parsing for permissions** : Before executing bash commands, Claude Code parses them into an AST and matches the result against your permission rules. Commands that cannot be parsed cleanly, or that do not match an allow rule, require explicit approval. A small set of constructs such as `eval` always require approval regardless of allow rules. This is a permission gate, not a sandbox; apart from built-in safety checks such as the [critical-path check](</docs/en/permission-modes#critical-paths>) on `rm` and `rmdir` and the [protected paths](</docs/en/permission-modes#protected-paths>) list, it does not infer whether a command is dangerous from its target path or effects. + * **Permissions system** : Permission rules decide whether a tool call runs, is blocked, or asks for approval first. For the forms a Bash rule misses and how rules combine with permission modes, see [What a Bash rule doesn’t match](</docs/en/permissions#bash-rule-limits>) and [Configure permissions](</docs/en/agent-sdk/permissions>). Administrators can also set rules in [managed settings](</docs/en/permissions#managed-settings>). + * **Critical-path removals** : With the permission mode set to `default`, an `rm` or `rmdir` command recognized as removing your working directory or another [critical path](</docs/en/permission-modes#critical-paths>) needs approval. A matching allow rule doesn’t skip that approval. This is a permission gate, not a sandbox. To control what the agent can write, use filesystem controls. * **Web search summarization** : Search results are summarized rather than passing raw content directly into the context, reducing the risk of prompt injection from malicious web content. * **Sandbox mode** : Bash commands can run in a sandboxed environment that restricts filesystem and network access. See the [sandboxing documentation](</docs/en/sandboxing>) for details. @@ -93,17 +93,14 @@ For lightweight isolation without containers, [sandbox-runtime](<https://github.com/anthropics/sandbox-runtime>) enforces filesystem and network restrictions at the OS level. The main advantage is simplicity: no Docker configuration, container images, or networking setup required. The proxy and filesystem restrictions are built in. **How it works:** * **Filesystem** : Uses OS primitives (`bubblewrap` on Linux, `sandbox-exec` on macOS) to restrict read/write access to configured paths - * **Network** : Removes network namespace (Linux) or uses Seatbelt profiles (macOS) to route network traffic through a built-in proxy + * **Network** : Runs commands in their own network namespace (Linux) or under a Seatbelt profile (macOS) and routes their traffic through a built-in proxy that allows the configured domains. A connection to an outside host that skips the proxy fails. * **Configuration** : JSON-based allowlists for domains and filesystem paths -**Setup:** - - npm install @anthropic-ai/sandbox-runtime - -Then create a configuration file specifying allowed paths and domains. **Security considerations:** +**Setup:** For the install, configuration, and launch steps, see [Set up and launch the runtime](</docs/en/sandbox-environments#set-up-and-launch-the-runtime>). **Security considerations:** 1. **Same-host kernel** : Unlike VMs, sandboxed processes share the host kernel. A kernel vulnerability could theoretically enable escape. For some threat models this is acceptable, but if you need kernel-level isolation, use gVisor or a separate VM. - 2. **No TLS inspection** : The proxy allowlists domains based on the client-supplied hostname and does not terminate or inspect encrypted traffic. Code running inside the sandbox can potentially use [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) or similar techniques to reach hosts outside the allowlist. If your threat model requires stronger guarantees, configure a TLS-terminating proxy. See the [sandboxing security limitations](</docs/en/sandboxing#security-limitations>) for more detail. Separately, if the agent has permissive credentials for an allowed domain, ensure it cannot use that domain to trigger other network requests or to exfiltrate data. + 2. **No TLS inspection** : By default, the proxy allowlists domains based on the client-supplied hostname and doesn’t terminate or inspect encrypted traffic. Code running inside the sandbox can potentially use [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) or similar techniques to reach hosts outside the allowlist. If your threat model requires stronger guarantees, use a TLS-terminating proxy that inspects traffic, as Traffic forwarding describes. For more information, see the [sandboxing security limitations](</docs/en/sandboxing#security-limitations>). + 3. **Credentials for allowed domains** : If the agent has permissive credentials for an allowed domain, ensure it cannot use that domain to trigger other network requests or to exfiltrate data. For many single-developer and CI/CD use cases, sandbox-runtime raises the bar significantly with minimal setup. The sections below cover containers and VMs for deployments requiring stronger isolation. @@ -140,14 +137,18 @@ `--security-opt seccomp=...`| Restricts available syscalls; Docker’s default blocks ~44, custom profiles can block more `--read-only`| Makes the container’s root filesystem immutable, preventing the agent from persisting changes `--tmpfs /tmp:...`| Provides a writable temporary directory that’s cleared when the container stops -`--network none`| Removes all network interfaces; the agent communicates through the mounted Unix socket below +`--network none`| Cuts the container off from external networks `--memory 2g`| Limits memory usage to prevent resource exhaustion `--pids-limit 100`| Limits process count to prevent fork bombs `--user 1000:1000`| Runs as a non-root user `-v ...:/workspace:ro`| Mounts code read-only so the agent can analyze but not modify it. **Avoid mounting sensitive host directories like`~/.ssh`, `~/.aws`, or `~/.config`** `-v .../proxy.sock:...`| Mounts a Unix socket connected to a proxy running outside the container (see below) -**Unix socket architecture:** With `--network none`, the container has no network interfaces at all. The only way for the agent to reach the outside world is through the mounted Unix socket, which connects to a proxy running on the host. This proxy can enforce domain allowlists, inject credentials, and log all traffic. This is the same architecture used by [sandbox-runtime](<https://github.com/anthropics/sandbox-runtime>). Even if the agent is compromised via prompt injection, it cannot exfiltrate data to arbitrary servers. It can only communicate through the proxy, which controls what domains are reachable. For more details, see the [Claude Code sandboxing blog post](<https://www.anthropic.com/engineering/claude-code-sandboxing>). **Additional hardening options:** +**Unix socket architecture:** With `--network none`, a DNS lookup or a direct connection to another host fails inside the container. To let code in the container reach other hosts, run a proxy on the host and mount its Unix socket into the container. If you point `ANTHROPIC_BASE_URL` or `HTTP_PROXY` at a port on `localhost`, as Configuring Claude Code to use a proxy shows, relay that port inside the container to the socket. You can set up this proxy to enforce domain allowlists, inject credentials, and log all traffic. + +Within your proxy’s allowlist, the agent can send data to any allowed domain. Allow only the domains the agent needs. + +**Additional hardening options:** Option| Purpose ---|---
modified Customize sessions in self-hosted environments View current →
--- a/self-hosted-environments-configuration.md +++ b/self-hosted-environments-configuration.md @@ -464,6 +464,31 @@ The orchestrator’s log then shows that message. If the hook creates other objects, name each after the order ID, give it its own command, and treat its already-exists answer as success in the same way. For an object that holds a secret, print a fixed message in place of the command’s output. To confirm the trap works, add a line directly below the `trap` line that calls a command that doesn’t exist, such as `no-such-command`. Run the hook file from your shell and check that `echo $?` prints `1`, then remove the line. + +#### + +​ + +Find out why a spawn request was sent + +Your hook receives the reason for each spawn request in `CLAUDE_RUNNER_SPAWN_REASON`, so you can log why the hook ran, together with `CLAUDE_RUNNER_SESSION_UUID`. Requires Claude Code v2.1.318 or later on the orchestrator. Read it as `"${CLAUDE_RUNNER_SPAWN_REASON:-}"`, because it can be unset, and start the runner whatever the value is. If your hook branches on it, keep a default branch, because Anthropic can add values. To find the reason for earlier requests, search the log of every orchestrator replica for `session=` and the session’s `CLAUDE_RUNNER_SESSION_UUID`, not its `session_...` ID. The `ok session=` and `nack session=` lines show the value of `CLAUDE_RUNNER_SPAWN_REASON` after `reason=`, or `reason=-` if it was unset: + + * **`[runner:orchestrator] ok session=`** : the hook exited 0 + * **`[runner:orchestrator] nack session=`** : the orchestrator is reporting a failed spawn request to Anthropic + +Each value gives only the last cause that Anthropic recorded for the session, not its history: + +Value| What happened| What to check +---|---|--- +`session_created`| This is the first spawn request for a new session| Nothing. Don’t rely on it to spot a session’s first request, because the first request your hook sees can carry `runner_lost` after a fixed-fleet or standby runner held the session. +`no_runner_registered`| No runner registered for the previous request within `--expected-spawn-seconds`, and Anthropic recorded no failure report for it| `stop: no nack for session=` or `nack failed session=` among the session’s earlier lines means that no failure report was recorded. Read any hook error before it, and if the orchestrator was stopping, see Stop or restart the orchestrator. After an `ok session=` line, check that its runner started and registered within `--expected-spawn-seconds`. If no replica logged the request, check your orchestrators for restarts and `poll failed` lines. +`hook_failed`| Your orchestrator reported that the previous request failed and can be retried, for example because your hook exited 1 or was still running when `--hook-timeout` ended. The value is the same when your orchestrator returns a request to Anthropic without running the hook, for example while the orchestrator is stopping.| Find the session’s last `[runner:orchestrator] nack session=` or `stop: handing back session=` line before this request. The spawn error that the orchestrator sent follows the `reason=` value and can continue onto the following lines. A `handing back session=` line means that the orchestrator was stopping and didn’t run the hook, so the hook has nothing to fix. +`runner_lost`| The runner that held the session stopped reporting to Anthropic, deregistered, or was deleted| Find what stopped the runner or cut it off from Anthropic, such as a node eviction, an out-of-memory kill, a spot reclaim, or your own rollout or scale-down +`runner_reported_failure`| The previous runner reported that the session failed on it, for example during checkout| Read the previous runner’s log. If many sessions get this value, check the image and the repository setup. +`resumed`| The session was paused and now needs a runner again. For example, its runner released it under `--release-idle-session-min`, and later it received a new message.| Nothing +`requeued`| The session was put back in the queue, for example when an Owner selected **Retry** or a blocked session received a new message| If the same session keeps getting this value, read the error on its `nack session=` lines. If its hook exited 0, read the runner’s log. +`server_retry`| Anthropic gave up on the previous request or on starting the session on its runner, and is retrying. Your hook didn’t fail.| Nothing for a single request. If the value keeps appearing, on one session or across many, report it to [your Anthropic account team](</docs/en/self-hosted-environments-deploy#report-an-issue>). +`prewarm`| This is a pre-warming request, with no session yet| Nothing ###
modified Configure server-managed settings View current →
--- a/server-managed-settings.md +++ b/server-managed-settings.md @@ -180,7 +180,16 @@ Fetch and caching behavior -Claude Code fetches settings from Anthropic’s servers at startup and polls for updates hourly during active sessions. A client signed in through a Claude apps gateway fetches its settings from the gateway and waits for that fetch before the session starts, so the fetch in the lists below doesn’t apply to it. Enforce fail-closed startup covers what happens when that fetch fails. **First launch without cached settings:** +Claude Code fetches settings from Anthropic’s servers at startup and polls for updates hourly during active sessions. A client signed in through a Claude apps gateway fetches its settings from the gateway and waits for that fetch before the session starts, so the fetch in the lists below doesn’t apply to it. Enforce fail-closed startup covers what happens when that fetch fails. + +On a Team or Enterprise claude.ai login stored on the machine, Anthropic can require your organization’s settings before a session starts. When it does, whatever the lists below say, a developer [can’t start a session](</docs/en/errors#couldnt-load-your-organizations-settings>) in cases such as these: + + * Their sign-in has expired, until they run `claude auth login` + * Claude Code has neither the settings nor a recent cached copy. Check that the machine can reach `api.anthropic.com` + +A startup message with `before a session can start` or `Your Claude session has expired` means the requirement applies. + +**First launch without cached settings:** * When a developer signs in at startup, such as on a first run or after `/logout`, Claude Code waits up to five seconds for the fetch before it opens the session. When the policy arrives in time, Claude Code enforces it from the first screen and shows your [`companyAnnouncements`](</docs/en/settings-reference#companyannouncements>) on it. When the payload needs security approval, Claude Code ends the wait and applies the payload once the developer approves * In any other startup, and when that five-second wait runs out, Claude Code opens the session while the fetch continues, so a brief window passes before the settings load and the restrictions take effect @@ -223,7 +232,7 @@ * Every setting in the payload fails validation. * None of them falls back to a stricter value. * The payload holds a key other than those two retention keys. -The startup notice, `/status`, and `claude doctor` then report the [failed load](</docs/en/errors#remote-managed-settings-failed-to-load>) with the cause `no setting in the server response could be applied as written`, and that entry says which policy the session runs on. Clients that enforce fail-closed startup exit at startup instead. +The startup notice, `/status`, and `claude doctor` then report the [failed load](</docs/en/errors#remote-managed-settings-failed-to-load>) with the cause `no setting in the server response could be applied as written`, and that entry says which policy the session runs on. Clients that enforce fail-closed startup exit at startup instead. If startup stops with a message that your organization requires its settings `before a session can start`, see [Claude Code couldn’t load your organization’s settings](</docs/en/errors#couldnt-load-your-organizations-settings>). * The security approval dialog evaluates the salvaged payload, so a stripped invalid entry is never presented for approval and never executes. To debug delivery issues, run `claude --debug-file <path>` and search the log for `Remote settings`. Validate a payload change with `claude doctor` on a test machine before rolling it out to the organization. @@ -234,7 +243,7 @@ Enforce fail-closed startup -By default, if the remote settings fetch fails at startup, the CLI continues with the settings cached from the last successful fetch, except for the values Claude Code withholds until a fetch succeeds. On a machine that has never fetched them, the CLI continues without server-managed settings and still applies any [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) on the device. To stop clients from starting on cached or absent server-managed settings, set `forceRemoteSettingsRefresh: true` in your managed settings. Clients signed in through a Claude apps gateway wait for the startup fetch whether or not you set this, and handle a failed fetch as follows: +By default, if the remote settings fetch fails at startup, the CLI continues with the settings cached from the last successful fetch. The values Claude Code withholds stay withheld until a fetch succeeds. On a machine that has never fetched them, the CLI continues without server-managed settings and still applies any [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) on the device. Anthropic can require the settings instead. To stop clients from starting on cached or absent server-managed settings, set `forceRemoteSettingsRefresh: true` in your managed settings. Clients signed in through a Claude apps gateway wait for the startup fetch whether or not you set this, and handle a failed fetch as follows: * If the gateway answers an attended interactive launch with a `401` and this setting is off, the gateway has ended that sign-in. Claude Code prints [`Cloud gateway session expired — run /login to reconnect.`](</docs/en/errors#cloud-gateway-session-expired>) and opens the session signed out of the gateway until the user runs `/login`. * When the fetch fails in any other way, or in any other kind of launch except a `claude auth` subcommand, the client exits with an error. @@ -352,7 +361,7 @@ User deletes the cached settings file| First-launch behavior occurs User runs a modified Claude Code binary| A user who can run a modified client can bypass any client-side control User runs an older Claude Code version| Versions that predate server-managed settings don’t fetch or apply them -API is unavailable| Cached settings apply if available, except for the values Claude Code withholds until a fetch succeeds. Without a cache, Claude Code enforces no server-managed settings until the next successful fetch and still applies any [endpoint-managed settings](</docs/en/managed-settings#delivery-mechanisms>) on the device. With `forceRemoteSettingsRefresh: true`, the CLI exits instead of continuing, except for `claude auth` subcommands. Clients signed in through a Claude apps gateway exit at startup without that setting, with the same `claude auth` exemption +API is unavailable| Cached settings apply if available. Without a cache, Claude Code enforces no server-managed settings until the next successful fetch. Fetch and caching behavior lists the exceptions, including when Anthropic requires the settings. With `forceRemoteSettingsRefresh: true`, the CLI exits instead of continuing, except for `claude auth` subcommands. Clients signed in through a Claude apps gateway exit at startup without that setting, with the same `claude auth` exemption User authenticates with a different organization| Settings are not delivered for accounts outside the managed organization, including a session that authenticates with a Console API key User configures a third-party model provider| Server-managed settings are bypassed. This includes setting `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_MANTLE`, `CLAUDE_CODE_USE_VERTEX`, `CLAUDE_CODE_USE_FOUNDRY`, `CLAUDE_CODE_USE_ANTHROPIC_AWS`, or a non-default `ANTHROPIC_BASE_URL` Network traffic is intercepted or redirected| Disabled TLS validation or intercepted traffic can alter the settings the client receives
modified Settings files and precedence View current →
--- a/settings.md +++ b/settings.md @@ -197,9 +197,9 @@ * **Settings Error** : a user, project, or local file has invalid JSON or a value the schema rejects. At the start of an interactive session Claude Code shows a dialog that lets you fix the file with Claude’s help, exit, or continue without the broken settings. * **Settings Warning** : only individual entries fail, such as a malformed permission rule or an unknown hook event name. Claude Code skips those values and keeps the rest of the file in effect. * **Managed settings** : Claude Code keeps enforcing the rest of the file. [Invalid entries in managed settings](</docs/en/managed-settings#invalid-entries-in-managed-settings>) says what it drops and which keys fall back to a stricter value until you fix them. For a managed settings document that isn’t valid JSON, see [Managed settings document could not be parsed](</docs/en/errors#managed-settings-document-could-not-be-parsed>). - * **Configuration error** : `~/.claude.json` can’t be parsed. Claude Code copies the broken file to `~/.claude/backups/.claude.json.corrupted.<timestamp>` and asks whether to exit and fix it by hand or reset to the default configuration; a `-p` run prints the error and exits. To recover your previous state, copy back one of the five most recent `.claude.json.backup.<timestamp>` files in `~/.claude/backups/`, which Claude Code saves before it writes the file. - -After you continue, run `/status` to see the affected files and `claude doctor` for the details of each error. A `-p` run shows no dialog. Unless [a managed settings document can’t be parsed](</docs/en/errors#managed-settings-document-could-not-be-parsed>), Claude Code skips the broken file or values and continues with the rest, so after a `-p` run that ignores a setting, run `claude doctor` to see what it dropped. + * **Configuration error** : [`~/.claude.json`](</docs/en/claude-directory#ce-claude-json>) can’t be parsed. A `claude -p` run exits, and your file is unchanged. See [Configuration error in ~/.claude.json](</docs/en/errors#configuration-error-in-claude-json>) to restore an earlier copy. Claude Code copies the broken file to `~/.claude/backups/.claude.json.corrupted.<timestamp>`, and in an interactive session asks whether to exit and fix it or reset to the default configuration. When the file is blank and there’s no backup to restore, Claude Code starts with default settings. + +After you continue, run `/status` to see the affected files and `claude doctor` for the details of each error. A `-p` run shows no dialog. Unless [a managed settings document can’t be parsed](</docs/en/errors#managed-settings-document-could-not-be-parsed>), Claude Code skips a broken user, project, or local file or its broken values and continues with the rest. After a `-p` run that ignores a setting, run `claude doctor` from your terminal to see what it dropped. ##
modified All settings View current →
--- a/settings-reference.md +++ b/settings-reference.md @@ -133,13 +133,13 @@ `outputStyle`| Change Claude’s role, tone, and output format with an [output style](</docs/en/output-styles>)| Model and responses| Any file `parentSettingsBehavior`| Apply or drop restrictions an [SDK or IDE host](</docs/en/managed-settings#let-an-embedding-host-add-policy>) passes when you deploy [managed settings](</docs/en/managed-settings>)| Enterprise and managed settings| Managed `permissionExplainerEnabled`| Removed in v2.1.257, together with the `Ctrl+E` command explanation on shell permission prompts| Global config settings| Global config -`permissions`| Set allow, ask, and deny rules and the starting [permission mode](</docs/en/permission-modes>)| Permission settings| Any file +`permissions`| Set allow, ask, and deny rules and the default [permission mode](</docs/en/permission-modes>)| Permission settings| Any file `permissions.additionalDirectories`| Give Claude file access to [directories outside the current one](</docs/en/permissions#working-directories>)| Permission settings| Any file `permissions.allow`| Approve listed [tool uses](</docs/en/permissions#permission-rule-syntax>) without a prompt| Permission settings| Any file `permissions.ask`| Always prompt before listed [tool uses](</docs/en/permissions#permission-rule-syntax>)| Permission settings| Any file `permissions.blockReadsOutsideWorkingDirectories`| Make the file tools refuse reads outside the [working directories](</docs/en/permissions#working-directories>) in every permission mode| Permission settings| Any file `permissions.blockWritesOutsideWorkingDirectories`| Make the `Write`, `Edit`, and `NotebookEdit` tools refuse paths outside the [working directories](</docs/en/permissions#working-directories>) in every permission mode, apart from some of Claude Code’s own files| Permission settings| Any file -`permissions.defaultMode`| Set the [permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) new sessions start in| Permission settings| Any file +`permissions.defaultMode`| Set the default [permission mode](</docs/en/permission-modes#which-mode-a-session-starts-in>) for new sessions| Permission settings| Any file `permissions.deny`| Block listed [tool uses](</docs/en/permissions#permission-rule-syntax>), including reads of files that hold secrets| Permission settings| Any file `permissions.disableBypassPermissionsMode`| Prevent anyone from entering [bypassPermissions mode](</docs/en/permission-modes#skip-all-checks-with-bypasspermissions-mode>)| Permission settings| Any file `plansDirectory`| Choose where [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>) writes plan files| Memory and context| Any file @@ -870,7 +870,7 @@ Permission settings -Decide what Claude can do without asking, which permission mode a session starts in, and what auto mode’s classifier allows. For rule syntax and the permission model, see [Configure permissions](</docs/en/permissions>). +Decide what Claude can do without asking, the default permission mode for new sessions, and what auto mode’s classifier allows. For rule syntax and the permission model, see [Configure permissions](</docs/en/permissions>). ### @@ -977,7 +977,7 @@ `permissions` -Control which tools Claude can use without asking, which ones always prompt, and which ones are blocked, and set the [permission mode](</docs/en/permission-modes>) a session starts in. Every `permissions.*` key below nests under this object. +Control which tools Claude can use without asking, which ones prompt, and which ones are blocked. Also set the default [permission mode](</docs/en/permission-modes>) for new sessions. Every `permissions.*` key below nests under this object. * **Scope** : `Any file` * **Type** : object with `allow`, `ask`, `deny`, `additionalDirectories`, `blockReadsOutsideWorkingDirectories`, `blockWritesOutsideWorkingDirectories`, `defaultMode`, `disableBypassPermissionsMode`, and `disableAutoMode` @@ -1237,7 +1237,7 @@ `permissions.defaultMode` -Set the [permission mode](</docs/en/permission-modes>) new sessions start in. When you leave it unset, sessions start in the [built-in default](</docs/en/permission-modes#which-mode-a-session-starts-in>) for your surface. +Set the default [permission mode](</docs/en/permission-modes>) for new sessions. When you leave it unset, the [built-in default](</docs/en/permission-modes#which-mode-a-session-starts-in>) for your surface applies. * **Scope** : `Any file`. `auto` and `bypassPermissions` don’t take effect from project or local settings, so set them in `~/.claude/settings.json` instead. Before v2.1.257, `bypassPermissions` took effect from any file. For conversations the VS Code extension starts, Claude Code reads only user, managed, and `--settings` values. * **Type** : string, one of: @@ -6421,12 +6421,12 @@ `forceRemoteSettingsRefresh` -Block CLI startup until Claude Code has freshly fetched [server-managed settings](</docs/en/server-managed-settings>). If the fetch fails, Claude Code exits instead of continuing with cached or no settings. Set it when your environment can’t accept even a brief window in which a session runs without its managed policy. When the key is unset, Claude Code doesn’t block startup on the fetch, though when the developer signs in at startup it waits up to five seconds for the fetch. A Cloud gateway session always waits, and exits if the gateway can’t be reached. +Block CLI startup until Claude Code has freshly fetched [server-managed settings](</docs/en/server-managed-settings>). If the fetch fails, Claude Code exits instead of continuing with cached or no settings. Set it when your environment can’t accept even a brief window in which a session runs without its managed policy. When the key is unset, Claude Code doesn’t block startup on the fetch, though when the developer signs in at startup it waits up to five seconds for the fetch. [Anthropic can require the settings](</docs/en/server-managed-settings#fetch-and-caching-behavior>), which does block a start without them. A Cloud gateway session waits, and exits if the gateway can’t be reached. * **Scope** : `Managed`. Claude Code honors a `true` from any admin-controlled managed source, even one that isn’t the highest-priority source. * **Type** : Boolean * `true`: Claude Code blocks startup until it has freshly fetched server-managed settings, and exits if the fetch fails - * `false`: Claude Code doesn’t block startup on the fetch, though at a sign-in startup it waits up to five seconds for the fetch + * `false`: unless Anthropic requires the settings, Claude Code doesn’t block startup on the fetch, though at a sign-in startup it waits up to five seconds for the fetch * **Default** : `false` managed-settings.json
modified Troubleshoot installation and login View current →
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -1110,6 +1110,28 @@ Once the Keychain is writable again, Claude Code moves the credentials back the next time it writes a credential. To force it now, run `/logout` and then `/login`. Logging out removes all stored credentials, including the plaintext file’s contents, saved MCP server logins, and plugin sensitive values, so expect to re-authorize MCP servers and re-enter plugin secrets afterwards. Logging in again stores your login in the Keychain. +#### + +​ + +Login fails on a network home directory + +When a request fails with `API Error: 401` and your [configuration directory](</docs/en/claude-directory>) is on a network filesystem, check whether that filesystem or your quota on it is full. With no room left, Claude Code can’t save a new or renewed login to the plaintext [`.credentials.json` file](</docs/en/authentication#credential-management>), and `claude auth login` can still print `Login successful.` + +1 + +Make room on the filesystem + +Delete files you no longer need on the filesystem that holds `~/.claude`, or the directory you set in [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>). + +2 + +Sign in again + +Run `/login` at the Claude Code prompt or `claude auth login` in your shell. + +Before v2.1.318, when Claude Code saved the login file on a full network filesystem, it could replace a still-valid stored login with an empty file. Later commands then reported `Not logged in`. + ### ​
modified Agent SDK reference - TypeScript View current →
--- a/typescript.md +++ b/typescript.md @@ -1441,7 +1441,7 @@ | "default" // Standard permission behavior | "acceptEdits" // Auto-accept file edits | "bypassPermissions" // Bypass permission checks; explicit ask rules still prompt - | "plan" // Planning mode - explore without editing + | "plan" // Planning mode - Claude explores and plans | "dontAsk" // Don't prompt for permissions, deny if not pre-approved | "auto"; // A model classifier reviews actions such as shell commands and network requests @@ -1451,7 +1451,12 @@ `CanUseTool` -Custom permission function type for controlling tool usage. The function is the SDK replacement for the interactive permission prompt: it’s invoked only when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Tool calls already approved by an `allowedTools` entry, a settings allow rule, or the permission mode, such as `acceptEdits` or `bypassPermissions`, never invoke it. To gate every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>) instead. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>); see [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for which of them reach the callback and what happens in `dontAsk` and `auto` mode. +Custom permission function type for controlling tool usage. The function replaces the interactive permission prompt. The SDK calls `canUseTool` when the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) resolves to a prompt. Calls approved in either of these ways run without calling `canUseTool`: + + * A call that an `allowedTools` entry or a settings allow rule approves + * A call the permission mode approves, such as a file edit in `acceptEdits` mode + +To check those calls, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which runs for them too. An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>); see [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for which of them reach the callback and what happens in `dontAsk` and `auto` mode. type CanUseTool = ( toolName: string, @@ -2102,6 +2107,7 @@ * A resume that Claude Code stops because it [can’t return the session to its worktree](</docs/en/worktrees#the-session-resumes-outside-its-worktree>), with `worktree_unverified` or `worktree_resume_refused`. That section says which error carries which value. * A refused `continue` of a conversation that a background session holds, with `session_held_by_background`. For a refused `resume` of such a conversation, Claude Code writes the result only when the variable is set. * A start that Claude Code refuses because `failIfUnavailable` is on and the sandbox can’t start, with `sandbox_required_unavailable`. + * A start that Claude Code refuses because `~/.claude.json` isn’t valid JSON, with `config_file_invalid`. The `SDKStartupFailureReason` type lists the values `startup_failure_reason` can hold: @@ -2125,7 +2131,8 @@ | "bypass_root" | "org_config_required_unavailable" | "org_config_refused" - | "sandbox_required_unavailable"; + | "sandbox_required_unavailable" + | "config_file_invalid"; Each value names one refusal: @@ -2151,6 +2158,7 @@ `org_config_required_unavailable`| The session needs the organization’s policies and managed settings before it can start, and they couldn’t be loaded, for example because of a network failure or an Anthropic server error. Requires Agent SDK v0.3.293 or later `org_config_refused`| Anthropic refused to provide the organization’s policies and managed settings for this sign-in, for example because the sign-in expired or was revoked, or the organization doesn’t allow Claude Code for this account. Requires Agent SDK v0.3.293 or later `sandbox_required_unavailable`| `failIfUnavailable` is on and the sandbox can’t start. The text in `errors` ends with `Set sandbox.failIfUnavailable=false to allow unsandboxed execution.` Requires Agent SDK v0.3.314 or later +`config_file_invalid`| `~/.claude.json` isn’t valid JSON. Claude Code leaves the file unchanged, so a retry fails the same way until someone repairs it. `errors` names the file and says how to restore or repair it. See [Configuration error in ~/.claude.json](</docs/en/errors#configuration-error-in-claude-json>). Requires TypeScript Agent SDK v0.3.318 or later and Claude Code v2.1.318 or later ### @@ -6446,7 +6454,7 @@ `httpProxyPort`| `number`| `undefined`| HTTP proxy port for network requests `socksProxyPort`| `number`| `undefined`| SOCKS proxy port for network requests -The built-in sandbox proxy enforces `allowedDomains` based on the requested hostname and does not terminate or inspect TLS traffic, so techniques such as [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) can potentially bypass it. See [Sandboxing security limitations](</docs/en/sandboxing#security-limitations>) for details and [Secure deployment](</docs/en/agent-sdk/secure-deployment#traffic-forwarding>) for configuring a TLS-terminating proxy. +The built-in sandbox proxy enforces `allowedDomains` based on the requested hostname. By default, the proxy doesn’t terminate or inspect TLS traffic, so techniques such as [domain fronting](<https://en.wikipedia.org/wiki/Domain_fronting>) can potentially bypass `allowedDomains`. See [Sandboxing security limitations](</docs/en/sandboxing#security-limitations>) for details and [Secure deployment](</docs/en/agent-sdk/secure-deployment#traffic-forwarding>) for configuring a TLS-terminating proxy. ###
modified Handle approvals and user input View current →
--- a/user-input.md +++ b/user-input.md @@ -33,9 +33,9 @@ The callback fires in two cases: 1. **Tool needs approval** : Claude wants to use a tool that isn’t auto-approved by a [permission rule](</docs/en/agent-sdk/permissions>) or permission mode. Check `tool_name` for the tool (e.g., `"Bash"`, `"Write"`). - 2. **Claude asks a question** : Claude calls the `AskUserQuestion` tool. Check if `tool_name == "AskUserQuestion"` to handle it differently. If you specify a `tools` array, include `AskUserQuestion` for this to work. See Handle clarifying questions for details. - -**The callback never fires for auto-approved tools.** Any approval earlier in the [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>), an allow rule or a mode like `acceptEdits` or `bypassPermissions`, resolves the call before `canUseTool` is consulted. If you list a tool bare in `allowed_tools`, a `canUseTool` check for that tool runs only when the [evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) routes the call back to a prompt, such as an ask rule or `plan` mode. For logic that must apply to every tool call, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which executes before the rest of the flow and can allow, deny, or modify requests.An allow rule doesn’t pre-approve the [actions no mode auto-approves](</docs/en/permission-modes#actions-no-mode-auto-approves>); see [How permissions are evaluated](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) for which of them reach the callback and what happens in `dontAsk` and `auto` mode. + 2. **Claude asks a question** : Claude calls the `AskUserQuestion` tool. Check if `tool_name == "AskUserQuestion"` to handle it differently. If you specify a `tools` array, include `AskUserQuestion` for this to work. For more information, see Handle clarifying questions. + +**An earlier step can allow or deny a call before`canUseTool` runs.** The [permission evaluation flow](</docs/en/agent-sdk/permissions#how-permissions-are-evaluated>) checks deny rules, the permission mode, and allow rules before your callback.To run your checks on calls that a rule or the permission mode already allowed, use a [`PreToolUse` hook](</docs/en/agent-sdk/hooks>), which runs for those calls and can allow, deny, or modify them. You can also use the [`PermissionRequest` hook](</docs/en/agent-sdk/hooks#available-hooks>) to send external notifications (Slack, email, push) when Claude is waiting for approval.