SpyBara
Go Premium

Documentation 2026-11-23 23:59 UTC to 2026-11-24 22:59 UTC

47 files changed +824 −205. View all changes and history on the product overview
2026
Wed 25 11:59 Tue 24 22:59 Mon 23 23:59 Sun 22 22:59 Sat 21 22:57 Fri 20 23:57 Thu 19 23:00 Wed 18 23:59 Tue 17 23:01 Mon 16 23:59 Sat 14 23:57 Fri 13 23:02 Thu 12 23:02 Wed 11 22:59 Tue 10 21:57 Mon 9 23:02 Sun 8 22:58 Sat 7 23:58 Fri 6 23:01 Thu 5 23:03 Wed 4 23:59 Tue 3 23:58 Mon 2 23:57 Sun 1 23:57
Details

940* [`API_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars): how long each request attempt can wait for response headers, in milliseconds. It doesn't limit how long a streaming response runs after the headers arrive. Default `600000`. Applies to the main loop and all subagents.940* [`API_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars): how long each request attempt can wait for response headers, in milliseconds. It doesn't limit how long a streaming response runs after the headers arrive. Default `600000`. Applies to the main loop and all subagents.

941* `CLAUDE_CODE_MAX_RETRIES`: maximum API retries. Default `10`, capped at `15`. Each retry gets its own `API_TIMEOUT_MS` window.941* `CLAUDE_CODE_MAX_RETRIES`: maximum API retries. Default `10`, capped at `15`. Each retry gets its own `API_TIMEOUT_MS` window.

942 942 

943 For unattended runs that need to wait through longer outages, set [`CLAUDE_CODE_RETRY_WATCHDOG=1`](https://code.claude.com/docs/en/errors#tune-retry-behavior): it retries transient capacity errors indefinitely and, on Claude Code v2.1.199 or later, raises the default for other transient errors to `300` and removes the cap on this variable.943 For unattended runs that need to wait through longer outages, set [`CLAUDE_CODE_RETRY_WATCHDOG=1`](https://code.claude.com/docs/en/errors#tune-retry-behavior) to keep retrying transient capacity errors. With `CLAUDE_CODE_RETRY_WATCHDOG` set on v2.1.199 or later, the cap doesn't apply, and the default for other transient errors is `300`.

944* `CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`: stall watchdog for subagents. While the stream watchdog is on, the default is `CLAUDE_STREAM_IDLE_TIMEOUT_MS` plus 5 minutes, which comes to `600000` unless you raise that variable. With the stream watchdog off, the default is `600000`. Before v2.1.257, the default was always `600000`.944* `CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`: stall watchdog for subagents. While the stream watchdog is on, the default is `CLAUDE_STREAM_IDLE_TIMEOUT_MS` plus 5 minutes, which comes to `600000` unless you raise that variable. With the stream watchdog off, the default is `600000`. Before v2.1.257, the default was always `600000`.

945 945 

946 The timer resets on each stream event. On a stall, Claude Code aborts the subagent and reports the stall to the parent. For a background subagent, it also marks the task failed and attaches any partial result.946 The timer resets on each stream event. On a stall, Claude Code aborts the subagent and reports the stall to the parent. For a background subagent, it also marks the task failed and attaches any partial result.

Details

631* [`API_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars): how long each request attempt can wait for response headers, in milliseconds. It doesn't limit how long a streaming response runs after the headers arrive. Default `600000`. Applies to the main loop and all subagents.631* [`API_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars): how long each request attempt can wait for response headers, in milliseconds. It doesn't limit how long a streaming response runs after the headers arrive. Default `600000`. Applies to the main loop and all subagents.

632* `CLAUDE_CODE_MAX_RETRIES`: maximum API retries. Default `10`, capped at `15`. Each retry gets its own `API_TIMEOUT_MS` window.632* `CLAUDE_CODE_MAX_RETRIES`: maximum API retries. Default `10`, capped at `15`. Each retry gets its own `API_TIMEOUT_MS` window.

633 633 

634 For unattended runs that need to wait through longer outages, set [`CLAUDE_CODE_RETRY_WATCHDOG=1`](https://code.claude.com/docs/en/errors#tune-retry-behavior): it retries transient capacity errors indefinitely and, on Claude Code v2.1.199 or later, raises the default for other transient errors to `300` and removes the cap on this variable.634 For unattended runs that need to wait through longer outages, set [`CLAUDE_CODE_RETRY_WATCHDOG=1`](https://code.claude.com/docs/en/errors#tune-retry-behavior) to keep retrying transient capacity errors. With `CLAUDE_CODE_RETRY_WATCHDOG` set on v2.1.199 or later, the cap doesn't apply, and the default for other transient errors is `300`.

635* `CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`: stall watchdog for subagents. While the stream watchdog is on, the default is `CLAUDE_STREAM_IDLE_TIMEOUT_MS` plus 5 minutes, which comes to `600000` unless you raise that variable. With the stream watchdog off, the default is `600000`. Before v2.1.257, the default was always `600000`.635* `CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS`: stall watchdog for subagents. While the stream watchdog is on, the default is `CLAUDE_STREAM_IDLE_TIMEOUT_MS` plus 5 minutes, which comes to `600000` unless you raise that variable. With the stream watchdog off, the default is `600000`. Before v2.1.257, the default was always `600000`.

636 636 

637 The timer resets on each stream event. On a stall, Claude Code aborts the subagent and reports the stall to the parent. For a background subagent, it also marks the task failed and attaches any partial result.637 The timer resets on each stream event. On a stall, Claude Code aborts the subagent and reports the stall to the parent. For a background subagent, it also marks the task failed and attaches any partial result.

agent-view.md +7 −1

Details

239 239 

240Press `Enter` or `→` on a selected row to attach. Agent view is replaced by the full interactive session. When you attach, Claude posts a short recap of what happened while you were away.240Press `Enter` or `→` on a selected row to attach. Agent view is replaced by the full interactive session. When you attach, Claude posts a short recap of what happened while you were away.

241 241 

242While attached, the session behaves like any other Claude Code session: [commands](https://code.claude.com/docs/en/commands.md), keyboard shortcuts, and features all work, with the exceptions below.242While you're attached, [commands](https://code.claude.com/docs/en/commands.md), keyboard shortcuts, and features all work, with the exceptions below. A [`/ship` or `/steward` watch](https://code.claude.com/docs/en/ship-command-troubleshooting#a-session-setting-blocks-a-watch) doesn't start in a background session.

243 243 

244While you're attached, `/install-github-app` and the [`/mcp`](https://code.claude.com/docs/en/mcp) settings list work normally, since a human at the terminal can complete their dialogs. When nobody is attached, these commands can't open their dialogs, so the session appears under `Needs input` in agent view with a row such as `open this session to manage MCP servers`, and the transcript reply says the same. Attach and run the command again to continue; the needs-input row clears when you attach. `/mcp reconnect <server>`, `/mcp enable`, and `/mcp disable` work without attaching either way.244While you're attached, `/install-github-app` and the [`/mcp`](https://code.claude.com/docs/en/mcp) settings list work normally, since a human at the terminal can complete their dialogs. When nobody is attached, these commands can't open their dialogs, so the session appears under `Needs input` in agent view with a row such as `open this session to manage MCP servers`, and the transcript reply says the same. Attach and run the command again to continue; the needs-input row clears when you attach. `/mcp reconnect <server>`, `/mcp enable`, and `/mcp disable` work without attaching either way.

245 245 


445 445 

446Run `/background` or its alias `/bg` to move the current conversation into a background session. Pass a prompt such as `/bg run the test suite and fix any failures` to give one more instruction first. If Claude is responding when you run `/bg`, the response continues in the background session.446Run `/background` or its alias `/bg` to move the current conversation into a background session. Pass a prompt such as `/bg run the test suite and fix any failures` to give one more instruction first. If Claude is responding when you run `/bg`, the response continues in the background session.

447 447 

448> [!NOTE]

449>

450> While a [`/ship` or `/steward` watch](https://code.claude.com/docs/en/ship-command) is on, `/bg` leaves the session in the foreground and prints the reason. See [Messages during a watch](https://code.claude.com/docs/en/ship-command-troubleshooting.md#messages-during-a-watch).

451 

448If you exit a session while some kinds of background work are running, such as subagents or workflows, a `Background work is running` dialog warns that the work stops. Choose `Move to background and exit` to background the session the same way `/background` does and return to your shell. The option isn't shown when agent view is [turned off](#turn-off-agent-view).452If you exit a session while some kinds of background work are running, such as subagents or workflows, a `Background work is running` dialog warns that the work stops. Choose `Move to background and exit` to background the session the same way `/background` does and return to your shell. The option isn't shown when agent view is [turned off](#turn-off-agent-view).

449 453 

450If a background session on the list already has the conversation's name, Claude Code numbers the new row's name, such as `my-session (2)`, and leaves the existing row's name alone. To rename the new row, select it in agent view and press `Ctrl+R`.454If a background session on the list already has the conversation's name, Claude Code numbers the new row's name, such as `my-session (2)`, and leaves the existing row's name alone. To rename the new row, select it in agent view and press `Ctrl+R`.


1052 1056 

1053| Version | Change |1057| Version | Change |

1054| - | - |1058| - | - |

1059| v2.1.331 | A [`/ship` or `/steward` watch](https://code.claude.com/docs/en/ship-command-troubleshooting#a-session-setting-blocks-a-watch) doesn't start in a background session. Before this release, one can start there. |

1060| v2.1.331 | [`/background`](#send-the-session-to-the-background) doesn't move a session to the background while a `/ship` or `/steward` watch is on. Before this release, the session moves and the watch ends. |

1055| v2.1.323 | In agent view's input, [`Ctrl+Y`](#keyboard-shortcuts) restores cleared text. |1061| v2.1.323 | In agent view's input, [`Ctrl+Y`](#keyboard-shortcuts) restores cleared text. |

1056| v2.1.299 | [`/effort` and `/fast` in the dispatch input](#set-the-model-effort-and-fast-mode) set the effort level and fast mode for the sessions you dispatch next. `/model`, `/effort`, or `/fast` typed with no value opens a picker. |1062| v2.1.299 | [`/effort` and `/fast` in the dispatch input](#set-the-model-effort-and-fast-mode) set the effort level and fast mode for the sessions you dispatch next. `/model`, `/effort`, or `/fast` typed with no value opens a picker. |

1057| v2.1.299 | Claude Code [reads `--bg` and `--background` as the flag](#from-your-shell) only before any bare `--` separator and outside another flag's value, and refuses an ambiguous position instead of guessing. Before this release, a prompt or reply of `--bg` or `--background` to a background session could be taken for the flag. That could start new background sessions over and over instead of delivering the text. |1063| v2.1.299 | Claude Code [reads `--bg` and `--background` as the flag](#from-your-shell) only before any bare `--` separator and outside another flag's value, and refuses an ambiguous position instead of guessing. Before this release, a prompt or reply of `--bg` or `--background` to a background session could be taken for the flag. That could start new background sessions over and over instead of delivering the text. |

Details

11View plans11View plans

12Contact sales12Contact sales

13 13 

14This page covers setting up Amazon Bedrock for the Claude Code CLI and IDE extensions.

15 

16> [!NOTE]

17>

18> To use Amazon Bedrock in the **Code** tab of the Claude Desktop app, you or your administrator configures the app:

19>

20> * **Your organization installed the app**: ask your administrator to [configure it for Amazon Bedrock](https://claude.com/docs/third-party/claude-desktop/bedrock)

21> * **You install the app yourself**: follow the [single-machine setup steps](https://claude.com/docs/third-party/claude-desktop/installation#single-machine-setup) and enter the [connection and model values for Amazon Bedrock](https://claude.com/docs/third-party/claude-desktop/bedrock#configure-the-app)

22 

14## Prerequisites23## Prerequisites

15 24 

16Before configuring Claude Code with Amazon Bedrock, ensure you have:25Before configuring Claude Code with Amazon Bedrock, ensure you have:

approvals.md +6 −1

Details

26 26 

27Approvals adds a check named **Claude Approvals** to the pull requests that it evaluates. The check's title says what's still needed, such as **Waiting on human review from any person (1/2)**. A title that starts with **(observe mode)** means that the policy wasn't enforced when the check ran. In [observe mode](#set-up-claude-approvals), the check shows what your policy would decide.27Approvals adds a check named **Claude Approvals** to the pull requests that it evaluates. The check's title says what's still needed, such as **Waiting on human review from any person (1/2)**. A title that starts with **(observe mode)** means that the policy wasn't enforced when the check ran. In [observe mode](#set-up-claude-approvals), the check shows what your policy would decide.

28 28 

29Claude also posts a comment with the reasons. Where the policy allows it, Claude can post an approving review. For the common titles and what to do about each, see [Find your approval status and what to do next](https://code.claude.com/docs/en/approvals-pull-requests.md#find-your-approval-status-and-what-to-do-next). If a pull request has no check, see [No Claude Approvals check appeared](https://code.claude.com/docs/en/approvals-troubleshooting.md#no-claude-approvals-check-appeared).29Claude also posts a comment with the reasons. Where the policy allows it, Claude can post an approving review:

30 

31* **In github.com repositories where the Claude GitHub App reports the check**: that review comes from `claude[bot]`

32* **On a pull request that `claude[bot]` opened**: that review comes from `claude-approvals[bot]`, once you add the [Claude Approvals GitHub App](https://code.claude.com/docs/en/approvals-pull-requests.md#pull-requests-that-claude-opens)

33 

34For the common titles and what to do about each, see [Find your approval status and what to do next](https://code.claude.com/docs/en/approvals-pull-requests.md#find-your-approval-status-and-what-to-do-next). If a pull request has no check, see [No Claude Approvals check appeared](https://code.claude.com/docs/en/approvals-troubleshooting.md#no-claude-approvals-check-appeared).

30 35 

31## Example policy36## Example policy

32 37 

Details

29 29 

30Both also name `claude/code_review`. Keep it in your policy file. Once the file is on the default branch, in observe mode or enforced, automatic Code Reviews normally stop where no matching rule names it.30Both also name `claude/code_review`. Keep it in your policy file. Once the file is on the default branch, in observe mode or enforced, automatic Code Reviews normally stop where no matching rule names it.

31 31 

32> [!TIP]

33>

34> To have Claude write or change a policy file for you, type [`/claude-approvals`](https://code.claude.com/docs/en/commands) at the Claude Code prompt in your repository, followed by what you want. Requires Claude Code v2.1.331 or later and [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching).

35 

32### Let Claude approve when Code Review passes36### Let Claude approve when Code Review passes

33 37 

34Once this starter policy is enforced, a pull request that passes Claude's review usually needs no approval from another person, except for changes under `.claude/`. Other pull requests usually need one person [besides the author](https://code.claude.com/docs/en/approvals-policy.md#whether-a-pull-request’s-author-counts).38Once this starter policy is enforced, a pull request that passes Claude's review usually needs no approval from another person, except for changes under `.claude/`. Other pull requests usually need one person [besides the author](https://code.claude.com/docs/en/approvals-policy.md#whether-a-pull-request’s-author-counts).

Details

34| :- | :- |34| :- | :- |

35| Approvals "did not run on this change" | Do what the comment says. One cause is a pull request that moves a file into or out of the paths that the policy's rules cover. Make that move in two pull requests, one that adds the file under its new name and one that removes the old one |35| Approvals "did not run on this change" | Do what the comment says. One cause is a pull request that moves a file into or out of the paths that the policy's rules cover. Make that move in two pull requests, one that adds the file under its new name and one that removes the old one |

36| "More than one Claude organization is connected to this GitHub account" | Ask an Owner of the Claude organization that should run Approvals to click **Connect** next to the repository's GitHub organization on [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship). Then push a commit |36| "More than one Claude organization is connected to this GitHub account" | Ask an Owner of the Claude organization that should run Approvals to click **Connect** next to the repository's GitHub organization on [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship). Then push a commit |

37| "Claude Approvals can't start in this repository yet" | Tell an Owner that the organization has no usage credits available |

38 37 

39### Ask an Owner to check your Claude organization38### Ask an Owner to check your Claude organization

40 39 


46| Whether the [Claude GitHub App](https://github.com/apps/claude) can access the repository and is linked | [**Organization settings > Git providers**](https://claude.ai/admin-settings/source-control) |45| Whether the [Claude GitHub App](https://github.com/apps/claude) can access the repository and is linked | [**Organization settings > Git providers**](https://claude.ai/admin-settings/source-control) |

47| Whether Approvals is turned off here | The **Approvals** column and the **Approve** row on [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship) |46| Whether Approvals is turned off here | The **Approvals** column and the **Approve** row on [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship) |

48 47 

48### Check for a GitHub IP allow list

49 

50GitHub refuses Approvals' requests from an address that isn't on an organization's IP allow list, which can leave no check or comment.

51 

52Ask an owner of the repository's GitHub organization or enterprise whether it restricts access by IP address. If it does, ask the owner to allow all of Anthropic's outbound addresses, as [GitHub allow lists and firewalls](https://code.claude.com/docs/en/network-config.md#github-allow-lists-and-firewalls) describes. Once the addresses are allowed, push a commit to your pull request.

53 

49## Approvals doesn't pass after you resolve a review thread54## Approvals doesn't pass after you resolve a review thread

50 55 

51Check whether your policy's [`findings`](https://code.claude.com/docs/en/approvals-policy#findings) list names you.56Check whether your policy's [`findings`](https://code.claude.com/docs/en/approvals-policy#findings) list names you.

Details

563| `region` | Yes | AWS region. The gateway derives the endpoint from it as `https://bedrock-mantle.<region>.api.aws/anthropic`. |563| `region` | Yes | AWS region. The gateway derives the endpoint from it as `https://bedrock-mantle.<region>.api.aws/anthropic`. |

564| `models` | Yes | The models your AWS account has been granted on Mantle, named as clients send them, such as `claude-haiku-4-5`. Only these go to this upstream, and every other model skips to the next one. |564| `models` | Yes | The models your AWS account has been granted on Mantle, named as clients send them, such as `claude-haiku-4-5`. Only these go to this upstream, and every other model skips to the next one. |

565| `auth` | No | Takes the same keys as the [Amazon Bedrock](#amazon-bedrock) upstream's `auth` block, under the same rules. |565| `auth` | No | Takes the same keys as the [Amazon Bedrock](#amazon-bedrock) upstream's `auth` block, under the same rules. |

566| `assume_role` | No | The role that this upstream's requests go through, with the same keys as [on a `bedrock` upstream](#bedrock-in-another-aws-account), including `session_name` for [per-developer attribution](#per-developer-aws-cost-attribution). Give the role Mantle's IAM actions. Requires a gateway running Claude Code v2.1.318 or later. An earlier gateway exits at startup with `Unrecognized key(s) in object: 'assume_role'`. |566| `assume_role` | No | The role that this upstream's requests go through, with the same keys as [on a `bedrock` upstream](#bedrock-in-another-aws-account), including `session_name` for [per-developer attribution](#per-developer-aws-cost-attribution). Requires a gateway running Claude Code v2.1.318 or later. An earlier gateway exits at startup with `Unrecognized key(s) in object: 'assume_role'`. |

567| `base_url` | No | Override the derived endpoint. Keep the `/anthropic` path at the end. |567| `base_url` | No | Override the derived endpoint. Keep the `/anthropic` path at the end. |

568 568 

569Grant the upstream's AWS identity Mantle's own IAM actions for inference and token counting, which [Use the Mantle endpoint](https://code.claude.com/docs/en/amazon-bedrock.md#use-the-mantle-endpoint) lists.569Grant [Mantle's IAM actions](https://code.claude.com/docs/en/amazon-bedrock.md#use-the-mantle-endpoint) to the `assume_role` role if you set one, otherwise to the upstream's AWS identity.

570 570 

571For a Mantle model ID that the gateway doesn't know, add an entry to the top-level [`models:`](#models) block whose `upstream_model` maps this upstream's name to that ID. Then put that entry's `id` in this upstream's `models` field too.571For a Mantle model ID that the gateway doesn't know, add an entry to the top-level [`models:`](#models) block whose `upstream_model` maps this upstream's name to that ID. Then put that entry's `id` in this upstream's `models` field too.

572 572 

Details

447| On an upstream other than `provider: anthropic`, a turn with a long thinking pause fails. The proxy in front of the gateway logs one or two requests, each 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](#long-thinking-ends-in-proxy-timeouts). |447| On an upstream other than `provider: anthropic`, a turn with a long thinking pause fails. The proxy in front of the gateway logs one or two requests, each 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](#long-thinking-ends-in-proxy-timeouts). |

448| On `provider: anthropic`, a turn with a long thinking pause fails. The proxy logs one or two requests, each 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. Each reply takes longer than the gateway's `timeouts.upstream_ttfb_ms` wait or the proxy's timeout. | Raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for your developers. See [Long thinking on an Anthropic API upstream](#long-thinking-on-an-anthropic-api-upstream). |448| On `provider: anthropic`, a turn with a long thinking pause fails. The proxy logs one or two requests, each 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. Each reply takes longer than the gateway's `timeouts.upstream_ttfb_ms` wait or the proxy's timeout. | Raise `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for your developers. See [Long thinking on an Anthropic API upstream](#long-thinking-on-an-anthropic-api-upstream). |

449| A developer's requests fail with `API Error: 400 you aren't in a group that can use this gateway. Ask your administrator to add you to one` | Every upstream has a [`groups` list](https://code.claude.com/docs/en/claude-apps-gateway-config#what-happens-when-a-developer-is-in-no-listed-group), and the developer's session carries none of the listed groups. | Add the developer to a listed group in your IdP, or list an upstream with no `groups` last to serve everyone else. The gateway reads groups again at the developer's next token refresh. If the IdP left groups out and its userinfo endpoint returns them, set [`oidc.userinfo_fallback: true`](https://code.claude.com/docs/en/claude-apps-gateway-config#oidc). |449| A developer's requests fail with `API Error: 400 you aren't in a group that can use this gateway. Ask your administrator to add you to one` | Every upstream has a [`groups` list](https://code.claude.com/docs/en/claude-apps-gateway-config#what-happens-when-a-developer-is-in-no-listed-group), and the developer's session carries none of the listed groups. | Add the developer to a listed group in your IdP, or list an upstream with no `groups` last to serve everyone else. The gateway reads groups again at the developer's next token refresh. If the IdP left groups out and its userinfo endpoint returns them, set [`oidc.userinfo_fallback: true`](https://code.claude.com/docs/en/claude-apps-gateway-config#oidc). |

450| A `400` that starts with a field path, such as `tools.0.model:`, and contains `is not in your role's availableModels allowlist`, `is blocked by your role's deniedModels denylist`, `is not in the operator's model allowlist`, or `refused by this gateway:` | The gateway refused that field's model or value | To allow the model, edit the list the message names in the [`managed`](https://code.claude.com/docs/en/claude-apps-gateway-config#managed) policy that sets the developer's list. For `deniedModels`, edit every policy that applies. For the operator's allowlist, edit [`models`](https://code.claude.com/docs/en/claude-apps-gateway-config#models). For `refused by this gateway:`, have the developer fix the request field at that path. |

450| IdP error: unknown or unsupported scope | The IdP rejects scopes it doesn't recognize | Set `oidc.scopes` to exactly the list your IdP accepts; it must include `openid`. The default is `openid profile email offline_access`. |451| IdP error: unknown or unsupported scope | The IdP rejects scopes it doesn't recognize | Set `oidc.scopes` to exactly the list your IdP accepts; it must include `openid`. The default is `openid profile email offline_access`. |

451| Sessions don't silently renew after setting `oidc.scopes` | `offline_access` was dropped from the override | Add `offline_access` back if your IdP supports it. Without a refresh token, developers re-run the browser login every `session.ttl_hours`. |452| Sessions don't silently renew after setting `oidc.scopes` | `offline_access` was dropped from the override | Add `offline_access` back if your IdP supports it. Without a refresh token, developers re-run the browser login every `session.ttl_hours`. |

452| Browser shows "This request came from another site and was blocked" | Cross-site form POST, blocked as CSRF protection. Expected for embedded or proxied pages | Open the verification link directly |453| Browser shows "This request came from another site and was blocked" | Cross-site form POST, blocked as CSRF protection. Expected for embedded or proxied pages | Open the verification link directly |

Details

285 285 

286* **`/model`, `/effort`, `/color`, and `/rename`**: pass the value as an argument, for example `/model sonnet`, instead of opening the terminal picker or slider. The argument forms follow each command's [availability notes](https://code.claude.com/docs/en/commands.md#all-commands).286* **`/model`, `/effort`, `/color`, and `/rename`**: pass the value as an argument, for example `/model sonnet`, instead of opening the terminal picker or slider. The argument forms follow each command's [availability notes](https://code.claude.com/docs/en/commands.md#all-commands).

287* **`/fast`**: toggles [fast mode](https://code.claude.com/docs/en/fast-mode.md#use-fast-mode-in-cloud-sessions) for the session when fast mode is [available on your account](https://code.claude.com/docs/en/fast-mode.md#requirements). Requires Claude Code v2.1.271 or later in the session's environment.287* **`/fast`**: toggles [fast mode](https://code.claude.com/docs/en/fast-mode.md#use-fast-mode-in-cloud-sessions) for the session when fast mode is [available on your account](https://code.claude.com/docs/en/fast-mode.md#requirements). Requires Claude Code v2.1.271 or later in the session's environment.

288* **`/config`**: in your browser at claude.ai/code, opens **Settings > Code** or **Settings > Claude Code** instead of setting a value. To change a setting for a cloud session, set an [environment variable](https://code.claude.com/docs/en/cloud-environments.md#set-environment-variables) on the environment. In a session with one repository outside a [project](https://code.claude.com/docs/en/claude-projects.md)'s threads, commit the key to that repository's `.claude/settings.json` instead. [Settings in cloud sessions](https://code.claude.com/docs/en/settings.md#settings-in-cloud-sessions) lists what each session reads.288* **`/config`**: in your browser at claude.ai/code, opens **Settings > Code** instead of setting a value. To change a setting for a cloud session, set an [environment variable](https://code.claude.com/docs/en/cloud-environments.md#set-environment-variables) on the environment. In a session with one repository outside a [project](https://code.claude.com/docs/en/claude-projects.md)'s threads, commit the key to that repository's `.claude/settings.json` instead. [Settings in cloud sessions](https://code.claude.com/docs/en/settings.md#settings-in-cloud-sessions) lists what each session reads.

289 289 

290For context management in a cloud session outside a [project's threads](https://code.claude.com/docs/en/claude-projects.md#choose-models-and-let-claude-manage-context):290For context management in a cloud session outside a [project's threads](https://code.claude.com/docs/en/claude-projects.md#choose-models-and-let-claude-manage-context):

291 291 


467 467 

468Reopen the session from [claude.ai/code](https://claude.ai/code) to provision a fresh VM:468Reopen the session from [claude.ai/code](https://claude.ai/code) to provision a fresh VM:

469 469 

470* **Restored**: your conversation history470* **Restored**: your conversation history, and tracking of [MCP tasks](https://code.claude.com/docs/en/mcp.md#mcp-task-results-in-the-cloud) still running on a connector

471* **Not restored**: background work that was still running or pending when the VM was reclaimed, including:471* **Not restored**: other background work that was still running or pending when the VM was reclaimed, including:

472 * **Shell commands**: Claude Code tells Claude which commands stopped. Ask Claude to rerun the ones you still need.472 * **Shell commands**: Claude Code tells Claude which commands stopped. Ask Claude to rerun the ones you still need.

473 * **Subagents**: Claude Code tells Claude which subagents stopped, and which of those can be [resumed](https://code.claude.com/docs/en/sub-agents.md#resume-subagents) instead of started over. Ask Claude to continue their work.473 * **Subagents**: Claude Code tells Claude which subagents stopped, and which of those can be [resumed](https://code.claude.com/docs/en/sub-agents.md#resume-subagents) instead of started over. Ask Claude to continue their work.

474 * **Session-scoped scheduled tasks**: tasks you [scheduled in the session](https://code.claude.com/docs/en/scheduled-tasks.md) and a `/loop` waiting for its next iteration don't carry over to the reopened session. Ask Claude to schedule the tasks again, or run `/loop` again to restart the loop.474 * **Session-scoped scheduled tasks**: tasks you [scheduled in the session](https://code.claude.com/docs/en/scheduled-tasks.md) and a `/loop` waiting for its next iteration don't carry over to the reopened session. Ask Claude to schedule the tasks again, or run `/loop` again to restart the loop.

Details

64A workspace API key is a long-lived secret, useful when you don't want to manage federated AWS credentials. Generate one in the AWS Console under **Claude Platform on AWS → API keys** and set it as `ANTHROPIC_AWS_API_KEY`:64A workspace API key is a long-lived secret, useful when you don't want to manage federated AWS credentials. Generate one in the AWS Console under **Claude Platform on AWS → API keys** and set it as `ANTHROPIC_AWS_API_KEY`:

65 65 

66```bash theme={null}66```bash theme={null}

67export ANTHROPIC_AWS_API_KEY=sk-ant-xxxxx67export ANTHROPIC_AWS_API_KEY=your-workspace-api-key

68```68```

69 69 

70The key is sent as `x-api-key` and takes precedence over SigV4, so any AWS credentials in your environment are ignored. API keys from a separate Claude Console organization won't work here.70The key is sent as `x-api-key` and takes precedence over SigV4, so any AWS credentials in your environment are ignored. API keys from a separate Claude Console organization won't work here.

claude-security.md +208 −35

Details

6 6 

7> Install the Claude Security plugin to scan your codebase for vulnerabilities in a Claude Code session and turn findings into patches you review and apply.7> Install the Claude Security plugin to scan your codebase for vulnerabilities in a Claude Code session and turn findings into patches you review and apply.

8 8 

9The Claude Security plugin runs a multi-agent vulnerability scan of your codebase inside a Claude Code session. [By default](#choose-a-scan-effort), when you scan a whole repository, Claude agents map your architecture, build a threat model, hunt for vulnerabilities, and independently review every finding before writing the report.9The Claude Security plugin runs a multi-agent vulnerability scan of your codebase inside a Claude Code session. [By default](#choose-a-scan-effort), when you scan a whole repository, Claude agents map your architecture, hunt for vulnerabilities, and independently review every finding before writing the report.

10 10 

11Use the plugin to scan a whole repository or [only a set of changes](#scan-only-your-changes), such as a branch's diff, a pull request's diff, or a single commit, then turn the findings you choose into patches that you review and apply yourself.11Use the plugin to scan a whole repository or [only a set of changes](#scan-only-your-changes), such as a branch's diff, a pull request's diff, or a single commit. Then turn the findings you choose into patches that you review and apply yourself. Scan only code that you own or have permission to test.

12 12 

13The plugin runs locally in your session, uses [whichever models you have access to in Claude Code](#models-and-providers), and each scan counts toward your [usage](https://code.claude.com/docs/en/costs.md). If you want a managed service that monitors your repositories, or want to run scans on [Claude Mythos](https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5-and-claude-mythos-5), see the [Claude Security](https://claude.com/product/claude-security) product, available on the Enterprise plan.13Run a scan in your session, your shell, or GitHub Actions:

14 14 

15The plugin is also distinct from the review tools already in Claude Code: the [security guidance plugin](https://code.claude.com/docs/en/security-guidance.md) reviews code as Claude writes it, [`/security-review`](https://code.claude.com/docs/en/commands#all-commands) runs a single pass over your branch, and [Code Review](https://code.claude.com/docs/en/code-review.md) reviews pull requests. For how the layers stack, see [How the plugin fits with other security tools](#how-the-plugin-fits-with-other-security-tools).15* **In your session**: [scan and fix your codebase](#scan-and-fix-your-codebase) with [whichever models you have access to in Claude Code](#models-and-providers)

16* **From your shell**: use the [`claude-security` command](#scan-from-your-shell)

17* **In GitHub Actions**: add the plugin's job to [scan pull requests](#scan-pull-requests-in-github-actions)

18 

19A scan in your session or shell counts toward your [usage](https://code.claude.com/docs/en/costs.md), and a scan in GitHub Actions counts toward the account that owns the job's model credential.

20 

21> [!NOTE]

22>

23> If you want a managed service that monitors your repositories, or want to run scans on [Claude Mythos](https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5-and-claude-mythos-5), see the [Claude Security](https://claude.com/product/claude-security) product, available on the Enterprise plan.

24 

25The plugin is also distinct from review tools already in Claude Code: the [security guidance plugin](https://code.claude.com/docs/en/security-guidance.md) reviews code as Claude writes it, and [Code Review](https://code.claude.com/docs/en/code-review.md) reviews pull requests. For how the layers stack, see [How the plugin fits with other security tools](#how-the-plugin-fits-with-other-security-tools).

16 26 

17## Prerequisites27## Prerequisites

18 28 

19To run the plugin, you need:29To run the plugin, you need:

20 30 

21* A paid plan, Anthropic API access, or a [third-party provider](#models-and-providers), for the [dynamic workflows](https://code.claude.com/docs/en/workflows.md) the scan uses to orchestrate its agents. On Pro, turn them on from the Dynamic workflows row in `/config`.31* A paid plan, Anthropic API access, or a [third-party provider](#models-and-providers), for the [dynamic workflows](https://code.claude.com/docs/en/workflows.md) the scan uses to orchestrate its agents. On Pro, turn them on from the Dynamic workflows row in `/config`.

22* Python 3.9 or later available on your `PATH` as `python3`. Check with `python3 --version`. The plugin's tooling uses only the Python standard library, so nothing is installed.32* Python 3.9 or later available on your `PATH` as `python3`. Check with `python3 --version`. The plugin's tooling uses only the Python standard library.

23* Linux, macOS, or Windows.33* Linux, macOS, or Windows.

24* Git, for change scans and for turning findings into patches; those jobs don't support other version control systems. A full scan works in any directory, with or without version control.34* Git, for change scans and for turning findings into patches; those jobs don't support other version control systems. A full scan works in any directory, with or without version control.

25 35 

26## Models and providers36## Models and providers

27 37 

28A scan runs inside your Claude Code session. The plugin makes no model calls of its own, so there's no separate API key or provider setting to configure.38The plugin makes no model calls of its own, so a scan in your session needs no separate API key or provider setting.

29 39 

30* **Model**: the agents that hunt for vulnerabilities, verify findings, and write and review patches run on [your session's model](https://code.claude.com/docs/en/sub-agents.md#choose-a-model). To change it, run [`/model`](https://code.claude.com/docs/en/model-config#setting-your-model) in your session before you start a scan. A few supporting steps, such as mapping the repository, use the [`sonnet` alias](https://code.claude.com/docs/en/model-config#model-aliases) instead.40* **Model**: the agents that hunt for vulnerabilities, verify findings, and write and review patches run on [your session's model](https://code.claude.com/docs/en/sub-agents.md#choose-a-model). To change it, run [`/model`](https://code.claude.com/docs/en/model-config#setting-your-model) in your session before you start a scan. A few supporting steps use the [`sonnet` alias](https://code.claude.com/docs/en/model-config#model-aliases) instead.

31* **Provider**: scans run on a paid plan, with Anthropic API access, or on a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md) such as [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md), or [Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md).41* **Provider**: scans run on a paid plan, with Anthropic API access, or on a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md) such as [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md), or [Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md).

32 42 

33On a third-party provider, the `sonnet` alias can resolve to a different version than it does on the Anthropic API. If your account can't use that version, [pin your model versions](https://code.claude.com/docs/en/model-config.md#pin-models-for-third-party-deployments), including `ANTHROPIC_DEFAULT_SONNET_MODEL`.43On a third-party provider, the `sonnet` alias can resolve to a different version than it does on the Anthropic API. If your account can't use that version, [pin your model versions](https://code.claude.com/docs/en/model-config.md#pin-models-for-third-party-deployments), including `ANTHROPIC_DEFAULT_SONNET_MODEL`.


36 46 

37## Install the plugin47## Install the plugin

38 48 

39In the VS Code extension or the desktop app, install it by following [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin). In a terminal, start Claude Code by running `claude`, then enter this at its prompt to install from the [official Anthropic marketplace](https://code.claude.com/docs/en/plugins/anthropic-marketplaces.md):49In the VS Code extension or the desktop app, install it by following [Install a plugin](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin).

50 

51In a terminal, start Claude Code by running `claude`, then enter this at its prompt to install from the [official Anthropic marketplace](https://code.claude.com/docs/en/plugins/anthropic-marketplaces.md):

40 52 

41```text theme={null}53```text theme={null}

42/plugin install claude-security@claude-plugins-official54/plugin install claude-security@claude-plugins-official

43```55```

44 56 

45The command opens the plugin's details, where you choose an [installation scope](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin) to start the install.57The command opens the plugin's details, where you choose an [installation scope](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin) to start the install. Choose user scope to have the plugin in every project.

46 58 

47If the install fails, match the message Claude Code reports:59If the install fails, match the message Claude Code reports:

48 60 


55 67 

56### Update the plugin68### Update the plugin

57 69 

70If a command or option doesn't work, [check](https://code.claude.com/docs/en/plugins/install.md#install-a-plugin) that you have version 0.13.0 or later of the plugin.

71 

58To update the plugin yourself, see [Update plugins now](https://code.claude.com/docs/en/plugins/install.md#update-plugins-now). Claude Code also [updates the plugin automatically](https://code.claude.com/docs/en/plugins/install.md#keep-plugins-updated) unless auto-update is turned off.72To update the plugin yourself, see [Update plugins now](https://code.claude.com/docs/en/plugins/install.md#update-plugins-now). Claude Code also [updates the plugin automatically](https://code.claude.com/docs/en/plugins/install.md#keep-plugins-updated) unless auto-update is turned off.

59 73 

60### Uninstall the plugin74### Uninstall the plugin


63 77 

64## Scan and fix your codebase78## Scan and fix your codebase

65 79 

66The plugin adds one command, `/claude-security`, which opens a menu of its three jobs: scanning the codebase, scanning a set of changes, and suggesting patches. The happy path runs a full scan, then turns its findings into patches:80At the Claude Code prompt, `/claude-security` opens a menu of jobs, such as scanning the codebase, scanning a set of changes, and suggesting patches. The happy path runs a full scan, then turns its findings into patches:

67 81 

68**1. Open the Claude Security menu**82**1. Start from a clean working tree**

69 83 

70Run `/claude-security` and pick **Scan codebase**.84If you want patches later, commit all your changes and untracked files, or stash them with `git stash -u` from your shell until the scan ends.

71 85 

72**2. Choose what to scan**86**2. Open the Claude Security menu**

87 

88Start Claude Code in your repository, run `/claude-security`, and pick **Scan codebase**.

89 

90**3. Choose what to scan**

73 91 

74The plugin reads your repository first, then offers the whole repository or a focused area. Pick the whole repository, or answer "I don't know" and the plugin picks a sensible default for your repository's size.92The plugin reads your repository first, then offers the whole repository or a focused area. Pick the whole repository, or answer "I don't know" and the plugin picks a sensible default for your repository's size.

75 93 

76**3. Confirm the run**94**4. Confirm the run**

77 95 

78A scan may take a while, may use a significant number of tokens, and needs Claude Code left open while it completes. Nothing runs until you confirm.96A scan may take a while, may use a significant number of tokens, and needs Claude Code left open while it completes. Nothing runs until you confirm.

79 97 

80**4. Read the report**98**5. Read the report**

99 

100When the scan starts in a terminal session, the plugin's [live view](#watch-a-running-scan), on by default, opens with a live map of the code. You can also follow each stage with [`/workflows`](https://code.claude.com/docs/en/workflows#watch-the-run) in the terminal. Results are written to a timestamped directory in the folder where you started Claude Code, described in [Read the scan results](#read-the-scan-results).

101 

102**6. Turn findings into patches**

103 

104Run `/claude-security` again and pick **Suggest patches**, then choose which findings to address. Reviewed patches are written to the report's `patches/` folder; [Fix findings](#fix-findings) covers how each patch is built and reviewed, and what to check afterward.

81 105 

82While the scan runs, it reports each stage as it starts, with the detail available under [`/workflows`](https://code.claude.com/docs/en/workflows). Results are written to a timestamped directory in your repository, described in [Read the scan results](#read-the-scan-results).106**7. Apply the patches you accept**

83 107 

84**5. Turn findings into patches**108Read each patch's [note](#patches-are-never-applied-automatically), then apply the patch from your shell at the root of your repository with `git apply`, in its own pull request. Patches aren't applied automatically.

85 109 

86Run `/claude-security` again and pick **Suggest patches**, then choose which findings to address. Reviewed patches are written to the report's `patches/` folder; [Fix findings](#fix-findings) covers how each patch is built and reviewed.110You can also ask for a job directly, as arguments to the command, such as `/claude-security scan my branch`. Or ask in plain language, such as "scan the whole repo with the Claude Security plugin". The plugin works best in [auto mode](https://code.claude.com/docs/en/permission-modes.md), which lets the scan proceed without a permission prompt at each step.

87 111 

88**6. Apply the patches you accept**112### Watch a running scan

89 113 

90Apply each patch from your shell with `git apply`, in its own pull request. Patches are never applied automatically.114When you start a scan in a terminal session, the plugin's [mod](https://code.claude.com/docs/en/plugins/mods/overview.md) opens a live view of the scan in a pane or a band above the prompt. You need Claude Code v2.1.292 or later.

91 115 

92You don't have to start from the menu: ask for a job directly, as arguments to the command, such as `/claude-security scan my branch`, or in plain language, such as "scan commit abc1234". The plugin works best in [auto mode](https://code.claude.com/docs/en/permission-modes.md), which lets the scan's agents proceed without a permission prompt at each step.116* **Close it**: press `Ctrl+X X` to shrink the pane to a band, and again to hide the band

117* **Reopen it**: enter `/claude-security-view` while the scan runs

118* **Turn it off**: enter `/plugin configure claude-security` and change **Live scan view**

119 

120### Continue a stopped scan

121 

122If a scan in your session stops before it writes its report, you can continue it, unless the session says that safeguards stopped one of the scan's agents. In that case, start a new scan instead.

123 

124To continue, leave your checkout and the scan's `CLAUDE-SECURITY-<timestamp>/` directory unchanged, and enter `/claude-security continue the scan` in the session that ran it. If you closed that session, [resume it](https://code.claude.com/docs/en/sessions.md#resume-a-session) first.

93 125 

94### Scan only your changes126### Scan only your changes

95 127 

96When your branch has commits its base doesn't, the `/claude-security` menu offers to scan only that diff, so you can check a branch before merging. You can also scan one of your open pull requests, or a single commit by asking for it, such as "scan commit abc1234". Only committed changes are scanned: commit or stash in-progress edits first, or run a full scan, which reads the working tree.128When your branch has commits its base doesn't, the `/claude-security` menu offers to scan only that diff, so you can check a branch before merging. Before a change scan, commit the edits you want scanned and stash the rest with `git stash -u`, or run a [full scan](#scan-and-fix-your-codebase), which reads the working tree.

97 129 

98Change scans need a git repository; full scans of an unversioned directory still work. Finding your open pull requests is offered only when your session already has permission to run the GitHub CLI and `gh` is signed in.130To scan one of your open pull requests or a single commit, check it out from your shell first, then ask at the Claude Code prompt:

131 

132* **Pull request**: run `git checkout feature-auth`, naming the pull request's branch, then `/claude-security scan my branch`

133* **Single commit**: run `git checkout abc1234`, then `/claude-security scan commit abc1234`

99 134 

100### Scope large repositories135### Scope large repositories

101 136 


105 140 

106Scan effort sets how deep a scan goes. Your findings go through the same independent verification at `low`, `medium`, and `high`.141Scan effort sets how deep a scan goes. Your findings go through the same independent verification at `low`, `medium`, and `high`.

107 142 

108* **`low`**: a quick first look. It skips the architecture map and the threat model when you scan your codebase.143* **`low`**: a quick first look. It skips the architecture map when you scan your codebase.

109* **`medium`**: the default.144* **`medium`**: the default.

110* **`high`**: what `medium` does, plus more hunting for vulnerabilities in the same code.145* **`high`**: what `medium` does, plus more hunting for vulnerabilities in the same code.

111 146 

112Name the scan effort in your request at the Claude Code prompt, such as `/claude-security scan my public API code at high` or `/claude-security scan my branch at high`.147Name the scan effort in your request at the Claude Code prompt, such as for a part of your codebase or for your changes:

148 

149* **Part of your codebase**: `/claude-security scan my public API code at high`

150* **Your changes**: `/claude-security scan my branch at high`

113 151 

114If a scan of a large repository finds less than you expect, choose `high` scan effort, scan a second time, or do both. Each can report findings that one `medium` scan doesn't.152If a scan of a large repository finds less than you expect, choose `high` scan effort, scan a second time, or do both. Each can report findings that one `medium` scan doesn't.

115 153 

154A codebase scan can cost a lot of tokens, and the cost grows with the size of the repository, the scan effort, and the model. To spend less, scan a [smaller area](#scope-large-repositories), choose `low`, or [change the model](#models-and-providers) before you start.

155 

156### Run a more thorough change scan

157 

158Replace the [scan effort](#choose-a-scan-effort) with `--change-scan-effort high`, such as `/claude-security scan my branch --change-scan-effort high`. More agents read the change than at `high` scan effort, so the scan takes longer and costs several times as much. Its report also lists vulnerabilities older than the change.

159 

160### Tell a scan about your system

161 

162To give a scan facts about your system, name up to 10 files in the folder that you scan or type your own notes.

163 

164Give them in your request, or when the scan asks:

165 

166```text theme={null}

167/claude-security scan this repository, and read docs/arch.md first

168```

169 

170Give only notes and files that are up to date and that you trust, because a wrong statement can hide a vulnerability. Keep your README and `SECURITY.md` up to date too, because the scan weighs what they say about trusted users and intended behavior.

171 

172To [get patches](#scan-and-fix-your-codebase) from this scan, commit the files that you name instead of stashing them.

173 

116### Read the scan results174### Read the scan results

117 175 

118Every scan writes its results into a timestamped `CLAUDE-SECURITY-<timestamp>/` directory in your repository:176After a scan in your session, find its results in a timestamped `CLAUDE-SECURITY-<timestamp>/` directory in the folder where you started Claude Code:

119 177 

120* **`CLAUDE-SECURITY-RESULTS.md`**: the report, with each finding's ID, such as `F1`, plus its impact, exploit scenario, severity, confidence, and recommendation178* **`CLAUDE-SECURITY-RESULTS.md`**: the report, with each finding's ID, such as `F1`, plus its impact, exploit scenario, severity, confidence, and recommendation

121* **`CLAUDE-SECURITY-RESULTS.jsonl`**: the same findings in machine-readable form, one JSON object per line179* **`CLAUDE-SECURITY-RESULTS.jsonl`**: the same findings in machine-readable form, one JSON object per line

122* **`CLAUDE-SECURITY-RESULTS.sarif`**: the same findings as a [SARIF 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) log for GitHub code scanning and any other tool that reads the standard. The scan classifies findings under their [CWE](https://cwe.mitre.org/) weakness categories180* **`CLAUDE-SECURITY-RESULTS.sarif`**: the same findings as a [SARIF 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) log for GitHub code scanning and any other tool that reads the standard. The scan classifies findings under their [CWE](https://cwe.mitre.org/) weakness categories

123* **`CLAUDE-SECURITY-REVISION-<commit>.json`**: the revision stamp, recording which commit was scanned, at what [scan effort](#choose-a-scan-effort), whether uncommitted changes were part of the scanned tree, and how thoroughly the run was verified. A scan outside version control stamps `UNVERSIONED` in place of the commit181* **`CLAUDE-SECURITY-REVISION-<commit>.json`**: the revision stamp, recording which commit was scanned, at what [scan effort](#choose-a-scan-effort), whether uncommitted changes were part of the scanned tree, and how thoroughly the run was verified. A scan outside version control stamps `UNVERSIONED` in place of the commit

124 182 

125That directory is the only change a scan makes to your checkout, and it carries its own `.gitignore`, so a stray `git add` never sweeps a report into a commit. To keep a report in history for an audit trail, delete that one `.gitignore` file and commit the directory like any other.183That directory is the only change a scan makes to your checkout, and it carries its own `.gitignore`, so a stray `git add` doesn't sweep a report into a commit. Some packaging and deploy tools don't read that file, so move report directories out while you package or deploy. To keep a report in history for an audit trail, delete that one `.gitignore` file and commit the directory.

126 184 

127Findings only appear in the report after independent verifier agents analyze them, which keeps reports short and worth reading. Scans are nondeterministic: two scans of the same code can surface different findings. Run scans regularly.185Findings only appear in the report after independent verifier agents analyze them, which keeps reports short and worth reading. Scans are nondeterministic: two scans of the same code can surface different findings. Run scans regularly.

128 186 

129## Fix findings187## Fix findings

130 188 

131Start the fix flow by picking **Suggest patches** from the `/claude-security` menu, or ask in plain language, such as "fix finding F3", then pick which findings from the report to address. Patches are built against committed code, and the report has to still describe the code you have: findings whose code has since changed are skipped with a note, and the plugin offers a fresh scan instead of patching from a stale report. Each patch is drafted in a scratch copy of your repository, so your source files stay untouched until you apply a patch yourself.189Start the fix flow by picking **Suggest patches** from the `/claude-security` menu, or ask in plain language, such as "fix finding F3", then pick which findings from the report to address. Each patch is drafted in a scratch copy of your repository. An agent can still edit your own files by mistake, so run `git status` when the job ends.

190 

191Before delivery, an agent independent of the one that wrote the patch reviews it. It runs your project's tests when it can, and reads the diff on its own terms for anything new it might introduce.

192 

193That review has to vouch that the patch:

194 

195* Addresses its one finding

196* Introduces no new vulnerability

197* Leaves behavior otherwise unchanged

198 

199When the review can't vouch for all three, the plugin writes a short note explaining why instead of a patch.

132 200 

133Before delivery, each patch is reviewed by an agent independent of the one that wrote it, which runs your project's tests against the change when the code has them and reads the diff on its own terms for anything new it might introduce. A patch is written only when that review can vouch that the change addresses the one finding, introduces no new vulnerability, and leaves behavior otherwise unchanged. When it can't vouch for all three, you get a short note explaining why instead of a patch.201### Patch from an older report

202 

203You can still use a scan's report after new commits, but only if the scanned commit is in your current history. If it isn't, take the fresh scan that the plugin offers.

134 204 

135### Patches are never applied automatically205### Patches are never applied automatically

136 206 

137Applying a patch is always your decision. Patches are written to the report's `patches/` folder, one `F<n>.patch` per finding with a note beside it explaining the change. Apply one from your shell, or ask Claude to apply it and open a pull request:207Applying a patch is your decision. Patches are written to the report's `patches/` folder, one `F<n>.patch` per patched finding with a note beside it explaining the change. Ask Claude to apply one and open a pull request, or apply it from your shell at the root of your repository.

208 

209Read the patch's note, `F<n>.md`, first, because it has the exact command, such as:

138 210 

139```bash theme={null}211```bash theme={null}

140git apply CLAUDE-SECURITY-<timestamp>/patches/F1.patch212git -C "$(git rev-parse --show-toplevel)" apply CLAUDE-SECURITY-<timestamp>/patches/F1.patch

141```213```

142 214 

143When the patched code has no tests, the patch's note says so, so you know its review ran without a test pass. Apply each patch in its own pull request so it can be reviewed and tested on its own.215Apply each patch in its own pull request so it can be reviewed and tested on its own. If `git apply` refuses a patch, read its note.

216 

217## Triage findings you already have

218 

219Vulnerability Triage checks whether the findings in a list hold up against your code. The list can be a SARIF 2.1.0 file from another scanner, or the `CLAUDE-SECURITY-<timestamp>/` directory of an earlier scan. Triage only a list from a source that you trust.

220 

221If you want patches later, leave nothing uncommitted or untracked but the list itself. Start Claude Code in the directory that the findings' file paths are relative to, usually your repository's root.

222 

223Then enter the command with the list's path:

224 

225```text theme={null}

226/claude-security triage results.sarif

227```

228 

229The report is `FINDINGS-TRIAGE.md`, in a new `CLAUDE-SECURITY-<timestamp>/` directory. Findings that the triage rejects are under **Not validated**. Check that section yourself, because the triage is more likely to reject a real finding that your list describes in only a few words. `FINDINGS-TRIAGE.sarif` beside the report is your list with the verdicts added.

230 

231To turn the report's valid findings into patches, accept the offer at the end of the triage. If you commit, pull, or switch branches first, start a new triage. See [Fix findings](#fix-findings) for what to check after a patch job.

232 

233## Create a threat model

234 

235The `/claude-security:threat-model` command drafts a threat model, a file that you can give to later scans.

236 

237Start Claude Code at the root of your repository and enter:

238 

239```text theme={null}

240/claude-security:threat-model

241```

242 

243Claude reads your code and any scan report, then asks about your system and what else it may read: folders, your [connectors](https://code.claude.com/docs/en/mcp.md), or text that you paste.

244 

245> [!WARNING]

246>

247> If you let Claude read your connectors, its search terms leave your machine, and they can include words from that report. Claude can be misled by what it reads there, or by text that you paste.

248 

249When Claude shows a draft:

250 

2511. Check it before you choose **Yes** to save it as `.claude-security/threat-model.md`, because a wrong statement can hide a vulnerability from a later scan.

2522. If there's a scan report, choose whether Claude writes `CLAUDE-SECURITY-PRECONDITIONS.md` in the report's folder. That file says whether each finding's preconditions are `met`, `not met`, or `not shown` in the sources that Claude read.

2533. When Claude finishes, enter [`/clear`](https://code.claude.com/docs/en/commands#all-commands) before you run another command of the plugin.

254 

255To be sure that a scan reads the threat model, [name it in your request](#tell-a-scan-about-your-system).

256 

257## Analyze your attack surface

258 

259An attack surface analysis examines the parts of your project that an attacker can reach, and proposes changes to shrink that attack surface.

260 

261Start Claude Code at the root of your repository, in [auto mode](https://code.claude.com/docs/en/permission-modes.md#switch-permission-modes) where it's [available](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), and enter:

262 

263```text theme={null}

264/claude-security:attack-surface-analysis

265```

266 

267An analysis may take a long time and use a significant number of tokens. Until it ends, leave Claude Code open, and don't commit, switch branches, or edit files.

268 

269An analysis doesn't replace a [scan](#scan-and-fix-your-codebase), which looks for vulnerabilities. The analysis looks for:

270 

271* Code that the default configuration reaches but no default feature uses

272* Sensitive code reachable before login or without any user action

273* Combinations of options that silently turn off a security feature

274 

275The report is `CLAUDE-SECURITY-<timestamp>/CLAUDE-SECURITY-RESULTS.md`, in the folder where you started Claude Code. If the analysis wrote patches, `attack-surface-patches/PATCHES.md` beside it describes them. Treat findings and patches as untested until you check them yourself.

276 

277## Scan from your shell

278 

279The `claude-security` command scans the folder that you run it in, and writes the [same report](#read-the-scan-results) there. The scan runs inside the [plugin's sandbox](https://github.com/anthropics/claude-plugins-official/blob/main/plugins/claude-security/README.md#running-in-a-sandbox). It signs in with your Claude Code login or your provider's environment variables.

280 

281The sandbox runs only on Linux:

282 

283* **Linux**: you need kernel 5.19 or later on x86-64 or arm64, Python 3.10 or later, and a user other than root. On Ubuntu 24.04 or later, add `--sudo`, which sets up the sandbox with `sudo`. If your system doesn't meet these requirements, [scan in a session](#scan-and-fix-your-codebase).

284* **Windows**: add `--no-sandbox`, or the command stops

285* **macOS and WSL 2**: the command isn't supported, so [scan in a session](#scan-and-fix-your-codebase)

286 

287> [!WARNING]

288>

289> The command doesn't load your repository's `.claude/` settings or hooks, so the deny rules there don't apply. In the sandbox, your organization's [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md#security-considerations) don't apply either. If you add `--no-sandbox`, the scan runs in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) with your user's access. See the plugin's [trust model](https://github.com/anthropics/claude-plugins-official/blob/main/plugins/claude-security/SECURITY.md#trust-model).

290 

291The plugin includes the command. To add it to your `PATH`, enter `/claude-security:install-cli` in Claude Code and follow what it prints.

292 

293Then run it in your repository, with `--sudo` or `--no-sandbox` if your system needs it:

294 

295* **Scan the codebase**: `claude-security`

296* **Scan this branch's changes**: `claude-security --changes`

297* **Scan with a full-screen view**: `claude-security --tui`, which needs Node.js 18 or later

298* **List the other options**: `claude-security --help`

299 

300The command runs in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), and stops if auto mode isn't available. If your Claude Code model doesn't support it, add `--model` with one that does. For any other cause, [scan in a session](#scan-and-fix-your-codebase).

301 

302## Scan pull requests in GitHub Actions

303 

304On a pull request, the plugin's GitHub Actions job scans the change, posts a review and suggested fixes, and can block the merge. It can also scan the whole repository on a schedule.

305 

306> [!WARNING]

307>

308> Use the job only in a repository where you trust everyone who can push. Anyone who adds text or code to a pull request's branch can steer the scan, have it run that code, and make it send model requests on the job's credential. By default, the job fails for a pull request from a fork.

309>

310> In a public repository, the review, the job summary, or the job's report artifact can disclose a live vulnerability. To keep findings private, [scan in your session](#scan-only-your-changes) instead.

311 

312The job needs a GitHub-hosted Linux runner on GitHub.com, and [Anthropic API access](https://platform.claude.com/docs/en/get-api-key) or a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md), because it can't sign in with a paid plan. Follow the plugin's [GitHub Actions guide](https://github.com/anthropics/claude-plugins-official/blob/main/plugins/claude-security/CI.md) to add the workflow and create a credential for this job alone. To move to version 0.13.0, put its commit after the `@` in each workflow: `d0d514288960e7a78e1a76e4a3ec694416458726`.

313 

314With the guide's sample workflow, a draft pull request from a branch of your repository passes with no scan until you mark it ready for review. A pull request from Dependabot passes with no scan too, so review its changes yourself.

144 315 

145## How the plugin fits with other security tools316## How the plugin fits with other security tools

146 317 

147The Claude Security plugin is the on-demand deep-scan layer in a defense-in-depth stack, alongside the [security guidance plugin](https://code.claude.com/docs/en/security-guidance.md), [`/security-review`](https://code.claude.com/docs/en/commands#all-commands), [Code Review](https://code.claude.com/docs/en/code-review.md), the managed [Claude Security](https://claude.com/product/claude-security) product, and your existing scanners:318The Claude Security plugin is the deep-scan layer in a defense-in-depth stack, alongside the [security guidance plugin](https://code.claude.com/docs/en/security-guidance.md), [Code Review](https://code.claude.com/docs/en/code-review.md), the managed [Claude Security](https://claude.com/product/claude-security) product, and your existing scanners:

148 319 

149| Stage | Tool | What it covers |320| Stage | Tool | What it covers |

150| :- | :- | :- |321| :- | :- | :- |

151| In session | [Security guidance plugin](https://code.claude.com/docs/en/security-guidance.md) | Common vulnerabilities in code Claude writes, fixed in the same session |322| In session | [Security guidance plugin](https://code.claude.com/docs/en/security-guidance.md) | Common vulnerabilities in code Claude writes, fixed in the same session |

152| On demand, single pass | [`/security-review`](https://code.claude.com/docs/en/commands#all-commands) | One-time security pass on the current branch |

153| On demand, deep scan | Claude Security plugin | Multi-agent scan of a repository or diff, with independently reviewed findings and patches |323| On demand, deep scan | Claude Security plugin | Multi-agent scan of a repository or diff, with independently reviewed findings and patches |

154| On pull request | [Code Review](https://code.claude.com/docs/en/code-review.md), Team and Enterprise plans | Multi-agent correctness and security review with full codebase context |324| On pull request | [Code Review](https://code.claude.com/docs/en/code-review.md), Team and Enterprise plans | Multi-agent correctness and security review with full codebase context |

325| On pull request, deep scan | [Claude Security plugin in GitHub Actions](#scan-pull-requests-in-github-actions) | Multi-agent scan of the pull request's changes |

155| Managed | [Claude Security](https://claude.com/product/claude-security), Enterprise plan | Hosted scanning that monitors connected repositories |326| Managed | [Claude Security](https://claude.com/product/claude-security), Enterprise plan | Hosted scanning that monitors connected repositories |

156| In CI | Your existing static analysis and dependency scanners | Language-specific rules, supply-chain checks, and policy enforcement |327| In CI | Your existing static analysis and dependency scanners | Language-specific rules, supply-chain checks, and policy enforcement |

157 328 

158The plugin doesn't replace your existing source-code security tools. Run it alongside static analysis, dependency scanning, and code review: it reasons about your code the way a human security researcher would, which complements the deterministic checks those tools provide.329The plugin doesn't replace your existing source-code security tools. Run it alongside static analysis, dependency scanning, and code review: it reasons about your code the way a human security researcher would, which complements the deterministic checks those tools provide.

159 330 

331If your organization uses the managed Claude Security product, `/claude-security:hosted` shows its findings in your session. Before you use it, read the [requirements](https://github.com/anthropics/claude-plugins-official/blob/main/plugins/claude-security/README.md#findings-from-hosted-claude-security) and the [risks](https://github.com/anthropics/claude-plugins-official/blob/main/plugins/claude-security/SECURITY.md#findings-from-hosted-claude-security).

332 

160## Troubleshooting333## Troubleshooting

161 334 

162**The `/claude-security` menu opens with a Python warning.** The plugin needs `python3` 3.9 or later on your `PATH`. When it can't find `python3` at all, the menu warns that Claude Security won't work until one is installed; when the first `python3` on your `PATH` is older, the warning names the version it found. Install Python 3, or put a newer `python3` first on your `PATH`, then start a new session.335**The `/claude-security` menu opens with a Python warning.** The plugin needs `python3` 3.9 or later on your `PATH`. When it can't find `python3` at all, the menu warns that Claude Security won't work until one is installed; when the first `python3` on your `PATH` is older, the warning names the version it found. Install Python 3, or put a newer `python3` first on your `PATH`, then start a new session.

163 336 

164**You may see a "safeguards flagged this message" notice when scanning on a Fable model.** The message names the model you're running. Fable's cybersecurity safety classifiers flag certain requests, and Claude Code re-runs a flagged request on an Opus model through [automatic model fallback](https://code.claude.com/docs/en/model-config.md#automatic-model-fallback). This is expected. When the request re-runs, the scan should still complete successfully.337**You may see a "safeguards flagged this message" notice when scanning on a Fable model.** The message names the model you're running. Fable's cybersecurity safety classifiers flag certain requests, and Claude Code re-runs a flagged request on an Opus model through [automatic model fallback](https://code.claude.com/docs/en/model-config.md#automatic-model-fallback). This is expected. When the request re-runs, the scan should still complete successfully. If the scan stops, see [Continue a stopped scan](#continue-a-stopped-scan).

165 338 

166## Related resources339## Related resources

167 340 

Details

63| `--advisor <model>` | Enable the server-side [advisor tool](https://code.claude.com/docs/en/advisor.md) for this session with a model alias, `fable`, `opus`, or `sonnet`, or a full model ID. Takes precedence over the `advisorModel` setting for the session. `fable` requires [Fable access](https://code.claude.com/docs/en/advisor.md#choose-an-advisor-model) | `claude --advisor opus` |63| `--advisor <model>` | Enable the server-side [advisor tool](https://code.claude.com/docs/en/advisor.md) for this session with a model alias, `fable`, `opus`, or `sonnet`, or a full model ID. Takes precedence over the `advisorModel` setting for the session. `fable` requires [Fable access](https://code.claude.com/docs/en/advisor.md#choose-an-advisor-model) | `claude --advisor opus` |

64| `--agent` | Specify an agent for the current session (overrides the `agent` setting) | `claude --agent my-custom-agent` |64| `--agent` | Specify an agent for the current session (overrides the `agent` setting) | `claude --agent my-custom-agent` |

65| `--agents` | Define custom subagents dynamically via JSON. Accepts the [fields listed for CLI-defined subagents](https://code.claude.com/docs/en/sub-agents.md#choose-the-subagent-scope). With `--print`, the value can instead be the path to a JSON file holding the object; the file form requires Claude Code v2.1.281 or later. Claude Code validates the value at startup and exits on an invalid one; see [`Invalid --agents configuration`](https://code.claude.com/docs/en/errors#invalid-agents-configuration) for the message and for the flags and environment variable that skip the validation. Validation requires Claude Code v2.1.242 or later | `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'` |65| `--agents` | Define custom subagents dynamically via JSON. Accepts the [fields listed for CLI-defined subagents](https://code.claude.com/docs/en/sub-agents.md#choose-the-subagent-scope). With `--print`, the value can instead be the path to a JSON file holding the object; the file form requires Claude Code v2.1.281 or later. Claude Code validates the value at startup and exits on an invalid one; see [`Invalid --agents configuration`](https://code.claude.com/docs/en/errors#invalid-agents-configuration) for the message and for the flags and environment variable that skip the validation. Validation requires Claude Code v2.1.242 or later | `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'` |

66| `--allow-dangerously-skip-permissions` | Add `bypassPermissions` to the `Shift+Tab` mode cycle without starting in it. While `bypassPermissions` is in the cycle of an interactive terminal session, most edits and commands Claude attempts in plan mode run with no prompt, before you approve a plan. See [permission modes](https://code.claude.com/docs/en/permission-modes.md#skip-all-checks-with-bypasspermissions-mode) | `claude --permission-mode default --allow-dangerously-skip-permissions` |66| `--allow-dangerously-skip-permissions` | Add `bypassPermissions` to the `Shift+Tab` mode cycle without starting in it. While `bypassPermissions` is in the cycle of an interactive terminal session, most edits and commands Claude attempts in plan mode can run with no prompt, before you approve a plan. See [permission modes](https://code.claude.com/docs/en/permission-modes.md#skip-all-checks-with-bypasspermissions-mode) | `claude --permission-mode default --allow-dangerously-skip-permissions` |

67| `--allowedTools`, `--allowed-tools` | Tools that execute without prompting for permission, apart from reads from [network paths](https://code.claude.com/docs/en/permissions.md#network-paths). See [permission rule syntax](https://code.claude.com/docs/en/settings-reference.md#permission-rule-syntax) for pattern matching. To restrict which tools are available, use `--tools` instead. If you name one of the [task-tracking tools](https://code.claude.com/docs/en/tools-reference.md#task-tool-availability) here, Claude Code also opts the session in | `"Bash(git log *)" "Bash(git diff *)" "Read"` |67| `--allowedTools`, `--allowed-tools` | Tools that execute without prompting for permission, apart from reads from [network paths](https://code.claude.com/docs/en/permissions.md#network-paths). See [permission rule syntax](https://code.claude.com/docs/en/settings-reference.md#permission-rule-syntax) for pattern matching. To restrict which tools are available, use `--tools` instead. If you name one of the [task-tracking tools](https://code.claude.com/docs/en/tools-reference.md#task-tool-availability) here, Claude Code also opts the session in | `"Bash(git log *)" "Bash(git diff *)" "Read"` |

68| `--append-subagent-system-prompt` | Append custom text to the end of every [subagent](https://code.claude.com/docs/en/sub-agents.md)'s system prompt, nested subagents included, apart from a [forked subagent](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation), which reuses the conversation's own prompt. Only applies in non-interactive mode with `-p`. Requires Claude Code v2.1.205 or later | `claude -p --append-subagent-system-prompt "Cite file paths in every answer" "query"` |68| `--append-subagent-system-prompt` | Append custom text to the end of every [subagent](https://code.claude.com/docs/en/sub-agents.md)'s system prompt, nested subagents included, apart from a [forked subagent](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation), which reuses the conversation's own prompt. Only applies in non-interactive mode with `-p`. Requires Claude Code v2.1.205 or later | `claude -p --append-subagent-system-prompt "Cite file paths in every answer" "query"` |

69| `--append-subagent-system-prompt-file` | Load text from a file and append it to [subagent](https://code.claude.com/docs/en/sub-agents.md) system prompts. An alternative to `--append-subagent-system-prompt` for text too long to pass on the command line. The two flags can't be combined. Only applies in non-interactive mode with `-p`. Requires Claude Code v2.1.261 or later | `claude -p --append-subagent-system-prompt-file ./subagent-rules.txt "query"` |69| `--append-subagent-system-prompt-file` | Load text from a file and append it to [subagent](https://code.claude.com/docs/en/sub-agents.md) system prompts. An alternative to `--append-subagent-system-prompt` for text too long to pass on the command line. The two flags can't be combined. Only applies in non-interactive mode with `-p`. Requires Claude Code v2.1.261 or later | `claude -p --append-subagent-system-prompt-file ./subagent-rules.txt "query"` |

code-mode.md +40 −24

Details

39 39 

40Before you turn on Code Mode, check that you can accept these limits:40Before you turn on Code Mode, check that you can accept these limits:

41 41 

42* **Resuming**: you can resume a Code Mode session only in the terminal, with Code Mode on42* **Resuming**: you can resume a Code Mode session only with Code Mode on. After a Code Mode session has run with a Claude subscription or a Console account, you can't resume it on a cloud provider such as Amazon Bedrock

43* **Auto mode**: auto mode's classifier [reviews the code, not each tool call](#permission-checks)43* **Auto mode**: auto mode's classifier [reviews the code, not each tool call](#permission-checks)

44* **Long-running code**: unless [code can run in the background](#long-running-code), you wait for it to finish, and it stops after ten minutes44* **Long-running code**: unless [code can run in the background](#long-running-code), you wait for it to finish, and it stops after ten minutes

45* **Hooks**: you can see [tool calls refused](#tool-call-refused-by-a-hook) when a `PreToolUse` hook doesn't finish, for example after a timeout45* **Hooks**: by default, expect a [refused tool call](#tool-call-refused-by-a-hook) when a `PreToolUse` hook doesn't finish, and a [call that can still run](#tool-call-ran-after-a-hook-failed) when the hook fails another way

46* **Unavailable features**: you can't use [Remote Control](https://code.claude.com/docs/en/remote-control.md), [Claude in Chrome](https://code.claude.com/docs/en/chrome.md), or [computer use](https://code.claude.com/docs/en/computer-use.md)46* **Unavailable features**: you can't use [Remote Control](https://code.claude.com/docs/en/remote-control.md), [Claude in Chrome](https://code.claude.com/docs/en/chrome.md), or [computer use](https://code.claude.com/docs/en/computer-use.md)

47* **Moving the session**: you can't move the session to the Desktop app or turn it into a [background session](https://code.claude.com/docs/en/agent-view.md), and `/fork` can't start a background copy47* **Moving the session**: you can't move the session to the Desktop app or turn it into a [background session](https://code.claude.com/docs/en/agent-view.md), and `/fork` can't start a background copy

48 48 

49## Requirements49## Requirements

50 50 

51* **Version**: Claude Code v2.1.323 or later, on either [release channel](https://code.claude.com/docs/en/setup.md#configure-release-channel). An older version starts without Code Mode, with or without the reason `it isn't open to your account yet`51* **Version**: Claude Code v2.1.323 or later, on either [release channel](https://code.claude.com/docs/en/setup.md#configure-release-channel). An older version starts without Code Mode, with or without the reason `it isn't open to your account yet`

52* **Account**: a Claude subscription or Console account. You can't use Code Mode through a gateway, Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, Microsoft Foundry, or [Claude Models on Google Cloud (Anthropic managed)](https://code.claude.com/docs/en/claude-models-on-google-cloud-anthropic-managed.md)52* **Account or provider**: a Claude subscription, a Console account, or a [cloud provider](https://code.claude.com/docs/en/feature-availability.md#availability-by-model-provider) such as Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry. With a cloud provider, you need v2.1.331 or later. You can't use Code Mode through a [gateway](https://code.claude.com/docs/en/gateways.md) or with Claude for Government. If you reach a cloud provider with an [Enterprise Admin Console sign-in](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code), you need Agent Platform, or Amazon Bedrock without the [Mantle endpoint](https://code.claude.com/docs/en/amazon-bedrock.md#use-the-mantle-endpoint)

53* **Organization**: your organization doesn't use the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup.md) or [zero data retention](https://code.claude.com/docs/en/zero-data-retention.md)53* **Organization**: your organization doesn't use the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup.md) or [zero data retention](https://code.claude.com/docs/en/zero-data-retention.md)

54* **Model**: Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.254* **Model**: Claude Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2. If you select the model by a deployment name or an application inference profile, ask whoever manages that name whether it points to one of these models

55* **Surface**: an interactive `claude` session in a terminal. Code Mode doesn't work with the VS Code panel, the Desktop app, or cloud sessions55* **Surface**: an interactive `claude` session in a terminal. Code Mode doesn't work with the VS Code panel, the Desktop app, or cloud sessions

56* **Agent teams**: to use Code Mode with [agent teams](https://code.claude.com/docs/en/agent-teams.md) on, you need v2.1.326 or later. Teammates run in Code Mode in the default [in-process display mode](https://code.claude.com/docs/en/agent-teams.md#choose-a-display-mode), and start without it in split panes56* **Agent teams**: to use Code Mode with [agent teams](https://code.claude.com/docs/en/agent-teams.md) on, you need v2.1.326 or later. Teammates run in Code Mode in the default [in-process display mode](https://code.claude.com/docs/en/agent-teams.md#choose-a-display-mode), and start without it in split panes

57* **Mods**: to use Code Mode with a [mod](https://code.claude.com/docs/en/plugins/mods/overview.md) that hooks tool calls, you need v2.1.327 or later. If you're on the `stable` channel and an update doesn't reach that version, [switch to `latest`](https://code.claude.com/docs/en/setup#configure-release-channel)

57* **Telemetry settings**: to use Code Mode with [feature-flag fetching off](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) or [OpenTelemetry](https://code.claude.com/docs/en/monitoring-usage.md) events and metrics on, you need v2.1.329 or later. Keep [tracing](https://code.claude.com/docs/en/monitoring-usage.md#traces-beta) off on any version58* **Telemetry settings**: to use Code Mode with [feature-flag fetching off](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) or [OpenTelemetry](https://code.claude.com/docs/en/monitoring-usage.md) events and metrics on, you need v2.1.329 or later. Keep [tracing](https://code.claude.com/docs/en/monitoring-usage.md#traces-beta) off on any version

58* **Installation**: the [native build](https://code.claude.com/docs/en/setup.md) of Claude Code59* **Installation**: the [native build](https://code.claude.com/docs/en/setup.md) of Claude Code

59* **Windows**: [Git for Windows](https://git-scm.com/downloads/win) is installed60* **Windows**: [Git for Windows](https://git-scm.com/downloads/win) is installed

60 61 

61You also can't start Code Mode with some settings on, such as an API key helper. For the fix for each, see [Code Mode doesn't start](#code-mode-doesnt-start).62You also can't start Code Mode with some settings on, such as an API key helper on a direct connection to Anthropic. For the fix for each, see [Code Mode doesn't start](#code-mode-doesnt-start).

62 63 

63## Try Code Mode64## Try Code Mode

64 65 


66 67 

67**1. Check your version**68**1. Check your version**

68 69 

69Run `claude --version`. If the version is older than v2.1.323, run `claude update`. If you're on the `stable` channel and the update doesn't reach v2.1.323, wait for `stable` to catch up or [switch to `latest`](https://code.claude.com/docs/en/setup#configure-release-channel).70Run `claude --version`. If the version is older than the one you [need for your setup](#requirements), run `claude update`. If you're on the `stable` channel and the update doesn't reach that version, wait for `stable` to catch up or [switch to `latest`](https://code.claude.com/docs/en/setup#configure-release-channel).

70 71 

71**2. Start Claude Code with Code Mode on**72**2. Start Claude Code with Code Mode on**

72 73 


127 128 

128### Turn off Code Mode129### Turn off Code Mode

129 130 

130Remove `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` from your shell and from `~/.claude/settings.json`, then start a new session. You can also keep the variable and change its value to `0` in either place. With a `0` in one place, Code Mode stays off even if you set `1` in the other.131Remove `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` from your shell, `~/.claude/settings.json`, and any `--settings` file, then start a new session. You can also keep the variable and change its value to `0` in any of them. With a `0` in one place, Code Mode stays off even if you set `1` in another.

131 132 

132### Block Code Mode for your organization133### Block Code Mode for your organization

133 134 


141}142}

142```143```

143 144 

145If your users can connect through a cloud provider, deploy this setting through [MDM or a managed settings file](https://code.claude.com/docs/en/managed-settings.md#delivery-mechanisms). A user who sets a provider variable such as `CLAUDE_CODE_USE_BEDROCK` in their shell or user settings can start Code Mode without receiving [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md#platform-availability).

146 

144Users who are in a Code Mode session stay in it until they exit or restart Claude Code. After that, your users start without Code Mode and can't resume their Code Mode sessions while the `0` is in place. You can't turn on Code Mode for your users from managed settings.147Users who are in a Code Mode session stay in it until they exit or restart Claude Code. After that, your users start without Code Mode and can't resume their Code Mode sessions while the `0` is in place. You can't turn on Code Mode for your users from managed settings.

145 148 

146### Monitor Code Mode with OpenTelemetry149### Monitor Code Mode with OpenTelemetry


159 162 

160In auto and `bypassPermissions` modes, code can run from start to finish without a permission prompt. Some calls still prompt you, such as the [actions no mode auto-approves](https://code.claude.com/docs/en/permission-modes.md#actions-no-mode-auto-approves).163In auto and `bypassPermissions` modes, code can run from start to finish without a permission prompt. Some calls still prompt you, such as the [actions no mode auto-approves](https://code.claude.com/docs/en/permission-modes.md#actions-no-mode-auto-approves).

161 164 

162Each tool call in the code goes through your `deny` and `ask` [permission rules](https://code.claude.com/docs/en/permissions.md) and [`PreToolUse` hooks](https://code.claude.com/docs/en/hooks#pretooluse) under the tool's usual name, such as `Bash` or an [MCP tool's name](https://code.claude.com/docs/en/permissions.md#mcp). Beyond rules and hooks, a classifier reviews the code in auto mode, and you answer prompts in the modes that ask:165To control tool calls in the code, write `deny` and `ask` [permission rules](https://code.claude.com/docs/en/permissions.md) and [`PreToolUse` hooks](https://code.claude.com/docs/en/hooks#pretooluse) under the tool's usual name, such as `Bash` or an [MCP tool's name](https://code.claude.com/docs/en/permissions.md#mcp). Beyond rules and hooks, a classifier reviews the code in auto mode, and you answer prompts in the modes that ask:

163 166 

164* **[Auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode)**: the classifier reviews each piece of code before it runs, not each tool call. It doesn't see values computed at run time, such as a path taken from search output, so keep rules or hooks for calls you must control. You can still be [prompted for some calls](#permission-prompt-with-a-countdown), such as calls in code that you approved yourself after repeated classifier blocks167* **[Auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode)**: the classifier reviews each piece of code before it runs, not each tool call. It doesn't see values computed at run time, such as a path taken from search output, so keep rules or hooks for calls you must control. You can still be [prompted for some calls](#permission-prompt-with-a-countdown), such as calls in code that you approved yourself after repeated classifier blocks

165* **Other [permission modes](https://code.claude.com/docs/en/permission-modes.md)**: you're prompted for each tool call that would prompt you in that mode168* **Other [permission modes](https://code.claude.com/docs/en/permission-modes.md)**: you're prompted for each tool call that would prompt you in that mode


224 227 

225For background code, start your session in auto or `bypassPermissions` mode. If Claude still waits, check your current mode and how you started the session:228For background code, start your session in auto or `bypassPermissions` mode. If Claude still waits, check your current mode and how you started the session:

226 229 

227* **You switched to another mode**: press `Shift+Tab` until you're back in the mode you started in230* **You're on a version before v2.1.328 and picked the session from the `claude --resume` list**: exit, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code), then run the same `claude --resume` command with Code Mode on. To stay on your version, replace `--resume` with `--continue`. If Claude still waits after the update, start a new session in auto mode

228* **You started in another mode**: if [auto mode is available](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) to you, exit, then run `claude --continue --permission-mode auto` with Code Mode on231* **You passed tool names to `--tools`**: start a new session in auto mode, with Code Mode on and without that flag

229* **You're on a version before v2.1.328 and picked the session from the `claude --resume` list**: exit, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code), then run the same `claude --resume` command with Code Mode on. To stay on your version, replace `--resume` with `--continue`232* **The session first started in auto or `bypassPermissions` mode**: press `Shift+Tab` until you're back in that mode. If that doesn't help, exit, then run `claude --continue --permission-mode auto` with Code Mode on

230* **You passed tool names to `--tools`**: start again in auto mode without that flag233* **The session first started in another mode**: if [auto mode is available](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) to you, exit, then run `claude --permission-mode auto` with Code Mode on to start a new session. On v2.1.331 or later, expect Claude to keep waiting if you resume the old session instead

231 234 

232### Stop code in progress235### Stop code in progress

233 236 


259 262 

260* **Change the text**: redact `result`, `stdout`, `stderr`, and `error`. Handle a `result` that's missing or `null`, and expect `error` only when the code failed or was stopped263* **Change the text**: redact `result`, `stdout`, `stderr`, and `error`. Handle a `result` that's missing or `null`, and expect `error` only when the code failed or was stopped

261* **Keep the shape**: return `code`, `stdout`, and `stderr` as strings, and return `error` as a string or leave it out. If you break this shape, Claude gets the original output264* **Keep the shape**: return `code`, `stdout`, and `stderr` as strings, and return `error` as a string or leave it out. If you break this shape, Claude gets the original output

262* **Remove images and PDFs**: if the copy has `images` or `documents` to hide, set that field to `[]`265* **Remove images, PDFs, and page errors**: if the copy has `images`, `documents`, or `imagePagesFailed` to hide, set that field to `[]`. The `imagePagesFailed` field lists the file path and error for each PDF page that couldn't be shown

266* **Remove the path to long output**: on v2.1.331 or later, omit `uncutOutputNote` from the copy. The field gives Claude a path to the uncut text

263 267 

264To hide the deploy token in the `notes.txt` result, print this JSON:268To hide the deploy token in the `notes.txt` result, print this JSON:

265 269 


305| :- | :- |309| :- | :- |

306| `it isn't open to your account in this version` or `it isn't open to your account yet` | If your version is older than v2.1.323, [update](#try-code-mode). Otherwise, check your network connection and start again. If the reason stays, try again another day |310| `it isn't open to your account in this version` or `it isn't open to your account yet` | If your version is older than v2.1.323, [update](#try-code-mode). Otherwise, check your network connection and start again. If the reason stays, try again another day |

307| `Anthropic has turned it off for now` | [Update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code), or start again later |311| `Anthropic has turned it off for now` | [Update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code), or start again later |

308| `it only works directly with the Anthropic API` or `it only works with the Anthropic API` | Remove the settings that route requests through a cloud provider, a gateway, or a custom `ANTHROPIC_BASE_URL` |312| `it only works directly with the Anthropic API` or `it only works with the Anthropic API` | If you use a cloud provider without a gateway, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to v2.1.331 or later. If you use a gateway, follow the next row |

313| `it isn't offered yet through a gateway or proxy` | If your administrator set up the [gateway](https://code.claude.com/docs/en/gateways.md), you need it, or you use Claude for Government, [turn off Code Mode](#turn-off-code-mode) to stop seeing the line. Otherwise, remove [the gateway's settings](https://code.claude.com/docs/en/llm-gateway-connect.md) and key, and connect directly. You can keep `HTTPS_PROXY`. If you signed in to a Claude apps gateway, also remove [its entries from your user settings](https://code.claude.com/docs/en/claude-apps-gateway#set-the-gateway-url-in-user-settings) and run `/logout`, which removes saved MCP server logins and plugin secrets too |

314| `it isn't offered yet through a gateway or proxy`, with an [Enterprise Admin Console sign-in](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code) | Run `/status`. If `API provider` shows a provider that the [requirements](#requirements) rule out, such as `Microsoft Foundry` or `Amazon Bedrock (Mantle)`, [turn off Code Mode](#turn-off-code-mode) to stop seeing the line. Otherwise, follow the previous row |

309| `it doesn't work with an API key helper` | Remove `apiKeyHelper`, `ANTHROPIC_AUTH_TOKEN`, and any `Authorization` or `X-Api-Key` header in `ANTHROPIC_CUSTOM_HEADERS`. Then sign in or set `ANTHROPIC_API_KEY` |315| `it doesn't work with an API key helper` | Remove `apiKeyHelper`, `ANTHROPIC_AUTH_TOKEN`, and any `Authorization` or `X-Api-Key` header in `ANTHROPIC_CUSTOM_HEADERS`. Then sign in or set `ANTHROPIC_API_KEY` |

310| `it only works with Opus 5.5, Sonnet 5.5 and later models` | Start with a [supported model](#requirements), for example with `--model opus`. Haiku 5.5 and Fable 5.2 also work |316| `it only works with Opus 5.5, Sonnet 5.5 and later models` | Pass the full name of a [supported model](#requirements) that your account can use, for example `--model claude-opus-5-5`, or on Microsoft Foundry the name of your deployment of one. Avoid aliases such as `sonnet`, which [select older models on some providers](https://code.claude.com/docs/en/model-config.md#model-aliases) |

311| `it doesn't work in background jobs` | Start in the foreground, without `--remote-control`. If the reason shows in a teammate's split pane, use the [in-process display mode](https://code.claude.com/docs/en/agent-teams.md#choose-a-display-mode) to run teammates in Code Mode |317| `it doesn't work in background jobs` | Start in the foreground, without `--remote-control`. If the reason shows in a teammate's split pane, use the [in-process display mode](https://code.claude.com/docs/en/agent-teams.md#choose-a-display-mode) to run teammates in Code Mode |

312| `it needs settings that Claude Code downloads from Anthropic` | [Update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to meet the [telemetry settings requirement](#requirements). To stay on your version, unset the variable that [turns off feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), such as `DISABLE_TELEMETRY` |318| `it needs settings that Claude Code downloads from Anthropic` | [Update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to meet the [telemetry settings requirement](#requirements). To stay on your version, unset the variable that [turns off feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), such as `DISABLE_TELEMETRY` |

313| `OpenTelemetry tracing is on` | Unset `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA`, `ENABLE_ENHANCED_TELEMETRY_BETA`, and `ENABLE_BETA_TRACING_DETAILED` if you can work without [traces](https://code.claude.com/docs/en/monitoring-usage.md#traces-beta) |319| `OpenTelemetry tracing is on` | Unset `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA`, `ENABLE_ENHANCED_TELEMETRY_BETA`, and `ENABLE_BETA_TRACING_DETAILED` if you can work without [traces](https://code.claude.com/docs/en/monitoring-usage.md#traces-beta) |

314| `OpenTelemetry is on` | To keep events and metrics on, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) and meet the [telemetry settings requirement](#requirements). To stay on your version, unset `CLAUDE_CODE_ENABLE_TELEMETRY` and `ENABLE_BETA_TRACING_DETAILED` if you can work without [OpenTelemetry export](https://code.claude.com/docs/en/monitoring-usage.md) |320| `OpenTelemetry is on` | To keep events and metrics on, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) and meet the [telemetry settings requirement](#requirements). To stay on your version, unset `CLAUDE_CODE_ENABLE_TELEMETRY` and `ENABLE_BETA_TRACING_DETAILED` if you can work without [OpenTelemetry export](https://code.claude.com/docs/en/monitoring-usage.md) |

315| `it doesn't yet work with the plugin` | In a session, run `/plugin` and disable each plugin that the reason names. If your organization turned one on, ask your administrator to turn it off |321| `it doesn't yet work with the plugin` | [Update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to meet the [mods requirement](#requirements). To stay on your version, run `/plugin` and disable each plugin that the reason names. If your organization turned one on, ask your administrator to turn it off |

316| `it doesn't yet work with an installed mod` | Turn off the [mod](https://code.claude.com/docs/en/plugins/mods/overview.md) that checks tool calls |322| `it doesn't yet work with an installed mod` | [Update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to meet the [mods requirement](#requirements). To stay on your version, run `/plugin` and disable each mod you installed |

317| `it can't be used together with agent teams yet` | To keep agent teams on, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to v2.1.326 or later. To stay on your version, unset `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` |323| `it can't be used together with agent teams yet` | To keep agent teams on, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code) to v2.1.326 or later. To stay on your version, unset `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` |

318| `this launch's tool options` | Start without `--restricted`, add `REPL` to `--tools`, and remove `REPL` from `--disallowedTools` and your `deny` rules |324| `this launch's tool options` | Start without `--restricted`, add `REPL` to `--tools`, and remove `REPL` from `--disallowedTools` and your `deny` rules |

325| `couldn't read your organization's settings or policy` | Start again. If your Enterprise Admin Console sign-in ended, run `claude auth login` and select your organization. If the reason stays and your network blocks `api.anthropic.com`, ask your administrator to allow that host. If you use a cloud provider and not that sign-in, you can instead unset `ANTHROPIC_API_KEY` and run `claude auth logout`, which also removes saved MCP server logins and plugin secrets |

319| `couldn't save your answer` | Make `~/.claude.json` writable |326| `couldn't save your answer` | Make `~/.claude.json` writable |

320| `your organization's settings don't allow it` | Ask your administrator about the [managed setting](#block-code-mode-for-your-organization) |327| `your organization's settings don't allow it` | Ask your administrator about the [managed setting](#block-code-mode-for-your-organization) |

321 328 


323 330 

324### Permission prompt with a countdown331### Permission prompt with a countdown

325 332 

326In auto mode, if you approve code yourself after [repeated classifier blocks](https://code.claude.com/docs/en/permission-modes.md#when-auto-mode-falls-back), you can be asked about tool calls in that code and in earlier code that's still running. With no IDE connected, the prompt can show a countdown:333In auto mode, if you approve code yourself after [repeated classifier blocks](https://code.claude.com/docs/en/permission-modes.md#when-auto-mode-falls-back), you can be asked about tool calls in that code and in earlier code that's still running. Expect the same in auto mode after an [`ask` rule](#approve-each-piece-of-code-first) or a `PreToolUse` hook on `REPL` has you approve the code.

334 

335With no IDE connected, the prompt can show a countdown:

327 336 

328```text theme={null}337```text theme={null}

329Claude Code will automatically block this request in 1:59, to avoid holding up an unattended session338Claude Code will automatically block this request in 1:59, to avoid holding up an unattended session


335 344 

336### Tool call refused by a hook345### Tool call refused by a hook

337 346 

338If Claude reports a refused tool call, ask it for the error text. These errors mean that your [`PreToolUse` hook](https://code.claude.com/docs/en/hooks#pretooluse) didn't give a decision:347If Claude reports a refused call, ask it for the error text. These errors mean your [`PreToolUse` hook](https://code.claude.com/docs/en/hooks#pretooluse) gave no decision:

348 

349* **`the hook did not finish`**: your hook timed out, or your agent hook ended without a decision. Raise the hook's [`timeout`](https://code.claude.com/docs/en/hooks#common-fields), or set [`"onFailure": "continue"`](#tool-call-ran-after-a-hook-failed) on a `command` or `http` hook. If an agent hook still gives this error, move the check to a `command` hook. After Claude runs code, you can see this error on calls outside code too

350* **`the hook failed`**: your hook failed on a call from code, for example because it couldn't start. Find the failure in the [debug log](https://code.claude.com/docs/en/hooks.md#debug-hooks) and fix it. Expect this error before v2.1.329. On later versions, you can see it after you turn off [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) during a session

351 

352### Tool call ran after a hook failed

339 353 

340* **`the hook did not finish`**: your hook timed out, or your agent hook ended without a decision. After a timeout, raise the hook's [`timeout`](https://code.claude.com/docs/en/hooks#common-fields). For an agent hook that gives no decision, move the check to a `command` hook. You can see this error on calls from code, and on other tool calls after Claude runs code in the session354To stop a call from code when its `PreToolUse` hook fails, use a `command` or `http` hook and set [`"onFailure": "block"`](https://code.claude.com/docs/en/hooks#block-the-action-when-a-hook-fails). If several settings files have that hook, give it the same `onFailure` value in each.

341* **`the hook failed`**: on a call from code, your hook couldn't start, was killed, exited with 126, 127, or a code above 128, or returned an HTTP error or invalid output. Fix the hook. You can see this error before v2.1.329. On later versions it's rare: one cause is [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) turning off during a session, after Claude has run code

342 355 

343On v2.1.329 or later, expect a call from code to run by default after a hook failure other than `the hook did not finish`. To choose whether the call runs, use a `command` or `http` hook and set [`onFailure`](https://code.claude.com/docs/en/hooks#block-the-action-when-a-hook-fails) on it:356On v2.1.329 or later, expect these results for `command` and `http` hooks:

344 357 

345* **To stop the call after a timeout or failure**: set `"onFailure": "block"`. Do this for a hook that guards calls358| `onFailure` | Hook times out | Hook fails another way, such as a missing script |

346* **To let the call run after a timeout or failure**: set `"onFailure": "continue"`359| :- | :- | :- |

360| Not set | Refused | Goes on to permission checks, [with rare exceptions](#tool-call-refused-by-a-hook) |

361| `"block"` | Refused | Refused |

362| `"continue"` | Goes on to permission checks | Goes on to permission checks |

347 363 

348### Code output withheld by a hook364### Code output withheld by a hook

349 365 

commands.md +5 −2

Details

56| `/auto-mode-setup` | [Draft `autoMode.environment` entries](https://code.claude.com/docs/en/auto-mode-config#generate-environment-entries) from your project and recent sessions, then review the draft and save it to your user settings. On a Pro, Max, Ultra, or Team plan, requires Claude Code v2.1.228 or later, or v2.1.233 or later on native Windows. On an Enterprise plan or with a Claude Console API key, requires v2.1.283 or later. If the command is missing, see [`/auto-mode-setup` returns "Unknown command"](https://code.claude.com/docs/en/auto-mode-config#auto-mode-setup-returns-unknown-command) |56| `/auto-mode-setup` | [Draft `autoMode.environment` entries](https://code.claude.com/docs/en/auto-mode-config#generate-environment-entries) from your project and recent sessions, then review the draft and save it to your user settings. On a Pro, Max, Ultra, or Team plan, requires Claude Code v2.1.228 or later, or v2.1.233 or later on native Windows. On an Enterprise plan or with a Claude Console API key, requires v2.1.283 or later. If the command is missing, see [`/auto-mode-setup` returns "Unknown command"](https://code.claude.com/docs/en/auto-mode-config#auto-mode-setup-returns-unknown-command) |

57| `/autocompact [auto\|<tokens>]` | Set the auto-compact window: how full the context window gets before Claude Code compacts automatically. Pass a size such as `500k`, or `auto` to return to the window tuned for your model. Claude Code saves the value to user settings and applies it to the current session. See [Set the auto-compact window](https://code.claude.com/docs/en/model-config.md#set-the-auto-compact-window) for accepted values and what overrides it. Without an argument, opens a dialog that shows the current window. Requires Claude Code v2.1.221 or later |57| `/autocompact [auto\|<tokens>]` | Set the auto-compact window: how full the context window gets before Claude Code compacts automatically. Pass a size such as `500k`, or `auto` to return to the window tuned for your model. Claude Code saves the value to user settings and applies it to the current session. See [Set the auto-compact window](https://code.claude.com/docs/en/model-config.md#set-the-auto-compact-window) for accepted values and what overrides it. Without an argument, opens a dialog that shows the current window. Requires Claude Code v2.1.221 or later |

58| `/autofix-pr [prompt]` | Spawn a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md#auto-fix-pull-requests) that watches the current branch's PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with `gh pr view`; to watch a different PR, check out its branch first. By default the cloud session is told to fix every CI failure and review comment; pass a prompt to give it different instructions, for example `/autofix-pr only fix lint and type errors`. Requires the `gh` CLI and access to [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) |58| `/autofix-pr [prompt]` | Spawn a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md#auto-fix-pull-requests) that watches the current branch's PR and pushes fixes when CI fails or reviewers leave comments. Detects the open PR from your checked-out branch with `gh pr view`; to watch a different PR, check out its branch first. By default the cloud session is told to fix every CI failure and review comment; pass a prompt to give it different instructions, for example `/autofix-pr only fix lint and type errors`. Requires the `gh` CLI and access to [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) |

59| `/background [prompt]` | Detach the current session to run as a [background agent](https://code.claude.com/docs/en/agent-view.md) and free this terminal. Pass a prompt to send one more instruction before detaching. Monitor the session with `claude agents`. To copy the conversation into a new background session while this one keeps running, use `/fork`. Alias: `/bg` |59| `/background [prompt]` | Detach the current session to run as a [background agent](https://code.claude.com/docs/en/agent-view.md) and free this terminal. Pass a prompt to send one more instruction before detaching. Monitor the session with `claude agents`. To copy the conversation into a new background session while this one keeps running, use `/fork`. While a `/ship` or `/steward` watch is on, see [Messages during a watch](https://code.claude.com/docs/en/ship-command-troubleshooting.md#messages-during-a-watch). Alias: `/bg` |

60| `/batch <instruction>` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one [background subagent](https://code.claude.com/docs/en/sub-agents.md#run-subagents-in-foreground-or-background) per unit in an isolated [worktree](https://code.claude.com/docs/en/worktrees.md). Each subagent implements its unit, runs tests, and opens a PR or reports what happened. Requires a git repository or a [`WorktreeCreate` hook](https://code.claude.com/docs/en/worktrees#non-git-version-control) that creates the worktrees. Outside a git repository, `/batch` requires Claude Code v2.1.281 or later. Example: `/batch migrate src/ from JavaScript to TypeScript` |60| `/batch <instruction>` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one [background subagent](https://code.claude.com/docs/en/sub-agents.md#run-subagents-in-foreground-or-background) per unit in an isolated [worktree](https://code.claude.com/docs/en/worktrees.md). Each subagent implements its unit, runs tests, and opens a PR or reports what happened. Requires a git repository or a [`WorktreeCreate` hook](https://code.claude.com/docs/en/worktrees#non-git-version-control) that creates the worktrees. Outside a git repository, `/batch` requires Claude Code v2.1.281 or later. Example: `/batch migrate src/ from JavaScript to TypeScript` |

61| `/branch [name]` | Create a branch of the current conversation at this point, so you can try a different direction without losing the conversation as it stands. Switches you into the branch and preserves the original, which you can return to with `/resume`. To run a copy as a separate [background session](https://code.claude.com/docs/en/agent-view.md) instead of switching into it, use `/fork`; to hand a side task to a [subagent](https://code.claude.com/docs/en/sub-agents.md) that reports back into this conversation, use `/subtask` |61| `/branch [name]` | Create a branch of the current conversation at this point, so you can try a different direction without losing the conversation as it stands. Switches you into the branch and preserves the original, which you can return to with `/resume`. To run a copy as a separate [background session](https://code.claude.com/docs/en/agent-view.md) instead of switching into it, use `/fork`; to hand a side task to a [subagent](https://code.claude.com/docs/en/sub-agents.md) that reports back into this conversation, use `/subtask` |

62| `/btw [question]` | Ask a [side question](https://code.claude.com/docs/en/interactive-mode.md#side-questions-with-%2Fbtw) about the current session without adding to the conversation. If you run `/btw` without a question, Claude Code shows your most recent side question so you can browse earlier answers; if you haven't asked one yet, Claude Code prints a usage line |62| `/btw [question]` | Ask a [side question](https://code.claude.com/docs/en/interactive-mode.md#side-questions-with-%2Fbtw) about the current session without adding to the conversation. If you run `/btw` without a question, Claude Code shows your most recent side question so you can browse earlier answers; if you haven't asked one yet, Claude Code prints a usage line |


64| `/cd <path>` | Move this session to a new working directory, keeping the conversation. Type a partial path to see matching directory suggestions; press `Tab` to accept one. For what Claude Code applies from the new directory as soon as you move, and how `/cd` differs from `/add-dir`, see [Move the session to another directory](https://code.claude.com/docs/en/permissions.md#move-the-session-to-another-directory) |64| `/cd <path>` | Move this session to a new working directory, keeping the conversation. Type a partial path to see matching directory suggestions; press `Tab` to accept one. For what Claude Code applies from the new directory as soon as you move, and how `/cd` differs from `/add-dir`, see [Move the session to another directory](https://code.claude.com/docs/en/permissions.md#move-the-session-to-another-directory) |

65| `/chrome` | Configure [Claude in Chrome](https://code.claude.com/docs/en/chrome.md) settings |65| `/chrome` | Configure [Claude in Chrome](https://code.claude.com/docs/en/chrome.md) settings |

66| `/claude-api [migrate\|upgrade\|api-version\|managed-agents-onboard\|managed-agents-secure\|prompt-audit\|cost-optimize\|latency-optimize\|build-eval\|hillclimb\|preserved-thinking-migration]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Load [Claude API](https://platform.claude.com/docs/en/api/overview) and [Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) reference material for your project's language. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk`. For what each subcommand does and the version it requires, see [Work on Claude API projects](https://code.claude.com/docs/en/skills.md#work-on-claude-api-projects) |66| `/claude-api [migrate\|upgrade\|api-version\|managed-agents-onboard\|managed-agents-secure\|prompt-audit\|cost-optimize\|latency-optimize\|build-eval\|hillclimb\|preserved-thinking-migration]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Load [Claude API](https://platform.claude.com/docs/en/api/overview) and [Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) reference material for your project's language. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk`. For what each subcommand does and the version it requires, see [Work on Claude API projects](https://code.claude.com/docs/en/skills.md#work-on-claude-api-projects) |

67| `/claude-approvals [what to change or explain]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Edit, explain, or tune a [Claude Approvals](https://code.claude.com/docs/en/approvals.md) policy file or classifier. Requires Claude Code v2.1.331 or later and [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) |

67| `/claude-in-chrome [task]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Have Claude carry out a task in your browser, such as testing a page, filling a form, or reading console logs, through [Claude in Chrome](https://code.claude.com/docs/en/chrome.md). Available when Chrome integration is enabled for the session, for example with `claude --chrome`, or when Claude Code can offer to [install the extension](https://code.claude.com/docs/en/chrome.md#install-the-extension-when-claude-asks) |68| `/claude-in-chrome [task]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Have Claude carry out a task in your browser, such as testing a page, filling a form, or reading console logs, through [Claude in Chrome](https://code.claude.com/docs/en/chrome.md). Available when Chrome integration is enabled for the session, for example with `claude --chrome`, or when Claude Code can offer to [install the extension](https://code.claude.com/docs/en/chrome.md#install-the-extension-when-claude-asks) |

68| `/clear [name]` | Start a new conversation with empty context. Pass a name to label the previous conversation in the `/resume` picker. To free up context while continuing the same conversation, use `/compact` instead. Resume the previous conversation with `/resume`, or, in the same Claude Code process, restore it from [the rewind menu's previous-session entry](https://code.claude.com/docs/en/checkpointing.md#rewind-past-a-cleared-conversation). Aliases: `/reset`, `/new` |69| `/clear [name]` | Start a new conversation with empty context. Pass a name to label the previous conversation in the `/resume` picker. To free up context while continuing the same conversation, use `/compact` instead. Resume the previous conversation with `/resume`, or, in the same Claude Code process, restore it from [the rewind menu's previous-session entry](https://code.claude.com/docs/en/checkpointing.md#rewind-past-a-cleared-conversation). Aliases: `/reset`, `/new` |

69| `/code-review [low\|medium\|high\|xhigh\|max\|ultra] [--fix] [--comment] [--max-findings n\|all\|default] [pr#\|branch\|path]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Review the current diff, or a PR number, branch, or path you pass, for correctness bugs. Depending on your model and effort level, the review also covers cleanup opportunities. Pass `--fix` to have Claude apply the findings, `--comment` to post them on the GitHub PR or GitLab merge request, or `ultra` to run a deep [cloud review](https://code.claude.com/docs/en/ultrareview.md). Posting to a GitLab merge request requires Claude Code v2.1.257 or later. With `ultra` on a `github.com` PR target, pass `--post` to preselect [posting the finished findings to the PR](https://code.claude.com/docs/en/ultrareview.md#post-findings-to-the-pull-request) in the launch dialog; `--post` requires Claude Code v2.1.227 or later. See [Review locally with `/code-review`](https://code.claude.com/docs/en/code-review-local) for the effort levels, targeting, and how it relates to `/simplify`. Alias: `/review` |70| `/code-review [low\|medium\|high\|xhigh\|max\|ultra] [--fix] [--comment] [--max-findings n\|all\|default] [pr#\|branch\|path]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Review the current diff, or a PR number, branch, or path you pass, for correctness bugs. Depending on your model and effort level, the review also covers cleanup opportunities. Pass `--fix` to have Claude apply the findings, `--comment` to post them on the GitHub PR or GitLab merge request, or `ultra` to run a deep [cloud review](https://code.claude.com/docs/en/ultrareview.md). Posting to a GitLab merge request requires Claude Code v2.1.257 or later. With `ultra` on a `github.com` PR target, pass `--post` to preselect [posting the finished findings to the PR](https://code.claude.com/docs/en/ultrareview.md#post-findings-to-the-pull-request) in the launch dialog; `--post` requires Claude Code v2.1.227 or later. See [Review locally with `/code-review`](https://code.claude.com/docs/en/code-review-local) for the effort levels, targeting, and how it relates to `/simplify`. Alias: `/review` |


110| `/memory` | Edit `CLAUDE.md` files, enable or disable [auto memory](https://code.claude.com/docs/en/memory.md#auto-memory), and view auto memory entries |111| `/memory` | Edit `CLAUDE.md` files, enable or disable [auto memory](https://code.claude.com/docs/en/memory.md#auto-memory), and view auto memory entries |

111| `/mobile` | Show QR code to download the Claude mobile app. Aliases: `/ios`, `/android` |112| `/mobile` | Show QR code to download the Claude mobile app. Aliases: `/ios`, `/android` |

112| `/model [model]` | Switch the AI model and save it as your default for new sessions. For models that support it, use left/right arrows to [adjust effort level](https://code.claude.com/docs/en/model-config.md#adjust-effort-level). With no argument, opens a picker; press `s` on a row to switch for the current session only. See [when the new model starts](https://code.claude.com/docs/en/interactive-mode.md#when-claude-code-sends-what-you-queued). Before v2.1.242, it could wait. With `-p`, pass a model argument, which isn't saved as your default; requires v2.1.205 or later |113| `/model [model]` | Switch the AI model and save it as your default for new sessions. For models that support it, use left/right arrows to [adjust effort level](https://code.claude.com/docs/en/model-config.md#adjust-effort-level). With no argument, opens a picker; press `s` on a row to switch for the current session only. See [when the new model starts](https://code.claude.com/docs/en/interactive-mode.md#when-claude-code-sends-what-you-queued). Before v2.1.242, it could wait. With `-p`, pass a model argument, which isn't saved as your default; requires v2.1.205 or later |

114| `/motion [brief]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Make a new animation from your brief as a [Claude Motion](https://support.claude.com/en/articles/17454997-get-started-with-claude-motion) artifact, for example `/motion an explainer of how our deploy pipeline works`. Available in local sessions in the [Desktop app](https://code.claude.com/docs/en/desktop.md) and in Anthropic-hosted [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), not in the terminal or IDE extensions. Requires Claude Code v2.1.323 or later and a Team or Enterprise account where the [Motion template is available](https://code.claude.com/docs/en/artifacts.md#start-from-a-slides-design-or-docs-template) |

113| `/output-style [style]` | List [output styles](https://code.claude.com/docs/en/output-styles.md) or switch to one, for example `/output-style concise`. See [Change your output style](https://code.claude.com/docs/en/output-styles.md#change-your-output-style). Requires Claude Code v2.1.269 or later |115| `/output-style [style]` | List [output styles](https://code.claude.com/docs/en/output-styles.md) or switch to one, for example `/output-style concise`. See [Change your output style](https://code.claude.com/docs/en/output-styles.md#change-your-output-style). Requires Claude Code v2.1.269 or later |

114| `/passes` | Share a free week of Claude Code with friends. Only visible if your account is eligible |116| `/passes` | Share a free week of Claude Code with friends. Only visible if your account is eligible |

115| `/permissions` | Manage allow, ask, and deny rules for tool permissions. Opens an interactive dialog where you can view rules by scope, add or remove rules, manage working directories, and review [recent auto mode denials](https://code.claude.com/docs/en/auto-mode-config.md#review-denials). You can also view and edit [auto mode classifier rules](https://code.claude.com/docs/en/auto-mode-config.md#edit-rules-from-permissions) from the dialog's **Auto mode** tab. In the desktop app, edit your [settings files](https://code.claude.com/docs/en/auto-mode-config.md#where-the-classifier-reads-configuration) instead. Alias: `/allowed-tools` |117| `/permissions` | Manage allow, ask, and deny rules for tool permissions. Opens an interactive dialog where you can view rules by scope, add or remove rules, manage working directories, and review [recent auto mode denials](https://code.claude.com/docs/en/auto-mode-config.md#review-denials). You can also view and edit [auto mode classifier rules](https://code.claude.com/docs/en/auto-mode-config.md#edit-rules-from-permissions) from the dialog's **Auto mode** tab. In the desktop app, edit your [settings files](https://code.claude.com/docs/en/auto-mode-config.md#where-the-classifier-reads-configuration) instead. Alias: `/allowed-tools` |


140| `/security-review` | Analyze the changes on your current branch for security vulnerabilities. Reviews the diff between your branch and origin's default branch, identifying risks like injection, auth issues, and data exposure. Needs an `origin` remote; if the review fails with an `ambiguous argument` error, see the [error reference](https://code.claude.com/docs/en/errors.md#security-review-fails-without-origin-head) |142| `/security-review` | Analyze the changes on your current branch for security vulnerabilities. Reviews the diff between your branch and origin's default branch, identifying risks like injection, auth issues, and data exposure. Needs an `origin` remote; if the review fails with an `ambiguous argument` error, see the [error reference](https://code.claude.com/docs/en/errors.md#security-review-fails-without-origin-head) |

141| `/setup-bedrock` | Configure [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md) authentication, region, and model pins through an interactive wizard. [Hidden from the command menu](#how-the-command-menu-matches-what-you-type) until `CLAUDE_CODE_USE_BEDROCK=1` is set; type it in full. First-time Amazon Bedrock users can also access this wizard from the login screen |143| `/setup-bedrock` | Configure [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md) authentication, region, and model pins through an interactive wizard. [Hidden from the command menu](#how-the-command-menu-matches-what-you-type) until `CLAUDE_CODE_USE_BEDROCK=1` is set; type it in full. First-time Amazon Bedrock users can also access this wizard from the login screen |

142| `/setup-vertex` | Configure [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md) authentication, project, region, and model pins through an interactive wizard. [Hidden from the command menu](#how-the-command-menu-matches-what-you-type) until `CLAUDE_CODE_USE_VERTEX=1` is set; type it in full. First-time Google Cloud's Agent Platform users can also access this wizard from the login screen |144| `/setup-vertex` | Configure [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md) authentication, project, region, and model pins through an interactive wizard. [Hidden from the command menu](#how-the-command-menu-matches-what-you-type) until `CLAUDE_CODE_USE_VERTEX=1` is set; type it in full. First-time Google Cloud's Agent Platform users can also access this wizard from the login screen |

143| `/ship [level] [pr] [+bot]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Commit and push your work and open a GitHub pull request, if your branch has none. Then review the change. Claude then watches the pull request in this session and pushes fixes for review feedback and failing checks. `/ship stop` ends the watch. See [Get a pull request ready with `/ship`](https://code.claude.com/docs/en/ship-command). If the command is missing, see [Troubleshooting](https://code.claude.com/docs/en/ship-command-troubleshooting.md) |145| `/ship [level] [pr] [+bot]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Commit and push your work [where `/ship` can](https://code.claude.com/docs/en/ship-command#what-%2Fship-commits-and-pushes), open a GitHub pull request for your branch if it has none, then review the change. Claude then watches the pull request in this session and pushes fixes for review feedback and failing checks. `/ship stop` ends the watch. See [Get a pull request ready with `/ship`](https://code.claude.com/docs/en/ship-command). If the command is missing, see [Troubleshooting](https://code.claude.com/docs/en/ship-command-troubleshooting.md) |

144| `/ship:review` | Alias for [`/code-review`](https://code.claude.com/docs/en/code-review-local) |146| `/ship:review` | Alias for [`/code-review`](https://code.claude.com/docs/en/code-review-local) |

145| `/simplify [target]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Review the changed code for cleanup opportunities and apply the fixes. Four review [agents](https://code.claude.com/docs/en/sub-agents.md) run in parallel, covering reuse of existing helpers, simplification, efficiency, and whether the change is at the right level of abstraction. The review doesn't look for correctness bugs. Use `/code-review` to find bugs. Pass a path or PR reference to review a specific target |147| `/simplify [target]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Review the changed code for cleanup opportunities and apply the fixes. Four review [agents](https://code.claude.com/docs/en/sub-agents.md) run in parallel, covering reuse of existing helpers, simplification, efficiency, and whether the change is at the right level of abstraction. The review doesn't look for correctness bugs. Use `/code-review` to find bugs. Pass a path or PR reference to review a specific target |

146| `/skill-doctor` | Show what each of your [skills](https://code.claude.com/docs/en/skills.md) costs in context and how often it gets used, so you can [find skills to turn off](https://code.claude.com/docs/en/skills.md#find-unused-skills). Requires Claude Code v2.1.252 or later and [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) |148| `/skill-doctor` | Show what each of your [skills](https://code.claude.com/docs/en/skills.md) costs in context and how often it gets used, so you can [find skills to turn off](https://code.claude.com/docs/en/skills.md#find-unused-skills). Requires Claude Code v2.1.252 or later and [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) |


169| `/vim` | Removed in v2.1.92. To toggle between Vim and Normal editing modes, use `/config` → Editor mode |171| `/vim` | Removed in v2.1.92. To toggle between Vim and Normal editing modes, use `/config` → Editor mode |

170| `/voice [hold\|tap\|off]` | Toggle [voice dictation](https://code.claude.com/docs/en/voice-dictation.md), or enable it in a specific mode. Requires a Claude.ai account |172| `/voice [hold\|tap\|off]` | Toggle [voice dictation](https://code.claude.com/docs/en/voice-dictation.md), or enable it in a specific mode. Requires a Claude.ai account |

171| `/web-setup` | Connect your GitHub account for [cloud sessions](https://code.claude.com/docs/en/web-quickstart.md#connect-from-your-terminal) using your local `gh` CLI credentials |173| `/web-setup` | Connect your GitHub account for [cloud sessions](https://code.claude.com/docs/en/web-quickstart.md#connect-from-your-terminal) using your local `gh` CLI credentials |

174| `/whiteboard [brief]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Make a new whiteboard from your brief as a [Claude Whiteboards](https://support.claude.com/en/articles/18324319-get-started-with-claude-whiteboards) artifact, for example `/whiteboard a service map of the checkout flow`. Requires Claude Code v2.1.323 or later, a session where [artifacts are available](https://code.claude.com/docs/en/artifacts.md#availability), and an account where the [Whiteboards template is available](https://code.claude.com/docs/en/artifacts.md#start-from-a-slides-design-or-docs-template). When your organization has that template off, the command doesn't appear, so ask an Owner to [turn it on](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_6e06d8f1a8) |

172| `/workflow-authoring` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Load the reference for writing [dynamic workflow](https://code.claude.com/docs/en/workflows.md) scripts: the script API, resume behavior, quality patterns, and worked examples. Claude normally loads it on its own before writing a script; run it yourself before [editing a saved script by hand](https://code.claude.com/docs/en/workflows.md#edit-a-saved-script). Available when dynamic workflows are enabled, and requires Claude Code v2.1.248 or later |175| `/workflow-authoring` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Load the reference for writing [dynamic workflow](https://code.claude.com/docs/en/workflows.md) scripts: the script API, resume behavior, quality patterns, and worked examples. Claude normally loads it on its own before writing a script; run it yourself before [editing a saved script by hand](https://code.claude.com/docs/en/workflows.md#edit-a-saved-script). Available when dynamic workflows are enabled, and requires Claude Code v2.1.248 or later |

173| `/workflows` | Open the [workflow](https://code.claude.com/docs/en/workflows.md#watch-the-run) progress view to watch, pause, resume, or save running and completed workflows |176| `/workflows` | Open the [workflow](https://code.claude.com/docs/en/workflows.md#watch-the-run) progress view to watch, pause, resume, or save running and completed workflows |

174 177 

desktop.md +3 −3

Details

8 8 

9In the Claude Desktop app, Claude Code is the **Code** tab. The app also has chat and [Cowork](https://claude.com/product/cowork), which handles Dispatch and longer agentic work. This page is the reference for the Code tab.9In the Claude Desktop app, Claude Code is the **Code** tab. The app also has chat and [Cowork](https://claude.com/product/cowork), which handles Dispatch and longer agentic work. This page is the reference for the Code tab.

10 10 

11> [card] [Download for macOS](https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code\&utm_medium=docs)11> [card] [Download for macOS](https://claude.ai/claude-code/desktop-download?platform=mac\&utm_source=claude_code\&utm_medium=docs)

12>12>

13> Universal build for Intel and Apple Silicon13> Universal build for Intel and Apple Silicon

14 14 

15> [card] [Download for Windows](https://claude.ai/api/desktop/win32/x64/setup/latest/redirect?utm_source=claude_code\&utm_medium=docs)15> [card] [Download for Windows](https://claude.ai/claude-code/desktop-download?platform=win-x64\&utm_source=claude_code\&utm_medium=docs)

16>16>

17> For x64 processors17> For x64 processors

18 18 


20>20>

21> apt or .deb for Ubuntu and Debian21> apt or .deb for Ubuntu and Debian

22 22 

23For Windows ARM64, download the [ARM64 installer](https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code\&utm_medium=docs). On Linux, install with apt; see [Claude Desktop on Linux](https://code.claude.com/docs/en/desktop-linux.md).23For Windows ARM64, download the [ARM64 installer](https://claude.ai/claude-code/desktop-download?platform=win-arm64\&utm_source=claude_code\&utm_medium=docs). On Linux, install with apt; see [Claude Desktop on Linux](https://code.claude.com/docs/en/desktop-linux.md).

24 24 

25After installing, launch Claude, sign in, and click the **Code** tab. For a walkthrough of your first session, see the [Get started guide](https://code.claude.com/docs/en/desktop-quickstart.md).25After installing, launch Claude, sign in, and click the **Code** tab. For a walkthrough of your first session, see the [Get started guide](https://code.claude.com/docs/en/desktop-quickstart.md).

26 26 

Details

10 10 

11Claude Code is in the **Code** tab at the top of the app's sidebar. This page walks through installing the app and starting your first session there. Claude Code requires a [Pro, Max, Ultra, Team, or Enterprise subscription](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=desktop_quickstart_pricing).11Claude Code is in the **Code** tab at the top of the app's sidebar. This page walks through installing the app and starting your first session there. Claude Code requires a [Pro, Max, Ultra, Team, or Enterprise subscription](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=desktop_quickstart_pricing).

12 12 

13> [card] [Download for macOS](https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code\&utm_medium=docs)13> [card] [Download for macOS](https://claude.ai/claude-code/desktop-download?platform=mac\&utm_source=claude_code\&utm_medium=docs)

14>14>

15> Universal build for Intel and Apple Silicon15> Universal build for Intel and Apple Silicon

16 16 

17> [card] [Download for Windows](https://claude.ai/api/desktop/win32/x64/setup/latest/redirect?utm_source=claude_code\&utm_medium=docs)17> [card] [Download for Windows](https://claude.ai/claude-code/desktop-download?platform=win-x64\&utm_source=claude_code\&utm_medium=docs)

18>18>

19> For x64 processors19> For x64 processors

20 20 


22>22>

23> apt or .deb for Ubuntu and Debian23> apt or .deb for Ubuntu and Debian

24 24 

25For Windows ARM64, download the [ARM64 installer](https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code\&utm_medium=docs). On Linux, install with apt; see [Claude Desktop on Linux](https://code.claude.com/docs/en/desktop-linux.md).25For Windows ARM64, download the [ARM64 installer](https://claude.ai/claude-code/desktop-download?platform=win-arm64\&utm_source=claude_code\&utm_medium=docs). On Linux, install with apt; see [Claude Desktop on Linux](https://code.claude.com/docs/en/desktop-linux.md).

26 26 

27> [!NOTE]27> [!NOTE]

28>28>

env-vars.md +8 −5

Details

261| `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS` | Set to `1` to remove built-in commit and PR workflow instructions and the git status snapshot from Claude's context. Useful when using your own git workflow skills. Takes precedence over the [`includeGitInstructions`](https://code.claude.com/docs/en/settings-reference#includegitinstructions) setting when set |261| `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS` | Set to `1` to remove built-in commit and PR workflow instructions and the git status snapshot from Claude's context. Useful when using your own git workflow skills. Takes precedence over the [`includeGitInstructions`](https://code.claude.com/docs/en/settings-reference#includegitinstructions) setting when set |

262| `CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT` | Set to `1` to stop Claude Code from reading scripts passed to a shell with `-c`, such as `bash -c 'rm -rf ~'`, for [critical-path](https://code.claude.com/docs/en/permission-modes.md#removals-inside-nested-commands-and-inline-scripts) removals. Claude Code still checks the shell variable and positional parameter targets in those scripts, and the other critical-path checks keep running. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.288 or later |262| `CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT` | Set to `1` to stop Claude Code from reading scripts passed to a shell with `-c`, such as `bash -c 'rm -rf ~'`, for [critical-path](https://code.claude.com/docs/en/permission-modes.md#removals-inside-nested-commands-and-inline-scripts) removals. Claude Code still checks the shell variable and positional parameter targets in those scripts, and the other critical-path checks keep running. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.288 or later |

263| `CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP` | Set to `1` to prevent automatic remapping of Opus 4 and Opus 4.1 to the current Opus version on the Anthropic API. The remap doesn't run on Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry |263| `CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP` | Set to `1` to prevent automatic remapping of Opus 4 and Opus 4.1 to the current Opus version on the Anthropic API. The remap doesn't run on Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry |

264| `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` | Set to `1` so that Claude waits for the result of an [MCP task](https://code.claude.com/docs/en/mcp.md#make-claude-wait-for-the-result-of-an-mcp-task) in an interactive session. While [automatic backgrounding](https://code.claude.com/docs/en/mcp.md#automatic-backgrounding-of-long-tool-calls) is on, it still moves the call to the background after two minutes by default. Requires Claude Code v2.1.304 or later |264| `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` | Set to `1` so that Claude waits for the result of an [MCP task](https://code.claude.com/docs/en/mcp.md#make-claude-wait-for-the-result-of-an-mcp-task) in an interactive terminal session. While [automatic backgrounding](https://code.claude.com/docs/en/mcp.md#automatic-backgrounding-of-long-tool-calls) is on, it still moves the call to the background after two minutes by default. Requires Claude Code v2.1.304 or later |

265| `CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK` | Set to `1` to stop Claude Code on [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md#when-a-model-is-disabled-mid-session) and [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md#when-a-model-is-disabled-mid-session) from switching to an older model when your account loses access to a session's model mid-session; the refused request fails at once instead. A [fallback model chain](https://code.claude.com/docs/en/model-config.md#fallback-model-chains) you configure still switches on that refusal, and the [startup model checks](https://code.claude.com/docs/en/amazon-bedrock.md#startup-model-checks) still fall back at launch. Requires Claude Code v2.1.285 or later |265| `CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK` | Set to `1` to stop Claude Code on [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md#when-a-model-is-disabled-mid-session) and [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md#when-a-model-is-disabled-mid-session) from switching to an older model when your account loses access to a session's model mid-session; the refused request fails at once instead. A [fallback model chain](https://code.claude.com/docs/en/model-config.md#fallback-model-chains) you configure still switches on that refusal, and the [startup model checks](https://code.claude.com/docs/en/amazon-bedrock.md#startup-model-checks) still fall back at launch. Requires Claude Code v2.1.285 or later |

266| `CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPT` | Set to `1` to turn off the [mounted drive prompt](https://code.claude.com/docs/en/permission-modes.md#the-mounted-drive-prompt) for paths such as `/Volumes/USB`. [Set it in the environment that launches Claude Code](#set-variables-in-your-shell), because Claude Code [ignores it in a settings `env` block](https://code.claude.com/docs/en/settings-reference#variables-claude-code-ignores-in-env). Requires Claude Code v2.1.304 or later |266| `CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPT` | Set to `1` to turn off the [mounted drive prompt](https://code.claude.com/docs/en/permission-modes.md#the-mounted-drive-prompt) for paths such as `/Volumes/USB`. [Set it in the environment that launches Claude Code](#set-variables-in-your-shell), because Claude Code [ignores it in a settings `env` block](https://code.claude.com/docs/en/settings-reference#variables-claude-code-ignores-in-env). Requires Claude Code v2.1.304 or later |

267| `CLAUDE_CODE_DISABLE_MOUSE` | Set to `1` to disable mouse tracking in [fullscreen rendering](https://code.claude.com/docs/en/fullscreen.md). Keyboard scrolling with `PgUp` and `PgDn` still works. Use this to keep your terminal's native copy-on-select behavior |267| `CLAUDE_CODE_DISABLE_MOUSE` | Set to `1` to disable mouse tracking in [fullscreen rendering](https://code.claude.com/docs/en/fullscreen.md). Keyboard scrolling with `PgUp` and `PgDn` still works. Use this to keep your terminal's native copy-on-select behavior |


277| `CLAUDE_CODE_DISABLE_PROXY_SCHEME_REPAIR` | Set to `1` to have Claude Code stop at startup on a plain `host:port` in `HTTPS_PROXY` or `https_proxy` even when it starts with no terminal. Claude Code ignores it in project and local settings. Requires Claude Code v2.1.327 or later |277| `CLAUDE_CODE_DISABLE_PROXY_SCHEME_REPAIR` | Set to `1` to have Claude Code stop at startup on a plain `host:port` in `HTTPS_PROXY` or `https_proxy` even when it starts with no terminal. Claude Code ignores it in project and local settings. Requires Claude Code v2.1.327 or later |

278| `CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK` | Set to `1` to turn off the [automatic model switch when a safety classifier flags a request](https://code.claude.com/docs/en/model-config.md#automatic-model-fallback), the behavior the [`switchModelsOnFlag`](https://code.claude.com/docs/en/settings-reference#switchmodelsonflag) setting controls |278| `CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK` | Set to `1` to turn off the [automatic model switch when a safety classifier flags a request](https://code.claude.com/docs/en/model-config.md#automatic-model-fallback), the behavior the [`switchModelsOnFlag`](https://code.claude.com/docs/en/settings-reference#switchmodelsonflag) setting controls |

279| `CLAUDE_CODE_DISABLE_SHELL_HEAD_START` | Set to `1` to turn off the head start that can run your shell startup files while Claude writes the session's first Bash command, before that command's permission prompt. Requires Claude Code v2.1.327 or later |279| `CLAUDE_CODE_DISABLE_SHELL_HEAD_START` | Set to `1` to turn off the head start that can run your shell startup files while Claude writes the session's first Bash command, before that command's permission prompt. Requires Claude Code v2.1.327 or later |

280| `CLAUDE_CODE_DISABLE_SHIP` | Set to `1` to turn off [`/ship` and `/steward`](https://code.claude.com/docs/en/ship-command#turn-off-%2Fship-and-%2Fsteward-for-your-organization). Requires Claude Code v2.1.331 or later |

280| `CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS` | Set to `1` to stop Claude Code from sending the structured-output `output_config.format` field and the `anthropic-beta` value that pairs with it, for an [LLM gateway](https://code.claude.com/docs/en/llm-gateway-protocol.md#feature-pass-through) whose upstream rejects them. This leaves on the other pre-release capabilities that [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](https://code.claude.com/docs/en/llm-gateway-protocol#disable-pre-release-capabilities) turns off. Requires Claude Code v2.1.288 or later |281| `CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS` | Set to `1` to stop Claude Code from sending the structured-output `output_config.format` field and the `anthropic-beta` value that pairs with it, for an [LLM gateway](https://code.claude.com/docs/en/llm-gateway-protocol.md#feature-pass-through) whose upstream rejects them. This leaves on the other pre-release capabilities that [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](https://code.claude.com/docs/en/llm-gateway-protocol#disable-pre-release-capabilities) turns off. Requires Claude Code v2.1.288 or later |

281| `CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT` | Set to `1` to turn off the [critical-path](https://code.claude.com/docs/en/permission-modes.md#critical-paths) check for a recursive `rm` whose target is entirely the output of a command substitution, such as `rm -rf "$(pwd)"`. The other critical-path checks keep running. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.281 or later |282| `CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT` | Set to `1` to turn off the [critical-path](https://code.claude.com/docs/en/permission-modes.md#critical-paths) check for a recursive `rm` whose target is entirely the output of a command substitution, such as `rm -rf "$(pwd)"`. The other critical-path checks keep running. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings `env` block. Requires Claude Code v2.1.281 or later |

282| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context. This also skips the background small/fast-model request that [generates a session title](https://code.claude.com/docs/en/sessions.md#name-your-sessions), and turns off [status reports to your terminal](https://code.claude.com/docs/en/terminal-config.md#see-session-status-in-your-terminal) |283| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context. This also skips the background small/fast-model request that [generates a session title](https://code.claude.com/docs/en/sessions.md#name-your-sessions), and turns off [status reports to your terminal](https://code.claude.com/docs/en/terminal-config.md#see-session-status-in-your-terminal) |


341| `CLAUDE_CODE_MAX_TURNS` | Cap the number of agentic turns when no explicit limit is passed. Equivalent to passing [`--max-turns`](https://code.claude.com/docs/en/cli-reference#cli-flags), which takes precedence when both are set. A value that is not a positive integer is rejected at startup with an error rather than treated as no cap |342| `CLAUDE_CODE_MAX_TURNS` | Cap the number of agentic turns when no explicit limit is passed. Equivalent to passing [`--max-turns`](https://code.claude.com/docs/en/cli-reference#cli-flags), which takes precedence when both are set. A value that is not a positive integer is rejected at startup with an error rather than treated as no cap |

342| `CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION` | Cap on [WebSearch](https://code.claude.com/docs/en/tools-reference.md#session-search-limit) calls (default: 200). When Claude reaches the cap, further WebSearch calls return a notice telling it to continue with the information it already gathered and say so in its answer. Accepts a positive whole number with no upper bound. Anything else is ignored and the default applies, so the cap can be raised but not turned off. Requires Claude Code v2.1.212 or later |343| `CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION` | Cap on [WebSearch](https://code.claude.com/docs/en/tools-reference.md#session-search-limit) calls (default: 200). When Claude reaches the cap, further WebSearch calls return a notice telling it to continue with the information it already gathered and say so in its answer. Accepts a positive whole number with no upper bound. Anything else is ignored and the default applies, so the cap can be raised but not turned off. Requires Claude Code v2.1.212 or later |

343| `CLAUDE_CODE_MCP_ALLOWLIST_ENV` | Set to `1` to spawn stdio MCP servers with only a safe baseline environment plus the server's configured `env`, instead of inheriting your shell environment |344| `CLAUDE_CODE_MCP_ALLOWLIST_ENV` | Set to `1` to spawn stdio MCP servers with only a safe baseline environment plus the server's configured `env`, instead of inheriting your shell environment |

344| `CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS` | Elapsed time in milliseconds before a still-running MCP tool call [moves to a background task](https://code.claude.com/docs/en/mcp.md#automatic-backgrounding-of-long-tool-calls) (default: 120000, or 2 minutes). Set to `0` to turn automatic backgrounding off and, in an interactive session, to make Claude wait for [MCP tasks](https://code.claude.com/docs/en/mcp.md#make-claude-wait-for-the-result-of-an-mcp-task). Requires Claude Code v2.1.212 or later |345| `CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS` | Elapsed time in milliseconds before a still-running MCP tool call [moves to a background task](https://code.claude.com/docs/en/mcp.md#automatic-backgrounding-of-long-tool-calls) (default: 120000, or 2 minutes). Set to `0` to turn automatic backgrounding off. In an interactive terminal session, `0` also makes Claude wait for [MCP tasks](https://code.claude.com/docs/en/mcp.md#make-claude-wait-for-the-result-of-an-mcp-task). Requires Claude Code v2.1.212 or later |

345| `CLAUDE_CODE_MCP_STARTUP_WAIT_MS` | How long in milliseconds the first turn of a [non-interactive](https://code.claude.com/docs/en/headless.md) session waits for MCP servers that are still connecting, in place of the default [first-turn wait](https://code.claude.com/docs/en/agent-sdk/mcp.md#connection-timing). In a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments-configuration.md#connection-timing), it changes only how long the wait lasts. Some servers keep a wait of their own regardless of the value; [Connection timing](https://code.claude.com/docs/en/agent-sdk/mcp.md#connection-timing) lists them. Set to `0` to skip the wait for every other server. Requires Claude Code v2.1.274 or later |346| `CLAUDE_CODE_MCP_STARTUP_WAIT_MS` | How long in milliseconds the first turn of a [non-interactive](https://code.claude.com/docs/en/headless.md) session waits for MCP servers that are still connecting, in place of the default [first-turn wait](https://code.claude.com/docs/en/agent-sdk/mcp.md#connection-timing). In a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments-configuration.md#connection-timing), it changes only how long the wait lasts. Some servers keep a wait of their own regardless of the value; [Connection timing](https://code.claude.com/docs/en/agent-sdk/mcp.md#connection-timing) lists them. Set to `0` to skip the wait for every other server. Requires Claude Code v2.1.274 or later |

346| `CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT` | Idle timeout in milliseconds for MCP tool calls. When a stdio, HTTP, SSE, WebSocket, or [claude.ai connector](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) MCP server sends no response and no progress notification for this long, the tool call aborts with an error instead of waiting for the overall `MCP_TOOL_TIMEOUT`. Overrides the per-transport defaults of 300000 (5 minutes) for network servers and 1800000 (30 minutes) for stdio servers. Set to `0` to disable the idle check. Values below 1000 are raised to one second, and the value is capped at the effective `MCP_TOOL_TIMEOUT`. A per-server `timeout` in `.mcp.json` of at least 1000 raises that server's idle window to at least the `timeout` value. Doesn't apply to IDE servers or SDK in-process servers. Requires Claude Code v2.1.187 or later. Before v2.1.203, stdio servers were exempt from the idle timeout |347| `CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT` | Idle timeout in milliseconds for MCP tool calls. When a stdio, HTTP, SSE, WebSocket, or [claude.ai connector](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) MCP server sends no response and no progress notification for this long, the tool call aborts with an error instead of waiting for the overall `MCP_TOOL_TIMEOUT`. Overrides the per-transport defaults of 300000 (5 minutes) for network servers and 1800000 (30 minutes) for stdio servers. Set to `0` to disable the idle check. Values below 1000 are raised to one second, and the value is capped at the effective `MCP_TOOL_TIMEOUT`. A per-server `timeout` in `.mcp.json` of at least 1000 raises that server's idle window to at least the `timeout` value. Doesn't apply to IDE servers or SDK in-process servers. Requires Claude Code v2.1.187 or later. Before v2.1.203, stdio servers were exempt from the idle timeout |

347| `CLAUDE_CODE_MESSAGING_SOCKET` | Set by Claude Code, not by you: in sessions that bind an [inbox socket](https://code.claude.com/docs/en/cross-session-messaging.md#the-sessions-inbox-socket), Claude Code exports that socket's path to hooks and Bash commands when it binds the socket. In a session that starts with messaging on, Claude Code binds the socket before any hook runs. Other sessions on the machine deliver messages to this path. Each session exports its own socket rather than one inherited from a parent, and messages arriving on it go through the session's [inbound controls](https://code.claude.com/docs/en/cross-session-messaging.md#control-inbound-messages). Settings `env` blocks can't set it. Requires Claude Code v2.1.224 or later |348| `CLAUDE_CODE_MESSAGING_SOCKET` | Set by Claude Code, not by you: in sessions that bind an [inbox socket](https://code.claude.com/docs/en/cross-session-messaging.md#the-sessions-inbox-socket), Claude Code exports that socket's path to hooks and Bash commands when it binds the socket. In a session that starts with messaging on, Claude Code binds the socket before any hook runs. Other sessions on the machine deliver messages to this path. Each session exports its own socket rather than one inherited from a parent, and messages arriving on it go through the session's [inbound controls](https://code.claude.com/docs/en/cross-session-messaging.md#control-inbound-messages). Settings `env` blocks can't set it. Requires Claude Code v2.1.224 or later |


387| `CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS` | Maximum age in milliseconds of the last transcript message for a session that ended mid-turn to continue automatically on resume. When the last message is older than this bound, Claude Code skips the `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` automatic resume and its `CLAUDE_CODE_RESUME_PROMPT` continuation message, and the session starts idle so you continue explicitly. Unset or `0` sets no bound, except that some turns resume only within six hours of their last message, such as one that ended with an API error. A positive value bounds every turn, including those; a negative or non-numeric value applies a one-hour bound. Spawn scripts for long-running agents can set this so a restart against an old transcript doesn't re-run a stale prompt. Claude Code sets a one-hour bound itself when it restarts a crashed [agent view](https://code.claude.com/docs/en/agent-view.md) session that inherited its conversation from an interactive session. Requires Claude Code v2.1.211 or later |388| `CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS` | Maximum age in milliseconds of the last transcript message for a session that ended mid-turn to continue automatically on resume. When the last message is older than this bound, Claude Code skips the `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` automatic resume and its `CLAUDE_CODE_RESUME_PROMPT` continuation message, and the session starts idle so you continue explicitly. Unset or `0` sets no bound, except that some turns resume only within six hours of their last message, such as one that ended with an API error. A positive value bounds every turn, including those; a negative or non-numeric value applies a one-hour bound. Spawn scripts for long-running agents can set this so a restart against an old transcript doesn't re-run a stale prompt. Claude Code sets a one-hour bound itself when it restarts a crashed [agent view](https://code.claude.com/docs/en/agent-view.md) session that inherited its conversation from an interactive session. Requires Claude Code v2.1.211 or later |

388| `CLAUDE_CODE_RESUME_PROMPT` | Override the continuation message Claude Code sends to Claude when `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` continues an interrupted turn instead of resending its prompt, or when you resume a [deferred tool call](https://code.claude.com/docs/en/hooks.md#defer-a-tool-call-for-later) with `-p`. Defaults to `Continue from where you left off.`. An empty string uses the default |389| `CLAUDE_CODE_RESUME_PROMPT` | Override the continuation message Claude Code sends to Claude when `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` continues an interrupted turn instead of resending its prompt, or when you resume a [deferred tool call](https://code.claude.com/docs/en/hooks.md#defer-a-tool-call-for-later) with `-p`. Defaults to `Continue from where you left off.`. An empty string uses the default |

389| `CLAUDE_CODE_RESUME_SHOWS_CUT_OFF_CALLS` | Set to `1` to keep [interrupted tool calls](https://code.claude.com/docs/en/sessions.md#what-a-resumed-session-restores), marked as cut off, in a turn that `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` continues. When unset, those calls are dropped before the turn continues. Some calls stay dropped, such as calls to subagents, skills, workflows, and tools that wait on a person. For the VS Code chat panel, see [Continue conversations after a reload](https://code.claude.com/docs/en/vs-code.md#continue-conversations-after-a-reload). Requires Claude Code v2.1.309 or later |390| `CLAUDE_CODE_RESUME_SHOWS_CUT_OFF_CALLS` | Set to `1` to keep [interrupted tool calls](https://code.claude.com/docs/en/sessions.md#what-a-resumed-session-restores), marked as cut off, in a turn that `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` continues. When unset, those calls are dropped before the turn continues. Some calls stay dropped, such as calls to subagents, skills, workflows, and tools that wait on a person. For the VS Code chat panel, see [Continue conversations after a reload](https://code.claude.com/docs/en/vs-code.md#continue-conversations-after-a-reload). Requires Claude Code v2.1.309 or later |

390| `CLAUDE_CODE_RETRY_WATCHDOG` | Set to `1` for unattended sessions such as eval harnesses, CI jobs, or remote workers. Retries `429` and `529` capacity errors indefinitely instead of failing after `CLAUDE_CODE_MAX_RETRIES` attempts. Claude Code fails at once when a standard-speed request gets a `429` that reports a spend limit or exhausted usage credits, even one from a [gateway spend cap](https://code.claude.com/docs/en/errors.md#spend-limit-reached) that resets on a schedule. Before v2.1.239, the watchdog retried these indefinitely. For fast mode requests, see [Handle rate limits](https://code.claude.com/docs/en/fast-mode.md#handle-rate-limits). The watchdog backs off up to 5 minutes between attempts, or until the limit resets when the response carries a rate-limit reset time, so a session that hits a usage limit waits out the remaining window. On v2.1.199 or later it also raises the default retry count for other transient errors, such as server errors, timeouts, and dropped connections, to 300, roughly three hours of backoff, and removes the cap of 15 on `CLAUDE_CODE_MAX_RETRIES` if you set that variable explicitly. Requires Claude Code v2.1.186 or later |391| `CLAUDE_CODE_RETRY_WATCHDOG` | Set to `1` for unattended sessions. Keeps retrying `429` and `529` capacity errors past `CLAUDE_CODE_MAX_RETRIES`. Spend limits and exhausted usage credits [can end the retries](https://code.claude.com/docs/en/errors.md#when-the-retry-watchdog-stops-retrying). See [retry limits](https://code.claude.com/docs/en/errors.md#tune-retry-behavior) and [fast mode](https://code.claude.com/docs/en/fast-mode.md#handle-rate-limits). Requires Claude Code v2.1.186 or later |

391| `CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS` | Maximum time in milliseconds that each API request spends waiting out `429` and `529` errors when `CLAUDE_CODE_RETRY_WATCHDOG` is set. Once that time is spent, the next such error ends the request. Give a positive whole number in plain digits, such as `1800000` for 30 minutes. When unset, the wait has no limit. Requires Claude Code v2.1.295 or later |392| `CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS` | Maximum time in milliseconds that each API request spends waiting out `429` and `529` errors when `CLAUDE_CODE_RETRY_WATCHDOG` is set. Once that time is spent, the next such error ends the request. Give a positive whole number in plain digits, such as `1800000` for 30 minutes. When unset, the wait has no limit. Requires Claude Code v2.1.295 or later |

392| `CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS` | Minimum interval in milliseconds between checks of whether a [usage limit](https://code.claude.com/docs/en/errors.md#youve-hit-your-session-limit) was already lifted, while a request waits for that limit to reset with `CLAUDE_CODE_RETRY_WATCHDOG` set. When a check finds the limit lifted, the request goes out at once. Give a whole number in plain digits from `60000`, one minute, to `10800000`, three hours. Checks are made only for a claude.ai subscription's session or weekly limit while usage credits aren't in use, and not while `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. When this variable is unset or its value is outside that range, no checks are made. Requires Claude Code v2.1.305 or later |393| `CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS` | Minimum interval in milliseconds between checks of whether a [usage limit](https://code.claude.com/docs/en/errors.md#youve-hit-your-session-limit) was already lifted, while a request waits for that limit to reset with `CLAUDE_CODE_RETRY_WATCHDOG` set. When a check finds the limit lifted, the request goes out at once. Give a whole number in plain digits from `60000`, one minute, to `10800000`, three hours. Checks are made only for a claude.ai subscription's session or weekly limit while usage credits aren't in use, and not while `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. When this variable is unset or its value is outside that range, no checks are made. Requires Claude Code v2.1.305 or later |

393| `CLAUDE_CODE_SAFE_MODE` | Set to `1` to start in safe mode: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto memory do not load, for troubleshooting a broken configuration. Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Equivalent to passing [`--safe-mode`](https://code.claude.com/docs/en/cli-reference#cli-flags). Directly spawned child processes inherit the variable |394| `CLAUDE_CODE_SAFE_MODE` | Set to `1` to start in safe mode: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP servers, and auto memory do not load, for troubleshooting a broken configuration. Managed settings policy still applies, including policy-configured hooks, status line, and file-suggestion commands; managed plugins, managed skills, managed CLAUDE.md, and policy-configured MCP servers do not. Equivalent to passing [`--safe-mode`](https://code.claude.com/docs/en/cli-reference#cli-flags). Directly spawned child processes inherit the variable |


600* Run [`claude import` or the `/import` command](https://code.claude.com/docs/en/cli-reference#cli-commands)601* Run [`claude import` or the `/import` command](https://code.claude.com/docs/en/cli-reference#cli-commands)

601* Run [`/skill-doctor`](https://code.claude.com/docs/en/skills#find-unused-skills) or open its report in the `/plugin` **Stats** tab602* Run [`/skill-doctor`](https://code.claude.com/docs/en/skills#find-unused-skills) or open its report in the `/plugin` **Stats** tab

602* Run [`/restart`](https://code.claude.com/docs/en/commands) on Pro, Max, and Ultra plans603* Run [`/restart`](https://code.claude.com/docs/en/commands) on Pro, Max, and Ultra plans

603* Run [`/ship` or `/steward`](https://code.claude.com/docs/en/ship-command)604* Run [`/ship` or `/steward`](https://code.claude.com/docs/en/ship-command), except with Claude Code v2.1.331 or later on a third-party provider or in a Claude apps gateway session

605* Run [`/claude-approvals`](https://code.claude.com/docs/en/commands)

604* Sync the [skills](https://code.claude.com/docs/en/skills.md#where-synced-skills-load) and [plugins](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins) enabled for your claude.ai account into your terminal sessions606* Sync the [skills](https://code.claude.com/docs/en/skills.md#where-synced-skills-load) and [plugins](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins) enabled for your claude.ai account into your terminal sessions

605* Turn on the [You should know mod](https://code.claude.com/docs/en/interactive-mode.md#you-should-know-suggestions)607* Turn on the [You should know mod](https://code.claude.com/docs/en/interactive-mode.md#you-should-know-suggestions)

606* Use [the advisor tool](https://code.claude.com/docs/en/advisor.md#requirements), except with Claude Code v2.1.300 or later on Claude Platform on AWS or [Claude Models on Google Cloud (Anthropic managed)](https://code.claude.com/docs/en/feature-availability.md#availability-by-model-provider)608* Use [the advisor tool](https://code.claude.com/docs/en/advisor.md#requirements), except with Claude Code v2.1.300 or later on Claude Platform on AWS or [Claude Models on Google Cloud (Anthropic managed)](https://code.claude.com/docs/en/feature-availability.md#availability-by-model-provider)

607* Use [MCP tasks](https://code.claude.com/docs/en/mcp.md#mcp-tasks-that-run-on-the-server)609* Use [MCP tasks](https://code.claude.com/docs/en/mcp.md#requirements-for-mcp-tasks) outside an interactive terminal session, or from a subagent

610* Use [skills from MCP servers](https://code.claude.com/docs/en/mcp.md#use-skills-from-mcp-servers)

608* Have Claude read [another organization's public artifact](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you)611* Have Claude read [another organization's public artifact](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you)

609* Get the [PowerShell tool](https://code.claude.com/docs/en/tools-reference.md#powershell-tool) by default for claude.ai and Console accounts on Windows with Git Bash installed; Claude Code routes shell commands through Git Bash unless you set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`. On Windows without Git Bash, the tool stays on612* Get the [PowerShell tool](https://code.claude.com/docs/en/tools-reference.md#powershell-tool) by default for claude.ai and Console accounts on Windows with Git Bash installed; Claude Code routes shell commands through Git Bash unless you set `CLAUDE_CODE_USE_POWERSHELL_TOOL=1`. On Windows without Git Bash, the tool stays on

610* Get [Claude-drafted feedback](https://code.claude.com/docs/en/tools-reference.md#sendfeedback-tool-behavior), which Claude Code turns on through a fetched flag613* Get [Claude-drafted feedback](https://code.claude.com/docs/en/tools-reference.md#sendfeedback-tool-behavior), which Claude Code turns on through a fetched flag

errors.md +22 −4

Details

330| `Failed to resume the conversation` | [Command-line errors](#failed-to-resume-the-conversation) |330| `Failed to resume the conversation` | [Command-line errors](#failed-to-resume-the-conversation) |

331| `No conversation found with session ID: <session-id>` | [Command-line errors](#no-conversation-found-with-the-session-id) |331| `No conversation found with session ID: <session-id>` | [Command-line errors](#no-conversation-found-with-the-session-id) |

332| `Windows reported an error (EBADF) when Claude Code read this session's transcript file` | [Command-line errors](#windows-reported-an-error-ebadf) |332| `Windows reported an error (EBADF) when Claude Code read this session's transcript file` | [Command-line errors](#windows-reported-an-error-ebadf) |

333| `Failed to resolve base branch "HEAD"` / `Failed to resolve HEAD in <folder>` | [Run parallel sessions with worktrees](https://code.claude.com/docs/en/common-workflows.md#run-parallel-sessions-with-worktrees) |

334| `points to a bare repository` | [Manage worktrees manually](https://code.claude.com/docs/en/worktrees.md#manage-worktrees-manually) |

335| `Cannot use PR/MR #<number>` | Follow the fix in the message. |

333| `Cannot switch renderers in this session` | [Command-line errors](#cannot-switch-renderers-in-this-session) |336| `Cannot switch renderers in this session` | [Command-line errors](#cannot-switch-renderers-in-this-session) |

334| `Cannot switch renderers while work is running in the background` | [Command-line errors](#cannot-switch-renderers-in-this-session) |337| `Cannot switch renderers while work is running in the background` | [Command-line errors](#cannot-switch-renderers-in-this-session) |

335| `Can't restart while work is running in the background` | [Command-line errors](#cant-restart-while-work-is-running-or-remote-control-is-connected) |338| `Can't restart while work is running in the background` | [Command-line errors](#cant-restart-while-work-is-running-or-remote-control-is-connected) |


350| `Marketplace "<name>" is registered from an untrusted source` | [Plugin errors](#marketplace-is-registered-from-an-untrusted-source) |353| `Marketplace "<name>" is registered from an untrusted source` | [Plugin errors](#marketplace-is-registered-from-an-untrusted-source) |

351| `Claude Code refuses the marketplace name "<name>"` | [Plugin errors](#claude-code-refuses-the-marketplace-name) |354| `Claude Code refuses the marketplace name "<name>"` | [Plugin errors](#claude-code-refuses-the-marketplace-name) |

352| `Marketplace name impersonates an official Anthropic/Claude marketplace` | [Plugin errors](#claude-code-refuses-the-marketplace-name) |355| `Marketplace name impersonates an official Anthropic/Claude marketplace` | [Plugin errors](#claude-code-refuses-the-marketplace-name) |

356| `Can't use the marketplace name "<name>"` | [Reserved names](https://code.claude.com/docs/en/plugins/marketplace-reference.md#reserved-names) |

353| `Marketplace "<name>" is already added from a different source` | [Plugin errors](#marketplace-is-already-added-from-a-different-source) |357| `Marketplace "<name>" is already added from a different source` | [Plugin errors](#marketplace-is-already-added-from-a-different-source) |

354| `"<name>" is another spelling of "<reserved>", a reserved marketplace name` | [Plugin errors](#marketplace-name-is-another-spelling-of-a-reserved-name) |358| `"<name>" is another spelling of "<reserved>", a reserved marketplace name` | [Plugin errors](#marketplace-name-is-another-spelling-of-a-reserved-name) |

355| `Cannot add marketplace "<name>": Claude Code cannot install plugins from a marketplace with this name` | [Plugin troubleshooting](https://code.claude.com/docs/en/plugins/troubleshooting.md#cannot-install-plugins-from-a-marketplace-with-this-name) |359| `Cannot add marketplace "<name>": Claude Code cannot install plugins from a marketplace with this name` | [Plugin troubleshooting](https://code.claude.com/docs/en/plugins/troubleshooting.md#cannot-install-plugins-from-a-marketplace-with-this-name) |


367| `does not load (...), so Claude Code ignores the whole file` | [Plugin troubleshooting](https://code.claude.com/docs/en/plugins/troubleshooting.md#does-not-load-so-claude-code-ignores-the-whole-file) |371| `does not load (...), so Claude Code ignores the whole file` | [Plugin troubleshooting](https://code.claude.com/docs/en/plugins/troubleshooting.md#does-not-load-so-claude-code-ignores-the-whole-file) |

368| `path escapes plugin directory` | [Plugin errors](#path-escapes-plugin-directory) |372| `path escapes plugin directory` | [Plugin errors](#path-escapes-plugin-directory) |

369| `path not read: <path> is absolute or has a ".." part` | [Plugin errors](#server-file-path-not-read) |373| `path not read: <path> is absolute or has a ".." part` | [Plugin errors](#server-file-path-not-read) |

374| `Plugin path not found: <path>` | Fix the plugin path you started the session with. For a plugin synced from claude.ai, restart Claude Code. |

375| `commands path not found: <path>` | [Plugin troubleshooting](https://code.claude.com/docs/en/plugins/troubleshooting.md#commands-path-not-found) |

370| `Plugin not loaded: its manifest <path> was not read` | [Plugin errors](#plugin-not-loaded-its-manifest-was-not-read) |376| `Plugin not loaded: its manifest <path> was not read` | [Plugin errors](#plugin-not-loaded-its-manifest-was-not-read) |

371| `path couldn't be checked` / `path could not be checked` | [Plugin errors](#path-could-not-be-checked) |377| `path couldn't be checked` / `path could not be checked` | [Plugin errors](#path-could-not-be-checked) |

372| `its marketplace entry path does not stay inside the marketplace directory` | [Plugin errors](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |378| `its marketplace entry path does not stay inside the marketplace directory` | [Plugin errors](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |


407| `Sandbox is required (sandbox.failIfUnavailable) and stopped being available in this session: <reason>` | [Sandboxing troubleshooting](https://code.claude.com/docs/en/sandboxing.md#commands-refused-with-sandbox-is-required) |413| `Sandbox is required (sandbox.failIfUnavailable) and stopped being available in this session: <reason>` | [Sandboxing troubleshooting](https://code.claude.com/docs/en/sandboxing.md#commands-refused-with-sandbox-is-required) |

408| `pkill: refusing to run` | [Tool errors](#pkill-pattern-matches-the-claude-code-process) |414| `pkill: refusing to run` | [Tool errors](#pkill-pattern-matches-the-claude-code-process) |

409| `Sandbox settings can't be changed here` / `Sandbox settings are overridden by a higher-priority configuration` | [Sandboxing troubleshooting](https://code.claude.com/docs/en/sandboxing.md#sandbox-settings-overridden) |415| `Sandbox settings can't be changed here` / `Sandbox settings are overridden by a higher-priority configuration` | [Sandboxing troubleshooting](https://code.claude.com/docs/en/sandboxing.md#sandbox-settings-overridden) |

416| `GH_HOST names a host other than github.com` / `GH_REPO names a host other than github.com` | Ask Claude to pass `--hostname <host>` on the `gh api` command, as in `gh api --hostname ghe.example.com repos/my-org/my-repo/pulls`. For `GH_REPO`, also have Claude replace the command's `{owner}` and `{repo}` with real names. |

410| `Failed to write to <name>'s inbox — nothing was sent` | [Tool errors](#failed-to-write-to-a-teammate-inbox) |417| `Failed to write to <name>'s inbox — nothing was sent` | [Tool errors](#failed-to-write-to-a-teammate-inbox) |

411| `Failed to write the plan approval request to the lead's inbox — plan not submitted` | [Tool errors](#failed-to-write-to-a-teammate-inbox) |418| `Failed to write the plan approval request to the lead's inbox — plan not submitted` | [Tool errors](#failed-to-write-to-a-teammate-inbox) |

412| `Its agent definition was not restored: the folder its definition file came from is not trusted` | [Tool errors](#teammate-agent-definition-not-restored) |419| `Its agent definition was not restored: the folder its definition file came from is not trusted` | [Tool errors](#teammate-agent-definition-not-restored) |


523| `Managed settings drop-in directory could not be read` | [Configuration warnings](#managed-settings-document-could-not-be-parsed) |530| `Managed settings drop-in directory could not be read` | [Configuration warnings](#managed-settings-document-could-not-be-parsed) |

524| `Unable to read managed policy settings` | [Configuration warnings](#unable-to-read-managed-policy-settings) |531| `Unable to read managed policy settings` | [Configuration warnings](#unable-to-read-managed-policy-settings) |

525| `Managed settings contain invalid entries, including PreToolUse/PermissionRequest hooks that are NOT loaded; fix or remove each entry:` | [Configuration warnings](#managed-settings-hooks-not-loaded) |532| `Managed settings contain invalid entries, including PreToolUse/PermissionRequest hooks that are NOT loaded; fix or remove each entry:` | [Configuration warnings](#managed-settings-hooks-not-loaded) |

533| `did not load, so nothing in them is in effect` / `These settings entries were skipped` in a `-p` run | [Broken settings in a `-p` run](https://code.claude.com/docs/en/settings#broken-settings-in-a-p-run) |

526| `otelHeadersHelper failed; telemetry is not being exported. See /status: ...` | [Configuration warnings](#otelheadershelper-failed) |534| `otelHeadersHelper failed; telemetry is not being exported. See /status: ...` | [Configuration warnings](#otelheadershelper-failed) |

527| `apply_flag_settings: nothing in this request was applied and earlier settings stay in force. Fix or remove these invalid settings and send it again` | [`applyFlagSettings()`](https://code.claude.com/docs/en/agent-sdk/typescript#applyflagsettings) |535| `apply_flag_settings: nothing in this request was applied and earlier settings stay in force. Fix or remove these invalid settings and send it again` | [`applyFlagSettings()`](https://code.claude.com/docs/en/agent-sdk/typescript#applyflagsettings) |

528| `Invalid JSON provided to --settings` / `Invalid JSON provided to the settings option` | [`--settings` flag](https://code.claude.com/docs/en/cli-reference#cli-flags) or [`settings` option](https://code.claude.com/docs/en/agent-sdk/typescript#options) |536| `Invalid JSON provided to --settings` / `Invalid JSON provided to the settings option` | [`--settings` flag](https://code.claude.com/docs/en/cli-reference#cli-flags) or [`settings` option](https://code.claude.com/docs/en/agent-sdk/typescript#options) |


615 623 

616| Variable | Default | Effect |624| Variable | Default | Effect |

617| :- | :- | :- |625| :- | :- | :- |

618| [`CLAUDE_CODE_MAX_RETRIES`](https://code.claude.com/docs/en/env-vars) | 10 | Number of retry attempts. Capped at 15 as of v2.1.186; as of v2.1.199 `CLAUDE_CODE_RETRY_WATCHDOG` raises the default and removes the cap. Lower it to surface failures faster in scripts. |626| [`CLAUDE_CODE_MAX_RETRIES`](https://code.claude.com/docs/en/env-vars) | 10 | Number of retry attempts, capped at 15. Lower it to surface failures faster in scripts. With `CLAUDE_CODE_RETRY_WATCHDOG` set on v2.1.199 or later, the cap doesn't apply, and the default for transient errors other than capacity errors is 300. |

619| [`CLAUDE_CODE_RETRY_WATCHDOG`](https://code.claude.com/docs/en/env-vars) | unset | Set to `1` in unattended sessions such as CI jobs to retry `429` and `529` capacity errors indefinitely instead of failing after `CLAUDE_CODE_MAX_RETRIES` attempts. Claude Code fails at once when a standard-speed request gets a `429` that reports a spend limit or exhausted usage credits, even one from a [gateway spend cap](#spend-limit-reached) that resets on a schedule. Before v2.1.239, the watchdog retried these indefinitely. For fast mode requests, see [Handle rate limits](https://code.claude.com/docs/en/fast-mode.md#handle-rate-limits). On v2.1.199 or later it also raises the default retry count for other transient errors, such as server errors, timeouts, and dropped connections, to 300, roughly three hours of backoff, and removes the cap of 15 on `CLAUDE_CODE_MAX_RETRIES` if you set that variable explicitly. |627| [`CLAUDE_CODE_RETRY_WATCHDOG`](https://code.claude.com/docs/en/env-vars) | unset | Set to `1` in unattended sessions such as CI jobs to keep retrying `429` and `529` capacity errors past `CLAUDE_CODE_MAX_RETRIES`. For exceptions, see [When the retry watchdog stops retrying](#when-the-retry-watchdog-stops-retrying). For fast mode requests, see [Handle rate limits](https://code.claude.com/docs/en/fast-mode.md#handle-rate-limits). |

620| [`CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS`](https://code.claude.com/docs/en/env-vars) | unset | Maximum time in milliseconds that each API request spends waiting out `429` and `529` errors when `CLAUDE_CODE_RETRY_WATCHDOG` is set. When unset, the wait has no limit. Requires Claude Code v2.1.295 or later. |628| [`CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS`](https://code.claude.com/docs/en/env-vars) | unset | Maximum time in milliseconds that each API request spends waiting out `429` and `529` errors when `CLAUDE_CODE_RETRY_WATCHDOG` is set. When unset, the wait has no limit. Requires Claude Code v2.1.295 or later. |

621| `CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS` | no cap | With `CLAUDE_CODE_RETRY_WATCHDOG` set, the longest time in milliseconds one request waits for your plan's [usage limit](#youve-hit-your-session-limit), such as the session or weekly limit, to reset. When the reset is further away than this cap, the request fails at once, unless usage credits have room or the API couldn't check them. In those cases it's retried, and fails if the cap passes before it succeeds. Requires Claude Code v2.1.301 or later. |629| `CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS` | no cap | With `CLAUDE_CODE_RETRY_WATCHDOG` set, the longest time in milliseconds one request waits for your plan's [usage limit](#youve-hit-your-session-limit), such as the session or weekly limit, to reset. When the reset is further away than this cap, the request fails at once, unless usage credits have room or the API couldn't check them. In those cases it's retried, and fails if the cap passes before it succeeds. Requires Claude Code v2.1.301 or later. |

622| [`CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS`](https://code.claude.com/docs/en/env-vars) | unset | Minimum interval in milliseconds between checks of whether a [usage limit](#youve-hit-your-session-limit) was already lifted, while a request waits for that limit to reset with `CLAUDE_CODE_RETRY_WATCHDOG` set. When a check finds the limit lifted, the request goes out at once. Give plain digits from `60000` to `10800000`. When unset or outside that range, no checks are made. For when Claude Code skips these checks, see the [environment variables reference](https://code.claude.com/docs/en/env-vars.md). Requires Claude Code v2.1.305 or later. |630| [`CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS`](https://code.claude.com/docs/en/env-vars) | unset | Minimum interval in milliseconds between checks of whether a [usage limit](#youve-hit-your-session-limit) was already lifted, while a request waits for that limit to reset with `CLAUDE_CODE_RETRY_WATCHDOG` set. When a check finds the limit lifted, the request goes out at once. Give plain digits from `60000` to `10800000`. When unset or outside that range, no checks are made. For when Claude Code skips these checks, see the [environment variables reference](https://code.claude.com/docs/en/env-vars.md). Requires Claude Code v2.1.305 or later. |


626| [`CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`](https://code.claude.com/docs/en/env-vars) | unset | Limit on re-sends of a [non-streaming request](#streaming-response-ended-before-any-complete-data-was-received) that times out. At the limit, the request fails. A response from Claude that takes longer than the timeout to generate times out again on every re-send, so set a low number such as `0` to fail sooner. For each attempt's timeout, see [How long a non-streaming attempt waits](#how-long-a-non-streaming-attempt-waits). Requires Claude Code v2.1.285 or later. |634| [`CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`](https://code.claude.com/docs/en/env-vars) | unset | Limit on re-sends of a [non-streaming request](#streaming-response-ended-before-any-complete-data-was-received) that times out. At the limit, the request fails. A response from Claude that takes longer than the timeout to generate times out again on every re-send, so set a low number such as `0` to fail sooner. For each attempt's timeout, see [How long a non-streaming attempt waits](#how-long-a-non-streaming-attempt-waits). Requires Claude Code v2.1.285 or later. |

627| [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars) | unset | Deadline in milliseconds for the first response byte of a streaming request. Requires Claude Code v2.1.242 or later. For how Claude Code picks the deadline when this is unset, see [No response from API](#no-response-from-api). |635| [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](https://code.claude.com/docs/en/env-vars) | unset | Deadline in milliseconds for the first response byte of a streaming request. Requires Claude Code v2.1.242 or later. For how Claude Code picks the deadline when this is unset, see [No response from API](#no-response-from-api). |

628 636 

637#### When the retry watchdog stops retrying

638 

639With `CLAUDE_CODE_RETRY_WATCHDOG` set, Claude Code stops retrying a request outside fast mode on responses such as these:

640 

641* **Spend limit**: a `429` for a [usage-credit spend limit](#youve-hit-your-monthly-spend-limit), or for a [gateway spend cap](#spend-limit-reached) that resets on a schedule.

642* **Exhausted [usage credits](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription)**: an out-of-credits `429` with no `anthropic-ratelimit-unified-overage-status` or `anthropic-ratelimit-unified-representative-claim` header.

643* **Marked not retryable**: a `429` or `529` with the [`x-should-retry: false`](https://code.claude.com/docs/en/llm-gateway-protocol#response-headers) header. Claude Code still retries the request when the API couldn't check your usage credits.

644 

645The spend limit and usage credit cases require Claude Code v2.1.239 or later. The `x-should-retry` case requires v2.1.311 or later.

646 

629#### How long a non-streaming attempt waits647#### How long a non-streaming attempt waits

630 648 

631A non-streaming attempt ends at its request timeout or at the body idle timeout, whichever comes first:649A non-streaming attempt ends at its request timeout or at the body idle timeout, whichever comes first:


3938 3956 

3939A message with `more than 4,000,000 characters` means a skill, a command, or a [prompt or agent hook](https://code.claude.com/docs/en/hooks.md#prompt-and-agent-hook-fields) didn't run. If you pasted long text as arguments, save it to a file, run `/clear`, since the text stays in the conversation, then pass its path.3957A message with `more than 4,000,000 characters` means a skill, a command, or a [prompt or agent hook](https://code.claude.com/docs/en/hooks.md#prompt-and-agent-hook-fields) didn't run. If you pasted long text as arguments, save it to a file, run `/clear`, since the text stays in the conversation, then pass its path.

3940 3958 

3941If your `PreToolUse` prompt or agent hook is over the limit, a tool call that Claude makes directly isn't blocked. Use a [command hook](https://code.claude.com/docs/en/hooks.md#command-hook-fields), which has no such limit. For a call from code in Code Mode, see [Tool call refused by a hook](https://code.claude.com/docs/en/code-mode.md#tool-call-refused-by-a-hook).3959If your `PreToolUse` prompt or agent hook is over the limit, a tool call that Claude makes directly isn't blocked. Use a [command hook](https://code.claude.com/docs/en/hooks.md#command-hook-fields), which has no such limit. For a call from code in Code Mode, see [Tool call ran after a hook failed](https://code.claude.com/docs/en/code-mode.md#tool-call-ran-after-a-hook-failed).

3942 3960 

3943### Input must be provided when using `--print`3961### Input must be provided when using `--print`

3944 3962 


4642* One of a plugin's [default component locations](https://code.claude.com/docs/en/plugins/manifest-reference.md#standard-layout), such as the `skills/` folder, the `monitors/monitors.json` file, or a [`SKILL.md` at the plugin root](https://code.claude.com/docs/en/plugins/components#skills): the plugin's other components still load4660* One of a plugin's [default component locations](https://code.claude.com/docs/en/plugins/manifest-reference.md#standard-layout), such as the `skills/` folder, the `monitors/monitors.json` file, or a [`SKILL.md` at the plugin root](https://code.claude.com/docs/en/plugins/components#skills): the plugin's other components still load

4643* The plugin's own directory: nothing from that plugin loads4661* The plugin's own directory: nothing from that plugin loads

4644 4662 

4645You don't see this error for a path that doesn't exist at all. In `/plugin`, the error appears under the plugin and names the path and the code the operating system returned:4663In `/plugin`, the error names the path and the code the operating system returned:

4646 4664 

4647```text theme={null}4665```text theme={null}

4648skills path couldn't be checked: /home/user/my-plugin/skills (ELOOP)4666skills path couldn't be checked: /home/user/my-plugin/skills (ELOOP)

Details

129 <td>[Code Mode](https://code.claude.com/docs/en/code-mode.md)</td>129 <td>[Code Mode](https://code.claude.com/docs/en/code-mode.md)</td>

130 <td>✓ (experimental, [requirements apply](https://code.claude.com/docs/en/code-mode.md#requirements))</td>130 <td>✓ (experimental, [requirements apply](https://code.claude.com/docs/en/code-mode.md#requirements))</td>

131 <td>✓ (experimental, [requirements apply](https://code.claude.com/docs/en/code-mode.md#requirements))</td>131 <td>✓ (experimental, [requirements apply](https://code.claude.com/docs/en/code-mode.md#requirements))</td>

132 <td>✗</td>132 <td>✓ (experimental, [requirements apply](https://code.claude.com/docs/en/code-mode.md#requirements))</td>

133 <td>✗</td>133 <td>✓ (experimental, [requirements apply](https://code.claude.com/docs/en/code-mode.md#requirements))</td>

134 <td>✗</td>134 <td>✓ (experimental, [requirements apply](https://code.claude.com/docs/en/code-mode.md#requirements))</td>

135 <td>✗</td>135 <td>✓ (experimental, [requirements apply](https://code.claude.com/docs/en/code-mode.md#requirements))</td>

136 <td>✗</td>136 <td>✓ (experimental, [requirements apply](https://code.claude.com/docs/en/code-mode.md#requirements))</td>

137 </tr>137 </tr>

138 138 

139 <tr>139 <tr>


258 258 

259> [tab] Amazon Bedrock259> [tab] Amazon Bedrock

260>260>

261> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [web search](https://code.claude.com/docs/en/tools-reference.md#websearch-tool-behavior), [fast mode](https://code.claude.com/docs/en/fast-mode.md), [Advisor](https://code.claude.com/docs/en/advisor.md), [Channels](https://code.claude.com/docs/en/channels.md), [Code Mode](https://code.claude.com/docs/en/code-mode.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).261> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [web search](https://code.claude.com/docs/en/tools-reference.md#websearch-tool-behavior), [fast mode](https://code.claude.com/docs/en/fast-mode.md), [Advisor](https://code.claude.com/docs/en/advisor.md), [Channels](https://code.claude.com/docs/en/channels.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).

262>262>

263> **Partial support:**263> **Partial support:**

264>264>


271 271 

272> [tab] Claude Platform on AWS272> [tab] Claude Platform on AWS

273>273>

274> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [fast mode](https://code.claude.com/docs/en/fast-mode.md), [Channels](https://code.claude.com/docs/en/channels.md), [GitHub Actions](https://code.claude.com/docs/en/github-actions.md), [Code Mode](https://code.claude.com/docs/en/code-mode.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).274> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [fast mode](https://code.claude.com/docs/en/fast-mode.md), [Channels](https://code.claude.com/docs/en/channels.md), [GitHub Actions](https://code.claude.com/docs/en/github-actions.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).

275>275>

276> **Available here, not on Amazon Bedrock:** [web search](https://code.claude.com/docs/en/tools-reference.md#websearch-tool-behavior), plus the [Advisor](https://code.claude.com/docs/en/advisor.md) in Claude Code v2.1.300 or later.276> **Available here, not on Amazon Bedrock:** [web search](https://code.claude.com/docs/en/tools-reference.md#websearch-tool-behavior), plus the [Advisor](https://code.claude.com/docs/en/advisor.md) in Claude Code v2.1.300 or later.

277>277>


283 283 

284> [tab] Google Cloud (Anthropic managed)284> [tab] Google Cloud (Anthropic managed)

285>285>

286> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [fast mode](https://code.claude.com/docs/en/fast-mode.md), [Channels](https://code.claude.com/docs/en/channels.md), [GitHub Actions](https://code.claude.com/docs/en/github-actions.md), [Code Mode](https://code.claude.com/docs/en/code-mode.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).286> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [fast mode](https://code.claude.com/docs/en/fast-mode.md), [Channels](https://code.claude.com/docs/en/channels.md), [GitHub Actions](https://code.claude.com/docs/en/github-actions.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).

287>287>

288> **Available here, not on Google Cloud (Google managed):** the [Advisor](https://code.claude.com/docs/en/advisor.md) in Claude Code v2.1.300 or later.288> **Available here, not on Google Cloud (Google managed):** the [Advisor](https://code.claude.com/docs/en/advisor.md) in Claude Code v2.1.300 or later.

289>289>


298>298>

299> If you set `CLAUDE_CODE_USE_VERTEX` to use Claude Code with Google Cloud's Agent Platform, you're on this provider.299> If you set `CLAUDE_CODE_USE_VERTEX` to use Claude Code with Google Cloud's Agent Platform, you're on this provider.

300>300>

301> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [Advisor](https://code.claude.com/docs/en/advisor.md), [Channels](https://code.claude.com/docs/en/channels.md), [Code Mode](https://code.claude.com/docs/en/code-mode.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).301> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [Advisor](https://code.claude.com/docs/en/advisor.md), [Channels](https://code.claude.com/docs/en/channels.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).

302>302>

303> **Partial support:**303> **Partial support:**

304>304>


313 313 

314> [tab] Microsoft Foundry314> [tab] Microsoft Foundry

315>315>

316> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [fast mode](https://code.claude.com/docs/en/fast-mode.md), [Advisor](https://code.claude.com/docs/en/advisor.md), [Channels](https://code.claude.com/docs/en/channels.md), [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md), [Code Mode](https://code.claude.com/docs/en/code-mode.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).316> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription), plus [fast mode](https://code.claude.com/docs/en/fast-mode.md), [Advisor](https://code.claude.com/docs/en/advisor.md), [Channels](https://code.claude.com/docs/en/channels.md), [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md), the [analytics dashboard](https://code.claude.com/docs/en/analytics.md), [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), and the [`/design-sync` and `/import` commands](https://code.claude.com/docs/en/commands#all-commands).

317>317>

318> **Partial support:**318> **Partial support:**

319>319>


346| [Cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) | ✓ | ✓ | ✓ | ✓ | ✓ |346| [Cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) | ✓ | ✓ | ✓ | ✓ | ✓ |

347| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | ✓ | ✓ | ✓ | Admin-enabled | Admin-enabled |347| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | ✓ | ✓ | ✓ | Admin-enabled | Admin-enabled |

348| [Channels](https://code.claude.com/docs/en/channels.md) | ✓ | ✓ | ✓ | Admin-enabled | Admin-enabled |348| [Channels](https://code.claude.com/docs/en/channels.md) | ✓ | ✓ | ✓ | Admin-enabled | Admin-enabled |

349| [Skills from MCP servers](https://code.claude.com/docs/en/mcp.md#requirements-for-skills-from-mcp-servers) | ✓ | ✓ | ✓ | Admin-enabled | Admin-enabled |

349| [Computer use](https://code.claude.com/docs/en/computer-use.md) | ✓ | ✓ | ✓ | ✗ | ✗ |350| [Computer use](https://code.claude.com/docs/en/computer-use.md) | ✓ | ✓ | ✓ | ✗ | ✗ |

350| Dispatch ([Desktop](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch)) | Not available to new users | Not available to new users | Not available to new users | ✗ | ✗ |351| Dispatch ([Desktop](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch)) | Not available to new users | Not available to new users | Not available to new users | ✗ | ✗ |

351| [Code Review](https://code.claude.com/docs/en/code-review.md) | ✗ | ✗ | ✗ | ✓ | ✓ |352| [Code Review](https://code.claude.com/docs/en/code-review.md) | ✗ | ✗ | ✗ | ✓ | ✓ |

Details

11View plans11View plans

12Contact sales12Contact sales

13 13 

14This page covers one of the two ways to use Claude through your Google Cloud project: Google Cloud's Agent Platform, formerly Vertex AI, which Google manages.

15 

14> [!NOTE]16> [!NOTE]

15>17>

16> This page covers one of the two ways to use Claude through your Google Cloud project: Google Cloud's Agent Platform, formerly Vertex AI, which Google manages. If you use Claude Models on Google Cloud (Anthropic managed), follow [its Claude Code setup page](https://code.claude.com/docs/en/claude-models-on-google-cloud-anthropic-managed.md) instead. To find out which one you use, see [Which offering are you using?](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/overview#which-offering-are-you-using)18> Use a different page in these cases:

19>

20> * **Claude Models on Google Cloud (Anthropic managed)**: follow [its Claude Code setup page](https://code.claude.com/docs/en/claude-models-on-google-cloud-anthropic-managed.md)

21> * **Not sure which Google Cloud offering you use**: see [Which offering are you using?](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/overview#which-offering-are-you-using)

22> * **Code tab, when your organization installed the Claude Desktop app**: ask your administrator to [configure the app for Agent Platform](https://claude.com/docs/third-party/claude-desktop/vertex)

23> * **Code tab, when you install the Claude Desktop app yourself**: follow the [single-machine setup steps](https://claude.com/docs/third-party/claude-desktop/installation#single-machine-setup) and enter the [connection and model values for Agent Platform](https://claude.com/docs/third-party/claude-desktop/vertex#configure-the-app)

17 24 

18## Prerequisites25## Prerequisites

19 26 

headless.md +2 −1

Details

208claude -p "Explain recursion" --output-format stream-json --verbose --include-partial-messages208claude -p "Explain recursion" --output-format stream-json --verbose --include-partial-messages

209```209```

210 210 

211The last line of the stream is a `result` message with the final response text, cost, and session metadata.211Find each [`result` message](https://code.claude.com/docs/en/agent-sdk/typescript#sdkresultmessage) by `type`, because a message such as a task notification can follow a result and start another turn. A successful `result` message holds any final response text, the running cost total, and session metadata.

212 212 

213If your consumer reads the stream slowly, Claude Code waits for the queued output to drain before exiting, scaling the wait with how much is still queued, capped at 30 seconds.213If your consumer reads the stream slowly, Claude Code waits for the queued output to drain before exiting, scaling the wait with how much is still queued, capped at 30 seconds.

214 214 


377> Command support differs in `-p` mode:377> Command support differs in `-p` mode:

378>378>

379> * User-invoked [skills](https://code.claude.com/docs/en/skills.md) and custom commands work. Include `/skill-name` in the prompt string and Claude Code expands it before running.379> * User-invoked [skills](https://code.claude.com/docs/en/skills.md) and custom commands work. Include `/skill-name` in the prompt string and Claude Code expands it before running.

380> * [Skills from MCP servers](https://code.claude.com/docs/en/mcp.md#requirements-for-skills-from-mcp-servers) aren't supported.

380> * Built-in commands that only run in the terminal interface, such as `/login`, aren't available.381> * Built-in commands that only run in the terminal interface, such as `/login`, aren't available.

381> * `/model`, `/effort`, `/fast`, `/color`, and `/rename` accept the value as an argument, for example `/model sonnet`, and `/mcp` with no argument prints a text summary of server status. These forms follow each command's [availability notes](https://code.claude.com/docs/en/commands.md#all-commands).382> * `/model`, `/effort`, `/fast`, `/color`, and `/rename` accept the value as an argument, for example `/model sonnet`, and `/mcp` with no argument prints a text summary of server status. These forms follow each command's [availability notes](https://code.claude.com/docs/en/commands.md#all-commands).

382> * To change a setting, pass `key=value` to `/config`, for example `/config verbose=true`.383> * To change a setting, pass `key=value` to `/config`, for example `/config verbose=true`.

hooks.md +2 −2

Details

1383#!/bin/bash1383#!/bin/bash

1384 1384 

1385git -C ~/.claude/skills/team-skills pull --quiet 2>/dev/null || \1385git -C ~/.claude/skills/team-skills pull --quiet 2>/dev/null || \

1386 git clone --quiet https://git.example.com/your-org/team-skills.git ~/.claude/skills/team-skills1386 git -c protocol.file.allow=never clone --quiet https://git.example.com/your-org/team-skills.git ~/.claude/skills/team-skills

1387 1387 

1388echo '{"hookSpecificOutput": {"hookEventName": "SessionStart", "reloadSkills": true}}'1388echo '{"hookSpecificOutput": {"hookEventName": "SessionStart", "reloadSkills": true}}'

1389```1389```

1390 1390 

1391The repository URL is a placeholder. Replace it with your own skills repository.1391The repository URL is a placeholder. Replace it with your skills repository's HTTPS or SSH URL. With `protocol.file.allow=never` in the command, you can't clone from a folder path.

1392 1392 

1393#### Persist environment variables1393#### Persist environment variables

1394 1394 

Details

177 177 

178 Without the lock, Claude Code reads `allowedMcpServers` from the managed source it applies, so under `"first-wins"` an unselected admin source's list is ignored. Requires Claude Code v2.1.273 or later178 Without the lock, Claude Code reads `allowedMcpServers` from the managed source it applies, so under `"first-wins"` an unselected admin source's list is ignored. Requires Claude Code v2.1.273 or later

179* `deniedMcpServers` and [`disableClaudeAiConnectors`](https://code.claude.com/docs/en/settings-reference#disableclaudeaiconnectors): an entry or a `true` in any admin source applies. Requires Claude Code v2.1.273 or later179* `deniedMcpServers` and [`disableClaudeAiConnectors`](https://code.claude.com/docs/en/settings-reference#disableclaudeaiconnectors): an entry or a `true` in any admin source applies. Requires Claude Code v2.1.273 or later

180* [`disableDirectMcpSkills`](https://code.claude.com/docs/en/settings-reference#disabledirectmcpskills): a `true` in any admin source turns off skills from MCP servers other than claude.ai connectors. To turn them on, set `false` in the highest-ranked admin source you use. Claude Code ignores a `false` in the HKCU registry. Skills from MCP servers require Claude Code v2.1.331 or later

180* The sandbox binary paths `sandbox.bwrapPath` and `sandbox.socatPath`181* The sandbox binary paths `sandbox.bwrapPath` and `sandbox.socatPath`

181* The sandbox `ripgrep` binary, [`sandbox.ripgrep`](https://code.claude.com/docs/en/settings-reference#sandbox-ripgrep)182* The sandbox `ripgrep` binary, [`sandbox.ripgrep`](https://code.claude.com/docs/en/settings-reference#sandbox-ripgrep)

182* `sandbox.filesystem.disabled` and `sandbox.network.strictAllowlist`183* `sandbox.filesystem.disabled` and `sandbox.network.strictAllowlist`


424| [`blockedMarketplaces`](https://code.claude.com/docs/en/settings-reference#blockedmarketplaces) | Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](https://code.claude.com/docs/en/plugins/org.md#restrict-what-users-can-install) |425| [`blockedMarketplaces`](https://code.claude.com/docs/en/settings-reference#blockedmarketplaces) | Blocklist of marketplace sources. Blocked sources are checked before downloading, so they never touch the filesystem. See [managed marketplace restrictions](https://code.claude.com/docs/en/plugins/org.md#restrict-what-users-can-install) |

425| [`channelsEnabled`](https://code.claude.com/docs/en/settings-reference#channelsenabled) | Allow [channels](https://code.claude.com/docs/en/channels.md) for the organization. See [enterprise controls](https://code.claude.com/docs/en/channels.md#enterprise-controls) for the default on each plan |426| [`channelsEnabled`](https://code.claude.com/docs/en/settings-reference#channelsenabled) | Allow [channels](https://code.claude.com/docs/en/channels.md) for the organization. See [enterprise controls](https://code.claude.com/docs/en/channels.md#enterprise-controls) for the default on each plan |

426| [`disableCommandPluginSources`](https://code.claude.com/docs/en/settings-reference#disablecommandpluginsources) | When `true`, blocks [`command` plugin sources](https://code.claude.com/docs/en/plugins/marketplace-reference#command-plugin-source) entirely, so the marketplace-declared command never runs. Also blocks marketplace [`headersHelper` commands](https://code.claude.com/docs/en/plugins/host-marketplace#authenticate-archive-downloads), except for a marketplace that managed settings themselves declare. When unset, follows `allowManagedHooksOnly`. Requires Claude Code v2.1.229 or later, and the `headersHelper` block requires v2.1.238 or later |427| [`disableCommandPluginSources`](https://code.claude.com/docs/en/settings-reference#disablecommandpluginsources) | When `true`, blocks [`command` plugin sources](https://code.claude.com/docs/en/plugins/marketplace-reference#command-plugin-source) entirely, so the marketplace-declared command never runs. Also blocks marketplace [`headersHelper` commands](https://code.claude.com/docs/en/plugins/host-marketplace#authenticate-archive-downloads), except for a marketplace that managed settings themselves declare. When unset, follows `allowManagedHooksOnly`. Requires Claude Code v2.1.229 or later, and the `headersHelper` block requires v2.1.238 or later |

428| [`disableDirectMcpSkills`](https://code.claude.com/docs/en/settings-reference#disabledirectmcpskills) | Controls [skills from MCP servers other than claude.ai connectors](https://code.claude.com/docs/en/mcp.md#turn-on-skills-for-an-organization). Set to `false` to turn them on for Team and Enterprise plans, or to `true` to turn them off. Skills from MCP servers require Claude Code v2.1.331 or later |

427| [`disableSideloadFlags`](https://code.claude.com/docs/en/settings-reference#disablesideloadflags) | Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` flags at startup. In cloud sessions, Claude Code instead starts the session and drops the server-delivered `--mcp-config` servers, apart from the exceptions its [reference entry](https://code.claude.com/docs/en/settings-reference.md#disablesideloadflags) lists. Requires Claude Code v2.1.193 or later |429| [`disableSideloadFlags`](https://code.claude.com/docs/en/settings-reference#disablesideloadflags) | Reject the `--plugin-dir`, `--plugin-url`, `--agents`, and `--mcp-config` flags at startup. In cloud sessions, Claude Code instead starts the session and drops the server-delivered `--mcp-config` servers, apart from the exceptions its [reference entry](https://code.claude.com/docs/en/settings-reference.md#disablesideloadflags) lists. Requires Claude Code v2.1.193 or later |

428| [`forceRemoteSettingsRefresh`](https://code.claude.com/docs/en/settings-reference#forceremotesettingsrefresh) | When `true`, blocks CLI startup until remote managed settings are freshly fetched and exits if the fetch fails. See [fail-closed enforcement](https://code.claude.com/docs/en/server-managed-settings.md#enforce-fail-closed-startup) |430| [`forceRemoteSettingsRefresh`](https://code.claude.com/docs/en/settings-reference#forceremotesettingsrefresh) | When `true`, blocks CLI startup until remote managed settings are freshly fetched and exits if the fetch fails. See [fail-closed enforcement](https://code.claude.com/docs/en/server-managed-settings.md#enforce-fail-closed-startup) |

429| [`managedMcpServers`](https://code.claude.com/docs/en/settings-reference#managedmcpservers) | Remote MCP servers provided to every user alongside their own. It provides servers rather than locking anything down. See [Provide servers through managed settings](https://code.claude.com/docs/en/managed-mcp.md#provide-servers-through-managed-settings). Requires Claude Code v2.1.259 or later |431| [`managedMcpServers`](https://code.claude.com/docs/en/settings-reference#managedmcpservers) | Remote MCP servers provided to every user alongside their own. It provides servers rather than locking anything down. See [Provide servers through managed settings](https://code.claude.com/docs/en/managed-mcp.md#provide-servers-through-managed-settings). Requires Claude Code v2.1.259 or later |

mcp.md +221 −17

Details

485 485 

486To change or turn off automatic backgrounding:486To change or turn off automatic backgrounding:

487 487 

488* Set the [`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`](https://code.claude.com/docs/en/env-vars) environment variable in milliseconds to change the threshold, or set it to `0` to turn automatic backgrounding off. With `0`, Claude also [waits for MCP tasks](#make-claude-wait-for-the-result-of-an-mcp-task) in an interactive session488* Set the [`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`](https://code.claude.com/docs/en/env-vars) environment variable in milliseconds to change the threshold, or set it to `0` to turn automatic backgrounding off. With `0`, Claude also [waits for MCP tasks](#make-claude-wait-for-the-result-of-an-mcp-task) in an interactive terminal session

489* Set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](https://code.claude.com/docs/en/env-vars) to `1` to turn off automatic backgrounding and [background commands](https://code.claude.com/docs/en/tools-reference.md#background-commands)489* Set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](https://code.claude.com/docs/en/env-vars) to `1` to turn off automatic backgrounding and [background commands](https://code.claude.com/docs/en/tools-reference.md#background-commands)

490 490 

491Some calls never move to the background:491Some calls never move to the background:

492 492 

493* Calls from [subagents](https://code.claude.com/docs/en/sub-agents.md); Claude Code backgrounds only main-conversation calls493* Calls from [subagents](https://code.claude.com/docs/en/sub-agents.md), except an [MCP task in the cloud](#mcp-tasks-in-the-cloud)

494* Calls to IDE servers494* Calls to IDE servers

495* Calls in [non-interactive mode](https://code.claude.com/docs/en/headless.md), unless `CLAUDE_AUTO_BACKGROUND_TASKS` is set to `1`, since a one-shot run can end before the result arrives495* Calls in [non-interactive mode](https://code.claude.com/docs/en/headless.md), unless `CLAUDE_AUTO_BACKGROUND_TASKS` is set to `1`, since a one-shot run can end before the result arrives

496 496 


498 498 

499### MCP tasks that run on the server499### MCP tasks that run on the server

500 500 

501An MCP task is a long job, such as a report export or a build, that an MCP server runs itself using the [MCP tasks extension](https://modelcontextprotocol.io/extensions/tasks/overview). Claude's tool call returns once the server accepts the job, so Claude keeps working unless you [make Claude wait](#make-claude-wait-for-the-result-of-an-mcp-task). When the job ends, the transcript says so and Claude gets the result. Ask Claude for it.501An MCP task is a long job, such as a report export or a build, that an MCP server runs itself using the [MCP tasks extension](https://modelcontextprotocol.io/extensions/tasks/overview). In the main conversation, Claude's tool call returns once the server accepts the job, so Claude keeps working unless you [make Claude wait](#make-claude-wait-for-the-result-of-an-mcp-task). When the job ends, the transcript says so and Claude gets the result. Ask Claude for it.

502 502 

503Meanwhile, the footer shows a count such as `1 MCP task`, and Claude Code follows the task by checking its status with the server. A task on a remote server keeps running after you exit. To follow it again, [resume the same session](#exit-clear-or-resume-while-an-mcp-task-runs).503Meanwhile, the footer shows a count such as `1 MCP task`, and Claude Code follows the task by checking its status with the server. A task on a remote server keeps running after you exit. To follow it again, [resume the same session](#exit-clear-or-resume-while-an-mcp-task-runs).

504 504 

505> [!NOTE]505> [!NOTE]

506>506>

507> MCP tasks are in public beta and require Claude Code v2.1.304 or later. [What a call needs to become an MCP task](#requirements-for-mcp-tasks) lists the sessions and servers that get them.507> MCP tasks require Claude Code v2.1.304 or later. [What a call needs to become an MCP task](#requirements-for-mcp-tasks) lists the sessions and servers that get them.

508 508 

509#### Stop an MCP task or get its result509#### Stop an MCP task or get its result

510 510 


516MCP task <server task id> (<server>/<tool>) completed.516MCP task <server task id> (<server>/<tool>) completed.

517```517```

518 518 

519The result goes to Claude, not into the transcript, so ask Claude for it. If Claude is idle when the result arrives, Claude starts on it unprompted.519The result goes to Claude, not into the transcript, so ask Claude for it. If Claude is idle when the result arrives, Claude starts on it unprompted. When a [subagent's call](#requirements-for-mcp-tasks) becomes a task in a terminal session, the subagent waits for the result.

520 520 

521#### Answer a question from an MCP task521#### Answer a question from an MCP task

522 522 


524 524 

525Unless you've set Claude to [wait for the result](#make-claude-wait-for-the-result-of-an-mcp-task), press `Esc` in the dialog to answer later. To reopen the question, run `/tasks`, open the task's details, and press `Enter`. Answering later requires Claude Code v2.1.324 or later.525Unless you've set Claude to [wait for the result](#make-claude-wait-for-the-result-of-an-mcp-task), press `Esc` in the dialog to answer later. To reopen the question, run `/tasks`, open the task's details, and press `Enter`. Answering later requires Claude Code v2.1.324 or later.

526 526 

527In a [non-interactive](https://code.claude.com/docs/en/headless.md) session, Claude Code asks the server to cancel a task that requests input, without running your [`Elicitation` hooks](https://code.claude.com/docs/en/hooks#elicitation) or calling the Agent SDK's `onElicitation` callback.527Outside an interactive terminal session, check whether you can answer, because some sessions cancel the task:

528 

529* **[`claude -p`](https://code.claude.com/docs/en/headless) runs and Agent SDK sessions**: Claude Code asks the server to cancel the task, without running your [`Elicitation` hooks](https://code.claude.com/docs/en/hooks#elicitation) or calling the Agent SDK's `onElicitation` callback

530* **VS Code and local desktop app sessions**: see [MCP tasks in VS Code and the desktop app](#mcp-tasks-in-vs-code-and-desktop)

531* **Cloud sessions and claude.ai chats**: see [Answer an MCP task's question in the cloud](#mcp-task-questions-in-the-cloud)

528 532 

529#### Exit, clear, or resume while an MCP task runs533#### Exit, clear, or resume while an MCP task runs

530 534 


540 544 

541#### What a call needs to become an MCP task545#### What a call needs to become an MCP task

542 546 

543A tool call becomes an MCP task only when all of these conditions hold:547For the cloud, see [MCP tasks in cloud sessions and claude.ai chats](#mcp-tasks-in-the-cloud). Elsewhere, a tool call becomes an MCP task only when it meets all of these conditions:

544 548 

545* The server supports tasks549* The server supports tasks

546* The server is an HTTP, stdio, or claude.ai connector server connected on [protocol revision 2026-07-28](#mcp-client-runtimes). Setting [`MCP_SDK_GENERATION=v1` or `MCP_PROTOCOL_NEGOTIATION=legacy`](https://code.claude.com/docs/en/env-vars) rules that out550* The server is an HTTP, stdio, or claude.ai connector server connected on [protocol revision 2026-07-28](#mcp-client-runtimes). Setting [`MCP_SDK_GENERATION=v1` or `MCP_PROTOCOL_NEGOTIATION=legacy`](https://code.claude.com/docs/en/env-vars) rules that out

547* The session [fetches feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), so not on a third-party provider such as Amazon Bedrock, and not with telemetry or flag fetching turned off

548* Anthropic has turned MCP tasks on for your kind of session:551* Anthropic has turned MCP tasks on for your kind of session:

549 * Terminal CLI sessions, [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) sessions, and [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) runs have them on v2.1.304 or later552 * Terminal CLI sessions, [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) sessions, and [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) runs have them on v2.1.304 or later

550 * [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), including ones you open in the desktop app, have them only if Anthropic has turned them on for your account or organization. You can't turn them on or look up their state in a setting553 * For the VS Code extension and local sessions in the desktop app, see [MCP tasks in VS Code and the desktop app](#mcp-tasks-in-vs-code-and-desktop)

551 * Some other Claude Code surfaces, such as the [VS Code extension](https://code.claude.com/docs/en/vs-code.md) and local sessions in the [desktop app](https://code.claude.com/docs/en/desktop.md), don't have them554* If [feature-flag fetching is off](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), for example on Amazon Bedrock or with telemetry turned off, you need an interactive terminal session on Claude Code v2.1.317 or later

552* The call comes from the main conversation, not from a [subagent](https://code.claude.com/docs/en/sub-agents.md)555* The call comes from one of these:

556 * The main conversation

557 * A non-[fork](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation) [subagent](https://code.claude.com/docs/en/sub-agents.md) that the main conversation started, in an interactive terminal session that [fetches feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), on v2.1.331 or later. The server can't be one [defined in the subagent's own file](https://code.claude.com/docs/en/sub-agents.md#scope-mcp-servers-to-a-subagent)

553* Either the session is interactive, or an [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) session or a `claude -p` run reading `--input-format stream-json` has:558* Either the session is interactive, or an [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) session or a `claude -p` run reading `--input-format stream-json` has:

554 * [`CLAUDE_AUTO_BACKGROUND_TASKS`](https://code.claude.com/docs/en/env-vars) at `1`559 * [`CLAUDE_AUTO_BACKGROUND_TASKS`](https://code.claude.com/docs/en/env-vars) at `1`

555 * `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` not `1`560 * `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` not `1`


559 564 

560Keep an Agent SDK or stream-json session's input open, because the run [doesn't wait for MCP tasks](https://code.claude.com/docs/en/headless.md#mcp-work-when-a-non-interactive-run-ends) after input closes. A one-shot `claude -p "<prompt>"` run doesn't get MCP tasks.565Keep an Agent SDK or stream-json session's input open, because the run [doesn't wait for MCP tasks](https://code.claude.com/docs/en/headless.md#mcp-work-when-a-non-interactive-run-ends) after input closes. A one-shot `claude -p "<prompt>"` run doesn't get MCP tasks.

561 566 

567#### MCP tasks in VS Code and the desktop app

568 

569MCP tasks can work in the [VS Code extension](https://code.claude.com/docs/en/vs-code.md) and in local [desktop app](https://code.claude.com/docs/en/desktop.md) sessions. In both, you need Claude Code v2.1.331 or later and a session that [fetches feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching).

570 

571Use a terminal session in these cases:

572 

573* **claude.ai connector in the desktop app**: it gets no tasks in local sessions

574* **Server from `claude_desktop_config.json`**: it gets no tasks either, so [add it to the CLI](#installing-mcp-servers) first

575* **Task that asks questions**: neither app shows a task's question, and Claude Code asks the server to cancel the task unless an [`Elicitation` hook](https://code.claude.com/docs/en/hooks#elicitation) accepts the request

576 

577Once the server accepts the job, you can see or stop the task in VS Code's [`/tasks`](https://code.claude.com/docs/en/vs-code#monitor-background-processes) or the desktop app's [**Background tasks** pane](https://code.claude.com/docs/en/desktop.md#watch-background-tasks). If no row appears while Claude waits on the call, or the tool fails, check these causes:

578 

579* **`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS` at `0` or `CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND` at `1`**: remove it, for example from `env` in [`settings.json`](https://code.claude.com/docs/en/settings), and start a new session

580* **Claude Code earlier than v2.1.331**: check the version in [VS Code](https://code.claude.com/docs/en/vs-code.md#install-the-extension) or the [desktop app](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab), then update the extension or app and start a new session. If the latest update still carries an earlier version, use a terminal session until an update brings v2.1.331 or later.

581* **First session after an update**: MCP tasks [can be missing in that session](https://code.claude.com/docs/en/env-vars.md#first-session-after-an-install-or-upgrade), so start another one

582 

583If the call still doesn't become a task after these checks, use a terminal session. If it doesn't become one there either, see [What a call needs to become an MCP task](#requirements-for-mcp-tasks).

584 

585#### MCP tasks in cloud sessions and claude.ai chats

586 

587MCP tasks work in the cloud with [claude.ai connectors](#use-mcp-servers-from-claude-ai) that support them on [protocol revision 2026-07-28](#mcp-client-runtimes). Tool calls can become tasks in these places:

588 

589* [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) you start yourself in Anthropic-hosted environments

590* New chats in the [unified Claude experience](https://support.claude.com/en/articles/16761823-claude-cowork-and-chat-are-one-claude) on Pro, Max, Ultra, and Team plans

591 

592Not every existing chat has tasks. If a tool that works only as a task fails in an existing chat on one of those plans, try a new chat.

593 

594Only some accounts get MCP tasks in these other places:

595 

596* New chats in the unified Claude experience on Free and Enterprise plans

597* The **Cowork** option, on accounts without the unified experience, where the message box offers a choice of **Chat** or **Cowork**

598* [Recurring work that you schedule](https://support.claude.com/en/articles/13854387-schedule-recurring-tasks-in-cowork) from a chat or from Cowork

599 

600You can't turn MCP tasks on for your account in a setting. If a tool that works only as a task fails in one of those places, run it from a terminal session on a paid plan.

601 

602In cloud sessions, servers from `.mcp.json` or a plugin get no tasks, so a tool that works only as a task returns the server's error. Add a remote server as a connector instead.

603 

604Expect calls without tasks in cases such as these, and run a tool that needs tasks from a terminal session:

605 

606* [Project](https://code.claude.com/docs/en/claude-projects.md) threads

607* Incognito chats

608* Claude Code's [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md)

609 

610In cloud sessions and chats that have tasks, a [subagent](https://code.claude.com/docs/en/sub-agents.md)'s call can become a task too. This needs a subagent that the main conversation started and that isn't a [fork](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation). The subagent gets the result if the task ends within two minutes. For a longer task, expect Claude to pick up the result in the main conversation.

611 

612#### Answer an MCP task's question in the cloud

613 

614When a task asks you a question in a cloud session or chat, select **Allow** on the permission prompt, then answer in the form that opens. If the prompt is denied, or if the form closes before you answer, the task keeps waiting, so ask Claude to show the question again.

615 

616You can't answer in the **Cowork** option or in recurring work that you schedule. If Claude reports there, or in any other session or chat, that the question cancelled the task, start the task again from an interactive terminal session.

617 

618#### Check or stop an MCP task in the cloud

619 

620To check on or stop a running MCP task, ask Claude in the cloud session or claude.ai chat that started it, for example `stop the export task`. In a claude.ai chat on a computer, you can also hover over the tool call that started the task and select **Stop** if it appears.

621 

622The server may still finish the job after either kind of stop, so ask Claude to check the task afterward. If the job still runs, look for a way to cancel it in the server's other tools or in the service that runs it.

623 

624#### Get an MCP task's result in the cloud

625 

626If a task's result hasn't arrived in a cloud session or chat, send a message so Claude Code checks the task again. You can leave while a task runs. When it completes or fails, Claude usually picks up the result unprompted, even in a session that stopped for inactivity.

627 

628If Claude reports one of these problems with the task, take the step that matches its report:

629 

630* **The task was cancelled because it asked you a question**: you [can't answer](#mcp-task-questions-in-the-cloud) in that session or chat, so start the task again from an interactive terminal session

631* **Tracking stopped after failed status checks**: the job can still be running, so ask Claude to check it again. If no result follows, ask Claude to find the outcome with the server's other tools

632* **The server no longer knows the task**: the result may be lost, so ask Claude to find the outcome with the server's other tools before you run the job again

633* **The task reached the seven-day tracking limit**: the job can still be running. In a cloud session, ask Claude to check it again. In a chat, ask Claude to find the outcome with the server's other tools

634 

562#### Status messages on an MCP task635#### Status messages on an MCP task

563 636 

564These messages, in a task's `/tasks` entry or its closing transcript line, mean Claude Code can't reach the server or the task. While one shows in `/tasks`, the job may still be running: Claude Code leaves it alone and keeps checking. The `300s` and configuration messages stay on the entry even after contact returns.637These messages, in a task's `/tasks` entry or its closing transcript line, mean Claude Code can't reach the server or the task. While one shows in `/tasks`, the job may still be running: Claude Code leaves it alone and keeps checking. The `300s` and configuration messages stay on the entry even after contact returns.


578 651 

579#### Time limits on MCP tasks652#### Time limits on MCP tasks

580 653 

581By default, a task in the background has no Claude Code time limit. The [tool call time limits](#time-limits-on-mcp-tool-calls), including the wall-clock limit and the idle timeout, apply until the server answers the call with the task. If you [make Claude wait](#make-claude-wait-for-the-result-of-an-mcp-task), they apply for the whole task. Answered status checks count as activity for the idle timeout.654Outside [cloud sessions and claude.ai chats](#mcp-task-results-in-the-cloud), a task in the background has no Claude Code time limit by default. The [tool call time limits](#time-limits-on-mcp-tool-calls), including the wall-clock limit and the idle timeout, apply until the server answers the call with the task. If you [make Claude wait](#make-claude-wait-for-the-result-of-an-mcp-task), they apply for the whole task. Answered status checks count as activity for the idle timeout.

582 655 

583#### Make Claude wait for the result of an MCP task656#### Make Claude wait for the result of an MCP task

584 657 

585To make Claude wait for a task's result in an interactive session, set one of two environment variables, for example in the `env` block of [`settings.json`](https://code.claude.com/docs/en/settings):658To make Claude wait for a task's result in an interactive terminal session, set one of two environment variables, for example in the `env` block of [`settings.json`](https://code.claude.com/docs/en/settings):

586 659 

587* **[`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`](https://code.claude.com/docs/en/env-vars) set to `0`**: Claude waits for every MCP tool call until the call ends660* **[`CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS`](https://code.claude.com/docs/en/env-vars) set to `0`**: Claude waits for every MCP tool call until the call ends

588* **[`CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND`](https://code.claude.com/docs/en/env-vars) set to `1`**: Claude waits for a task's result. While [automatic backgrounding](#automatic-backgrounding-of-long-tool-calls) is on, it moves the call after two minutes by default, so short tasks finish in place and long ones don't block you. The moved call is a plain background call rather than an MCP task. It doesn't survive exiting the session661* **[`CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND`](https://code.claude.com/docs/en/env-vars) set to `1`**: Claude waits for a task's result. While [automatic backgrounding](#automatic-backgrounding-of-long-tool-calls) is on, it moves the call after two minutes by default, so short tasks finish in place and long ones don't block you. The moved call is a plain background call rather than an MCP task. It doesn't survive exiting the session


626| `taskId` | Required. At most 128 printable ASCII characters with no spaces, or Claude gets a tool error beginning `MCP server "<name>" returned a malformed task handle for tool "<tool>"`. Keep the ID answerable across connections, because after a resume Claude Code asks about it on a new connection |699| `taskId` | Required. At most 128 printable ASCII characters with no spaces, or Claude gets a tool error beginning `MCP server "<name>" returned a malformed task handle for tool "<tool>"`. Keep the ID answerable across connections, because after a resume Claude Code asks about it on a new connection |

627| `status` | Required. One of `working`, `input_required`, `completed`, `failed`, or `cancelled`. Another value gives the `Unsupported result type` error |700| `status` | Required. One of `working`, `input_required`, `completed`, `failed`, or `cancelled`. Another value gives the `Unsupported result type` error |

628| `createdAt`, `lastUpdatedAt`, `ttlMs` | Required by the tasks extension, and `ttlMs` may be `null`. Claude Code doesn't drop a task because its `ttlMs` has passed |701| `createdAt`, `lastUpdatedAt`, `ttlMs` | Required by the tasks extension, and `ttlMs` may be `null`. Claude Code doesn't drop a task because its `ttlMs` has passed |

629| `pollIntervalMs` | Optional. Milliseconds between `tasks/get` requests, clamped to between 250 and 30000. Claude Code uses 2000 when the field is absent or `null`, and reads the value again from each `tasks/get` response |702| `pollIntervalMs` | Optional. Milliseconds between `tasks/get` requests, read again from each `tasks/get` response. Outside the cloud, Claude Code clamps the value to between 250 and 30000, and uses 2000 when the field is absent or `null`. For the cloud, see [Choose a time to live and a poll interval](#choose-a-time-to-live-and-a-poll-interval) |

630| `statusMessage` | Optional. `/tasks` shows the value from your latest `tasks/get` response, not this first one, and a response that omits the field clears it. A [status message from Claude Code](#status-messages-on-an-mcp-task) can take its place |703| `statusMessage` | Optional. `/tasks` shows the value from your latest `tasks/get` response, not this first one, and a response that omits the field clears it. A [status message from Claude Code](#status-messages-on-an-mcp-task) can take its place |

631 704 

632Claude Code accepts a task answer that omits `createdAt`, `lastUpdatedAt`, or `ttlMs`, or that sets `pollIntervalMs` to `null`. Before v2.1.317, the call failed with the `Unsupported result type` error instead. To work with those versions too, send the three fields that the tasks extension requires, and send `pollIntervalMs` as a number or not at all.705Claude Code accepts a task answer that omits `createdAt`, `lastUpdatedAt`, or `ttlMs`, or that sets `pollIntervalMs` to `null`. Before v2.1.317, the call failed with the `Unsupported result type` error instead. To work with those versions too, send the three fields that the tasks extension requires, and send `pollIntervalMs` as a number or not at all.


635 708 

636#### Report status, results, and questions709#### Report status, results, and questions

637 710 

638Right after the task answer, Claude Code sends `tasks/get` with `{ "taskId": ... }`, then repeats it once per poll interval. The tasks extension requires your response to carry `"resultType": "complete"` along with `taskId`, `status`, `createdAt`, `lastUpdatedAt`, and `ttlMs`. `ttlMs` may be `null`, and `statusMessage` and `pollIntervalMs` are optional. This example reports the build as done:711Right after the task answer, Claude Code sends `tasks/get` with `{ "taskId": ... }`, then repeats it once per [poll interval](#choose-a-time-to-live-and-a-poll-interval). The tasks extension requires your response to carry `"resultType": "complete"` along with `taskId`, `status`, `createdAt`, `lastUpdatedAt`, and `ttlMs`. `ttlMs` may be `null`, and `statusMessage` and `pollIntervalMs` are optional.

712 

713This example reports the build as done:

639 714 

640```json theme={null}715```json theme={null}

641{716{


658| `failed` | Tells Claude the `message` of the top-level `error` object `{ code, message, data }`, which the tasks extension requires on a failed task. Without that `message`, Claude gets `statusMessage` instead, or else `Task failed` |733| `failed` | Tells Claude the `message` of the top-level `error` object `{ code, message, data }`, which the tasks extension requires on a failed task. Without that `message`, Claude gets `statusMessage` instead, or else `Task failed` |

659| `cancelled` | Tells Claude `statusMessage`, or else `Task was cancelled by the server` |734| `cancelled` | Tells Claude `statusMessage`, or else `Task was cancelled by the server` |

660| `input_required` | Reads `inputRequests`, an object that maps a key you choose to `{ method, params }`. Claude Code answers each key once through `tasks/update` with `{ taskId, inputResponses }`, where `inputResponses` maps the same key to that request's result. Keys beyond 16 per task are ignored |735| `input_required` | Reads `inputRequests`, an object that maps a key you choose to `{ method, params }`. Claude Code answers each key once through `tasks/update` with `{ taskId, inputResponses }`, where `inputResponses` maps the same key to that request's result. Keys beyond 16 per task are ignored |

661| Methods in `inputRequests` | `elicitation/create` is served only in interactive terminal sessions, and `roots/list` everywhere. When Claude Code can't serve a request, it asks the server to cancel the task |736| Methods in `inputRequests` | `elicitation/create` reaches a person in interactive terminal sessions. For the cloud, see [where a person can answer](#mcp-task-questions-in-the-cloud). `roots/list` is served outside the cloud. Don't depend on it in [cloud sessions and claude.ai chats](#mcp-tasks-in-the-cloud). When Claude Code can't serve a request, it asks the server to cancel the task |

662| Another `status` value | Claude Code asks the server to cancel the task and reports it to Claude as failed |737| Another `status` value | Claude Code asks the server to cancel the task and reports it to Claude as failed |

663| JSON-RPC error `-32602` | Read as an unknown task ID. For a task in the background, Claude Code keeps asking for up to five minutes, then reports the outcome to Claude as unknown |738| JSON-RPC error `-32602` | Read as an unknown task ID. For a task in the background outside the cloud, Claude Code keeps asking for up to five minutes, then reports the outcome to Claude as unknown. In cloud sessions and claude.ai chats, expect about five minutes of retries too, then a report that [the server no longer knows the task](#mcp-task-results-in-the-cloud) |

664| `tasks/cancel` | Sent, for example, when Claude or the person stops the task while the server is connected. Not sent on exit |739| `tasks/cancel` | Sent, for example, when Claude or the person stops the task while the server is connected. Not sent on exit |

665| `tasks/result`, `tasks/list`, `notifications/tasks` | Not used, so put the outcome in your `tasks/get` responses |740| `tasks/result`, `tasks/list`, `notifications/tasks` | Not used, so put the outcome in your `tasks/get` responses |

666 741 


673* **`ttlMs`**: report how long your server keeps the task, counted from the task's creation. Send your longest run time plus the time you keep the result, such as `5400000` for a 30-minute job and one hour. Send `null` if your server keeps tasks with no time limit748* **`ttlMs`**: report how long your server keeps the task, counted from the task's creation. Send your longest run time plus the time you keep the result, such as `5400000` for a 30-minute job and one hour. Send `null` if your server keeps tasks with no time limit

674* **`pollIntervalMs`**: send 10000 to 30000 for a job that runs longer than a minute, so your server answers fewer status checks. For a shorter job, send 2000 so Claude gets the result sooner749* **`pollIntervalMs`**: send 10000 to 30000 for a job that runs longer than a minute, so your server answers fewer status checks. For a shorter job, send 2000 so Claude gets the result sooner

675 750 

751In [cloud sessions and claude.ai chats](#mcp-tasks-in-the-cloud), status checks can come less often than your `pollIntervalMs` asks, so plan for these intervals:

752 

753* **A new task**: expect checks to follow a `pollIntervalMs` from 1000 to 30000. A lower value can be raised to 1000. If you omit the field, expect at most 10 seconds between checks

754* **An older task**: allow for checks that slow to every 10 seconds once the task is a minute old, and to every 30 seconds after 10 minutes

755* **A value above 30000**: checks can follow it as sent and delay the result, so stay at 30000 or below

756 

676### Plugin-provided MCP servers757### Plugin-provided MCP servers

677 758 

678[Plugins](https://code.claude.com/docs/en/plugins/overview.md) can bundle MCP servers that provide tools and integrations when you enable the plugin.759[Plugins](https://code.claude.com/docs/en/plugins/overview.md) can bundle MCP servers that provide tools and integrations when you enable the plugin.


1748 1829 

1749MCP Apps UI resources are entries with a `ui://` URI or the `text/html;profile=mcp-app` media type: pages for a host application to render rather than content for Claude to read. They don't appear in the `@` suggestions or in the resource list tool's results, and a server that offers only UI resources shows an empty resource list. Reading a UI resource by its URI still works.1830MCP Apps UI resources are entries with a `ui://` URI or the `text/html;profile=mcp-app` media type: pages for a host application to render rather than content for Claude to read. They don't appear in the `@` suggestions or in the resource list tool's results, and a server that offers only UI resources shows an empty resource list. Reading a UI resource by its URI still works.

1750 1831 

1832## Use skills from MCP servers

1833 

1834With Skills over MCP, a server can provide [skills](https://code.claude.com/docs/en/skills.md) alongside its tools. This works for [claude.ai connectors](#use-mcp-servers-from-claude-ai), [servers you add](#installing-mcp-servers), and [servers from plugins](#plugin-provided-mcp-servers). To serve skills from a server you build, implement the [Skills extension](https://modelcontextprotocol.io/extensions/skills/overview), an extension to MCP that defines how servers list and deliver skills.

1835 

1836> [!NOTE]

1837>

1838> MCP skills are in public beta and require Claude Code v2.1.331 or later. In the Desktop app, check the [Code tab's Claude Code version](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab). See [where they're supported](#requirements-for-skills-from-mcp-servers).

1839 

1840### Find and call MCP skills by name

1841 

1842To find a skill, type `/` at the prompt in the terminal, VS Code, or the Desktop app's Code tab. In the terminal or VS Code, you can also run `/skills`. To use a skill, ask Claude, or type its name as a command. A skill's name is `<server>:<skill>`.

1843 

1844For example, if you added a server named `docs` that has a `pdf` skill, the skill's name is `docs:pdf`, and this command runs it on `report.pdf`:

1845 

1846```text theme={null}

1847/docs:pdf report.pdf

1848```

1849 

1850Connector and plugin servers add a prefix, such as `claude_ai_Docs:pdf` for a connector named Docs, or `plugin_my-plugin_docs:pdf` for a `docs` server from `my-plugin`. In `<server>`, spaces and punctuation other than `-` become `_`.

1851 

1852### Approvals for MCP skills

1853 

1854When Claude loads an MCP skill in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), the default, you don't see a prompt. The classifier decides whether the skill loads, without reading it. In Manual or `acceptEdits` mode, you see a prompt. Select **Allow this version** to skip the prompt and the classifier until the server changes the skill's files. To remove that approval in the terminal, delete its rule in `/permissions`.

1855 

1856With an [ask rule](#block-a-servers-skills-or-ask-first) or a connector set to [**Restrict to Ask**](#restrict-mcp-skills-for-organizations), Claude needs your approval each time, including in auto and `bypassPermissions` modes. In plan mode, you see the prompt even for a version you allowed, unless your terminal session has [bypass available](https://code.claude.com/docs/en/permission-modes.md#skip-all-checks-with-bypasspermissions-mode). Typing a skill's command at the prompt doesn't need approval. For Remote Control, see [Where MCP skills are supported](#where-mcp-skills-are-supported).

1857 

1858#### Set rules for a server's skills

1859 

1860Add a [permission rule](https://code.claude.com/docs/en/permissions.md) to block an MCP server's skills, see a prompt each time Claude loads one, or skip the prompt. In the terminal, run `/permissions` to add one.

1861 

1862These example rules use `docs` as the [server name](#run-an-mcp-skill):

1863 

1864| To | Add to | Rule |

1865| :- | :- | :- |

1866| Block its skills, including typed commands | `deny` | `Skill(mcp__docs__*)` |

1867| Block only its `pdf` skill | `deny` | `Skill(docs:pdf)` |

1868| Block its skills and tools | `deny` | `mcp__docs` |

1869| See a prompt each time Claude loads one | `ask` | `Skill(mcp__docs__*)` |

1870| Approve all versions of its skills | `allow` | `Skill(mcp__docs__*)` |

1871 

1872Add the `allow` rule to user or managed settings. It works for servers you added at user or local scope and for managed servers, but not for connectors, `.mcp.json` servers, or plugin servers. `Skill(mcp__docs__*)` rules require Claude Code v2.1.331 or later.

1873 

1874With `deny` rules, normal [resource reads](#use-mcp-resources) from the server are still allowed. To stop Claude from reading any server's resources, including allowed skills' supporting files, deny `ReadMcpResourceTool`.

1875 

1876### Security scanning for MCP skills

1877 

1878Anthropic scans skills from some connectors, with [exceptions and limitations](#limitations-of-mcp-skills). For these connectors, a version loads only after it passes the scan:

1879 

1880* Third-party [Directory](https://claude.ai/directory) connectors you add on claude.ai

1881* Custom connectors, while your Enterprise organization keeps **Skill and plugin security scanning** on in [**Organization settings > Plugins & skills > Policy**](https://claude.ai/admin-settings/skills?tab=policy)

1882 

1883Anthropic doesn't scan skills from other connectors or servers, including Directory servers added with `claude mcp add`.

1884 

1885> [!WARNING]

1886>

1887> Skills can direct Claude to run code. Servers can change skills at any time. Add only servers you trust.

1888 

1889### MCP skill availability

1890 

1891When you sign in with `/login` on a Pro, Max, or Ultra plan, MCP skills are on. With `/login` on a Team or Enterprise plan, they're off until your organization [turns them on](#turn-on-skills-for-an-organization).

1892 

1893With a [long-lived token](https://code.claude.com/docs/en/authentication.md#generate-a-long-lived-token) from any of these plans, MCP skills are on. With an API key or a Console login, they're rolling out: off now, and on by default when the rollout reaches you. For a token, a key, or a Console login, claude.ai connectors don't load, so you can use skills only from other MCP servers.

1894 

1895#### Where MCP skills are supported

1896 

1897You can use MCP skills in a terminal, including in JetBrains IDEs, and in local sessions you start in the Desktop app. In the VS Code extension, they're rolling out and turn on without a setting. When you control an interactive terminal session over [Remote Control](https://code.claude.com/docs/en/remote-control.md), ask Claude to use a skill instead of sending its command.

1898 

1899You also need a Fable model, or Claude Opus 4.8, Sonnet 5, Haiku 5.5, or later, and a direct connection to Anthropic with [feature flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) on. If your setup matches one of these, MCP skills aren't supported:

1900 

1901* **Sessions**: cloud sessions, `claude -p`, `claude remote-control` server mode, [GitHub Actions](https://code.claude.com/docs/en/github-actions.md), and the Agent SDK

1902* **Servers in the Desktop app**: connectors, Desktop extensions, and servers from [`claude_desktop_config.json`](https://code.claude.com/docs/en/desktop#mcp-servers-from-the-claude-desktop-chat-app)

1903* **Connections**: cloud providers, a custom `ANTHROPIC_BASE_URL`, `apiKeyHelper`, and `ANTHROPIC_AUTH_TOKEN`

1904* **Compliance settings**: organizations with a setting such as [HIPAA](https://code.claude.com/docs/en/hipaa-setup.md) or [zero data retention](https://code.claude.com/docs/en/zero-data-retention.md). For connectors, this includes [customer-managed encryption keys](https://platform.claude.com/docs/en/manage-claude/cmek).

1905 

1906### MCP skill limitations

1907 

1908Each server shows up to 100 skills. [Scanned skills](#safety-of-mcp-skills) have limits:

1909 

1910* **Size**: 100 KB per text file, 400 KB per skill

1911* **Unscanned files**: PNG, JPEG, GIF, BMP, ICO, SVG, PDF, WOFF, WOFF2, TTF, EOT, MP3, MP4, WAV, AVI, MOV, and dependency lock files aren't scanned or counted

1912* **Unsupported files**: skills with an archive, another binary file such as WebP or OTF, or text in folders such as `dist/` don't load

1913 

1914### Turn on MCP skills for organizations

1915 

1916To turn on MCP skills for Team or Enterprise members who sign in with `/login`:

1917 

1918* **Connectors**: an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) turns on **Skills over MCP** in [**Organization settings > Connectors**](https://claude.ai/admin-settings/connectors). Your organization's [**Skills** setting](https://claude.ai/admin-settings/skills?tab=policy) must also be on.

1919* **Other servers**: set [`disableDirectMcpSkills`](https://code.claude.com/docs/en/settings-reference#disabledirectmcpskills) to `false` in [managed settings](https://code.claude.com/docs/en/managed-settings.md), in the highest-ranked [admin source](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources) you use

1920 

1921> [!WARNING]

1922>

1923> Turn skills on only if you trust your members' servers: skill instructions or code can make Claude take unintended actions, including through [prompt injection](https://code.claude.com/docs/en/security.md#protect-against-prompt-injection).

1924 

1925#### Restrict MCP skills for organizations

1926 

1927To restrict one connector's skills, open the connector in [**Organization settings > Connectors**](https://claude.ai/admin-settings/connectors) and change **Default restriction for unconfigured tools**:

1928 

1929* **Restrict to Ask**: Claude needs approval each time it loads a skill

1930* **Restrict to Blocked**: no skill loads, including typed commands

1931 

1932Either way, you also restrict the connector's tools that have no restriction of their own. [Per-tool controls](#organization-controls-on-connector-tools) don't apply to skills.

1933 

1934On devices you manage, people can also sign in with a personal plan, an API key, or a long-lived token, where your organization's defaults don't apply. To turn skills off on those devices, set these keys to `true` in a [managed settings file or MDM policy](https://code.claude.com/docs/en/server-managed-settings.md#platform-availability):

1935 

1936* **`disableDirectMcpSkills`**: turns off skills from servers other than connectors

1937* **[`disableClaudeAiConnectors`](#disable-claude-ai-connectors)**: turns off the connectors Claude Code fetches, including their skills and tools

1938 

1939Normal [resource reads](#use-mcp-resources) from MCP servers are still allowed when skills are turned off.

1940 

1941### Troubleshoot MCP skills

1942 

1943If skills from MCP servers are missing, check the [supported setups](#requirements-for-skills-from-mcp-servers), [approval](#approvals-for-mcp-skills), the [`claude --debug=mcp` log](https://code.claude.com/docs/en/debug-your-config#check-mcp-servers), and these cases:

1944 

1945| What you see | What to do |

1946| :- | :- |

1947| A **Features** row in `/status` that names a variable, such as `DISABLE_TELEMETRY` | Unset the variable to turn [feature flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) on, then restart Claude Code |

1948| `Unknown command`, or Claude treats the command as text | Send it again. |

1949| `Claude Code could not read whether your organization limits this connector` in a prompt | Restart Claude Code |

1950| `scan of this skill has no result yet` | Retry in a minute, then tell the server's owner. Some [unsupported files](#limitations-of-mcp-skills) get no result. |

1951| `scan cannot take it` or `scan stopped this version` | Tell the server's owner |

1952| A connector shows tools but no skills | Ask its provider whether it serves skills to Claude Code. During the beta, Anthropic keeps skills off for some connectors, and no setting changes that. |

1953| No **Protocol** row on a connected server's `/mcp` page | Confirm the server supports [MCP revision](#mcp-client-runtimes) 2026-07-28 or later, over HTTP or stdio. If a stdio server takes over 3 seconds to start, change its command from `npx` to the installed program, then select **Reconnect**. |

1954 

1751## Scale with MCP tool search1955## Scale with MCP tool search

1752 1956 

1753Tool search keeps MCP context usage low by deferring tool definitions until Claude needs them. Only tool names and server instructions load at session start, so adding more MCP servers has minimal impact on your context window. Claude Code doesn't impose a fixed per-server tool cap; the practical limit is your context window budget.1957Tool search keeps MCP context usage low by deferring tool definitions until Claude needs them. Only tool names and server instructions load at session start, so adding more MCP servers has minimal impact on your context window. Claude Code doesn't impose a fixed per-server tool cap; the practical limit is your context window budget.

Details

11View plans11View plans

12Contact sales12Contact sales

13 13 

14This page covers setting up Microsoft Foundry for the Claude Code CLI.

15 

16> [!NOTE]

17>

18> To use Microsoft Foundry in the **Code** tab of the Claude Desktop app, you or your administrator configures the app:

19>

20> * **Your organization installed the app**: ask your administrator to [configure it for Microsoft Foundry](https://claude.com/docs/third-party/claude-desktop/foundry)

21> * **You install the app yourself**: follow the [single-machine setup steps](https://claude.com/docs/third-party/claude-desktop/installation#single-machine-setup) and enter the [connection and model values for Microsoft Foundry](https://claude.com/docs/third-party/claude-desktop/foundry#configure-the-app)

22 

14## Prerequisites23## Prerequisites

15 24 

16Before configuring Claude Code with Microsoft Foundry, ensure you have:25Before configuring Claude Code with Microsoft Foundry, ensure you have:

Details

323Claude Code writes this event from a tool call's successful return, so a call that raises an error records nothing, whatever the tool. Among the calls that do return, it records no `tool.output` event for:323Claude Code writes this event from a tool call's successful return, so a call that raises an error records nothing, whatever the tool. Among the calls that do return, it records no `tool.output` event for:

324 324 

325* A call to any tool other than Read, Edit, Write, Bash, WebFetch, WebSearch, and MCP tools325* A call to any tool other than Read, Edit, Write, Bash, WebFetch, WebSearch, and MCP tools

326* A Read that returns anything other than file text, such as an image, a PDF, or a re-read of a file whose contents haven't changed326* A Read that returns anything other than file text, such as an image or a PDF

327* An Edit or Write call, unless you also set `OTEL_LOG_TOOL_DETAILS=1`327* An Edit or Write call, unless you also set `OTEL_LOG_TOOL_DETAILS=1`

328* A WebFetch or WebSearch call that Claude Code moved to the background while it ran so that a waiting message could reach Claude. The result that arrives later isn't recorded either. To learn when Claude Code moves a call, see [When Claude Code sends what you queued](https://code.claude.com/docs/en/interactive-mode.md#when-claude-code-sends-what-you-queued) for the terminal and the [`priority` field](https://code.claude.com/docs/en/agent-sdk/typescript#sdkusermessage) for Agent SDK sessions328* A WebFetch or WebSearch call that Claude Code moved to the background while it ran so that a waiting message could reach Claude. The result that arrives later isn't recorded either. To learn when Claude Code moves a call, see [When Claude Code sends what you queued](https://code.claude.com/docs/en/interactive-mode.md#when-claude-code-sends-what-you-queued) for the terminal and the [`priority` field](https://code.claude.com/docs/en/agent-sdk/typescript#sdkusermessage) for Agent SDK sessions

329 329 

Details

760| Mode | Protected-path writes |760| Mode | Protected-path writes |

761| :- | :- |761| :- | :- |

762| `default`, `acceptEdits` | Prompted |762| `default`, `acceptEdits` | Prompted |

763| `plan` | Allowed in interactive terminal sessions with [bypass permissions](#skip-all-checks-with-bypasspermissions-mode) available. Otherwise, routed to the classifier when [auto mode](#eliminate-prompts-with-auto-mode) is available during planning, and prompted when it isn't |763| `plan` | Can be allowed in interactive terminal sessions with [bypass permissions](#skip-all-checks-with-bypasspermissions-mode) available. Otherwise, routed to the classifier when [auto mode](#eliminate-prompts-with-auto-mode) is available during planning, and prompted when it isn't |

764| `auto` | Routed to the classifier, which decides |764| `auto` | Routed to the classifier, which decides |

765| `dontAsk` | Denied |765| `dontAsk` | Denied |

766| `bypassPermissions` | Allowed |766| `bypassPermissions` | Allowed |

permissions.md +1 −1

Details

534* **PreToolUse hooks**: a [hook](#extend-permissions-with-hooks) that returns `"allow"` doesn't skip the prompt534* **PreToolUse hooks**: a [hook](#extend-permissions-with-hooks) that returns `"allow"` doesn't skip the prompt

535* **Auto mode**: the prompt comes to you, and the [classifier](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) doesn't decide the read535* **Auto mode**: the prompt comes to you, and the [classifier](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) doesn't decide the read

536 536 

537In `dontAsk` mode, Claude Code denies the read instead of prompting. In `bypassPermissions` mode, and in interactive terminal sessions in plan mode with [bypass permissions](https://code.claude.com/docs/en/permission-modes.md#skip-all-checks-with-bypasspermissions-mode) available, the read runs without this prompt.537In `dontAsk` mode, Claude Code denies the read instead of prompting. In `bypassPermissions` mode, and in interactive terminal sessions in plan mode with [bypass permissions](https://code.claude.com/docs/en/permission-modes.md#skip-all-checks-with-bypasspermissions-mode) available, the read can run without this prompt.

538 538 

539To read files on a network share without this prompt, give the share a local path first:539To read files on a network share without this prompt, give the share a local path first:

540 540 

Details

186| `$.process.run`, `$.process.spawn` | Starts programs as the user |186| `$.process.run`, `$.process.spawn` | Starts programs as the user |

187| `$.http.fetch` | Makes network requests |187| `$.http.fetch` | Makes network requests |

188| `$.env.get`, `$.settings.read` | Reads environment variables and settings, which can hold API keys. An `env reads:` line in the output names each variable. |188| `$.env.get`, `$.settings.read` | Reads environment variables and settings, which can hold API keys. An `env reads:` line in the output names each variable. |

189| `$.env.set` | Sets an environment variable for Claude Code and for every command and MCP server it starts afterward, which can change what those programs run. An `env writes:` line names each variable. |189| `$.env.set` | Sets an environment variable for Claude Code and for commands and MCP servers it starts afterward, which can change what those programs run. An `env writes:` line names each variable. |

190| `$.mcp.call` | Calls a tool on a connected MCP server, with no permission prompt |190| `$.mcp.call` | Calls a tool on a connected MCP server, with no permission prompt |

191| `$.model.complete` | Uses the user's plan or API key for model calls |191| `$.model.complete` | Uses the user's plan or API key for model calls |

192| `$.prompt.submit` | Submits a prompt, and can send it as the user's own words |192| `$.prompt.submit` | Submits a prompt, and can send it as the user's own words |

193| `$.session.send` | Sends a message that another session's, subagent's, or [teammate's](https://code.claude.com/docs/en/agent-teams.md) Claude reads |193| `$.session.send` | Sends a message that another session's, subagent's, or [teammate's](https://code.claude.com/docs/en/agent-teams.md) Claude reads |

194 194 

195In the `hooks:` line, [`tool.call`](https://code.claude.com/docs/en/plugins/mods/reference#tools) and [`prompt.submit`](https://code.claude.com/docs/en/plugins/mods/reference#prompts-and-what-claude-reads) mean the mod sees every tool call and every prompt, and can change them. [`session.append`](https://code.claude.com/docs/en/plugins/mods/reference#session) means the mod can rewrite each row of the conversation before it's stored, apart from [the rows the guard passes over](#hooks-the-guard-passes-over). [`ui.render{component=AskUserQuestion}`](https://code.claude.com/docs/en/plugins/mods/interface#change-what-claude-code-already-draws) means the mod can redraw the dialog Claude uses to ask the user a question. `tool.check` means the mod can approve or deny a tool call before a permission prompt appears. [Know what happens by default](#know-what-happens-by-default) lists which of your rules and hooks take precedence over its answer.195In the `hooks:` lines, look for the events that let a mod change what runs, what Claude reads, or what the user sees:

196 

197| Hook | What it means | Example |

198| :- | :- | :- |

199| [`tool.call`](https://code.claude.com/docs/en/plugins/mods/reference#tools), [`prompt.submit`](https://code.claude.com/docs/en/plugins/mods/reference#prompts-and-what-claude-reads) | Sees every tool call and every prompt, and can change them | Change a Bash command before it runs |

200| `tool.check` | Can approve or deny a tool call before a permission prompt appears. [Know what happens by default](#know-what-happens-by-default) lists which of your rules and hooks take precedence over its answer. | Approve a Bash command with no prompt |

201| [`session.append`](https://code.claude.com/docs/en/plugins/mods/reference#session) | Can rewrite each row of the conversation before it's stored, except [the rows the guard passes over](#hooks-the-guard-passes-over) and rows that hold a [skill from an MCP server](https://code.claude.com/docs/en/mcp.md#use-skills-from-mcp-servers) | Replace the text of a tool result |

202| [`skill.prompt`](https://code.claude.com/docs/en/plugins/mods/reference#prompts-and-what-claude-reads) | Can change a skill's text before Claude reads it, including a skill from an MCP server | Add instructions to a skill |

203| [`ui.render{component=AskUserQuestion}`](https://code.claude.com/docs/en/plugins/mods/interface#change-what-claude-code-already-draws) | Can redraw the dialog Claude uses to ask the user a question | Show its own text above a question |

196 204 

197## Choose how much to allow205## Choose how much to allow

198 206 

Details

150| `session.end` | The session ends, or `/clear`, `/resume`, or `/branch` runs. `e.reason` is `clear`, `resume`, `logout`, `prompt_input_exit`, or `other`. `/branch` reports `resume`. | `next(e)` |150| `session.end` | The session ends, or `/clear`, `/resume`, or `/branch` runs. `e.reason` is `clear`, `resume`, `logout`, `prompt_input_exit`, or `other`. `/branch` reports `resume`. | `next(e)` |

151| `session.compact` | The conversation is about to be compacted | `{ skip: reason }` |151| `session.compact` | The conversation is about to be compacted | `{ skip: reason }` |

152| [`session.receive`](https://code.claude.com/docs/en/plugins/mods/api#send-and-receive-messages-between-sessions), [`session.send`](https://code.claude.com/docs/en/plugins/mods/api#send-and-receive-messages-between-sessions) | A message arrives from, or is about to go to, another agent or session. See [Send and receive messages between sessions](https://code.claude.com/docs/en/plugins/mods/api.md#send-and-receive-messages-between-sessions). | `{ consumed: reason }` for `receive`, `{ isDelivered: false, reason }` for `send` |152| [`session.receive`](https://code.claude.com/docs/en/plugins/mods/api#send-and-receive-messages-between-sessions), [`session.send`](https://code.claude.com/docs/en/plugins/mods/api#send-and-receive-messages-between-sessions) | A message arrives from, or is about to go to, another agent or session. See [Send and receive messages between sessions](https://code.claude.com/docs/en/plugins/mods/api.md#send-and-receive-messages-between-sessions). | `{ consumed: reason }` for `receive`, `{ isDelivered: false, reason }` for `send` |

153| `session.append` | Once for each row the conversation keeps, such as a prompt, a response block, a tool result, or a notice, before it's stored | `next({ ...e, message })` with a changed `message.content`, to rewrite the row's text blocks or the `content` of a `tool_result` block in it |153| `session.append` | Once for each row the conversation keeps, such as a prompt, a response block, a tool result, or a notice, before it's stored | `next({ ...e, message })` with a changed `message.content`, to rewrite the row's text blocks or the `content` of a `tool_result` block in it. You can't rewrite a row that holds a [skill from an MCP server](https://code.claude.com/docs/en/mcp.md#use-skills-from-mcp-servers). To change that skill's text, hook [`skill.prompt`](#prompts-and-what-claude-reads) instead. |

154| `session.attach`, `session.detach` | Another app connects to or disconnects from the session | `next(e)` |154| `session.attach`, `session.detach` | Another app connects to or disconnects from the session | `next(e)` |

155| `session.measure` | After each turn, and when a plan limit's percent used changes | `next(e)` |155| `session.measure` | After each turn, and when a plan limit's percent used changes | `next(e)` |

156| `session.stop` | The user stops Claude, such as with Esc during a turn. Requires Claude Code v2.1.326 or later. | `next(e)` |156| `session.stop` | The user stops Claude, such as with Esc during a turn. Requires Claude Code v2.1.326 or later. | `next(e)` |

pr-steward.md +1 −1

Details

42 42 

43### Stop or limit PR Steward43### Stop or limit PR Steward

44 44 

45To stop PR Steward on one pull request, remove the `claude-pr-steward-watching` label or [comment `@claude stop`](https://code.claude.com/docs/en/pr-steward-pull-requests#start-or-stop-pr-steward-on-one-pull-request). To turn off or limit PR Steward on the pull requests that you open later, go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** or **Settings > Claude Code**.45To stop PR Steward on one pull request, remove the `claude-pr-steward-watching` label or [comment `@claude stop`](https://code.claude.com/docs/en/pr-steward-pull-requests#start-or-stop-pr-steward-on-one-pull-request). To turn off or limit PR Steward on the pull requests that you open later, go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** on claude.ai.

46 46 

47## Decide whether PR Steward fits your team47## Decide whether PR Steward fits your team

48 48 

Details

101 101 

102### Turn off or limit PR Steward on all your pull requests102### Turn off or limit PR Steward on all your pull requests

103 103 

104Go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** or **Settings > Claude Code** on claude.ai and select how much PR Steward does on the pull requests that you open. To change the setting, you need a [connected GitHub account](https://code.claude.com/docs/en/web-quickstart.md#connect-github).104Go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** on claude.ai and select how much PR Steward does on the pull requests that you open. To change the setting, you need a [connected GitHub account](https://code.claude.com/docs/en/web-quickstart.md#connect-github).

105 105 

106| Option | What PR Steward does on your pull requests |106| Option | What PR Steward does on your pull requests |

107| :- | :- |107| :- | :- |


118 118 

119To tell PR Steward what to work on, for every pull request that you open, use the toggles in your settings. A repository's `.claude/skills/steward/SKILL.md` can say something else, so see [which instructions take priority](#which-pr-steward-instructions-take-priority).119To tell PR Steward what to work on, for every pull request that you open, use the toggles in your settings. A repository's `.claude/skills/steward/SKILL.md` can say something else, so see [which instructions take priority](#which-pr-steward-instructions-take-priority).

120 120 

1211. Go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** or **Settings > Claude Code** on claude.ai1211. Go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** on claude.ai

1222. For **How much should Steward do on its own?**, select [**Customize**](#turn-off-or-limit-pr-steward-on-all-your-pull-requests)1222. For **How much should Steward do on its own?**, select [**Customize**](#turn-off-or-limit-pr-steward-on-all-your-pull-requests)

1233. Turn off the toggle for each thing that you don't want PR Steward to do. Each toggle is on until you turn it off:1233. Turn off the toggle for each thing that you don't want PR Steward to do. Each toggle is on until you turn it off:

124 * **Failing CI and merge conflicts**124 * **Failing CI and merge conflicts**


141 141 

142### Save PR Steward instructions for every pull request you open142### Save PR Steward instructions for every pull request you open

143 143 

144To give PR Steward the same instructions on every pull request that you open, go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** or **Settings > Claude Code** on claude.ai. Under **My instructions for Steward**, enter up to 1,000 characters.144To give PR Steward the same instructions on every pull request that you open, go to [**PR Steward**](https://claude.ai/settings/claude-code#pr-steward) in **Settings > Code** on claude.ai. Under **My instructions for Steward**, enter up to 1,000 characters.

145 145 

146These instructions ask for small commits and no replies to reviewers:146These instructions ask for small commits and no replies to reviewers:

147 147 

Details

128 128 

129### See what PR Steward spent129### See what PR Steward spent

130 130 

131To see the average for each merged pull request, open a repository's **Edit** dialog. For your organization's total over the last 30 days, go to [claude.ai/analytics/pr-steward](https://claude.ai/analytics/pr-steward).131To see a repository's estimated spend on PR Steward, open its **Edit** dialog. For your organization's estimated total over the last 30 days, go to [claude.ai/analytics/pr-steward](https://claude.ai/analytics/pr-steward).

132 132 

133### Set PR Steward's spend limits133### Set PR Steward's spend limits

134 134 

Details

378 * Text-output commands: `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/usage-credits`, `/recap`, and `/reload-plugins`. `/usage-credits` replies in text, such as where to manage usage credits. `/reload-plugins` works only when the session runs in an interactive terminal; a session without one declines it.378 * Text-output commands: `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/usage-credits`, `/recap`, and `/reload-plugins`. `/usage-credits` replies in text, such as where to manage usage credits. `/reload-plugins` works only when the session runs in an interactive terminal; a session without one declines it.

379 * `/model`, `/effort`, `/fast`, `/color`, and `/rename`: pass the value as an argument, for example `/model sonnet` or `/effort high`. From mobile and web, `/model` and `/effort` take the argument in place of the terminal picker or slider.379 * `/model`, `/effort`, `/fast`, `/color`, and `/rename`: pass the value as an argument, for example `/model sonnet` or `/effort high`. From mobile and web, `/model` and `/effort` take the argument in place of the terminal picker or slider.

380 * `/mcp`: from the mobile app, returns a text summary of server status instead of opening the picker. On the web, `/mcp` on its own opens a directory of [claude.ai connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) instead of returning the summary. The `reconnect`, `enable`, and `disable` [subcommands](https://code.claude.com/docs/en/commands.md#all-commands) work from both when the session runs in an interactive terminal. `/mcp reconnect` with no server name retries every server that has failed or needs authentication. To authorize a claude.ai connector without the picker, see [Authorize a connector again from your shell](#authorize-a-connector-again-from-your-shell).380 * `/mcp`: from the mobile app, returns a text summary of server status instead of opening the picker. On the web, `/mcp` on its own opens a directory of [claude.ai connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) instead of returning the summary. The `reconnect`, `enable`, and `disable` [subcommands](https://code.claude.com/docs/en/commands.md#all-commands) work from both when the session runs in an interactive terminal. `/mcp reconnect` with no server name retries every server that has failed or needs authentication. To authorize a claude.ai connector without the picker, see [Authorize a connector again from your shell](#authorize-a-connector-again-from-your-shell).

381 * `/config`: from the mobile app, pass `key=value` to set a setting, or run it with no argument to list the keys you can set. On the web, `/config` opens **Settings > Code** or **Settings > Claude Code** instead.381 * `/config`: from the mobile app, pass `key=value` to set a setting, or run it with no argument to list the keys you can set. On the web, `/config` opens **Settings > Code** instead.

382 * If you're a Team or Enterprise member without billing access, `/usage-credits` from mobile or web doesn't send a [usage-credits request to your admin](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription). Sending requires a confirmation that appears only in the interactive CLI, so the command tells you to run it there instead.382 * If you're a Team or Enterprise member without billing access, `/usage-credits` from mobile or web doesn't send a [usage-credits request to your admin](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription). Sending requires a confirmation that appears only in the interactive CLI, so the command tells you to run it there instead.

383 * `/autocompact`, from v2.1.221: pass the window size as an argument, for example `/autocompact 500k`. With no argument, it prints the current window size as text instead of opening the dialog the command shows in a terminal session.383 * `/autocompact`, from v2.1.221: pass the window size as an argument, for example `/autocompact 500k`. With no argument, it prints the current window size as text instead of opening the dialog the command shows in a terminal session.

384 * `/advisor`, from v2.1.260: pass the model as an argument, for example `/advisor opus`, or pass `off` to turn the advisor off. Both forms apply to the current session only and leave your saved default unchanged. With no argument, it prints the current advisor as text instead of opening the picker.384 * `/advisor`, from v2.1.260: pass the model as an argument, for example `/advisor opus`, or pass `off` to turn the advisor off. Both forms apply to the current session only and leave your saved default unchanged. With no argument, it prints the current advisor as text instead of opening the picker.

Details

15> * **Reacting to events as they happen instead of polling**: see [Channels](https://code.claude.com/docs/en/channels.md). Your CI can push the failure into the session directly.15> * **Reacting to events as they happen instead of polling**: see [Channels](https://code.claude.com/docs/en/channels.md). Your CI can push the failure into the session directly.

16> * **Keeping the session working turn after turn toward a condition rather than on an interval**: see [`/goal`](https://code.claude.com/docs/en/goal).16> * **Keeping the session working turn after turn toward a condition rather than on an interval**: see [`/goal`](https://code.claude.com/docs/en/goal).

17 17 

18Tasks are session-scoped. When you resume with `--resume` or `--continue`, Claude Code restores tasks that haven't [expired](#seven-day-expiry), except those listed under [Limitations](#limitations). For scheduling that survives independently of any session, create a [cloud scheduled task](https://code.claude.com/docs/en/routines.md), set up a [Desktop scheduled task](https://code.claude.com/docs/en/desktop-scheduled-tasks.md), or use [GitHub Actions](https://code.claude.com/docs/en/github-actions.md).18Tasks are session-scoped. When you resume with `--resume` or `--continue`, Claude Code restores tasks that haven't [expired](#recurring-task-expiry), except those listed under [Limitations](#limitations). For scheduling that survives independently of any session, create a [cloud scheduled task](https://code.claude.com/docs/en/routines.md), set up a [Desktop scheduled task](https://code.claude.com/docs/en/desktop-scheduled-tasks.md), or use [GitHub Actions](https://code.claude.com/docs/en/github-actions.md).

19 19 

20## Compare scheduling options20## Compare scheduling options

21 21 


78 78 

79In a session where the [Monitor tool is available](https://code.claude.com/docs/en/tools-reference.md#monitor-tool), Claude may use it directly when you ask for a dynamic `/loop` schedule. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval.79In a session where the [Monitor tool is available](https://code.claude.com/docs/en/tools-reference.md#monitor-tool), Claude may use it directly when you ask for a dynamic `/loop` schedule. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval.

80 80 

81A dynamically scheduled loop appears in your [scheduled task list](#manage-scheduled-tasks) like any other task, so you can list or cancel it the same way. The list shows its pending wakeup as a one-shot task, so a wakeup scheduled for `:00` or `:30` can [run a little early](#when-a-one-shot-task-runs-early). The [seven-day expiry](#seven-day-expiry) applies to the loop too.81A dynamically scheduled loop appears in your [scheduled task list](#manage-scheduled-tasks), so you can ask Claude to list or cancel it. The list shows its pending wakeup as a one-shot task, so a wakeup scheduled for `:00` or `:30` can [run a little early](#when-a-one-shot-task-runs-early). The loop [expires 30 days after it starts](#recurring-task-expiry).

82 82 

83> [!NOTE]83> [!NOTE]

84>84>


127### Stop a loop127### Stop a loop

128 128 

129* **[Self-paced loop](#let-claude-choose-the-interval)**: while the loop is waiting for its next iteration, press `Esc` on an empty prompt to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a [background session you've attached to](#detach-without-stopping-a-loop). A `Pending wakeup cancelled` notice confirms that the loop won't fire again.129* **[Self-paced loop](#let-claude-choose-the-interval)**: while the loop is waiting for its next iteration, press `Esc` on an empty prompt to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a [background session you've attached to](#detach-without-stopping-a-loop). A `Pending wakeup cancelled` notice confirms that the loop won't fire again.

130* **[Fixed-interval loop](#run-on-a-fixed-interval)**: to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don't stop it, or any task you [scheduled by asking Claude directly](#manage-scheduled-tasks). A loop you don't cancel ends when [seven days elapse](#seven-day-expiry).130* **[Fixed-interval loop](#run-on-a-fixed-interval)**: to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don't stop it, or any task you [scheduled by asking Claude directly](#manage-scheduled-tasks). A loop you don't cancel ends [30 days after you start it](#recurring-task-expiry).

131 131 

132In [self-paced mode](#let-claude-choose-the-interval), Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](https://code.claude.com/docs/en/tools-reference) with `stop: true`, which cancels the pending wakeup immediately.132In [self-paced mode](#let-claude-choose-the-interval), Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](https://code.claude.com/docs/en/tools-reference) with `stop: true`, which cancels the pending wakeup immediately.

133 133 


208 208 

209A one-shot task scheduled for `:00` or `:30` runs up to 90 seconds early. Claude Code doesn't shift a one-shot task scheduled for any other minute, so when the timing matters, schedule it off the hour and half hour: `3 9 * * *` instead of `0 9 * * *`.209A one-shot task scheduled for `:00` or `:30` runs up to 90 seconds early. Claude Code doesn't shift a one-shot task scheduled for any other minute, so when the timing matters, schedule it off the hour and half hour: `3 9 * * *` instead of `0 9 * * *`.

210 210 

211### Seven-day expiry211### Recurring task expiry

212 212 

213Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) or [Desktop scheduled tasks](https://code.claude.com/docs/en/desktop-scheduled-tasks.md) for durable scheduling.213Recurring tasks automatically expire 30 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. Before v2.1.330, the limit was 7 days, and recurring tasks created with `CronCreate` on those versions keep it.

214 

215If you need a recurring task to last longer, cancel and recreate it before it expires, or use [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) or [Desktop scheduled tasks](https://code.claude.com/docs/en/desktop-scheduled-tasks.md) for durable scheduling.

214 216 

215## Cron expression reference217## Cron expression reference

216 218 

settings.md +16 −2

Details

203 203 

204After you continue, run `/status` to see the affected files and `claude doctor` for the details of each error.204After you continue, run `/status` to see the affected files and `claude doctor` for the details of each error.

205 205 

206A `-p` run shows no dialog. Unless [a managed settings document can't be parsed](https://code.claude.com/docs/en/errors.md#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.206#### Broken settings in a `-p` run

207 

208A `-p` run shows no dialog. Unless [a managed settings document can't be parsed](https://code.claude.com/docs/en/errors.md#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.

209 

210With the default `text` [output format](https://code.claude.com/docs/en/headless.md#get-structured-output), stderr lists what didn't load or was skipped:

211 

212```text theme={null}

213These settings did not load, so nothing in them is in effect, including hooks, permission rules and sandbox settings, though environment variables they already set can stay:

214 /home/you/.claude/settings.json (cleanupPeriodDays): Expected number, but received string

215These settings entries were skipped; the rest of each source is in effect:

216 /home/you/app/.claude/settings.json (permissions.allow): Invalid permission rule "Bash(ls) x" was skipped: Malformed Tool(content) rule. Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal

217Fix each problem listed, then start Claude Code again. For settings sent with applyFlagSettings, shown as SDK inline settings, send them again instead.

218```

219 

220After a `-p` run that ignores a setting, run `claude doctor` from your terminal to see what it dropped.

207 221 

208## Settings precedence222## Settings precedence

209 223 


330* **Shared project settings with several repositories**: in an Anthropic-hosted environment, a session with several repositories starts above the clones and reads only the `enabledPlugins` and `extraKnownMarketplaces` keys from each repository's `.claude/settings.json`, not permission rules, hooks, `env`, or other keys. The marketplaces a repository declares still [aren't added in a cloud session](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup). For a self-hosted environment, see [which repository's settings apply](https://code.claude.com/docs/en/self-hosted-environments-configuration.md#repository-settings-in-sessions-with-several-repositories).344* **Shared project settings with several repositories**: in an Anthropic-hosted environment, a session with several repositories starts above the clones and reads only the `enabledPlugins` and `extraKnownMarketplaces` keys from each repository's `.claude/settings.json`, not permission rules, hooks, `env`, or other keys. The marketplaces a repository declares still [aren't added in a cloud session](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup). For a self-hosted environment, see [which repository's settings apply](https://code.claude.com/docs/en/self-hosted-environments-configuration.md#repository-settings-in-sessions-with-several-repositories).

331* **User and project local settings** (`~/.claude/settings.json` and `.claude/settings.local.json`): not read. Both stay on your machine, and the local file isn't in the clone.345* **User and project local settings** (`~/.claude/settings.json` and `.claude/settings.local.json`): not read. Both stay on your machine, and the local file isn't in the clone.

332* **Managed settings**: a `managed-settings.json` file or MDM profile on your device doesn't reach a cloud session. Your organization's [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) do; [surface coverage](https://code.claude.com/docs/en/model-config.md#surface-coverage) lists which cloud sessions receive them. A [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments) also reads the managed settings file in its runner image. [How Claude Code combines managed sources](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources) says when that file applies.346* **Managed settings**: a `managed-settings.json` file or MDM profile on your device doesn't reach a cloud session. Your organization's [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) do; [surface coverage](https://code.claude.com/docs/en/model-config.md#surface-coverage) lists which cloud sessions receive them. A [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments) also reads the managed settings file in its runner image. [How Claude Code combines managed sources](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources) says when that file applies.

333* **`/config`**: in your browser at claude.ai/code, opens your claude.ai **Code** or **Claude Code** settings page instead of changing a value. To change a setting for a cloud session, set an [environment variable](https://code.claude.com/docs/en/cloud-environments.md#set-environment-variables) on the environment. In a session with one repository outside a project's threads, you can instead commit the key to that repository's `.claude/settings.json`.347* **`/config`**: in your browser at claude.ai/code, opens **Settings > Code** instead of changing a value. To change a setting for a cloud session, set an [environment variable](https://code.claude.com/docs/en/cloud-environments.md#set-environment-variables) on the environment. In a session with one repository outside a project's threads, you can instead commit the key to that repository's `.claude/settings.json`.

334 348 

335[What carries over from your setup](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup) lists the rest: `CLAUDE.md`, skills, MCP servers, plugins, and credentials.349[What carries over from your setup](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup) lists the rest: `CLAUDE.md`, skills, MCP servers, plugins, and credentials.

336 350 

Details

83| [`disableCommandPluginSources`](#disablecommandpluginsources) | Block [plugins](https://code.claude.com/docs/en/plugins/overview.md) that install by running a marketplace-declared command | Plugins and skills | Managed |83| [`disableCommandPluginSources`](#disablecommandpluginsources) | Block [plugins](https://code.claude.com/docs/en/plugins/overview.md) that install by running a marketplace-declared command | Plugins and skills | Managed |

84| [`disableDeepLinkRegistration`](#disabledeeplinkregistration) | Stop Claude Code from registering the [`claude-cli://` handler](https://code.claude.com/docs/en/deep-links) | Remote, desktop, and notifications | Any file |84| [`disableDeepLinkRegistration`](#disabledeeplinkregistration) | Stop Claude Code from registering the [`claude-cli://` handler](https://code.claude.com/docs/en/deep-links) | Remote, desktop, and notifications | Any file |

85| [`disableDesktopLocalSessions`](#disabledesktoplocalsessions) | Turn off [Desktop Code sessions](https://code.claude.com/docs/en/desktop.md#local-sessions-on-managed-devices) that run on the device, leaving SSH to other hosts and cloud | Remote, desktop, and notifications | Managed |85| [`disableDesktopLocalSessions`](#disabledesktoplocalsessions) | Turn off [Desktop Code sessions](https://code.claude.com/docs/en/desktop.md#local-sessions-on-managed-devices) that run on the device, leaving SSH to other hosts and cloud | Remote, desktop, and notifications | Managed |

86| [`disableDirectMcpSkills`](#disabledirectmcpskills) | Turn [skills from MCP servers](https://code.claude.com/docs/en/mcp.md#turn-on-skills-for-an-organization) other than connectors on or off for your organization | MCP | Managed |

86| [`disabledMcpjsonServers`](#disabledmcpjsonservers) | Reject specific servers from a project's [`.mcp.json`](https://code.claude.com/docs/en/mcp#project-scope) | MCP | Any file |87| [`disabledMcpjsonServers`](#disabledmcpjsonservers) | Reject specific servers from a project's [`.mcp.json`](https://code.claude.com/docs/en/mcp#project-scope) | MCP | Any file |

87| [`disableMobileSimulatorTools`](#disablemobilesimulatortools) | Block Claude's tools in the [desktop](https://code.claude.com/docs/en/desktop.md) iOS Simulator pane | Tools | Managed |88| [`disableMobileSimulatorTools`](#disablemobilesimulatortools) | Block Claude's tools in the [desktop](https://code.claude.com/docs/en/desktop.md) iOS Simulator pane | Tools | Managed |

88| [`disableRemoteControl`](#disableremotecontrol) | Turn off [Remote Control](https://code.claude.com/docs/en/remote-control.md) everywhere it can start | Remote, desktop, and notifications | Any file |89| [`disableRemoteControl`](#disableremotecontrol) | Turn off [Remote Control](https://code.claude.com/docs/en/remote-control.md) everywhere it can start | Remote, desktop, and notifications | Any file |


4181 4182 

4182Lock the `skills` surface. Claude Code stops loading skills from `~/.claude/skills/` and `.claude/skills/`, custom commands from `~/.claude/commands/` and `.claude/commands/`, skills and commands under `--add-dir` directories, and skills synced from your claude.ai account. It keeps loading bundled skills, skills in the managed policy directory, and skills from plugins other than [skills-directory plugins](https://code.claude.com/docs/en/plugins/loading.md#skills-directory-plugins-blocked-by-managed-settings).4183Lock the `skills` surface. Claude Code stops loading skills from `~/.claude/skills/` and `.claude/skills/`, custom commands from `~/.claude/commands/` and `.claude/commands/`, skills and commands under `--add-dir` directories, and skills synced from your claude.ai account. It keeps loading bundled skills, skills in the managed policy directory, and skills from plugins other than [skills-directory plugins](https://code.claude.com/docs/en/plugins/loading.md#skills-directory-plugins-blocked-by-managed-settings).

4183 4184 

4185With the lock on, [skills from MCP servers](https://code.claude.com/docs/en/mcp.md#use-skills-from-mcp-servers) that users, projects, and `--mcp-config` add don't load. Skills from claude.ai connectors still load.

4186 

4184* **Scope**: [`Managed`](#scopes)4187* **Scope**: [`Managed`](#scopes)

4185* **Type**: the string `"skills"` in the [`strictPluginOnlyCustomization`](#strictpluginonlycustomization) array4188* **Type**: the string `"skills"` in the [`strictPluginOnlyCustomization`](#strictpluginonlycustomization) array

4186* **Default**: not locked4189* **Default**: not locked


4540 4543 

4541The denylist takes precedence over [`allowedMcpServers`](#allowedmcpservers), so a server on both lists is blocked. See [Policy-based control with allowlists and denylists](https://code.claude.com/docs/en/managed-mcp.md#policy-based-control-with-allowlists-and-denylists).4544The denylist takes precedence over [`allowedMcpServers`](#allowedmcpservers), so a server on both lists is blocked. See [Policy-based control with allowlists and denylists](https://code.claude.com/docs/en/managed-mcp.md#policy-based-control-with-allowlists-and-denylists).

4542 4545 

4546### `disableDirectMcpSkills`

4547 

4548Turn [skills from MCP servers](https://code.claude.com/docs/en/mcp.md#turn-on-skills-for-an-organization) on or off for your organization. This key covers every server except claude.ai connectors. For connectors, an Owner uses the **Skills over MCP** switch in [**Organization settings > Connectors**](https://claude.ai/admin-settings/connectors) instead. Skills from MCP servers require Claude Code v2.1.331 or later.

4549 

4550* **Scope**: [`Managed`](#scopes). If you use several [managed sources](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources), set `false` in the highest-ranked one. Claude Code ignores a `false` in the Windows HKCU registry

4551* **Type**: Boolean

4552 * `true`: Claude Code doesn't list or load skills from these servers. The servers keep their tools, and claude.ai connectors keep their skills

4553 * `false`: on Team and Enterprise plans, allows these skills. They stay off for servers you lock out with `strictPluginOnlyCustomization`, and if your organization isn't [eligible](https://code.claude.com/docs/en/mcp.md#requirements-for-skills-from-mcp-servers). On other plans, `false` is the same as unset

4554* **Default**: unset. These skills are off for Team and Enterprise members who sign in to claude.ai with `/login`. For other sign-ins, see [MCP skill availability](https://code.claude.com/docs/en/mcp.md#requirements-for-skills-from-mcp-servers)

4555 

4556This example allows these skills for Team and Enterprise members:

4557 

4558```json managed-settings.json theme={null}

4559{

4560 "disableDirectMcpSkills": false

4561}

4562```

4563 

4564If any [admin source](https://code.claude.com/docs/en/managed-settings.md#keys-read-from-every-admin-source) sets `true`, the skills stay off.

4565 

4566Anthropic doesn't scan these skills. They can contain instructions or code that cause Claude to take unintended actions, including through [prompt injection](https://code.claude.com/docs/en/security.md#protect-against-prompt-injection). Set this to `false` only if you trust the servers your members add.

4567 

4543### `disableClaudeAiConnectors`4568### `disableClaudeAiConnectors`

4544 4569 

4545Turn off the [claude.ai MCP connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) [Claude Code fetches itself](https://code.claude.com/docs/en/mcp.md#how-connectors-reach-claude-code), so it neither fetches nor connects them. A `true` in any settings file applies: a checked-in project `.claude/settings.json` can opt a repository out of those connectors, but a project-level `false` can't override a user- or managed-level `true`.4570Turn off the [claude.ai MCP connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) [Claude Code fetches itself](https://code.claude.com/docs/en/mcp.md#how-connectors-reach-claude-code), so it neither fetches nor connects them. A `true` in any settings file applies: a checked-in project `.claude/settings.json` can opt a repository out of those connectors, but a project-level `false` can't override a user- or managed-level `true`.

setup.md +1 −1

Details

32 32 

33> [!TIP]33> [!TIP]

34>34>

35> Prefer a graphical interface? The [Desktop app](https://code.claude.com/docs/en/desktop-quickstart.md) lets you use Claude Code without the terminal. Download it for [macOS](https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code\&utm_medium=docs), [Windows](https://claude.com/download?utm_source=claude_code\&utm_medium=docs), or [Linux](https://code.claude.com/docs/en/desktop-linux.md).35> Prefer a graphical interface? The [Desktop app](https://code.claude.com/docs/en/desktop-quickstart.md) lets you use Claude Code without the terminal. Download it for [macOS](https://claude.ai/claude-code/desktop-download?platform=mac\&utm_source=claude_code\&utm_medium=docs), [Windows](https://claude.ai/claude-code/desktop-download?platform=win\&utm_source=claude_code\&utm_medium=docs), or [Linux](https://code.claude.com/docs/en/desktop-linux.md).

36 36 

37To install Claude Code, open a terminal and run the command for your system. If you haven't used a terminal before, the [terminal guide](https://code.claude.com/docs/en/terminal-guide) shows how to open one and paste the command.37To install Claude Code, open a terminal and run the command for your system. If you haven't used a terminal before, the [terminal guide](https://code.claude.com/docs/en/terminal-guide) shows how to open one and paste the command.

38 38 

Details

59* **Visibility options**: **Private** and **Public**59* **Visibility options**: **Private** and **Public**

60* **Repository access**: **Require repository access** is off by default. Turn it on to limit the cloud sessions you share to recipients with access to each session's private repositories. People without repository access may be able to open a Remote Control session's link.60* **Repository access**: **Require repository access** is off by default. Turn it on to limit the cloud sessions you share to recipients with access to each session's private repositories. People without repository access may be able to open a Remote Control session's link.

61 61 

62To turn on **Require repository access** or turn off **Show your name**, open Settings on claude.ai, then:62To turn on **Require repository access** or turn off **Show your name**, go to [**Settings > Privacy**](https://claude.ai/settings/data-privacy-controls) on claude.ai and click **Manage** next to **Shared Code sessions**.

63 

64* **If the Settings menu shows Code instead of Claude Code**: go to [**Privacy**](https://claude.ai/settings/data-privacy-controls)

65* **Otherwise**: go to [**Claude Code > Sharing settings**](https://claude.ai/settings/claude-code)

66 63 

67## Stop sharing a session64## Stop sharing a session

68 65 

ship-command.md +67 −22

Details

47Install or update these tools:47Install or update these tools:

48 48 

49* Claude Code v2.1.330 or later. If `/ship` is missing, see [/ship isn't available in your session](https://code.claude.com/docs/en/ship-command-troubleshooting.md#%2Fship-isn’t-available-in-your-session)49* Claude Code v2.1.330 or later. If `/ship` is missing, see [/ship isn't available in your session](https://code.claude.com/docs/en/ship-command-troubleshooting.md#%2Fship-isn’t-available-in-your-session)

50* The [GitHub CLI](https://cli.github.com) 2.63 or later, signed in with `gh auth login`. With an older version, Claude can't push fixes50* For a repository on GitHub, the [GitHub CLI](https://cli.github.com) 2.63 or later, signed in with `gh auth login`. With an older version, no watch starts. Before v2.1.331, a watch starts and Claude can't push fixes

51* git 2.38 or later, to merge new commits into your branch. With an older git, Claude leaves those merges to you51* git 2.38 or later, to merge new commits into your branch. With an older git, Claude leaves those merges to you, and no watch starts [on another host](#watch-a-branch-on-another-host)

52 52 

53Then get your change and your session ready:53Then get your change and your session ready:

54 54 

55* **A finished change, for `/ship`**: have it in your local clone of a repository on GitHub. It can be uncommitted, committed on a branch other than the default branch, or already in an open pull request of yours. If the repository is hosted somewhere other than GitHub, `/ship` opens no pull request, and Claude reviews your change55* **A finished change, for `/ship`**: have it in your local clone of a repository on GitHub. It can be uncommitted, committed on a branch other than the default branch, or already in an open pull request of yours. If the repository is hosted somewhere other than GitHub, `/ship` opens no pull request. Claude reviews your change, and can then [watch your branch](#watch-a-branch-on-another-host). Before v2.1.331, no watch starts there

56* **Only the files that you want in the pull request, for `/ship`**: `/ship` can commit all your uncommitted changes, new files included. In your shell, run `git status`. Delete each new file that you don't want in the pull request, or stash the file with `git stash push -u -- <file>`56* **Only the files that you want in the pull request, for `/ship`**: `/ship` can commit all your uncommitted changes, new files included. In your shell, run `git status`. Delete each new file that you don't want in the pull request, or stash the file with `git stash push -u -- <file>`

57* **No secrets in those files, for `/ship`**: `/ship` looks for secrets by file name, such as `.env`, so look inside your files yourself. A deny rule such as `Read(./notes.txt)` doesn't keep a file out of the commit57* **No secrets in those files, for `/ship`**: `/ship` looks for secrets by file name, such as `.env`, so look inside your files yourself. A deny rule such as `Read(./notes.txt)` doesn't keep a file out of the commit

58* **An open pull request on GitHub, for `/steward`**: it has to be your own, with its branch checked out in your local clone58* **An open pull request on GitHub, for `/steward`**: it has to be your own, with its branch checked out in your local clone. On a host other than GitHub, see [Watch a branch on another host](#watch-a-branch-on-another-host)

59* **Permission mode**: choose [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) if you want Claude to work on the pull request unattended. In most other permission modes, Claude waits at each prompt. In `bypassPermissions` mode, no watch starts59* **Permission mode**: choose [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) if you want Claude to work on the pull request unattended. In most other permission modes, Claude waits at each prompt. In `bypassPermissions` mode, no watch starts. In plan mode, `/ship` doesn't start

60 60 

61On native Windows, [no watch starts](https://code.claude.com/docs/en/ship-command-troubleshooting.md#cases-where-no-watch-can-start).61On native Windows, [no watch starts](https://code.claude.com/docs/en/ship-command-troubleshooting.md#cases-where-no-watch-can-start). In a [background session](https://code.claude.com/docs/en/agent-view.md), [no watch starts](https://code.claude.com/docs/en/ship-command-troubleshooting.md#a-session-setting-blocks-a-watch) either. Before v2.1.331, one can start there.

62 62 

63> [!WARNING]63> [!WARNING]

64>64>


82 82 

83In a repository on github.com that isn't a fork, `/ship` can commit your uncommitted changes, push the branch, and open the pull request before the review. On the default branch, it commits on a new branch and switches your checkout to that branch. If your work is already committed on another branch, `/ship` pushes that branch and opens the pull request.83In a repository on github.com that isn't a fork, `/ship` can commit your uncommitted changes, push the branch, and open the pull request before the review. On the default branch, it commits on a new branch and switches your checkout to that branch. If your work is already committed on another branch, `/ship` pushes that branch and opens the pull request.

84 84 

85`/ship` doesn't commit your uncommitted changes in these cases. Take the first one that fits:85`/ship` does something else in these cases. Take the first one that fits:

86 86 

87* **A pull request is already open for the branch**: commit and push anything that you want in the pull request87* **Someone else's pull request is open for the branch**: `/ship` doesn't commit or push your work, and no watch starts

88* **The repository is public**: if you're on a branch other than the default branch and it has commits of its own, `/ship` pushes those and opens a pull request without your uncommitted changes. Otherwise, commit your work on a branch other than the default branch, then run `/ship` again

89* **An uncommitted file's name suggests a secret, such as `.env`**: in a repository that isn't public, `/ship` doesn't commit or push anything. See [/ship committed or pushed nothing](https://code.claude.com/docs/en/ship-command-troubleshooting.md#%2Fship-committed-or-pushed-nothing)88* **An uncommitted file's name suggests a secret, such as `.env`**: in a repository that isn't public, `/ship` doesn't commit or push anything. See [/ship committed or pushed nothing](https://code.claude.com/docs/en/ship-command-troubleshooting.md#%2Fship-committed-or-pushed-nothing)

89* **Your own pull request is already open for the branch**: where a watch can start and the repository isn't public, `/ship` can commit your uncommitted changes, then push them and your unpushed commits onto it. [In other cases](https://code.claude.com/docs/en/ship-command-troubleshooting.md#your-pull-request-is-already-open), it leaves some of that work off. If a watch then starts, your unpushed commits [can go up with Claude's next push](#keep-working-while-a-watch-runs). Before v2.1.331, `/ship` doesn't commit or push here

90* **The repository is public**: `/ship` doesn't commit your uncommitted changes. If you're on a branch other than the default branch and it has commits of its own, `/ship` pushes those and opens a pull request without your uncommitted changes. Otherwise, commit your work on a branch other than the default branch, then run `/ship` again

91* **Your commits are on the default branch, with nothing uncommitted**: in a repository that isn't public, `/ship` makes a new branch for them, pushes that branch, opens a pull request, and switches your checkout to the new branch. Before v2.1.331, `/ship` pushes nothing, so put the commits on a branch other than the default branch, then run `/ship` again

90 92 

91Open the pull request yourself, then run `/ship`, if you want any of these:93Open the pull request yourself, then run `/ship`, if you want any of these:

92 94 


105 107 

106## What Claude does during a watch108## What Claude does during a watch

107 109 

108A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. Claude uses your `gh` and `git` sign-ins, so its work on GitHub appears under your name.110A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. On a host other than GitHub, see [Watch a branch on another host](#watch-a-branch-on-another-host). Claude uses your `gh` and `git` sign-ins, so its work on GitHub appears under your name.

109 111 

110In auto mode, Claude takes these actions without asking:112In auto mode, on a GitHub pull request, Claude takes these actions without asking:

111 113 

112* Works on the review findings that it judges to be problems114* Works on the review findings that it judges to be problems

113* Can post one comment that sums up its review115* Can post one comment that sums up its review


116* Works on failing checks, and re-runs failed ones118* Works on failing checks, and re-runs failed ones

117* Answers review comments, resolves threads, and re-requests reviews119* Answers review comments, resolves threads, and re-requests reviews

118 120 

119Claude reads comments from you and from people with write access. On github.com, it also reads comments from Claude's bot. To have Claude read another bot's comments, type `/steward +` and the bot's name, as in `/steward +my-lint-bot`.121On GitHub, Claude reads comments from you and from people with write access. On github.com, it also reads comments from Claude's bot. To have Claude read another bot's comments, type `/steward +` and the bot's name, as in `/steward +my-lint-bot`.

120 122 

121When checks pass and comments are answered, Claude says so in the session. Merge the pull request yourself. What can merge depends on your permissions and your repository's branch rules. See [When a watch can lead to a merge](#when-a-watch-can-lead-to-a-merge).123When checks pass and comments are answered, Claude says so in the session. Merge the pull request yourself. What can merge depends on your permissions and your repository's branch rules. See [When a watch can lead to a merge](#when-a-watch-can-lead-to-a-merge).

122 124 

125### Watch a branch on another host

126 

127On a host other than GitHub, such as GitLab, Bitbucket, or Azure DevOps, Claude can watch your branch for up to seven days. The watch needs git 2.38 or later, and works without the GitHub CLI. `/ship` and `/steward` don't commit, push, or open anything when they start. Before v2.1.331, `/ship` reviews your change there, and no watch starts.

128 

129Commit your change first, then push your branch with an upstream from your shell:

130 

131```bash theme={null}

132git push -u origin <branch>

133```

134 

135On gitlab.com, bitbucket.org, or dev.azure.com, open your merge request or pull request next. Claude Code can then [read its checks and comments with your git sign-in](#checks-and-comments-on-gitlab-bitbucket-and-azure-devops). Then type `/ship` at the Claude Code prompt, or `/steward` for a watch with no review first.

136 

137With your git sign-in, Claude can take actions such as these, in auto mode without asking:

138 

139* Merge the base branch into yours to resolve a conflict

140* Merge in other people's pushes to your branch

141* Push commits to your branch

142 

143The watch gives Claude no command to reply to comments, re-run a check, or read CI logs there. To see what Claude may do there, type `/ship terms` at the prompt while the watch runs.

144 

145#### Checks and comments on GitLab, Bitbucket, and Azure DevOps

146 

147In a terminal session, Claude Code can read details such as your open merge request or pull request, its checks, and its comments. To do so, it asks git for the sign-in that git keeps for the remote that your branch pushes to. That sign-in goes to the API of gitlab.com, bitbucket.org, or dev.azure.com in `GET` requests. You aren't asked first.

148 

149A line such as this one appears before the first read, which can go out as soon as you run `/ship` or `/steward`:

150 

151```text theme={null}

152Claude Code is about to read gitlab.com's web API with the sign-in that git keeps for it. It only reads.

153```

154 

155A watch that reads the host repeats these reads until it ends. To see whether they apply to your checkout, run `git remote -v` in your shell. They can happen only when the `(fetch)` line of the remote that your branch pushes to shows an `https` address on one of those hosts.

156 

157To prevent them, switch the remote to SSH or deny the host in your settings before you run `/ship` or `/steward`. If a watch is running, type `/ship stop` first:

158 

159* Have the remote that your branch pushes to fetch over SSH, as in `git remote set-url origin git@gitlab.com:<group>/<project>.git` in your shell, with that remote's name in place of `origin`. Then check that `git remote -v` shows no `https` address on its `(fetch)` line

160* Add the host to [`sandbox.network.deniedDomains`](https://code.claude.com/docs/en/settings-reference#sandbox-network-denieddomains). The `about to read` notice still appears, but Claude Code doesn't ask git for the sign-in or call the web API. The watch's own git commands, which Claude Code runs outside the [sandbox](https://code.claude.com/docs/en/sandboxing.md), still contact the host with git's sign-in. With the sandbox on, Claude also can't fetch from or push to that host

161 

162At the watch's start, the host can refuse the sign-in, or show no open merge request or pull request of yours for the branch. The watch can then go on with git alone, and the lines at its start include `Claude can't see checks or comments on gitlab.com, so watch those yourself`. If you close yours without merging it, that watch continues, so type `/ship stop`.

163 

123### Keep working while a watch runs164### Keep working while a watch runs

124 165 

125While a watch runs, keep the session open and [in the foreground](https://code.claude.com/docs/en/agent-view.md#send-the-session-to-the-background), the computer awake, and your pull request's branch checked out. Claude edits files in the same checkout as you.166While a watch runs, keep the session open, the computer awake, and your pull request's branch checked out. Before v2.1.331, also keep the session [in the foreground](https://code.claude.com/docs/en/agent-view.md#send-the-session-to-the-background). Claude edits files in the same checkout as you.

126 167 

127* **To start your next change**: work in another folder, such as a second clone of the repository, and open another Claude Code session there168* **To start your next change**: work in another folder, such as a second clone of the repository, and open another Claude Code session there

128* **To push your own commits**: name the remote and branch, as in `git push origin <branch>`. If you change git's settings, for example with `git push -u` or `git branch -u`, the watch ends169* **To push your own commits**: name the remote and branch, as in `git push origin <branch>`. If you change git's settings, for example with `git push -u` or `git branch -u`, the watch ends


161 202 

162### What ends a watch203### What ends a watch

163 204 

164After a watch ends, look for a line that starts `Stopped watching pull request`. [A watch stopped](https://code.claude.com/docs/en/ship-command-troubleshooting.md#a-watch-stopped) lists reasons that it gives.205After a watch ends, look for a line that starts `Stopped watching`. [A watch stopped](https://code.claude.com/docs/en/ship-command-troubleshooting.md#a-watch-stopped) lists reasons that it gives.

165 206 

166The watch ends in cases such as these:207The watch ends in cases such as these:

167 208 

168| Where | What ends the watch |209| Where | What ends the watch |

169| :- | :- |210| :- | :- |

170| On the pull request | It's merged or closed, [PR Steward](https://code.claude.com/docs/en/pr-steward.md) labels it, or seven days pass |211| On a GitHub pull request | It's merged or closed, [PR Steward](https://code.claude.com/docs/en/pr-steward.md) labels it, or seven days pass |

212| On another host | Your branch is gone from its remote or adds nothing to its base any more, or seven days pass. Where Claude Code reads your merge request or pull request, the watch also ends when it's merged or closed. Otherwise, if you close it without merging it, [the watch can go on](#checks-and-comments-on-gitlab-bitbucket-and-azure-devops) |

171| At the keyboard | You press `Esc` or `Ctrl+C` at the prompt or while Claude is working. One press can end the watch, with no confirmation |213| At the keyboard | You press `Esc` or `Ctrl+C` at the prompt or while Claude is working. One press can end the watch, with no confirmation |

172| In your checkout | You check out another branch, or change git's settings |214| In your checkout | You check out another branch, or change git's settings |

173| In the session | The session ends, you send it to the background, you start another watch or a `/loop` with a task, or you run `/clear`, `/resume`, or `/branch` |215| In the session | The session ends, you start another watch or a `/loop` with a task, you run `/clear`, `/resume`, or `/branch`, or the session is in plan mode when Claude next checks the pull request. Before v2.1.331, a watch goes on in plan mode, and ends when you send the session to the background |

174| After a failure | An error, a declined prompt, or a usage limit can end it early |216| After a failure | An error, a declined prompt, or a usage limit can end it early |

175 217 

176### Stop or restart a watch218### Stop or restart a watch

177 219 

178To end a watch, type `/ship stop` at the Claude Code prompt in the session that runs it. If Claude is working when you type it, the watch ends when the current turn does, so what Claude pushes or posts in that turn still reaches the pull request. To stop the turn as well, press `Esc`.220To end a watch, type `/ship stop` at the Claude Code prompt in the session that runs it. If Claude is working when you type it, the watch ends when the current turn does, so what Claude pushes or posts in that turn still reaches the pull request. To stop the turn as well, press `Esc`.

179 221 

180To start a watch again, type [`/steward`](#start-a-watch-with-%2Fsteward).222To start a watch again, type [`/steward`](#start-a-watch-with-%2Fsteward). On a host other than GitHub, add any base that you named, as in `/steward origin/main`.

181 223 

182## Decide where to run a watch224## Decide where to run a watch

183 225 


211 253 

212| Case | What happens |254| Case | What happens |

213| :- | :- |255| :- | :- |

214| Auto-merge is on for the pull request | GitHub merges once the checks and reviews allow. What Claude does during the watch, such as pushing a fix, can bring that about. To turn it off, run `gh pr merge --disable-auto <number>` in your shell |256| Auto-merge is on for the pull request | The host merges once the checks and reviews allow. What Claude does during the watch, such as pushing a fix, can bring that about. To turn it off on GitHub, run `gh pr merge --disable-auto <number>` in your shell |

215| In a terminal session, you type a message while Claude is idle | [Claude Code's limits](#what-claude-code-blocks-during-a-watch) are off while Claude answers your message. They're also off while Claude handles a background task's result that arrives during that time. In auto mode, Claude may then be allowed to merge |257| In a terminal session, you type a message while Claude is idle | [Claude Code's limits](#what-claude-code-blocks-during-a-watch) are off while Claude answers your message. They're also off while Claude handles a background task's result that arrives during that time. In auto mode, Claude may then be allowed to merge |

216| You send a session that you started in your terminal to the background during the review or the watch, for example by pressing `←` | The watch ends. Work under way can go on there without these limits. To end that work, [stop that session](https://code.claude.com/docs/en/agent-view.md#manage-sessions-from-the-shell) |258| Before v2.1.331, you send a session that you started in your terminal to the background during the review or the watch, for example by pressing `←` | The watch ends. Work under way can go on there without these limits. To end that work, [stop that session](https://code.claude.com/docs/en/agent-view.md#manage-sessions-from-the-shell) |

217 259 

218### Permission rules and hooks that apply to /ship and /steward260### Permission rules and hooks that apply to /ship and /steward

219 261 


244}286}

245```287```

246 288 

289You can also set [`CLAUDE_CODE_DISABLE_SHIP`](https://code.claude.com/docs/en/env-vars#variables) to `1`, for example under `env` in managed settings. Requires Claude Code v2.1.331 or later.

290 

247To stop `/ship`'s own pushes, put a [deny rule](https://code.claude.com/docs/en/permissions.md#manage-permissions) such as `Bash(git push *)` in managed settings. With that rule, no watch starts.291To stop `/ship`'s own pushes, put a [deny rule](https://code.claude.com/docs/en/permissions.md#manage-permissions) such as `Bash(git push *)` in managed settings. With that rule, no watch starts.

248 292 

249## Arguments for /ship and /steward293## Arguments for /ship and /steward


253| You type | Commands | What it does |297| You type | Commands | What it does |

254| :- | :- | :- |298| :- | :- | :- |

255| `low`, `medium`, `high`, `xhigh`, or `max` | `/ship` | Asks for a review at that effort level. The default is `high` |299| `low`, `medium`, `high`, `xhigh`, or `max` | `/ship` | Asks for a review at that effort level. The default is `high` |

256| `41`, or a pull request's URL | `/ship`, `/steward` | Works on that pull request. For a watch, it has to be your own, with its branch checked out |300| `41`, or a pull request's URL | `/ship`, `/steward` | On GitHub, works on that pull request. For a watch, it has to be your own, with its branch checked out |

257| `+botname` | `/ship`, `/steward` | Also reads that bot's comments. Repeat it when you start a watch again |301| `+botname` | `/ship`, `/steward` | On GitHub, also reads that bot's comments. Repeat it when you start a watch again |

302| `origin/main`, or another remote and branch | `/ship`, `/steward` | On [a host other than GitHub](#watch-a-branch-on-another-host), names the branch that your change goes into. Requires Claude Code v2.1.331 or later |

258| `stop` | `/ship`, `/steward` | Ends the watch |303| `stop` | `/ship`, `/steward` | Ends the watch |

259| `terms` | `/ship`, `/steward` | Shows what Claude may do during a watch and what limits it |304| `terms` | `/ship`, `/steward` | Shows what Claude may do during a watch and what limits it. On [another host](#watch-a-branch-on-another-host), type it while the watch runs |

260 305 

261## Related resources306## Related resources

262 307 

Details

341. Run `claude update` in your shell, then quit and start `claude` again.341. Run `claude update` in your shell, then quit and start `claude` again.

352. If `/ship` is still missing, quit and start `claude` once more, because a new feature [can take a second start](https://code.claude.com/docs/en/env-vars.md#first-session-after-an-install-or-upgrade) to show.352. If `/ship` is still missing, quit and start `claude` once more, because a new feature [can take a second start](https://code.claude.com/docs/en/env-vars.md#first-session-after-an-install-or-upgrade) to show.

363. Run `/status` at the Claude Code prompt. Its `Setting sources` line lists the settings that loaded. In each one that's your own [settings file](https://code.claude.com/docs/en/settings.md#find-or-create-your-settings-files), remove [`disableBundledSkills`](https://code.claude.com/docs/en/settings-reference#disablebundledskills) and any `ship-local` entry under [`skillOverrides`](https://code.claude.com/docs/en/skills#override-skill-visibility-from-settings). To change managed settings, ask your administrator.363. Run `/status` at the Claude Code prompt. Its `Setting sources` line lists the settings that loaded. In each one that's your own [settings file](https://code.claude.com/docs/en/settings.md#find-or-create-your-settings-files), remove [`disableBundledSkills`](https://code.claude.com/docs/en/settings-reference#disablebundledskills) and any `ship-local` entry under [`skillOverrides`](https://code.claude.com/docs/en/skills#override-skill-visibility-from-settings). To change managed settings, ask your administrator.

374. Check whether your session [skips feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), for example because `DISABLE_TELEMETRY` is set or you use a third-party provider. `/ship` isn't available in those sessions.374. Check whether your session [skips feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching). On a third-party provider or in a Claude apps gateway session, `/ship` requires Claude Code v2.1.331 or later. In any other session, unset any variable that turns fetching off, such as `DISABLE_TELEMETRY`.

385. Check whether [`CLAUDE_CODE_DISABLE_SHIP`](https://code.claude.com/docs/en/env-vars#variables) is set, in your shell or under `env` in a settings file. Unset it, then quit and start `claude` again. The variable requires Claude Code v2.1.331 or later.

38 39 

39### A skillOverrides entry turns off /ship or /steward40### A skillOverrides entry turns off /ship or /steward

40 41 


49| `This session was started by another session` | Run it in a session that you started yourself |50| `This session was started by another session` | Run it in a session that you started yourself |

50| `Usage: /ship` or `Usage: /steward` | Check what you typed against [the arguments](https://code.claude.com/docs/en/ship-command.md#arguments-for-%2Fship-and-%2Fsteward) |51| `Usage: /ship` or `Usage: /steward` | Check what you typed against [the arguments](https://code.claude.com/docs/en/ship-command.md#arguments-for-%2Fship-and-%2Fsteward) |

51| `Nothing started. /ship starts only from a line that you type`, or the same for `/steward` | Type the command yourself at the Claude Code prompt. It doesn't start from `claude -p` or from a program |52| `Nothing started. /ship starts only from a line that you type`, or the same for `/steward` | Type the command yourself at the Claude Code prompt. It doesn't start from `claude -p` or from a program |

52| `/ship didn't start:` or `/steward didn't start:` | The rest of the message says what to check |53| `Nothing started. This line counts only if you type it yourself` | You accepted a [prompt suggestion](https://code.claude.com/docs/en/interactive-mode.md#prompt-suggestions). Type the command yourself at the Claude Code prompt |

53| `/ship is turned off right now`, or the same for `/steward` | Run `/login` at the Claude Code prompt, as the message says, then run the command again |54| `Nothing started. Claude Code's built-in /ship is turned off while`, or the same for `/steward` | Unset the variable that the message names, such as `CLAUDE_CODE_DISABLE_SHIP`, then start Claude Code again |

55| `Nothing started. Claude Code's built-in /ship doesn't start in this kind of session`, or the same for `/steward` | You typed it somewhere such as `claude -p`. Run `claude` in a terminal and type the command there |

56| `Nothing started. /ship is a command built into Claude Code`, or the same for `/steward` | Another command, such as a plugin's, has the same name. To run the built-in command, type the same line again. To run the other one, follow the message, which gives its name or says where to find it |

57| `/ship didn't start:` or `/steward didn't start:` | The rest of the message says what to check. In plan mode, for example, press `Shift+Tab` to leave plan mode, then run the command again |

58| `/ship is turned off right now`, or the same for `/steward` | If the message says to run `/login`, do that at the Claude Code prompt, then run the command again. Otherwise, one cause is that `CLAUDE_CODE_DISABLE_SHIP` was set after the session started, for example under `env` in a settings file. Unset it, quit and start `claude` again, then run the command |

54| `/ship can't start from a queued message` or `/steward can't start from a queued message` | Wait until Claude has finished, then run it again |59| `/ship can't start from a queued message` or `/steward can't start from a queued message` | Wait until Claude has finished, then run it again |

55 60 

56### The GitHub CLI isn't ready61### The GitHub CLI isn't ready


61| :- | :- |66| :- | :- |

62| `GitHub CLI (gh) isn't installed` or `GitHub CLI (gh) isn't signed in` | Install it, run `gh auth login` in your shell, then run the command again |67| `GitHub CLI (gh) isn't installed` or `GitHub CLI (gh) isn't signed in` | Install it, run `gh auth login` in your shell, then run the command again |

63| `gh couldn't tell me about a pull request here` | The words in parentheses say what failed. To see `gh`'s own error, run `gh pr view` in your shell. One cause is that none of your checkout's remotes is on a GitHub host that `gh` is signed in to. For GitHub Enterprise, run `gh auth login --hostname HOST` in your shell |68| `gh couldn't tell me about a pull request here` | The words in parentheses say what failed. To see `gh`'s own error, run `gh pr view` in your shell. One cause is that none of your checkout's remotes is on a GitHub host that `gh` is signed in to. For GitHub Enterprise, run `gh auth login --hostname HOST` in your shell |

69| `I can't watch the branch with git alone` | None of your checkout's remotes is on a GitHub host that `gh` is signed in to. For GitHub Enterprise, run `gh auth login --hostname HOST` in your shell, then run the command again. On another host, the words after the colon say what to fix, such as pushing the branch first. See [Watch a branch on another host](https://code.claude.com/docs/en/ship-command.md#watch-a-branch-on-another-host) |

64 70 

65## /ship committed or pushed nothing71## /ship committed or pushed nothing

66 72 

67In some cases, `/ship` leaves the commit or the push to you and says why. Its message can start with `Nothing committed or pushed`, `Nothing pushed`, `I didn't push anything`, `There is no pull request to watch`, or `This branch has no open pull request`.73In some cases, `/ship` leaves the commit or the push to you and says why. Its message can start with `Nothing committed or pushed`, `Nothing pushed`, `I didn't push anything`, `There is no pull request to watch`, or `This branch has no open pull request`. On a host other than GitHub, `/ship` doesn't commit or push when it starts, so see [Watch a branch on another host](https://code.claude.com/docs/en/ship-command.md#watch-a-branch-on-another-host).

68 74 

69Find your case, take the step in its row, then run `/ship` again. In these cases, if nothing is pushed and the branch has no pull request, Claude reviews your change and [no watch starts](#no-watch-started).75Find your case, take the step in its row, then run `/ship` again. In these cases, if nothing is pushed and the branch has no pull request, Claude reviews your change and [no watch starts](#no-watch-started).

70 76 


85 91 

86| Case | What to do |92| Case | What to do |

87| :- | :- |93| :- | :- |

88| `there is nothing here to open one for`: you have no uncommitted changes, and every commit on the branch is already on the default branch | Make a change, or check out the branch that holds your work |94| `there is nothing here to open one for`: you have no uncommitted changes, and every commit on the branch is already on the default branch, or merging them would change nothing there | Make a change, or check out the branch that holds your work |

89| The default branch holds your commits, and nothing is uncommitted | Move the commits to a new branch, for example with `git switch -c <branch>` in your shell |95| `you're on the default branch, which /ship never pushes` | Move your commits to a new branch, for example with `git switch -c <branch>` in your shell |

90| You're in detached HEAD state, or in the middle of a rebase | Check out a branch, or finish the rebase |96| You're in detached HEAD state, or in the middle of a rebase | Check out a branch, or finish the rebase |

91 97 

92### Deny rules that forbid a commit or push98### Deny rules that forbid a commit or push


95 101 

96A watch needs `git commit` and `git push` as well. If the rule forbids one of them, [have it removed](#a-tool-rule-or-hook-blocks-a-watch) before you run `/ship` again.102A watch needs `git commit` and `git push` as well. If the rule forbids one of them, [have it removed](#a-tool-rule-or-hook-blocks-a-watch) before you run `/ship` again.

97 103 

104### Your pull request is already open

105 

106Messages such as these mean that `/ship` left newer work off your open pull request:

107 

108| Message | What it means | What to do |

109| :- | :- | :- |

110| `/ship didn't commit your uncommitted work` | Where a watch can start, the review and the watch go on without that work, and your unpushed commits [can go up with Claude's next push](https://code.claude.com/docs/en/ship-command.md#keep-working-while-a-watch-runs). Cases such as these lead to it: a public repository, auto-merge turned on, a merge or rebase under way, or a session where [no watch can start](#no-watch-started) | If the message gives a `git push` line, commit the work yourself, then run that line. Otherwise, run `/ship` again when the message says to |

111| `Nothing pushed` or `Nothing committed or pushed`, with a sentence about your unpushed commits | `/ship` held those commits back. No review or watch starts, and a running watch on that pull request ends. One cause is a file in them with a name such as `password.txt` | If the commits should go up, run the `git push` line in the message. If not, take the file out of every unpushed commit. Then run `/ship` again |

112 

113Before v2.1.331, `/ship` prints neither message. It doesn't commit your uncommitted work once a pull request is open, so commit it, then push it, as in `git push origin <branch>` in your shell. It doesn't hold back your unpushed commits, which [can go up with Claude's next push](https://code.claude.com/docs/en/ship-command.md#keep-working-while-a-watch-runs).

114 

98### GitHub Enterprise and forks115### GitHub Enterprise and forks

99 116 

100`/ship` doesn't open a pull request on GitHub Enterprise or from a fork. Push the branch and open the pull request yourself, then run `/ship`. From a fork, the checkout also needs a remote for the repository that the pull request goes to, or no watch starts.117`/ship` doesn't open a pull request on GitHub Enterprise or from a fork. Push the branch and open the pull request yourself, then run `/ship`. From a fork, the checkout also needs a remote for the repository that the pull request goes to, or no watch starts.


103 120 

104A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. In some cases, no watch starts and Claude says why. Its message can contain `/steward didn't start.`, `I can't watch`, or `is running on pull request`.121A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. In some cases, no watch starts and Claude says why. Its message can contain `/steward didn't start.`, `I can't watch`, or `is running on pull request`.

105 122 

106Fix the cause, then type `/steward` to start the watch with no second review, or `/ship` if the branch still has no pull request.123Fix the cause, then type `/steward` to start the watch with no second review. On a host other than GitHub, add any base that you named, as in `/steward origin/main`. If a branch on GitHub still has no pull request, type `/ship`.

107 124 

108### Your pull request or branch isn't ready for a watch125### Your pull request or branch isn't ready for a watch

109 126 


111 128 

112| Cause | What to do |129| Cause | What to do |

113| :- | :- |130| :- | :- |

114| The branch has no pull request, and `/steward` doesn't open one | See [/ship committed or pushed nothing](#%2Fship-committed-or-pushed-nothing) |131| On GitHub, the branch has no pull request, and `/steward` doesn't open one | See [/ship committed or pushed nothing](#%2Fship-committed-or-pushed-nothing) |

115| The pull request's branch isn't checked out in this session | Check it out |132| The pull request's branch isn't checked out in this session | Check it out |

116| The pull request carries one of [PR Steward](https://code.claude.com/docs/en/pr-steward.md)'s labels, such as `claude-pr-steward-watching` | To take over, remove the label and pull the branch, as Claude's message says |133| The pull request carries one of [PR Steward](https://code.claude.com/docs/en/pr-steward.md)'s labels, such as `claude-pr-steward-watching` | To take over, remove the label and pull the branch, as Claude's message says |

117 134 


123| :- | :- |140| :- | :- |

124| The session is in `bypassPermissions` mode | Press `Shift+Tab` to switch to a permission mode other than plan mode |141| The session is in `bypassPermissions` mode | Press `Shift+Tab` to switch to a permission mode other than plan mode |

125| [Remote Control](https://code.claude.com/docs/en/remote-control.md) is on | Run `/rc`, then select **Disconnect this session** |142| [Remote Control](https://code.claude.com/docs/en/remote-control.md) is on | Run `/rc`, then select **Disconnect this session** |

126| `your PATH has a relative or empty entry` | `/ship` with no pull request number reviews your change, and doesn't commit, push, or look for a pull request. Take the empty or relative entry out of `PATH`, such as a trailing `:`, or `;` on Windows. Start `claude` again, then run `/ship` |143| `this session runs in the background` | Open a new terminal in the checkout that holds the branch, run `claude`, and type `/steward` there |

144| A message about an entry `on your PATH`, such as `entry 2 of 9 on your PATH is empty (a stray colon)` | Take the entry out of `PATH`, or write it as a full path, in your shell's profile and in any `env` block of your Claude Code settings that sets `PATH`. Quit Claude Code, start it again from a new terminal, then type `/steward` |

145| `your PATH has a relative or empty entry` | Before v2.1.331, `/ship` with no pull request number reviews your change, and doesn't commit, push, or look for a pull request. Take the empty or relative entry out of `PATH`, such as a trailing `:`, or `;` on Windows. Start `claude` again, then run `/ship` |

127| Your `PATH` holds a folder inside the checkout. This happens, for example, when you activate a Python virtual environment that's in the checkout, or start `claude` through `npx` or a package script | To start a session without that folder, run `deactivate` in your shell if you use a virtual environment, then start `claude` directly |146| Your `PATH` holds a folder inside the checkout. This happens, for example, when you activate a Python virtual environment that's in the checkout, or start `claude` through `npx` or a package script | To start a session without that folder, run `deactivate` in your shell if you use a virtual environment, then start `claude` directly |

128 147 

129### A tool, rule, or hook blocks a watch148### A tool, rule, or hook blocks a watch

130 149 

131A watch needs `gh`, `git commit`, and `git push`, and it doesn't start where a project's hook could approve commands:150A watch on a GitHub pull request needs `gh`, `git commit`, and `git push`, and it doesn't start where a project's hook could approve commands:

132 151 

133| Cause | What to do |152| Cause | What to do |

134| :- | :- |153| :- | :- |

135| `gh` isn't installed or signed in | See [The GitHub CLI isn't ready](#the-github-cli-isn’t-ready) |154| `gh` isn't installed or signed in | See [The GitHub CLI isn't ready](#the-github-cli-isn’t-ready) |

155| `this gh is too old for a watch` | Update the GitHub CLI to 2.63 or later, then type `/steward` |

136| A deny rule forbids a command that the watch needs, such as `git push` | Claude's message names the command and the settings that hold the rule. If whoever set it agrees, remove it there. To change a rule in managed settings, ask your administrator |156| A deny rule forbids a command that the watch needs, such as `git push` | Claude's message names the command and the settings that hold the rule. If whoever set it agrees, remove it there. To change a rule in managed settings, ask your administrator |

137| The project sets a hook that could approve commands, for example a `PreToolUse` or `PermissionRequest` [hook](https://code.claude.com/docs/en/hooks.md) on shell commands in the checkout's `.claude/settings.json` | The message names the file and says what to change |157| The project sets a hook that could approve commands, for example a `PreToolUse` or `PermissionRequest` [hook](https://code.claude.com/docs/en/hooks.md) on shell commands in the checkout's `.claude/settings.json` | The message names the file and says what to change |

138 158 


141In these cases, `/ship` can still review your change:161In these cases, `/ship` can still review your change:

142 162 

143* You're on native Windows163* You're on native Windows

144* Someone else opened the pull request164* On GitHub, someone else opened the pull request

145* You can't push to the repository that the pull request goes to, and another person has commented or reviewed. If this happens while a watch is running, the watch ends165* On GitHub, you can't push to the repository that the pull request goes to, and another person has commented or reviewed. If this happens while a watch is running, the watch ends

146 166 

147## A watch stopped167## A watch stopped

148 168 

149A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. After one ends, look for a line that starts `Stopped watching pull request`, which gives the reason.169A watch is Claude's ongoing work on your pull request, which starts after `/ship`'s review or when you type `/steward`. After one ends, look for a line that starts `Stopped watching`, which gives the reason.

150 170 

151To start the watch again, type the command that the line gives, if it gives one. To check whether a watch is still running, type [`/tasks`](https://code.claude.com/docs/en/ship-command#check-whether-a-watch-is-running) at the Claude Code prompt while Claude is idle.171To start the watch again, type the command that the line gives, if it gives one. To check whether a watch is still running, type [`/tasks`](https://code.claude.com/docs/en/ship-command#check-whether-a-watch-is-running) at the Claude Code prompt while Claude is idle.

152 172 


154 174 

155| Reason | What happened |175| Reason | What happened |

156| :- | :- |176| :- | :- |

157| `its check-in was cancelled` | You pressed `Esc` or `Ctrl+C` at the prompt or while Claude was working, or stopped the task in `/tasks`. Claude's messages call its work on the pull request a check-in. An `Esc` that closes the `/tasks` list leaves a watch running |177| `the watch was cancelled`, or `its check-in was cancelled` | You pressed `Esc` or `Ctrl+C` at the prompt or while Claude was working, or stopped the task in `/tasks`. Claude's messages call its work on the pull request a check-in. An `Esc` that closes the `/tasks` list leaves a watch running |

158| `the watch couldn't go on` | Claude's reply may give the cause. One cause is that the pull request's branch is no longer checked out. Check it out in the folder where you started, then type `/steward` |178| `the watch couldn't go on` | Claude's reply may give the cause. One cause is that the pull request's branch is no longer checked out. Check it out in the folder where you started, then start the watch again |

159| `a watch doesn't carry over when a session is resumed` | The process that ran the watch has ended, for example because you closed the terminal. Running `claude --continue` in your shell brings back the conversation without the watch |179| `a watch doesn't carry over when a session is resumed` | The process that ran the watch has ended, for example because you closed the terminal. Running `claude --continue` in your shell brings back the conversation without the watch |

160| `you moved to another session` | `/clear`, `/resume`, or `/branch` can do that |180| `you moved to another session` | `/clear`, `/resume`, or `/branch` can do that |

161| `its check-ins were replaced` | You started a `/loop` |181| `another loop took its place`, or `its check-ins were replaced` | You started a `/loop` |

162| `your new command took over this session` | You ran `/ship` or `/steward` again |182| `your new command took over this session` | You ran `/ship` or `/steward` again |

163| `a deny rule now forbids a command that the watch runs` | Type `/permissions` at the Claude Code prompt to see the rule. See [A tool, rule, or hook blocks a watch](#a-tool-rule-or-hook-blocks-a-watch) |183| `a deny rule now blocks a command that the watch runs`, or `a deny rule now forbids a command that the watch runs` | Type `/permissions` at the Claude Code prompt to see the rule. See [A tool, rule, or hook blocks a watch](#a-tool-rule-or-hook-blocks-a-watch) |

164| `the watch reached its time limit` | About seven days passed |184| `the watch reached its time limit` | About seven days passed |

165| `no next check-in was set` | A declined permission prompt, an error, or a usage limit can do that |185| `the watch stalled`, or `no next check-in was set` | A declined permission prompt, an error, or a usage limit can do that |

186| `this session is in plan mode` | Press `Shift+Tab` to leave plan mode, then type the command that the line gives |

187| `this session runs in the background` | Open a new terminal in the checkout that holds the branch, run `claude`, and type the command that the line gives |

188| `you asked` | You typed `/ship stop` or `/steward stop` |

166| `a file that gh, git, or /steward relies on changed` | See [A file that the watch relies on changed](#a-file-that-the-watch-relies-on-changed) |189| `a file that gh, git, or /steward relies on changed` | See [A file that the watch relies on changed](#a-file-that-the-watch-relies-on-changed) |

190| `a file that git or /steward relies on changed` | The same message, for a [watch on another host](https://code.claude.com/docs/en/ship-command.md#watch-a-branch-on-another-host). See [A file that the watch relies on changed](#a-file-that-the-watch-relies-on-changed) |

167 191 

168`No pull request is being watched in this session` means that you typed `/ship stop` or `/steward stop` and no watch was running. Scroll up for a `Stopped watching pull request` line.192Where a row gives two wordings, the second is the one from before v2.1.331.

193 

194`Nothing to stop. This session isn't watching a pull request`, or `No pull request is being watched in this session`, means that you typed `/ship stop` or `/steward stop` and no watch was running. Scroll up for a `Stopped watching` line.

169 195 

170### A file that the watch relies on changed196### A file that the watch relies on changed

171 197 


174* **Git's settings**: `git push -u`, `git branch -u`, and `git remote add` change them. An editor such as VS Code can also add a setting to `.git/config` when it opens the repository or you switch back to it200* **Git's settings**: `git push -u`, `git branch -u`, and `git remote add` change them. An editor such as VS Code can also add a setting to `.git/config` when it opens the repository or you switch back to it

175* **`.claude/settings.local.json`**: Claude Code writes it when you answer a permission prompt with "Yes, and don't ask again"201* **`.claude/settings.local.json`**: Claude Code writes it when you answer a permission prompt with "Yes, and don't ask again"

176 202 

177Review the change, then type `/steward` to start the watch again.203Review the change, then type the command that the `Stopped watching` line gives to start the watch again.

178 204 

179If you changed none, one cause on Linux and WSL2 is a [sandboxed](https://code.claude.com/docs/en/sandboxing.md) command that starts or ends during the watch. Stop the command or wait for it to end.205If you changed none, one cause on Linux and WSL2 is a [sandboxed](https://code.claude.com/docs/en/sandboxing.md) command that starts or ends during the watch. Stop the command or wait for it to end.

180 206 


185| Message, or what you see | What to do |211| Message, or what you see | What to do |

186| :- | :- |212| :- | :- |

187| `Claude Code did not run this`, or `Not run · permission denied` | Claude tried a step, and a [limit on the watch](https://code.claude.com/docs/en/ship-command.md#what-claude-code-blocks-during-a-watch) or one of your rules or hooks refused it. The message also appears when the watch had already ended. Claude's messages call those limits "the fence" |213| `Claude Code did not run this`, or `Not run · permission denied` | Claude tried a step, and a [limit on the watch](https://code.claude.com/docs/en/ship-command.md#what-claude-code-blocks-during-a-watch) or one of your rules or hooks refused it. The message also appears when the watch had already ended. Claude's messages call those limits "the fence" |

188| `In this session there's a way around my limits` | A setting in your session, such as a rule, a hook, a plugin, or the sandbox, lets some commands past the [limits on the watch](https://code.claude.com/docs/en/ship-command.md#what-claude-code-blocks-during-a-watch). The text after the message names it. To see your rules, type `/permissions` at the Claude Code prompt. To end the watch while you decide, type `/steward stop` |214| `In this session there's a way around`, followed by `the watch's limits`, `these limits`, or `my limits` | A setting in your session, such as a rule, a hook, a plugin, or the sandbox, lets some commands past the [limits on the watch](https://code.claude.com/docs/en/ship-command.md#what-claude-code-blocks-during-a-watch). The text after the message names it. To see your rules, type `/permissions` at the Claude Code prompt. To end the watch while you decide, type `/steward stop` |

189| A line such as `1 comment not read (no write access, or a bot that you haven't named)` | Claude [skipped a comment](https://code.claude.com/docs/en/ship-command.md#what-claude-does-during-a-watch). Open the link in the message to read it. For a bot that you want Claude to read, type `/steward +botname`. For a person's comment that you agree with, tell Claude what to change |215| A line such as `1 comment not read (no write access, or a bot that you haven't named)` | Claude [skipped a comment](https://code.claude.com/docs/en/ship-command.md#what-claude-does-during-a-watch). Open the link in the message to read it. For a bot on GitHub that you want Claude to read, type `/steward +botname`. For a person's comment that you agree with, tell Claude what to change |

190| `gh couldn't say where the pull request's head and base stand` | One cause is a GitHub CLI older than 2.63. Run `gh --version` in your shell to check. Update it, then type `/steward` to start the watch again |216| `gh couldn't say where the pull request's head and base stand` | Claude Code refused one of Claude's pushes. To see `gh`'s own error, run `gh pr view` in your shell. Before v2.1.331, one cause is a GitHub CLI older than 2.63. Run `gh --version` in your shell to check. Update it, then type `/steward` to start the watch again |

217| `A watch is on`, `The watch's limits still hold`, or `/ship is still starting` or the same for `/steward`, after you press `←` or type `/background` | Claude Code doesn't move a session to the background while a watch is on. To move it, first take the step that the message names, such as typing `/steward stop`, which ends the watch. Before v2.1.331, the session moves, and [the watch ends](https://code.claude.com/docs/en/ship-command.md#when-a-watch-can-lead-to-a-merge) |

191| `Claude resuming /loop wakeup` or `/steward --tend` in the session | Claude Code enters them when Claude checks the pull request during a watch. You can keep working as you are |218| `Claude resuming /loop wakeup` or `/steward --tend` in the session | Claude Code enters them when Claude checks the pull request during a watch. You can keep working as you are |

192 219 

193## Pull request results that you didn't expect220## Pull request results that you didn't expect


196 223 

197| What you see | Why, and what to do |224| What you see | Why, and what to do |

198| :- | :- |225| :- | :- |

199| The pull request's title is a line such as `Update greet.py and 1 more` | `/ship` falls back to that title when Claude can't write one from the session's conversation, for example in a session where you didn't discuss the change. Edit the title and description on GitHub. Next time, run `/ship` in the session where you made the change, or commit your work yourself first, on a branch other than the default branch |226| The pull request's title, or the commit message, is a line such as `Update greet.py and 1 more` | `/ship` falls back to that line when Claude can't write one from the session's conversation, for example in a session where you didn't discuss the change. Edit the title and description on GitHub. Next time, run `/ship` in the session where you made the change, or commit your work yourself first, on a branch other than the default branch |

200| Claude pushed commits or answered a reviewer before you saw them | In auto mode, or where your rules or the sandbox allow a command, a watch works that way. See [Ask Claude to check with you first](https://code.claude.com/docs/en/ship-command.md#ask-claude-to-check-with-you-first) |227| Claude pushed commits or answered a reviewer before you saw them | In auto mode, or where your rules or the sandbox allow a command, a watch works that way. See [Ask Claude to check with you first](https://code.claude.com/docs/en/ship-command.md#ask-claude-to-check-with-you-first) |

201| New uncommitted changes didn't reach the open pull request | Once a pull request is open, `/ship` doesn't commit your work. Commit it, then push it, as in `git push origin <branch>` in your shell |228| New uncommitted changes didn't reach the open pull request | See [Your pull request is already open](#your-pull-request-is-already-open) |

202| `git pull` or `git push` asks for an upstream branch | `/ship` sets no upstream. Name the remote and branch, as in `git push origin <branch>`. Setting an upstream changes git's settings, which [ends a running watch](https://code.claude.com/docs/en/ship-command.md#keep-working-while-a-watch-runs) |229| `git pull` or `git push` asks for an upstream branch | `/ship` sets no upstream. Name the remote and branch, as in `git push origin <branch>`. Setting an upstream changes git's settings, which [ends a running watch](https://code.claude.com/docs/en/ship-command.md#keep-working-while-a-watch-runs) |

203 230 

204## A custom /ship or /steward command stopped loading231## A custom /ship or /steward command stopped loading

205 232 

206A `Not loaded: a custom /ship` or `Not loaded: custom /ship, /steward` notice is about a custom skill or command. Its name is one that the built-in commands reserve, such as `ship`, `ship-local`, or `steward`. Rename it, then restart Claude Code.233These messages are about a custom skill or command. Its name is one that the built-in commands reserve, such as `ship`, `ship-local`, or `steward`:

234 

235| Message | What to do |

236| :- | :- |

237| `Not loaded: a custom /ship` or `Not loaded: custom /ship, /steward` | Rename it, then restart Claude Code |

238| `Nothing started. A custom /ship isn't loaded`, or the same for `/steward` | To run the built-in command, type the same line again. To run the custom one, rename it, then restart Claude Code |

207 239 

208Leave a repository's `.claude/skills/steward/SKILL.md` as it is, because PR Steward and the watch read it as instructions. The notice doesn't count that file, so a notice that names `/steward` is about another skill or command.240Leave a repository's `.claude/skills/steward/SKILL.md` as it is, because PR Steward and the watch read it as instructions. Neither message counts that file, so one that names `/steward` is about another skill or command.

209 241 

210## Related resources242## Related resources

211 243 

skills.md +26 −4

Details

320* In a Cowork session on your desktop, the body keeps the behavior a local skill has, except that Claude Code replaces every `!` command line with the [`disableSkillShellExecution` placeholder](#inject-dynamic-context), as it does for every skill you supply there.320* In a Cowork session on your desktop, the body keeps the behavior a local skill has, except that Claude Code replaces every `!` command line with the [`disableSkillShellExecution` placeholder](#inject-dynamic-context), as it does for every skill you supply there.

321* In a terminal or VS Code session, Claude Code doesn't run [`!` commands](#inject-dynamic-context), doesn't attach the files that `@` references name, and doesn't substitute the `${CLAUDE_PROJECT_DIR}` and `${CLAUDE_SESSION_ID}` placeholders. The `@` references and both placeholders reach Claude as literal text. A `!` command line reaches Claude as literal text too, or as the `disableSkillShellExecution` placeholder when that setting is on. This handling requires Claude Code v2.1.228 or later.321* In a terminal or VS Code session, Claude Code doesn't run [`!` commands](#inject-dynamic-context), doesn't attach the files that `@` references name, and doesn't substitute the `${CLAUDE_PROJECT_DIR}` and `${CLAUDE_SESSION_ID}` placeholders. The `@` references and both placeholders reach Claude as literal text. A `!` command line reaches Claude as literal text too, or as the `disableSkillShellExecution` placeholder when that setting is on. This handling requires Claude Code v2.1.228 or later.

322 322 

323### Skills from MCP servers

324 

325[MCP servers can provide skills](https://code.claude.com/docs/en/mcp.md#use-skills-from-mcp-servers). Using them requires Claude Code v2.1.331 or later. Claude reads a skill's supporting files from the server as [MCP resources](https://code.claude.com/docs/en/mcp.md#use-mcp-resources). For prompts and rules, see [Approvals for MCP skills](https://code.claude.com/docs/en/mcp.md#approvals-for-mcp-skills).

326 

327#### Skill features that don't apply

328 

329Because the server supplies the content, you can't use these features of [local skills](#where-skills-live) in an MCP skill:

330 

331* **Frontmatter fields**: Claude Code ignores `allowed-tools`, `disallowed-tools`, `hooks`, `model`, `effort`, `context`, `agent`, `background`, `shell`, `paths`, and `metadata`

332* **[`!` commands](#inject-dynamic-context)**: they don't run

333* **`@` references**: the files aren't attached

334* **`${CLAUDE_PROJECT_DIR}` and `${CLAUDE_SESSION_ID}`**: they aren't substituted

335 

323### Edit a skill during a session336### Edit a skill during a session

324 337 

325Claude Code watches skill directories for file changes, except in [bare mode](https://code.claude.com/docs/en/headless.md#start-faster-with-bare-mode). When you add, edit, or remove a skill under `~/.claude/skills/`, the project `.claude/skills/`, or a `.claude/skills/` inside an `--add-dir` directory, Claude Code picks up the change within the current session.338Claude Code watches skill directories for file changes, except in [bare mode](https://code.claude.com/docs/en/headless.md#start-faster-with-bare-mode). When you add, edit, or remove a skill under `~/.claude/skills/`, the project `.claude/skills/`, or a `.claude/skills/` inside an `--add-dir` directory, Claude Code picks up the change within the current session.


6755. Create a commit6885. Create a commit

676```689```

677 690 

678When you run `/fix-issue 123`, Claude receives "Fix GitHub issue 123 following our coding standards..."691When you run `/fix-issue 123`, Claude receives `Fix GitHub issue 123 following our coding standards...`

679 692 

680If you invoke a skill with arguments but no placeholder in the skill's content receives one, Claude Code appends `ARGUMENTS: <your input>` to the end of the skill content so Claude still sees what you typed. A placeholder is `$ARGUMENTS`, an indexed form such as `$1`, or a named argument. An indexed placeholder with no argument at its position stays as literal text and doesn't count as receiving one. A named placeholder counts even when its position has no argument, because it expands to an empty string.693If you invoke a skill with arguments but no placeholder in the skill's content receives one, Claude Code appends `ARGUMENTS: <your input>` to the end of the skill content so Claude still sees what you typed. A placeholder is `$ARGUMENTS`, an indexed form such as `$1`, or a named argument.

694 

695With no argument at its position, a placeholder counts as receiving one only if it's named:

696 

697* **Indexed placeholder, such as `$1`**: stays as literal text

698* **Named placeholder, such as `$issue`**: expands to an empty string

681 699 

682To access individual arguments by position, use `$ARGUMENTS[N]` or the shorter `$N`:700To access individual arguments by position, use `$ARGUMENTS[N]` or the shorter `$N`:

683 701 


871 889 

872### Restrict Claude's skill access890### Restrict Claude's skill access

873 891 

874By default, Claude can invoke any skill that doesn't have `disable-model-invocation: true` set. Skills that define [`allowed-tools`](#pre-approve-tools-for-a-skill) grant Claude access to those tools without per-use approval during the turn that invokes the skill; the grant clears when you send your next message. Your [permission settings](https://code.claude.com/docs/en/permissions.md) still govern baseline approval behavior for all other tools. A few built-in commands are also available through the Skill tool, including `/init` and `/security-review`. Other built-in commands such as `/compact` are not.892By default, Claude can invoke any skill that doesn't have `disable-model-invocation: true` set. Skills that define [`allowed-tools`](#pre-approve-tools-for-a-skill) grant Claude access to those tools without per-use approval during the turn that invokes the skill; the grant clears when you send your next message. Your [permission settings](https://code.claude.com/docs/en/permissions.md) still govern baseline approval behavior for all other tools. With a [skill from an MCP server](#skills-from-mcp-servers), Claude gets no `allowed-tools` grant.

875 893 

876Three ways to control which skills Claude can invoke:894A few built-in commands are also available through the Skill tool, including `/init` and `/security-review`. Other built-in commands such as `/compact` aren't.

895 

896You can control which skills Claude invokes in these ways:

877 897 

878**Disable all skills** by denying the Skill tool in `/permissions`:898**Disable all skills** by denying the Skill tool in `/permissions`:

879 899 


913* `Skill(anthropic-skills *)` approves every synced skill933* `Skill(anthropic-skills *)` approves every synced skill

914* `Skill(anthropic *)` doesn't cover `anthropic-skills:pdf`, because a prefix outside the namespace doesn't match the names inside it934* `Skill(anthropic *)` doesn't cover `anthropic-skills:pdf`, because a prefix outside the namespace doesn't match the names inside it

915 935 

936For a [skill from an MCP server](#skills-from-mcp-servers), [set a rule for its server](https://code.claude.com/docs/en/mcp.md#block-a-servers-skills-or-ask-first) instead. You can't skip its prompt with an `allow` rule for the skill's name.

937 

916**Hide individual skills** by adding `disable-model-invocation: true` to their frontmatter. This removes the skill from Claude's context entirely.938**Hide individual skills** by adding `disable-model-invocation: true` to their frontmatter. This removes the skill from Claude's context entirely.

917 939 

918> [!NOTE]940> [!NOTE]

sub-agents.md +3 −1

Details

1182 1182 

1183`SendMessage` checks that a name still refers to the same agent it reached earlier in the conversation. If a newer agent has taken the name, such as a re-spawned background agent that reused it, Claude Code refuses the send rather than delivering it to the wrong agent, and the error reports which agent the name now reaches so Claude can retarget. To reach the earlier agent while it's still running, Claude addresses it by the agent ID it received when it spawned that agent. The check is scoped to the current conversation and resets on `/clear`.1183`SendMessage` checks that a name still refers to the same agent it reached earlier in the conversation. If a newer agent has taken the name, such as a re-spawned background agent that reused it, Claude Code refuses the send rather than delivering it to the wrong agent, and the error reports which agent the name now reaches so Claude can retarget. To reach the earlier agent while it's still running, Claude addresses it by the agent ID it received when it spawned that agent. The check is scoped to the current conversation and resets on `/clear`.

1184 1184 

1185A subagent treats messages from the agent that launched it as normal task direction, including mid-task course corrections, and acts on them within its own permission settings. Two limits hold regardless of who sent the message: no message from any agent counts as your approval for a pending permission prompt, and no agent message can change a subagent's permission settings, `CLAUDE.md`, or configuration. Only the permission system or your own messages can grant approval.1185> [!NOTE]

1186>

1187> A subagent treats messages from the agent that launched it as normal task direction, including mid-task course corrections, and acts on them within its own permission settings. A message from an agent doesn't count as your approval for a pending permission prompt.

1186 1188 

1187You can also ask Claude for the agent ID if you want to reference it explicitly, or find IDs in the transcript files at `~/.claude/projects/{project}/{sessionId}/subagents/`. Each transcript is stored as `agent-{agentId}.jsonl`.1189You can also ask Claude for the agent ID if you want to reference it explicitly, or find IDs in the transcript files at `~/.claude/projects/{project}/{sessionId}/subagents/`. Each transcript is stored as `agent-{agentId}.jsonl`.

1188 1190 

Details

56| `SendMessage` | Sends a message to another agent: an [agent team](https://code.claude.com/docs/en/agent-teams.md) teammate, a [subagent it resumes](https://code.claude.com/docs/en/sub-agents.md#resume-subagents) by agent ID or name, or one of your other Claude Code sessions, on this machine or beyond it. Messaging other sessions requires Claude Code v2.1.224 or later. [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md) covers which sessions Claude can reach, [what a message looks like when it arrives](https://code.claude.com/docs/en/cross-session-messaging.md#what-a-message-looks-like), and [how Claude gets a notice when another session goes idle](https://code.claude.com/docs/en/cross-session-messaging.md#get-a-notice-when-another-session-goes-idle). Claude can include an optional `summary` input, typically 5-10 words, that Claude Code shows as a one-line preview. When Claude omits it on a [plain-text message](https://code.claude.com/docs/en/cross-session-messaging.md#limitations), Claude Code uses the first line of the message as the summary. Claude Code truncates a summary longer than 200 characters with an ellipsis | No |56| `SendMessage` | Sends a message to another agent: an [agent team](https://code.claude.com/docs/en/agent-teams.md) teammate, a [subagent it resumes](https://code.claude.com/docs/en/sub-agents.md#resume-subagents) by agent ID or name, or one of your other Claude Code sessions, on this machine or beyond it. Messaging other sessions requires Claude Code v2.1.224 or later. [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md) covers which sessions Claude can reach, [what a message looks like when it arrives](https://code.claude.com/docs/en/cross-session-messaging.md#what-a-message-looks-like), and [how Claude gets a notice when another session goes idle](https://code.claude.com/docs/en/cross-session-messaging.md#get-a-notice-when-another-session-goes-idle). Claude can include an optional `summary` input, typically 5-10 words, that Claude Code shows as a one-line preview. When Claude omits it on a [plain-text message](https://code.claude.com/docs/en/cross-session-messaging.md#limitations), Claude Code uses the first line of the message as the summary. Claude Code truncates a summary longer than 200 characters with an ellipsis | No |

57| `SendUserFile` | Sends files from the session to you with an optional caption, so a generated report, diagram, screenshot, or built artifact reaches your device instead of only being mentioned in the transcript. The optional `display` input controls presentation: `render` opens the file inline in the client, `attach` shows a download card only, and when unset the client decides by file type. Available when a [Remote Control](https://code.claude.com/docs/en/remote-control.md) client is connected or in a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md). Delivery runs through Anthropic-hosted infrastructure, so the tool is not available on Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry | No |57| `SendUserFile` | Sends files from the session to you with an optional caption, so a generated report, diagram, screenshot, or built artifact reaches your device instead of only being mentioned in the transcript. The optional `display` input controls presentation: `render` opens the file inline in the client, `attach` shows a download card only, and when unset the client decides by file type. Available when a [Remote Control](https://code.claude.com/docs/en/remote-control.md) client is connected or in a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md). Delivery runs through Anthropic-hosted infrastructure, so the tool is not available on Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry | No |

58| `ShareOnboardingGuide` | Uploads `ONBOARDING.md` and returns a share link teammates can open in Claude Code. Called from `/team-onboarding` after the guide is written. Available to claude.ai subscribers on Team and Enterprise plans | Yes |58| `ShareOnboardingGuide` | Uploads `ONBOARDING.md` and returns a share link teammates can open in Claude Code. Called from `/team-onboarding` after the guide is written. Available to claude.ai subscribers on Team and Enterprise plans | Yes |

59| `Skill` | Executes a [skill](https://code.claude.com/docs/en/skills.md#control-who-invokes-a-skill) within the main conversation. Can prompt for skills that set `allowed-tools`, `disallowed-tools`, or `hooks` | Some skills |59| `Skill` | Executes a [skill](https://code.claude.com/docs/en/skills.md#control-who-invokes-a-skill) within the main conversation. Can prompt for skills that set `allowed-tools`, `disallowed-tools`, or `hooks`, and for [skills from MCP servers](https://code.claude.com/docs/en/mcp.md#approvals-for-mcp-skills) | Some skills |

60| `SubagentHandback` | Delivers a subagent's final report to whichever conversation receives that subagent's result. Provided only in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), to subagents that the Agent tool runs locally other than [forks](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation), and available in the terminal CLI, IDE extensions, cloud sessions, and the Agent SDK; the classifier reviews the report before it's delivered. Requires Claude Code v2.1.271 or later | No |60| `SubagentHandback` | Delivers a subagent's final report to whichever conversation receives that subagent's result. Provided only in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), to subagents that the Agent tool runs locally other than [forks](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation), and available in the terminal CLI, IDE extensions, cloud sessions, and the Agent SDK; the classifier reviews the report before it's delivered. Requires Claude Code v2.1.271 or later | No |

61| `SuggestPluginInstall` | Shows a [card of suggested plugins](https://code.claude.com/docs/en/claude-code-on-the-web.md#plugin-suggestions-in-the-conversation) you can add. Available in the same sessions as `ListPlugins` | No |61| `SuggestPluginInstall` | Shows a [card of suggested plugins](https://code.claude.com/docs/en/claude-code-on-the-web.md#plugin-suggestions-in-the-conversation) you can add. Available in the same sessions as `ListPlugins` | No |

62| `SuggestSkills` | Shows a card of claude.ai skills you can add. Available in the same sessions as `ListPlugins` | No |62| `SuggestSkills` | Shows a card of claude.ai skills you can add. Available in the same sessions as `ListPlugins` | No |


226The result of a command moved to the background states what happened:226The result of a command moved to the background states what happened:

227 227 

228* When the timeout triggers the move, the result reports it explicitly: `Command did not complete within its 120s timeout and was moved to the background`, with the seconds matching the timeout that applied, followed by the task ID and the path of the file the output is being written to.228* When the timeout triggers the move, the result reports it explicitly: `Command did not complete within its 120s timeout and was moved to the background`, with the seconds matching the timeout that applied, followed by the task ID and the path of the file the output is being written to.

229* In an interactive session, a [background subagent's](https://code.claude.com/docs/en/sub-agents.md#run-subagents-in-foreground-or-background) command can move after 3 minutes, before its timeout. The result then includes `Command was moved to the background (ID: <id>) after running for 180s`.

229* A `cd`, `pushd`, `popd`, or `chdir` inside a command that is moved to the background never carries over: the result states `Session cwd remains <dir>; directory changes made by the backgrounded command do not apply to subsequent commands.`, so Claude doesn't act on a directory change that didn't happen.230* A `cd`, `pushd`, `popd`, or `chdir` inside a command that is moved to the background never carries over: the result states `Session cwd remains <dir>; directory changes made by the backgrounded command do not apply to subsequent commands.`, so Claude doesn't act on a directory change that didn't happen.

230 231 

231### Memory limit on Linux and WSL232### Memory limit on Linux and WSL

Details

67 67 

68> [!TIP]68> [!TIP]

69>69>

70> If you'd rather skip the terminal entirely, the [Claude Code Desktop app](https://code.claude.com/docs/en/desktop-quickstart.md) lets you install and use Claude Code through a graphical interface. Download it for [macOS](https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code\&utm_medium=docs) or [Windows](https://claude.com/download?utm_source=claude_code\&utm_medium=docs) and start coding without any command-line setup. On Linux, install the app with apt by following the [Linux install instructions](https://code.claude.com/docs/en/desktop-linux.md).70> If you'd rather skip the terminal entirely, the [Claude Code Desktop app](https://code.claude.com/docs/en/desktop-quickstart.md) lets you install and use Claude Code through a graphical interface. Download it for [macOS](https://claude.ai/claude-code/desktop-download?platform=mac\&utm_source=claude_code\&utm_medium=docs) or [Windows](https://claude.ai/claude-code/desktop-download?platform=win\&utm_source=claude_code\&utm_medium=docs) and start coding without any command-line setup. On Linux, install the app with apt by following the [Linux install instructions](https://code.claude.com/docs/en/desktop-linux.md).

71 71 

72## Run diagnostic checks72## Run diagnostic checks

73 73 

worktrees.md +10 −6

Details

72 72 

73* **Claude Code finds another session in the worktree**: the worktree and branch stay even if you choose removal. Follow the `Worktree kept at` message73* **Claude Code finds another session in the worktree**: the worktree and branch stay even if you choose removal. Follow the `Worktree kept at` message

74* **The worktree is clean**: for an unnamed session, Claude removes the worktree and its branch automatically. A [named](https://code.claude.com/docs/en/sessions.md#name-your-sessions) session prompts you first so you can keep the worktree for later74* **The worktree is clean**: for an unnamed session, Claude removes the worktree and its branch automatically. A [named](https://code.claude.com/docs/en/sessions.md#name-your-sessions) session prompts you first so you can keep the worktree for later

75* **The worktree has work in it**: Claude prompts you to keep or remove the worktree. Keeping preserves the directory and branch. To return later, run the `claude --worktree <name> --resume` command that Claude Code prints on exit. Removing deletes the worktree directory and its branch, along with all the work in them75* **The worktree has work in it**: Claude prompts you to keep or remove the worktree. Keeping preserves the directory and branch so you can [return later](#resume-a-worktree-session). Removing deletes the worktree directory and its branch, along with all the work in them

76* **Another branch is checked out**: if the worktree is on a branch other than its own that has commits past the worktree's starting commit, Claude prompts you to keep or remove the worktree. Either answer keeps that other branch and its commits. Removing deletes the worktree directory and the worktree's own branch, the one Claude created with it76* **Another branch is checked out**: if the worktree is on a branch other than its own that has commits past the worktree's starting commit, Claude prompts you to keep or remove the worktree. Either answer keeps that other branch and its commits. Removing deletes the worktree directory and the worktree's own branch, the one Claude created with it

77* **The worktree's state can't be verified**: when Claude Code can't count the worktree's changes or can't inspect its submodule checkouts, it prompts you rather than removing the worktree automatically. The prompt names what it couldn't check77* **The worktree's state can't be verified**: when Claude Code can't count the worktree's changes or can't inspect its submodule checkouts, it prompts you rather than removing the worktree automatically. The prompt names what it couldn't check

78 78 


82 82 

83## Resume a worktree session83## Resume a worktree session

84 84 

85To return to a worktree you kept, run `claude --worktree <name> --resume <session-id>` from the main checkout, using the session ID printed on exit. For `<name>`, type the folder name under `.claude/worktrees/` with `/` in place of any `+`.

86 

87### Resume without `--worktree`

88 

85When you resume a session that ended [isolated](#how-claude-code-enforces-isolation) in its worktree without [exiting it](#clean-up-worktrees), Claude Code returns the session there and keeps it isolated. This holds for interactive resumes, for `--continue` and `--resume` in [non-interactive mode](https://code.claude.com/docs/en/headless.md) with `-p`, and for the Agent SDK. Back inside the worktree, Claude can leave with the [`ExitWorktree`](https://code.claude.com/docs/en/tools-reference) tool [when the session has that tool](#claude-has-no-enterworktree-tool).89When you resume a session that ended [isolated](#how-claude-code-enforces-isolation) in its worktree without [exiting it](#clean-up-worktrees), Claude Code returns the session there and keeps it isolated. This holds for interactive resumes, for `--continue` and `--resume` in [non-interactive mode](https://code.claude.com/docs/en/headless.md) with `-p`, and for the Agent SDK. Back inside the worktree, Claude can leave with the [`ExitWorktree`](https://code.claude.com/docs/en/tools-reference) tool [when the session has that tool](#claude-has-no-enterworktree-tool).

86 90 

87Before returning the session to its worktree, Claude Code verifies that the worktree is still a checkout separate from the main one, and declines to re-enter a worktree that fails the check. For a git worktree, the check reads its git metadata. A worktree without git metadata, such as one a [`WorktreeCreate` hook](#non-git-version-control) created, can pass the check; the cases Claude Code still refuses are listed with their recoveries under [Claude Code refuses to use a worktree](#claude-code-refuses-to-use-a-worktree). For the messages and how to recover from each, see [The session resumes outside its worktree](#the-session-resumes-outside-its-worktree).91Before returning the session to its worktree, Claude Code verifies that the worktree is still a checkout separate from the main one, and declines to re-enter a worktree that fails the check. For a git worktree, the check reads its git metadata. A worktree without git metadata, such as one a [`WorktreeCreate` hook](#non-git-version-control) created, can pass the check; the cases Claude Code still refuses are listed with their recoveries under [Claude Code refuses to use a worktree](#claude-code-refuses-to-use-a-worktree). For the messages and how to recover from each, see [The session resumes outside its worktree](#the-session-resumes-outside-its-worktree).


97>101>

98> Before v2.1.212, a non-interactive resume stayed in the starting directory and `ExitWorktree` reported that there was no active worktree session to exit.102> Before v2.1.212, a non-interactive resume stayed in the starting directory and `ExitWorktree` reported that there was no active worktree session to exit.

99 103 

104### Transcript location

105 

100When Claude enters or exits a worktree that Claude Code created with git, the transcript follows. Claude Code records the session under the session's new working directory, the same way [`/cd`](https://code.claude.com/docs/en/commands) does, so `/desktop` and `--resume` find it there. Exiting moves it back the same way. A worktree created by a [`WorktreeCreate` hook](#non-git-version-control) keeps its transcript at the launch directory.106When Claude enters or exits a worktree that Claude Code created with git, the transcript follows. Claude Code records the session under the session's new working directory, the same way [`/cd`](https://code.claude.com/docs/en/commands) does, so `/desktop` and `--resume` find it there. Exiting moves it back the same way. A worktree created by a [`WorktreeCreate` hook](#non-git-version-control) keeps its transcript at the launch directory.

101 107 

102## How Claude Code enforces isolation108## How Claude Code enforces isolation


151* A checked-out submodule in the worktree holds changed or untracked files, or Claude Code can't inspect the worktree's submodules. This check requires Claude Code v2.1.274 or later.157* A checked-out submodule in the worktree holds changed or untracked files, or Claude Code can't inspect the worktree's submodules. This check requires Claude Code v2.1.274 or later.

152* One of the [four cases that also block worktree creation](#git-lfs-content-is-missing-from-a-worktree-claude-code-created) applies: Claude Code can't determine which filter drivers the repository config defines, or finds a setting there it can't switch off.158* One of the [four cases that also block worktree creation](#git-lfs-content-is-missing-from-a-worktree-claude-code-created) applies: Claude Code can't determine which filter drivers the repository config defines, or finds a setting there it can't switch off.

153* The worktree belongs to a `--worktree` session you haven't backgrounded, whatever its age.159* The worktree belongs to a `--worktree` session you haven't backgrounded, whatever its age.

154* You created the worktree yourself with `git worktree add`, even if you then ran a `--worktree <name>` session in it and backgrounded that session.160* You created the worktree with `git worktree add` outside `.claude/worktrees/`.

155 

156Claude Code writes a marker into the git metadata of every worktree it creates with git, and the sweep keeps any worktree without one, including a worktree a [`WorktreeCreate` hook](#non-git-version-control) created.

157 161 

158#### Worktree locks and manual removal162#### Worktree locks and manual removal

159 163 


200claude --worktree "#1234"204claude --worktree "#1234"

201```205```

202 206 

203Claude Code reads only the number from the URL. It always fetches from your repository's `origin` remote, and picks the fetch path by `origin`'s host:207Claude Code ignores the host and repository in a URL you pass, and picks the fetch path by `origin`'s host:

204 208 

205* **github.com**: fetches `pull/<number>/head`209* **github.com**: fetches `pull/<number>/head`

206* **gitlab.com**: fetches `merge-requests/<number>/head`210* **gitlab.com**: fetches `merge-requests/<number>/head`

207* **GitHub Enterprise, self-managed GitLab, or any other host**: tries `pull/<number>/head` first, then `merge-requests/<number>/head`211* **GitHub Enterprise, self-managed GitLab, or any other host**: uses `pull/` for a pull request URL, `merge-requests/` for a merge request URL, and whichever exists for a `#` number. If both exist at different commits, follow the `Cannot use PR/MR #<number>` message.

208 212 

209This fetch never waits for input in your terminal. If git or ssh would ask for a password, a key passphrase, or confirmation of a new SSH host, the fetch fails instead and Claude Code exits with an `Error creating worktree: Failed to fetch PR/MR #<number>` message. A key that `ssh-agent` holds still works, so load your key there and run `git fetch` once by hand to record a new host before you start.213This fetch never waits for input in your terminal. If git or ssh would ask for a password, a key passphrase, or confirmation of a new SSH host, the fetch fails instead and Claude Code exits with an `Error creating worktree: Failed to fetch PR/MR #<number>` message. A key that `ssh-agent` holds still works, so load your key there and run `git fetch` once by hand to record a new host before you start.

210 214