SpyBara
Go Premium

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

91 files changed +941 −530. 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

admin-setup.md +3 −3

Details

53 53 

54Claude Code fetches server-managed settings at startup and refreshes them hourly during the session, with no endpoint infrastructure to deploy. Delivery through the claude.ai admin console requires a Claude for Teams or Enterprise plan. Deployments on Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry can get the same remote delivery by running a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), or use one of the file-based or OS-level mechanisms instead.54Claude Code fetches server-managed settings at startup and refreshes them hourly during the session, with no endpoint infrastructure to deploy. Delivery through the claude.ai admin console requires a Claude for Teams or Enterprise plan. Deployments on Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry can get the same remote delivery by running a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), or use one of the file-based or OS-level mechanisms instead.

55 55 

56If you set your provider or gateway at claude.ai under **Organization settings > Desktop 3P**, see [which settings take priority](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority) in the Enterprise Admin Console guide.56If you set your provider or gateway at claude.ai under [**Organization settings > Desktop 3P**](https://claude.ai/admin-settings/desktop-deployment), see [which settings take priority](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority) in the Enterprise Admin Console guide.

57 57 

58If your organization mixes providers, configure [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) for claude.ai users plus a [file-based or plist/registry fallback](https://code.claude.com/docs/en/managed-settings.md#delivery-mechanisms) so other users still receive managed policy.58If your organization mixes providers, configure [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) for claude.ai users plus a [file-based or plist/registry fallback](https://code.claude.com/docs/en/managed-settings.md#delivery-mechanisms) so other users still receive managed policy.

59 59 


158 158 

159**1. Allow organizations**159**1. Allow organizations**

160 160 

161As an Owner on a Team or Enterprise plan, open the GitHub section of [**Organization settings > Git providers**](https://claude.ai/admin-settings/source-control) in your browser and click **Choose organizations**. Select the organizations you approve in the table and click **Allow**. Include ones that are already linked, because they aren't allowed automatically.161On a Team or Enterprise plan, an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) can set this up. Open the GitHub section of [**Organization settings > Git providers**](https://claude.ai/admin-settings/source-control) in your browser and click **Choose organizations**. Select the organizations you approve in the table and click **Allow**. Include ones that are already linked, because they aren't allowed automatically.

162 162 

163**2. Allow other accounts by name**163**2. Allow other accounts by name**

164 164 


189| Usage monitoring | OpenTelemetry export of sessions, tools, and tokens | All providers | [Monitoring usage](https://code.claude.com/docs/en/monitoring-usage.md) |189| Usage monitoring | OpenTelemetry export of sessions, tools, and tokens | All providers | [Monitoring usage](https://code.claude.com/docs/en/monitoring-usage.md) |

190| Analytics dashboard | Adoption and contribution metrics with a leaderboard on Teams / Enterprise; per-user usage and spend metrics on Console | Teams / Enterprise at [claude.ai/analytics](https://claude.ai/analytics/claude-code), Console at [platform.claude.com/claude-code](https://platform.claude.com/claude-code) | [Analytics](https://code.claude.com/docs/en/analytics.md) |190| Analytics dashboard | Adoption and contribution metrics with a leaderboard on Teams / Enterprise; per-user usage and spend metrics on Console | Teams / Enterprise at [claude.ai/analytics](https://claude.ai/analytics/claude-code), Console at [platform.claude.com/claude-code](https://platform.claude.com/claude-code) | [Analytics](https://code.claude.com/docs/en/analytics.md) |

191| Programmatic reporting | Per-user usage and cost data over an API | [Enterprise Analytics API](https://platform.claude.com/docs/en/api/admin/analytics) for Enterprise, [Claude Code Analytics API](https://platform.claude.com/docs/en/build-with-claude/claude-code-analytics-api) for Console | [Costs](https://code.claude.com/docs/en/costs.md#manage-costs-for-your-organization) |191| Programmatic reporting | Per-user usage and cost data over an API | [Enterprise Analytics API](https://platform.claude.com/docs/en/api/admin/analytics) for Enterprise, [Claude Code Analytics API](https://platform.claude.com/docs/en/build-with-claude/claude-code-analytics-api) for Console | [Costs](https://code.claude.com/docs/en/costs.md#manage-costs-for-your-organization) |

192| Spend controls | Spend limits and rate limits | Organization settings for Teams / Enterprise, workspace limits for Console; on third-party clouds, cloud budget controls or a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) with per-user [spend limits](https://code.claude.com/docs/en/claude-apps-gateway-spend-limits.md) | [Costs](https://code.claude.com/docs/en/costs.md#manage-costs-for-your-organization) |192| Spend controls | Spend limits and rate limits | [Organization settings](https://claude.ai/admin-settings/usage) for Teams / Enterprise, workspace limits for Console; on third-party clouds, cloud budget controls or a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) with per-user [spend limits](https://code.claude.com/docs/en/claude-apps-gateway-spend-limits.md) | [Costs](https://code.claude.com/docs/en/costs.md#manage-costs-for-your-organization) |

193 193 

194On Teams and Enterprise, per-user usage and spend numbers come from the [spend report](https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans) in your organization's analytics settings, not the analytics dashboard. Cloud providers expose spend through AWS Cost Explorer, GCP Billing, or Azure Cost Management. For planning enterprise budgets across Claude chat, Claude Code, and Cowork, see the [Claude Enterprise consumption guide](https://support.claude.com/en/articles/14782391-claude-enterprise-consumption-guide).194On Teams and Enterprise, per-user usage and spend numbers come from the [spend report](https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans) in your organization's analytics settings, not the analytics dashboard. Cloud providers expose spend through AWS Cost Explorer, GCP Billing, or Azure Cost Management. For planning enterprise budgets across Claude chat, Claude Code, and Cowork, see the [Claude Enterprise consumption guide](https://support.claude.com/en/articles/14782391-claude-enterprise-consumption-guide).

195 195 

advisor.md +2 −2

Details

50* Run `/advisor` with a model, such as `/advisor opus`, to set it.50* Run `/advisor` with a model, such as `/advisor opus`, to set it.

51* Run `/advisor off` to turn it off.51* Run `/advisor off` to turn it off.

52 52 

53Claude Code doesn't invoke a saved advisor that your organization's [`availableModels`](https://code.claude.com/docs/en/model-config#restrict-model-selection) allowlist excludes. To use the advisor, pick an allowed model with `/advisor`.53Claude Code doesn't invoke a saved advisor that an [`availableModels`](https://code.claude.com/docs/en/model-config#restrict-model-selection) allowlist in your settings excludes. To use the advisor, pick an allowed model with `/advisor`.

54 54 

55Claude Code still saves an advisor that your current main model doesn't support. That advisor activates after you switch to a [compatible main model](#choose-an-advisor-model) with [`/model`](https://code.claude.com/docs/en/model-config#setting-your-model). If the API already refused the saved advisor in the current conversation, it stays off until `/clear` or `/compact`, even after you switch models.55Claude Code still saves an advisor that your current main model doesn't support. That advisor activates after you switch to a [compatible main model](#choose-an-advisor-model) with [`/model`](https://code.claude.com/docs/en/model-config#setting-your-model). If the API already refused the saved advisor in the current conversation, it stays off until `/clear` or `/compact`, even after you switch models.

56 56 


78 78 

79* The session's main model doesn't support the advisor79* The session's main model doesn't support the advisor

80* The requested model, such as Haiku 4.5, can't act as an advisor80* The requested model, such as Haiku 4.5, can't act as an advisor

81* Your organization's [`availableModels`](https://code.claude.com/docs/en/model-config#restrict-model-selection) allowlist excludes the requested model81* An [`availableModels`](https://code.claude.com/docs/en/model-config#restrict-model-selection) allowlist excludes the requested model

82* You requested Fable and your account still requires the [usage-credits consent](#fable-advisor-and-usage-credits)82* You requested Fable and your account still requires the [usage-credits consent](#fable-advisor-and-usage-credits)

83 83 

84If you start a [background session](https://code.claude.com/docs/en/agent-view.md) with `--advisor` and one of these applies, Claude Code starts the session without the advisor instead of exiting.84If you start a [background session](https://code.claude.com/docs/en/agent-view.md) with `--advisor` and one of these applies, Claude Code starts the session without the advisor instead of exiting.

Details

143Cap turns and spend with `maxTurns` / `max_turns` and `maxBudgetUsd` / `max_budget_usd`. Both caps are off when unset. When a session hits a cap, the run ends with a result message. The result's subtype is `error_max_turns` for the turn cap and `error_max_budget_usd` for the spend cap. Single-shot and streaming input handle a cap result differently:143Cap turns and spend with `maxTurns` / `max_turns` and `maxBudgetUsd` / `max_budget_usd`. Both caps are off when unset. When a session hits a cap, the run ends with a result message. The result's subtype is `error_max_turns` for the turn cap and `error_max_budget_usd` for the spend cap. Single-shot and streaming input handle a cap result differently:

144 144 

145* **Single-shot `query()`**: the SDK yields the cap result and then raises, so wrap the loop in a try block to continue past the error145* **Single-shot `query()`**: the SDK yields the cap result and then raises, so wrap the loop in a try block to continue past the error

146* **Streaming input**: the session stays alive past a cap result, and the max-turns count starts over for each queued message. The budget total accumulates across messages, and once spend reaches the cap, later messages in the same conversation end with the same budget result. A [`/clear`](https://code.claude.com/docs/en/agent-sdk/cost-tracking) starts the budget over.146* **Streaming input**: the session stays alive past a cap result, and the max-turns count starts over. The budget total accumulates across messages, and once spend reaches the cap, later messages in the same conversation end with the same budget result. A [`/clear`](https://code.claude.com/docs/en/agent-sdk/cost-tracking) starts the budget over.

147* **Streaming input in TypeScript**: the loop throws when the last response ends in an error result, such as `error_max_turns`. Wrap the loop in a try block to continue past it.147* **Streaming input in TypeScript**: the loop throws when the last response ends in an error result, such as `error_max_turns`. Wrap the loop in a try block to continue past it.

148 148 

149The two caps treat `0` differently:149The two caps treat `0` differently:

Details

241| `OTEL_LOG_USER_PROMPTS=1` | Prompt text on `claude_code.user_prompt` events and on the `claude_code.interaction` span |241| `OTEL_LOG_USER_PROMPTS=1` | Prompt text on `claude_code.user_prompt` events and on the `claude_code.interaction` span |

242| `OTEL_LOG_TOOL_DETAILS=1` | Tool input arguments such as file paths, shell commands, and search patterns on `claude_code.tool_result` events, and real agent, skill, plugin, and MCP server names on the [cost and token metrics](https://code.claude.com/docs/en/monitoring-usage.md#cost-counter). The built-in rule the auto mode classifier named when it blocked a call, as [`classifier_category`](https://code.claude.com/docs/en/monitoring-usage#tool-decision-event) on `claude_code.tool_decision` events |242| `OTEL_LOG_TOOL_DETAILS=1` | Tool input arguments such as file paths, shell commands, and search patterns on `claude_code.tool_result` events, and real agent, skill, plugin, and MCP server names on the [cost and token metrics](https://code.claude.com/docs/en/monitoring-usage.md#cost-counter). The built-in rule the auto mode classifier named when it blocked a call, as [`classifier_category`](https://code.claude.com/docs/en/monitoring-usage#tool-decision-event) on `claude_code.tool_decision` events |

243| `OTEL_LOG_TOOL_CONTENT=1` | A [`tool.output` span event](https://code.claude.com/docs/en/monitoring-usage#tool-output-span-event) on `claude_code.tool` with file contents, Bash output, and what MCP tools, WebFetch, and WebSearch return, truncated at 60 KB by default, configurable via `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH`, which requires Claude Code v2.1.214 or later. Results from MCP tools, WebFetch, and WebSearch require Claude Code v2.1.283 or later. Requires [tracing](#read-agent-traces) to be enabled. Span attributes carry tool content under [their own gates](https://code.claude.com/docs/en/monitoring-usage.md#new-context-gates) |243| `OTEL_LOG_TOOL_CONTENT=1` | A [`tool.output` span event](https://code.claude.com/docs/en/monitoring-usage#tool-output-span-event) on `claude_code.tool` with file contents, Bash output, and what MCP tools, WebFetch, and WebSearch return, truncated at 60 KB by default, configurable via `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH`, which requires Claude Code v2.1.214 or later. Results from MCP tools, WebFetch, and WebSearch require Claude Code v2.1.283 or later. Requires [tracing](#read-agent-traces) to be enabled. Span attributes carry tool content under [their own gates](https://code.claude.com/docs/en/monitoring-usage.md#new-context-gates) |

244| `OTEL_LOG_RAW_API_BODIES` | Full Anthropic Messages API request and response JSON as `claude_code.api_request_body` and `claude_code.api_response_body` log events. Set to `1` for inline bodies truncated at 60 KB by default, or `file:<dir>` for untruncated bodies on disk with a `body_ref` path in the event. `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` configures the inline truncation limit, and requires Claude Code v2.1.214 or later. Bodies include the entire conversation history and have extended-thinking content redacted. Enabling this implies consent to everything the three variables above would reveal |244| `OTEL_LOG_RAW_API_BODIES` | Full Anthropic Messages API request and response JSON as `claude_code.api_request_body` and `claude_code.api_response_body` log events. Set to `1` for inline bodies truncated at [60 KB by default](https://code.claude.com/docs/en/monitoring-usage.md#common-configuration-variables), or `file:<dir>` for untruncated bodies on disk with a `body_ref` path in the event. Bodies can include the entire conversation history, with extended-thinking content redacted. Enabling this implies consent to everything the three variables above would reveal |

245 245 

246Leave these unset unless your observability pipeline is approved to store the data your agent handles. See [Security and privacy](https://code.claude.com/docs/en/monitoring-usage.md#security-and-privacy) in the Monitoring reference for the full list of attributes and redaction behavior.246Leave these unset unless your observability pipeline is approved to store the data your agent handles. See [Security and privacy](https://code.claude.com/docs/en/monitoring-usage.md#security-and-privacy) in the Monitoring reference for the full list of attributes and redaction behavior.

247 247 

Details

2809 "taskId": str, # ID of the background monitor task2809 "taskId": str, # ID of the background monitor task

2810 "timeoutMs": int, # The watch's effective deadline in milliseconds2810 "timeoutMs": int, # The watch's effective deadline in milliseconds

2811 "persistent": bool | None, # False: every watch has a deadline2811 "persistent": bool | None, # False: every watch has a deadline

2812 "keptInSandboxByCheck": bool | None,

2812}2813}

2813```2814```

2814 2815 

Details

2088 | "org_config_required_unavailable"2088 | "org_config_required_unavailable"

2089 | "org_config_refused"2089 | "org_config_refused"

2090 | "sandbox_required_unavailable"2090 | "sandbox_required_unavailable"

2091 | "config_file_invalid";2091 | "config_file_invalid"

2092 | "sideload_flags_disabled";

2092```2093```

2093 2094 

2094Each value names one refusal:2095Each value names one refusal:


2116| `org_config_refused` | Anthropic refused to provide the organization's policies and managed settings for this sign-in, for example because the sign-in expired or was revoked, or the organization doesn't allow Claude Code for this account. Requires Agent SDK v0.3.293 or later |2117| `org_config_refused` | Anthropic refused to provide the organization's policies and managed settings for this sign-in, for example because the sign-in expired or was revoked, or the organization doesn't allow Claude Code for this account. Requires Agent SDK v0.3.293 or later |

2117| `sandbox_required_unavailable` | [`failIfUnavailable`](#sandboxsettings) is on and the sandbox can't start. The text in `errors` ends with `Set sandbox.failIfUnavailable=false to allow unsandboxed execution.` Requires Agent SDK v0.3.314 or later |2118| `sandbox_required_unavailable` | [`failIfUnavailable`](#sandboxsettings) is on and the sandbox can't start. The text in `errors` ends with `Set sandbox.failIfUnavailable=false to allow unsandboxed execution.` Requires Agent SDK v0.3.314 or later |

2118| `config_file_invalid` | `~/.claude.json` isn't valid JSON. Claude Code leaves the file unchanged, so a retry fails the same way until someone repairs it. `errors` names the file and says how to restore or repair it. See [Configuration error in \~/.claude.json](https://code.claude.com/docs/en/errors.md#configuration-error-in-claude-json). Requires TypeScript Agent SDK v0.3.318 or later and Claude Code v2.1.318 or later |2119| `config_file_invalid` | `~/.claude.json` isn't valid JSON. Claude Code leaves the file unchanged, so a retry fails the same way until someone repairs it. `errors` names the file and says how to restore or repair it. See [Configuration error in \~/.claude.json](https://code.claude.com/docs/en/errors.md#configuration-error-in-claude-json). Requires TypeScript Agent SDK v0.3.318 or later and Claude Code v2.1.318 or later |

2120| `sideload_flags_disabled` | A flag or launch option violates managed [`disableSideloadFlags`](https://code.claude.com/docs/en/settings-reference#disablesideloadflags). Requires TypeScript Agent SDK v0.3.331 or later and Claude Code v2.1.331 or later |

2119 2121 

2120### `SDKSystemMessage`2122### `SDKSystemMessage`

2121 2123 

agent-teams.md +1 −1

Details

170>170>

171> `teammateDefaultModel` was removed in v2.1.234; Claude Code ignores a leftover value. Name the model in your prompt instead.171> `teammateDefaultModel` was removed in v2.1.234; Claude Code ignores a leftover value. Name the model in your prompt instead.

172 172 

173Claude Code checks the model it selects for a teammate against your organization's [`availableModels`](https://code.claude.com/docs/en/model-config#restrict-model-selection) allowlist. When the allowlist blocks a value, Claude Code substitutes another model:173Claude Code checks the model it selects for a teammate against any [`availableModels`](https://code.claude.com/docs/en/model-config#restrict-model-selection) allowlist. When the allowlist blocks a value, Claude Code substitutes another model:

174 174 

175* **Family alias such as `opus`**: On the Anthropic API and Claude Platform on AWS, Claude Code runs the teammate on the newest version of that family the allowlist permits. On providers with provider-specific model IDs, where the [substitution doesn't operate](https://code.claude.com/docs/en/model-config.md#restrict-model-selection), a blocked alias falls back like any other blocked value per the next bullet175* **Family alias such as `opus`**: On the Anthropic API and Claude Platform on AWS, Claude Code runs the teammate on the newest version of that family the allowlist permits. On providers with provider-specific model IDs, where the [substitution doesn't operate](https://code.claude.com/docs/en/model-config.md#restrict-model-selection), a blocked alias falls back like any other blocked value per the next bullet

176* **Any other blocked value, including a family alias on providers where the substitution doesn't operate, or one whose family has no permitted version**: Claude Code runs the teammate on the lead's model instead. If you set `CLAUDE_CODE_SUBAGENT_MODEL`, Claude Code tries that model first, under these same rules176* **Any other blocked value, including a family alias on providers where the substitution doesn't operate, or one whose family has no permitted version**: Claude Code runs the teammate on the lead's model instead. If you set `CLAUDE_CODE_SUBAGENT_MODEL`, Claude Code tries that model first, under these same rules

agent-view.md +1 −1

Details

849 849 

850* **Working, paused on a permission prompt or other dialog, or attached**: the process keeps running. A running subagent, workflow, or monitor counts as working, and so does a pending [session-scoped scheduled task](https://code.claude.com/docs/en/scheduled-tasks.md), such as a `/loop` wakeup.850* **Working, paused on a permission prompt or other dialog, or attached**: the process keeps running. A running subagent, workflow, or monitor counts as working, and so does a pending [session-scoped scheduled task](https://code.claude.com/docs/en/scheduled-tasks.md), such as a `/loop` wakeup.

851* **Finished or waiting for your next message, and unattached for about an hour**: the supervisor stops the process to free resources. A session that ended its turn by asking you a question counts as waiting for your next message. The conversation stays on disk, and the next time you attach or reply, the session resumes where it left off. Pin a session with `Ctrl+T` to keep its process running.851* **Finished or waiting for your next message, and unattached for about an hour**: the supervisor stops the process to free resources. A session that ended its turn by asking you a question counts as waiting for your next message. The conversation stays on disk, and the next time you attach or reply, the session resumes where it left off. Pin a session with `Ctrl+T` to keep its process running.

852* **Exited unexpectedly while the supervisor is running**: the supervisor restarts the process. Ending a session you backgrounded yourself with `←` or `/background`, for example with `kill`, marks it stopped instead of restarting it. For sessions that ended with a shutdown, see [Sessions show as failed or stopped after shutdown](#sessions-show-as-failed-after-shutdown).852* **Exited unexpectedly while the supervisor is running**: the supervisor can restart the process. Ending a session you backgrounded yourself with `←` or `/background`, for example with `kill`, marks it stopped instead of restarting it. If the session's row shows `∙`, select it and press `Enter` to restart the session. For sessions that ended with a shutdown, see [Sessions show as failed or stopped after shutdown](#sessions-show-as-failed-after-shutdown).

853* **After an auto-update**: the supervisor restarts itself onto the new version and moves idle sessions over in the background. Sessions that are working, waiting on you, or attached aren't interrupted.853* **After an auto-update**: the supervisor restarts itself onto the new version and moves idle sessions over in the background. Sessions that are working, waiting on you, or attached aren't interrupted.

854* **The supervisor itself stops**, for example because its process was ended from outside Claude Code: on macOS and Linux, your sessions stop unless a new supervisor connects within about a minute. To start one, run `claude agents` in your shell. After that minute, see [Keep sessions running after the supervisor stops](#keep-sessions-running-after-the-supervisor-stops).854* **The supervisor itself stops**, for example because its process was ended from outside Claude Code: on macOS and Linux, your sessions stop unless a new supervisor connects within about a minute. To start one, run `claude agents` in your shell. After that minute, see [Keep sessions running after the supervisor stops](#keep-sessions-running-after-the-supervisor-stops).

855 855 

Details

76* **Each policy file has its own `mode`**: while the root policy file observes, none of its rules count under a directory's enforcing policy file, the `nested: inherit` rules included76* **Each policy file has its own `mode`**: while the root policy file observes, none of its rules count under a directory's enforcing policy file, the `nested: inherit` rules included

77* **Some custom classifiers go only under `advisory`**: that's a classifier whose [`tools`](https://code.claude.com/docs/en/approvals-classifiers#tools) list `reviewers` or `labels`, or that has an [input](https://code.claude.com/docs/en/approvals-classifiers.md#inputs) with no `merge`. List it in an enforced rule with no `if`. If a rule reads its result, the check on pull requests under a directory's policy file can read **Cannot evaluate: classifier outside advisory**77* **Some custom classifiers go only under `advisory`**: that's a classifier whose [`tools`](https://code.claude.com/docs/en/approvals-classifiers#tools) list `reviewers` or `labels`, or that has an [input](https://code.claude.com/docs/en/approvals-classifiers.md#inputs) with no `merge`. List it in an enforced rule with no `if`. If a rule reads its result, the check on pull requests under a directory's policy file can read **Cannot evaluate: classifier outside advisory**

78 78 

79## Top-level keys79## Rules for the whole file

80 

81Follow these rules in every part of the file:

80 82 

81Approvals refuses a file that has an unknown key. Write keys, and fixed words such as `observe` and `approves`, in lower case. Put double quotes around every purpose, pattern, condition, and `"!"` item.83* **Keys and fixed values**: write keys, and fixed values such as `observe` and `approves`, in lower case. Approvals refuses a file that has an unknown key

84* **Purposes, patterns, and conditions**: put double quotes around every purpose, `paths` pattern, and condition

85* **`!` items**: put double quotes around each `"!"` item outside a condition. Inside a condition, a `!` item takes single quotes. Approvals refuses a file that has an unquoted `!` item

86* **YAML**: keep the file to one YAML document, or Approvals refuses the file. Indent with spaces. Anchors, aliases, and `!!` tags draw at least a warning

82 87 

83Keep the file to one YAML document, quote each `!` item, and indent with spaces, or Approvals refuses the file. Anchors, aliases, and `!!` tags draw a warning.88## Top-level keys

84 89 

85Write these keys at the top level of the file:90Write these keys at the top level of the file:

86 91 


123| `*` | Any characters within one folder |128| `*` | Any characters within one folder |

124| `**` | Any number of folders, dot folders too. It has to be a whole segment, as in `**/*.go` |129| `**` | Any number of folders, dot folders too. It has to be a whole segment, as in `**/*.go` |

125| `{a,b}`, `[ab]`, `?` | Alternatives, one character of a set, and any one character |130| `{a,b}`, `[ab]`, `?` | Alternatives, one character of a set, and any one character |

126| `infra/**` | Every file in the folder. A bare `infra` matches no file in it |131| `infra/**` | Every file in the folder. A bare `infra` matches no file in it, and `infra/` is refused |

127| `*.md` | Markdown files beside the policy file's `.claude` folder. For any depth, write `**/*.md` |132| `*.md` | Markdown files beside the policy file's `.claude` folder. For any depth, write `**/*.md` |

128| `"!docs/**"` | Takes the files out of this rule only. A rule needs at least one pattern with no `!` |133| `"!docs/**"` | Takes the files out of this rule only. A rule needs at least one pattern with no `!` |

129 134 


133 138 

134* **Operators**: `=`, `!=`, `<`, `<=`, `>`, `>=`139* **Operators**: `=`, `!=`, `<`, `<=`, `>`, `>=`

135* **Joining**: `AND` and `OR` in capitals. Use parentheses to mix the two.140* **Joining**: `AND` and `OR` in capitals. Use parentheses to mix the two.

136* **Lists**: write `ANY` or `ALL` before `pr/authors` and `pr/approved_by`. Where the condition leads to a lighter verdict, use `ALL`: with `ANY`, one listed author relaxes the rule for everyone else's commits. Where it leads to a stricter one, use `ANY`: with `ALL`, one unlisted author switches it off.141* **Lists**: write `ANY` or `ALL` before `pr/authors` and `pr/approved_by`. Where the condition leads to a lighter verdict, use `ALL`: with `ANY`, one listed author relaxes the rule for everyone else's commits. Where it leads to a stricter one, use `ANY`: with `ALL`, one unlisted author switches it off. To test for an empty list, write neither, as in `"pr/approved_by = empty"`.

137* **Quotes**: single quotes around a login or a branch pattern, and none around a team, a `bot:` name, or a fact, as in `"ALL pr/authors = ['ana-acme', acme/payments]"`142* **Quotes**: single quotes around a login, a branch pattern, or a whole `!` item in a [list of people](#people-lists), as in `"ANY pr/authors = [humans, '!acme/interns']"`. No quotes around a team, a `bot:` name, or a fact without a `!`, as in `"ALL pr/authors = ['ana-acme', acme/payments]"`

138* **Classifiers**: `claude/code_review = pass`, `repo/change_risk <= medium`, and the other forms under [Read a classifier's answer from a rule](https://code.claude.com/docs/en/approvals-classifiers.md#read-a-classifier’s-answer-from-a-rule)143* **Classifiers**: `claude/code_review = pass`, `repo/change_risk <= medium`, and the other forms under [Read a classifier's answer from a rule](https://code.claude.com/docs/en/approvals-classifiers.md#read-a-classifier’s-answer-from-a-rule)

139 144 

140A fact comes from the pull request itself:145A fact comes from the pull request itself:


146| `rule/files_changed`, `rule/files_added`, `rule/files_removed` | `"rule/files_changed = pr/files_changed"` | Counts among the files that this rule's `paths` match |151| `rule/files_changed`, `rule/files_added`, `rule/files_removed` | `"rule/files_changed = pr/files_changed"` | Counts among the files that this rule's `paths` match |

147| `pr/authors` | `"ALL pr/authors = bot:dependabot"` | Accounts that wrote or pushed a commit, and the account that opened the pull request |152| `pr/authors` | `"ALL pr/authors = bot:dependabot"` | Accounts that wrote or pushed a commit, and the account that opened the pull request |

148| `pr/opened_by` | `"pr/opened_by = acme/release"` | The account that opened the pull request. After someone else pushes to a bot's pull request, an override on `pr/opened_by = bot:dependabot` stops lowering what the rule asks for |153| `pr/opened_by` | `"pr/opened_by = acme/release"` | The account that opened the pull request. After someone else pushes to a bot's pull request, an override on `pr/opened_by = bot:dependabot` stops lowering what the rule asks for |

149| `pr/approved_by` | `"ANY pr/approved_by = acme/security"` | People with write access who approved the current diff. Authors and bots aren't among them. Also takes `= empty` and `!= empty` |154| `pr/approved_by` | `"ANY pr/approved_by = acme/security"` | People with write access who approved the current diff. Authors and bots aren't among them. Also takes `= empty` and `!= empty`, with no `ANY` or `ALL` |

150| `pr/base` | `"pr/base = 'release/**'"` | The branch that the pull request targets |155| `pr/base` | `"pr/base = 'release/**'"` | The branch that the pull request targets |

151 156 

152### `verdict`157### `verdict`


175| `acme/payments` | A team of the repository's GitHub organization |180| `acme/payments` | A team of the repository's GitHub organization |

176| `bot:dependabot` | One bot, with no `[bot]` suffix. `bot:claude` means Claude's apps |181| `bot:dependabot` | One bot, with no `[bot]` suffix. `bot:claude` means Claude's apps |

177| `pr/authors`, `pr/opened_by` | The accounts that the fact holds |182| `pr/authors`, `pr/opened_by` | The accounts that the fact holds |

178| `"!pr/authors"` | Takes accounts away. Quote it, and put it beside an item with no `!` |183| `"!pr/authors"` | Takes accounts away. Quote it, with single quotes in a condition, and put it beside an item with no `!` |

179 184 

180If a set's `from` admits Claude, for example through `bots`, `everyone`, or `bot:claude`, and every rule that applies says `approves`, Approvals counts a seat in that set as filled before Claude approves. The **Claude Approvals** check can then pass with no person's approval.185If a set's `from` admits Claude, for example through `bots`, `everyone`, or `bot:claude`, and every rule that applies says `approves`, Approvals counts a seat in that set as filled before Claude approves. The **Claude Approvals** check can then pass with no person's approval.

181 186 


357* **Git files**: `.gitmodules`, `.gitattributes`, symlinks, and submodule pointers362* **Git files**: `.gitmodules`, `.gitattributes`, symlinks, and submodule pointers

358* **Code owners**: any file named `CODEOWNERS`363* **Code owners**: any file named `CODEOWNERS`

359 364 

360Don't rely on other files being protected. Write a rule for the ones that matter to you, such as `.github/`, `CLAUDE.md`, `AGENTS.md`, `.mcp.json`, and the rest of `.claude/`.365Don't rely on other files being protected. Write a rule for the ones that matter to you, such as the `.github` folder, `CLAUDE.md`, `AGENTS.md`, `.mcp.json`, and the rest of the `.claude` folder.

361 366 

362### Who has to approve a change to a protected file367### Who has to approve a change to a protected file

363 368 

Details

26 26 

27The **Claude Approvals** check gives your pull request's approval status in its title, the text beside its name in the list of checks. Find your check's title in these tables to see what it means and what to do next.27The **Claude Approvals** check gives your pull request's approval status in its title, the text beside its name in the list of checks. Find your check's title in these tables to see what it means and what to do next.

28 28 

29For a title that isn't here, open the **Claude Approvals** check's summary, which gives the cause and the next step. To find who maintains the policy file, `.claude/approvals.yml`, see who last changed it on the default branch.29For any other title, open the **Claude Approvals** check's summary, which gives the cause and the next step. To find who maintains the policy file, `.claude/approvals.yml`, see who last changed it on the default branch.

30 30 

31### Approvals waits for people31### Approvals waits for people

32 32 


40 40 

41### Approvals waits for Code Review or a classifier41### Approvals waits for Code Review or a classifier

42 42 

43With these titles, Approvals is waiting for an answer from [Code Review](https://code.claude.com/docs/en/code-review-pull-requests.md) or a [classifier](https://code.claude.com/docs/en/approvals-classifiers.md), or didn't get one:43With these titles, Approvals needs an answer from [Code Review](https://code.claude.com/docs/en/code-review-pull-requests.md) or a [classifier](https://code.claude.com/docs/en/approvals-classifiers.md):

44 44 

45| Title | What to do |45| Title | What to do |

46| :- | :- |46| :- | :- |

47| **Waiting for Code Review**, **Waiting for repo/change\_risk**, **Waiting for classifiers** | Nothing yet |47| **Waiting for Code Review**, **Waiting for repo/change\_risk**, **Waiting for classifiers** | Wait for the result |

48| **A classifier had no result**, **A classifier has not run**, or a name in place of "A classifier", as in **repo/change\_risk has not run** | [Rerun the Claude Approvals check](#comment-commands-for-approvals). See [when a run gives no answer](https://code.claude.com/docs/en/approvals-classifiers.md#what-a-rule-sees-when-a-classifier-run-gives-no-answer) |48| **A classifier had no result**, **A classifier has not run**, or a name in place of "A classifier", as in **repo/change\_risk has not run** | [Rerun the Claude Approvals check](#comment-commands-for-approvals). See [what a rule sees without an answer](https://code.claude.com/docs/en/approvals-classifiers.md#what-a-rule-sees-when-a-classifier-run-gives-no-answer) |

49 49 

50### A rule or a policy file keeps Approvals from passing50### A rule or a policy file keeps Approvals from passing

51 51 

52With these titles, a rule holds the pull request, no rule applies to a changed file, or a policy file can't be used:52With these titles, a rule holds the pull request or the policy needs a fix:

53 53 

54| Title | What to do |54| Title | What to do |

55| :- | :- |55| :- | :- |

56| **Held by Code Review's findings** | Fix the findings that Code Review posted on the pull request, then push. If the policy's [`findings`](https://code.claude.com/docs/en/approvals-policy#findings) list names you, you can resolve the findings' threads. If the **Claude Approvals** check doesn't pass after you resolve them, push a fix |56| **Held by Code Review's findings** | Fix the findings that Code Review posted on the pull request, then push. If the policy's [`findings`](https://code.claude.com/docs/en/approvals-policy#findings) list names you, you can resolve the findings' threads. If the **Claude Approvals** check is still held after you resolve them, push a fix |

57| **Held by** and a rule's purpose in quotes, **Held by a policy rule** | Ask whoever maintains the policy file what the rule in the check's summary needs, then push a fix |57| **Held by** and a rule's purpose in quotes, **Held by a policy rule** | Ask whoever maintains the policy file what the rule in the check's summary needs, then push a fix |

58| **No rule applies to** and a file's name in quotes, **No rule applies to a changed file** | Ask whoever maintains the policy file for a rule with no `if` that covers the file. Rerun the check once that rule merges |58| **No rule applies to** and a file's name in quotes, **No rule applies to a changed file** | Ask whoever maintains the policy file for a rule with no `if` that covers the file. Rerun the check once that rule merges |

59| **This change breaks a policy file**, **Default branch policy file cannot be used** | [Fix the policy file](https://code.claude.com/docs/en/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses) |59| **This change breaks a policy file**, **Default branch policy file cannot be used** | [Fix the policy file](https://code.claude.com/docs/en/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses) |


67| Title | What to do |67| Title | What to do |

68| :- | :- |68| :- | :- |

69| **Passed; no approval from Claude** | If GitHub requires an approval, ask a person |69| **Passed; no approval from Claude** | If GitHub requires an approval, ask a person |

70| **Nothing ran, not blocking: no file is covered** | Nothing. If someone should review the files that the pull request changes, ask whoever maintains the [policy file](https://code.claude.com/docs/en/approvals-policy.md) to cover them |70| **Nothing ran, not blocking: no file is covered** | If someone should review the files that the pull request changes, ask whoever maintains the [policy file](https://code.claude.com/docs/en/approvals-policy.md) to cover them |

71| **Observe mode ended: not evaluated yet** | Push a commit or [rerun the Claude Approvals check](#comment-commands-for-approvals). If it passes, a pull request with auto-merge on or in a merge queue can merge at once |71| **Observe mode ended: not evaluated yet** | Push a commit or [rerun the Claude Approvals check](#comment-commands-for-approvals). If it passes, a pull request with auto-merge on or in a merge queue can merge at once |

72 72 

73Under **Passed; no approval from Claude**, Claude posts no approval in cases such as these:73If you see **Passed; no approval from Claude**, check for causes such as these:

74 74 

75* A rule says `claude: comments`75* A rule says `claude: comments`

76* A changed file has no rule, or is a [symlink, submodule pointer, or `.gitattributes` file](https://code.claude.com/docs/en/approvals-policy#protected-files)76* A changed file has no rule, or is a [symlink, submodule pointer, or `.gitattributes` file](https://code.claude.com/docs/en/approvals-policy#protected-files)


80 80 

81In observe mode, the **Claude Approvals** check ends neutral, which GitHub counts as passing, with a title that starts **(observe mode)**.81In observe mode, the **Claude Approvals** check ends neutral, which GitHub counts as passing, with a title that starts **(observe mode)**.

82 82 

83The check isn't neutral in cases such as these:83The check can wait, fail, be withheld, or be missing in cases such as these:

84 84 

85| Case | What the check does |85| Case | What the check does |

86| :- | :- |86| :- | :- |

87| The pull request changes a policy or classifier file | It can wait for one person, who can be the author. It fails if the change breaks one of those files |87| The pull request changes a policy or classifier file | It can wait for one person, who can be the author. It fails if the change breaks one of those files |

88| The default branch's policy file can't be used | It fails until you [fix the policy file](https://code.claude.com/docs/en/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses) |88| The default branch's policy file can't be used | It fails until you [fix the policy file](https://code.claude.com/docs/en/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses) |

89| The title says Withheld | Approvals holds back a passing check, for example because another open pull request has the same latest commit. The check's summary says what clears it |89| The title says Withheld | Approvals holds back a passing check, for example because another open pull request has the same latest commit. Read the check's summary for what clears it |

90| The pull request targets another branch than the default | No check appears, unless the pull request changes a policy or classifier file |90| The pull request targets another branch than the default | No check appears, unless the pull request changes a policy or classifier file |

91 91 

92## Comment commands for Approvals92## Comment commands for Approvals


105 105 

106## Pull requests from Claude, forks, and outside contributors106## Pull requests from Claude, forks, and outside contributors

107 107 

108A pull request that `claude[bot]` opened needs a second GitHub App before Claude can approve it. A pull request from a fork, or from a person without write access, can need a maintainer.108Before Claude can approve a pull request that `claude[bot]` opened, you need a second GitHub App. A pull request from a fork, or from a person without write access, can need a maintainer.

109 109 

110### Pull requests that Claude opens110### Pull requests that Claude opens

111 111 

112GitHub doesn't let the account that opened a pull request approve it. Without a second app, Claude gives no approval on a pull request that `claude[bot]` opened, and the **Claude Approvals** check can pass with the title **Passed; no approval from Claude**.112Until you add a second GitHub App, the **Claude Approvals** check on a pull request that `claude[bot]` opened can pass with the title **Passed; no approval from Claude**.

113 113 

114To get Claude's approval on those pull requests, add a second app:114To get Claude's approval on those pull requests, add a second app:

115 115 

1161. **Install it**: ask an owner of your GitHub organization to install the [Claude Approvals GitHub App](https://github.com/apps/claude-approvals/installations/new) on the repository.1161. **Install it**: ask an owner of your GitHub organization to install the [Claude Approvals GitHub App](https://github.com/apps/claude-approvals/installations/new) on the repository.

1172. **Link it**: [link the app to your Claude organization](https://claude.ai/settings/claude-approvals/github/finish). That takes someone who is an owner of the GitHub organization and an Owner or Primary Owner of the Claude organization. If nobody is both, contact [Anthropic support](https://support.claude.com).1172. **Link it**: ask someone who is an owner of the GitHub organization and an Owner or Primary Owner of the Claude organization to [link the app to your Claude organization](https://claude.ai/settings/claude-approvals/github/finish). If they can't link it, contact [Anthropic support](https://support.claude.com).

118 118 

119Then [rerun the check](#comment-commands-for-approvals) on an open pull request that `claude[bot]` opened. Leave the required check's source as it is, because the [Claude GitHub App](https://github.com/apps/claude) still reports the check.119Then [rerun the check](#comment-commands-for-approvals) on an open pull request that `claude[bot]` opened. Leave the required check's source as it is, because the [Claude GitHub App](https://github.com/apps/claude) still reports the check.

120 120 

121### Pull requests from forks and outside contributors121### Pull requests from forks and outside contributors

122 122 

123Approvals can't confirm that someone with write access pushed a fork's commits. On a fork's pull request, Approvals can wait for a maintainer, meaning someone with write access:123On a fork's pull request, Approvals can wait for a maintainer, meaning someone with write access:

124 124 

125* **Until a maintainer vouches for a commit**: no classifier's answer counts, Code Review's included. Where a rule depends on one, the **Claude Approvals** check's title can read **No classifier result counts on this commit**.125* **Until a maintainer vouches for a commit**: no classifier's answer counts, Code Review's included. Where a rule depends on one, the **Claude Approvals** check's title can read **No classifier result counts on this commit**.

126* **To vouch for a commit**: outside observe mode, if you have write access, read the change. Then comment `@claude approvals rerun` followed by the latest commit's full SHA, as the comment's only text. Classifiers can then run for that commit. With no SHA, the command can cover the commit that was latest when you commented.126* **To vouch for a commit**: outside observe mode, if you have write access, read the change. Then comment `@claude approvals rerun` followed by the latest commit's full SHA, as the comment's only text. Classifiers can then run for that commit. With no SHA, the command can cover the commit that was latest when you commented.

approvals-setup.md +15 −15

Details

16* The [Claude GitHub App](https://github.com/apps/claude), installed on the repository and [linked to your Claude organization](https://code.claude.com/docs/en/admin-setup.md#connected-github-accounts)16* The [Claude GitHub App](https://github.com/apps/claude), installed on the repository and [linked to your Claude organization](https://code.claude.com/docs/en/admin-setup.md#connected-github-accounts)

17* Permission to merge into the default branch17* Permission to merge into the default branch

18* Admin access to the repository on GitHub, to require the **Claude Approvals** check. A private repository also needs a [paid GitHub plan](https://docs.github.com/en/get-started/learning-about-github/githubs-plans)18* Admin access to the repository on GitHub, to require the **Claude Approvals** check. A private repository also needs a [paid GitHub plan](https://docs.github.com/en/get-started/learning-about-github/githubs-plans)

19* Two people with write access, before you enforce either policy on this page. With only one, the check can't pass on a change under `.claude/`, or where Claude's review fails or gives no result. Under the policy that [keeps two people on each change](#keep-two-people-on-each-change), it can't pass on any change19* Two people with write access, before you enforce either policy on this page. Both policies require two people on a change under `.claude/`, which includes the policy file

20 20 

21## Plan your first policy21## Plan your first policy

22 22 

23A [policy file](https://code.claude.com/docs/en/approvals-policy.md) tells Approvals who has to approve a pull request. For your first one, decide whether Claude can approve, then copy the starter policy that matches:23In a [policy file](https://code.claude.com/docs/en/approvals-policy.md), you set who has to approve a pull request. For your first one, decide whether Claude can approve, then copy the starter policy that matches:

24 24 

25* **[Let Claude approve when Code Review passes](#let-claude-approve-when-code-review-passes)**: a pull request that passes Claude's review usually needs no approval from another person25* **[Let Claude approve when Code Review passes](#let-claude-approve-when-code-review-passes)**: a pull request that passes Claude's review usually needs only its author

26* **[Keep two people on each change](#keep-two-people-on-each-change)**: a pull request usually needs one person besides the author, and Claude doesn't approve26* **[Keep two people on each change](#keep-two-people-on-each-change)**: a pull request usually needs one person besides the author, and Claude only comments

27 27 

28Both policies start in observe mode, where the **Claude Approvals** check shows what the policy would decide, Claude doesn't approve, and the check [normally counts as passing](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode).28Both policies start in observe mode, where the **Claude Approvals** check shows what the policy would decide and [normally counts as passing](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode).

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 a rule that matches the files you want reviewed, so that [automatic Code Reviews continue](https://code.claude.com/docs/en/approvals.md#keep-automatic-code-reviews) in observe mode and once you enforce.

31 31 

32> [!TIP]32> [!TIP]

33>33>


35 35 

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

37 37 

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).38Once you enforce this starter policy, a pull request that passes Claude's review usually needs only its author, 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).

39 39 

40In this policy, the first rule asks for two people on a change. Its `override` lowers that to one and lets Claude approve when `claude/code_review` reads `pass`. The second rule asks for two people on a change under `.claude/`:40In this policy, the first rule asks for two people on a change. Its `override` lowers that to one and lets Claude approve when `claude/code_review` reads `pass`. The second rule asks for two people on a change under `.claude/`:

41 41 


59 59 

60### Keep two people on each change60### Keep two people on each change

61 61 

62This starter policy asks for two people on each change. Once the policy is enforced, a pull request usually needs one person besides the author, and Claude doesn't approve.62Use this starter policy to ask for two people on each change. Once you enforce it, a pull request usually needs one person besides the author, and Claude only comments.

63 63 

64In this policy, both rules ask for two people. The first rule lists `claude/code_review` under [`advisory`](https://code.claude.com/docs/en/approvals-policy#advisory), so reviews follow your Code Review settings:64In this policy, both rules ask for two people. The first rule lists `claude/code_review` under [`advisory`](https://code.claude.com/docs/en/approvals-policy#advisory), so reviews follow your Code Review settings:

65 65 


104 104 

105Before you [switch your policy from observe mode to enforcement](#switch-from-observe-mode-to-enforcement), decide which files need a person, which branches the check gates, and when to change GitHub's required approvals:105Before you [switch your policy from observe mode to enforcement](#switch-from-observe-mode-to-enforcement), decide which files need a person, which branches the check gates, and when to change GitHub's required approvals:

106 106 

107* **Files**: decide which ones need a person's approval whatever Claude finds, then copy [this rule](https://code.claude.com/docs/en/approvals-github-rules.md#ask-for-a-person-who-isn’t-an-author) and narrow its `paths`107* **Files**: decide which ones need a person's approval whatever Claude finds, then copy [this rule](https://code.claude.com/docs/en/approvals-github-rules.md#ask-for-a-person-who-isn’t-an-author) and narrow its `paths` list

108* **Branches**: an enforced policy also covers pull requests into branches other than the default branch, so list each branch whose merges the **Claude Approvals** check should gate. On those branches, a pull request with no covered file gets no check, so a required check waits108* **Branches**: an enforced policy also covers pull requests into branches other than the default branch, so list each branch whose merges the **Claude Approvals** check should gate. On those branches, a pull request with no covered file gets no check, so a required check waits

109* **GitHub's required approvals**: [change the number of approvals that GitHub requires](https://code.claude.com/docs/en/approvals-github-rules.md#required-reviews-and-codeowners) only after the last step of the switch109* **GitHub's required approvals**: [change the number of approvals that GitHub requires](https://code.claude.com/docs/en/approvals-github-rules.md#required-reviews-and-codeowners) only after the last step of the switch

110 110 

111### Switch from observe mode to enforcement111### Switch from observe mode to enforcement

112 112 

113A policy file's [`mode`](https://code.claude.com/docs/en/approvals-policy#top-level-keys) is one of these:113A policy file's [`mode`](https://code.claude.com/docs/en/approvals-policy#top-level-keys) key is one of these:

114 114 

115* **`observe`**: the **Claude Approvals** check shows what the policy would decide, Claude doesn't approve, and the check [normally counts as passing](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode)115* **`observe`**: the **Claude Approvals** check shows what the policy would decide, Claude doesn't approve, and the check [normally counts as passing](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode)

116* **`enforce`**: the check can block a merge, and Claude can approve where the policy allows it. This is the default, so a policy file with no `mode` line is enforced116* **`enforce`**: the check can block a merge, and Claude can approve where the policy allows it. This is the default, so a policy file with no `mode` line is enforced


137 137 

138### Set the source that GitHub accepts for Claude Approvals138### Set the source that GitHub accepts for Claude Approvals

139 139 

140Set the required check's source to the Claude app. With **any source**, GitHub accepts a check named **Claude Approvals** from elsewhere. To set the source through GitHub's API, put the Claude app's ID, `1236702`, in `integration_id` in a ruleset or `app_id` in a branch protection rule.140Set the required check's source to the Claude app. If you allow **any source**, GitHub accepts a check named **Claude Approvals** from elsewhere. To set the source through GitHub's API, put the Claude app's ID, `1236702`, in `integration_id` in a ruleset or `app_id` in a branch protection rule.

141 141 

142## Control what Approvals spends142## Control what Approvals spends

143 143 


147 147 

148A policy with `claude/code_review` in an `if` condition can start a [billed Code Review](https://code.claude.com/docs/en/code-review-costs.md) when a pull request opens and at each push. To stop those reviews, move it from the conditions to `advisory`. When `claude/code_review` is only under `advisory`, with no [`level`](https://code.claude.com/docs/en/approvals-classifiers#read-a-classifier’s-answer-from-a-rule), reviews follow your Code Review settings.148A policy with `claude/code_review` in an `if` condition can start a [billed Code Review](https://code.claude.com/docs/en/code-review-costs.md) when a pull request opens and at each push. To stop those reviews, move it from the conditions to `advisory`. When `claude/code_review` is only under `advisory`, with no [`level`](https://code.claude.com/docs/en/approvals-classifiers#read-a-classifier’s-answer-from-a-rule), reviews follow your Code Review settings.

149 149 

150A rule can also read other [classifiers](https://code.claude.com/docs/en/approvals-classifiers.md). For `claude/diff` and custom classifiers, each [run that calls a model](https://code.claude.com/docs/en/approvals-classifiers.md#what-a-classifier-run-costs) is billed. To limit each run of a custom classifier, set its [`budget`](https://code.claude.com/docs/en/approvals-classifiers#budget).150A rule can also read other [classifiers](https://code.claude.com/docs/en/approvals-classifiers.md). For `claude/diff` and custom classifiers, each [run that calls a model](https://code.claude.com/docs/en/approvals-classifiers.md#what-a-classifier-run-costs) is billed. To limit each run of a custom classifier, set its [`budget`](https://code.claude.com/docs/en/approvals-classifiers#budget) key.

151 151 

152### Limit what a policy costs152### Limit what a policy costs

153 153 


172 172 

173> [!WARNING]173> [!WARNING]

174>174>

175> Suspend or uninstall the Claude GitHub App, or unlink your GitHub organization, only after you turn off Approvals. If you do it first, new commits get no check, so a required check can block merges. GitHub can also continue to count Claude's approving reviews that are left on open pull requests.175> Suspend or uninstall the Claude GitHub App, or unlink your GitHub organization, only after you turn off Approvals. If you take any of those steps first, a required **Claude Approvals** check can block merges. GitHub can also continue to count Claude's approving reviews that are left on open pull requests.

176 176 

177Follow this order:177Follow this order:

178 178 


1813. **Turn Approvals off**: [choose how](#ways-to-turn-off-approvals), by the scope that you want.1813. **Turn Approvals off**: [choose how](#ways-to-turn-off-approvals), by the scope that you want.

1824. **Dismiss Claude's reviews**: on open pull requests that Claude approved, dismiss that review in GitHub.1824. **Dismiss Claude's reviews**: on open pull requests that Claude approved, dismiss that review in GitHub.

183 183 

184To stop the check from blocking without turning Approvals off, first stop requiring it on branches other than the default branch. Then put `mode: observe` in every policy file. The check then normally stops blocking, and classifiers still run and bill. Pull requests into those other branches get no check unless they change a policy or classifier file.184To keep Approvals on and stop the check from blocking, first stop requiring it on branches other than the default branch. Then put `mode: observe` in every policy file. The check then [normally stops blocking](https://code.claude.com/docs/en/approvals-pull-requests.md#approvals-in-observe-mode), and classifiers still run and bill.

185 185 

186### Ways to turn off Approvals186### Ways to turn off Approvals

187 187 


193| A GitHub organization, or a repository whose **Edit** dialog shows **Claude Approvals** | With an [Owner role](https://code.claude.com/docs/en/server-managed-settings.md#access-control), go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship), click **Edit** on its row, and turn off **Claude Approvals** |193| A GitHub organization, or a repository whose **Edit** dialog shows **Claude Approvals** | With an [Owner role](https://code.claude.com/docs/en/server-managed-settings.md#access-control), go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship), click **Edit** on its row, and turn off **Claude Approvals** |

194| The whole Claude organization | With an Owner role, go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship) and click **Block globally** in the **Approve** row. To turn it back on, click **Allow policy files** in the same row |194| The whole Claude organization | With an Owner role, go to [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship) and click **Block globally** in the **Approve** row. To turn it back on, click **Allow policy files** in the same row |

195 195 

196What you turn off for the whole Claude organization stays off when a policy file merges later. If you're turning off Code Review too, turn off Approvals first, because a policy can start billed reviews where Code Review is off.196After you turn off Approvals for the whole Claude organization, it stays off when a policy file merges later. If you're turning off Code Review too, turn off Approvals first, because a policy can start billed reviews where Code Review is off.

197 197 

198## Related resources198## Related resources

199 199 

Details

84| "no key of this name is read at this place" | Check the key's spelling and its level against [Top-level keys](https://code.claude.com/docs/en/approvals-policy.md#top-level-keys) and [Rule keys](https://code.claude.com/docs/en/approvals-policy.md#rule-keys) |84| "no key of this name is read at this place" | Check the key's spelling and its level against [Top-level keys](https://code.claude.com/docs/en/approvals-policy.md#top-level-keys) and [Rule keys](https://code.claude.com/docs/en/approvals-policy.md#rule-keys) |

85| "this names no fact and no usable classifier" | Check the name against the [facts](https://code.claude.com/docs/en/approvals-policy.md#if). For `repo/<name>`, check that `.claude/classifiers/<name>/def.yml` loads, beside the policy file or in a directory above it |85| "this names no fact and no usable classifier" | Check the name against the [facts](https://code.claude.com/docs/en/approvals-policy.md#if). For `repo/<name>`, check that `.claude/classifiers/<name>/def.yml` loads, beside the policy file or in a directory above it |

86| "a condition has no NOT" | Write the opposite operator |86| "a condition has no NOT" | Write the opposite operator |

87| "a login goes in single quotes inside a condition" | If the word is a login, put it in single quotes, as in `"pr/opened_by = 'ana-acme'"`. For a bot, write `bot:` and its name with no quotes, as in `"pr/opened_by = bot:dependabot"` |

87| "no local has this name" | Define the local in this file or a policy file above it. Write a login or a team with no `@` |88| "no local has this name" | Define the local in this file or a policy file above it. Write a login or a team with no `@` |

88| "this is not YAML" | Look near the line that the message names for a quote or bracket that doesn't close, or a tab. Indent with spaces |89| "this is not YAML" | Look near the line that the message names for a quote or bracket that doesn't close, or a tab. Indent with spaces |

89 90 

90## A classifier gave no answer or its definition is refused91## A classifier gave no answer or its definition is refused

91 92 

92To see each [classifier](https://code.claude.com/docs/en/approvals-classifiers.md) run's state and the reason for a missing answer, open **Classifier results** in Claude's comment on the pull request. If a run reached its budget, split the pull request, or raise a `time` or `cost` that is under its [maximum](https://code.claude.com/docs/en/approvals-classifiers.md#budget).93To see each [classifier](https://code.claude.com/docs/en/approvals-classifiers.md) run's state and the reason for a missing answer, open **Classifier results** in Claude's comment on the pull request:

94 

95* **A run reached its budget**: split the pull request, or raise a `time` or `cost` that is under its [maximum](https://code.claude.com/docs/en/approvals-classifiers.md#budget)

96* **A run had more to read than one run can handle**, for example a large diff: try a smaller pull request

93 97 

94Then find the **Claude Approvals** check's title here:98Then find the **Claude Approvals** check's title here:

95 99 

artifacts.md +16 −16

Details

43Build a dashboard artifact of last week's deploy failures by service and keep it updated as you investigate.43Build a dashboard artifact of last week's deploy failures by service and keep it updated as you investigate.

44```44```

45 45 

46Unless you name a location, Claude writes the page to an HTML or Markdown file in a temporary directory outside your project, then publishes it. The artifact stays private to you until you [share it](#share-an-artifact).46The artifact stays private to you until you [share it](#share-an-artifact).

47 47 

48After the first publish, Claude prints the URL, and your browser opens to the new page.48After the first publish, Claude prints the URL, and your browser opens to the new page.

49 49 


58 58 

59### When Claude Code asks before publishing59### When Claude Code asks before publishing

60 60 

61A new artifact that Claude publishes in response to a prompt you type goes through without a permission prompt or classifier review. In these cases Claude Code asks you first, or in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) has the classifier review the publish:61A new artifact that Claude publishes in response to a prompt you type can go through without a permission prompt or classifier review.

62 

63Outside `bypassPermissions` mode, the publish needs your approval in cases such as these, or the classifier's review in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode):

62 64 

63| When | What Claude Code does |65| When | What Claude Code does |

64| :- | :- |66| :- | :- |


66| The publish declares runtime capabilities for the page, such as [connector calls](#pull-live-data-with-mcp-connectors) or [file downloads](#offer-a-file-download) | Asks before that publish |68| The publish declares runtime capabilities for the page, such as [connector calls](#pull-live-data-with-mcp-connectors) or [file downloads](#offer-a-file-download) | Asks before that publish |

67| You shared the artifact publicly | Asks at least once per conversation before changing it, and before each reply to a comment on it |69| You shared the artifact publicly | Asks at least once per conversation before changing it, and before each reply to a comment on it |

68| Claude publishes in a turn that a [session-scoped scheduled task](https://code.claude.com/docs/en/scheduled-tasks.md) firing in your session started, rather than a prompt you typed | Asks before the first publish of each artifact |70| Claude publishes in a turn that a [session-scoped scheduled task](https://code.claude.com/docs/en/scheduled-tasks.md) firing in your session started, rather than a prompt you typed | Asks before the first publish of each artifact |

69| Claude can't read the file without your approval | Asks before publishing it. An allow rule for the `Artifact` tool doesn't skip this prompt |71| Claude publishes from a file it can't read without your approval | Asks before publishing, or refuses the file. An allow rule for the `Artifact` tool doesn't count as approval |

70| In [Manual](https://code.claude.com/docs/en/permission-modes.md) or `acceptEdits` mode, Claude makes a small change to an artifact's file it can't edit without your approval, such as a project file in Manual mode | Asks before publishing the change. You're asked even if an allow rule covers the `Artifact` tool, because the edit to the file needs your approval |72| In [Manual](https://code.claude.com/docs/en/permission-modes.md) or `acceptEdits` mode, Claude makes a small change to an artifact's file it can't edit without your approval, such as a project file in Manual mode | Asks before publishing the change. You're asked even if an allow rule covers the `Artifact` tool, because the edit to the file needs your approval |

71 73 

72To let Claude read a file outside your [working directories](https://code.claude.com/docs/en/permissions.md#working-directories) without your approval, add its folder as a working directory with [`--add-dir`](https://code.claude.com/docs/en/cli-reference#cli-flags) at launch or `/add-dir` during the session. Claude already reads files in those directories, and in the temporary directory it writes pages to, without asking.74To let Claude read a file outside your [working directories](https://code.claude.com/docs/en/permissions.md#working-directories) without your approval, add its folder as a working directory with [`--add-dir`](https://code.claude.com/docs/en/cli-reference#cli-flags) at launch or `/add-dir` during the session.

73 75 

74If a publish prompt includes a sentence such as `Also makes 1 edit to that file on disk.`, Claude is changing the artifact's file and publishing it in one step. When you approve the prompt, Claude Code publishes the page, then writes the change to your file.76If a publish prompt includes a sentence such as `Also makes 1 edit to that file on disk.`, Claude is changing the artifact's file and publishing it in one step. When you approve the prompt, Claude Code publishes the page, then writes the change to your file.

75 77 

76## Update an artifact78## Update an artifact

77 79 

78Ask Claude to revise the page, or let a long-running task republish as it makes progress. Claude edits the underlying file and publishes again to the same URL.80Ask Claude to revise the page, or let a long-running task republish as it makes progress. Claude publishes again to the same URL.

79 81 

80```text wrap theme={null}82```text wrap theme={null}

81Add a per-region breakdown below the summary chart and republish.83Add a per-region breakdown below the summary chart and republish.


150 152 

151When someone shares an artifact with you, you can have Claude read it: give Claude its URL, or attach it from [`/artifacts`](#find-an-artifact-again).153When someone shares an artifact with you, you can have Claude read it: give Claude its URL, or attach it from [`/artifacts`](#find-an-artifact-again).

152 154 

153Claude reads a page someone else wrote the way it reads a web page with [WebFetch](https://code.claude.com/docs/en/tools-reference.md#webfetch-tool-behavior): it gets a summary of what it asked about rather than the raw page, and the summary reports instructions written into the page instead of relaying them. Claude Code also saves the page's full source to a local file, which Claude can open when it needs the exact content, such as to republish the artifact as an [editor](#let-someone-edit-with-you).155Claude Code can save the page's full source to a local file, which Claude can open.

154 156 

155Claude Code asks for your approval before Claude reads the artifact in these cases, in addition to any prompt your permission mode or rules call for:157Claude Code can ask for your approval before the [Artifact tool](https://code.claude.com/docs/en/tools-reference.md) reads an artifact in these cases, in addition to any prompt your permission mode or rules call for:

156 158 

157* **Cloud session without network access**: for a [cloud environment](https://code.claude.com/docs/en/cloud-environments.md#access-levels), that's the **None** level. In [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), the classifier can approve instead; in a [Cowork](https://claude.com/product/cowork) session, the approval is yours alone.159* **Cloud session without network access**: for a [cloud environment](https://code.claude.com/docs/en/cloud-environments.md#access-levels), that's the **None** level. In [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), the classifier can approve instead; in a [Cowork](https://claude.com/product/cowork) session, the approval is yours alone.

158* **Another organization's public artifact**: Claude Code asks you first, even in auto mode. Where Claude Code can't ask you, such as in `bypassPermissions` mode, Claude can't read the artifact. Claude can read these artifacts only while [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) is on.160* **Another organization's public artifact**: the tool asks you first, even in auto mode. Where Claude Code can't ask you, such as in `bypassPermissions` mode, the tool can't read one you haven't approved in this conversation. The tool can read these artifacts only while [feature-flag fetching](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) is on.

159* **Unconfirmed owner or network setting**: when Claude Code can't confirm who made the artifact, or can't confirm a cloud session's network setting, it asks, and your approval covers that one request. In [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), the classifier can approve or block the read instead of asking you.161* **Unconfirmed owner or network setting**: when Claude Code can't confirm who made the artifact, or can't confirm a cloud session's network setting, it asks, and your approval covers that one request. In [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), the classifier can approve or block the read instead of asking you.

160* **Plan mode**: in [plan mode](https://code.claude.com/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode), Claude Code asks before the Artifact tool reads an artifact someone else in your organization made.162* **Plan mode**: in [plan mode](https://code.claude.com/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode), Claude Code asks before the Artifact tool reads an artifact someone else in your organization made.

161 163 


165 167 

166When you share an artifact within your organization, the people you share it with can leave comments on the page, and you can have Claude read those comments and reply to them. You need Claude Code v2.1.221 or later. Claude reads the comments in two cases:168When you share an artifact within your organization, the people you share it with can leave comments on the page, and you can have Claude read those comments and reply to them. You need Claude Code v2.1.221 or later. Claude reads the comments in two cases:

167 169 

168* **You ask Claude to read them**: give Claude the artifact's URL and ask for the comments. Claude lists each thread and marks the comments someone who can edit the artifact sent to it.170* **You ask Claude to read them**: give Claude the artifact's URL and ask for the comments.

169* **Someone who can edit the artifact sends a comment to Claude**: in a thread on the page, they send a comment with **Send to Claude**, or mention `@claude` in one. Either way, they activate the thread.171* **Someone who can edit the artifact sends a comment to Claude**: in a thread on the page, they send a comment with **Send to Claude**, or mention `@claude` in one. Either way, they activate the thread.

170 172 

171Claude can reply to or resolve only an activated thread. Other threads stay open until a person resolves them on the page. Viewers see each reply attributed to Claude, via you.173Claude can reply to or resolve only an activated thread. Other threads stay open until a person resolves them on the page. Viewers see each reply attributed to Claude, via you.


188 190 

189Your [permission mode](https://code.claude.com/docs/en/permission-modes.md) decides what Claude does when a sent comment arrives:191Your [permission mode](https://code.claude.com/docs/en/permission-modes.md) decides what Claude does when a sent comment arrives:

190 192 

191* **Claude replies on its own**: if you're in a permission mode that lets Claude post the reply without asking you, Claude reads the thread and replies. You see `Auto-replied to comment thread on Artifact: <name>`.193* **Claude replies on its own**: if you're in a permission mode that lets Claude post the reply without asking you, Claude reads the thread and replies. You see a notice such as `Auto-replied to comment thread on Artifact: <name>`.

192* **Claude waits for you**: outside plan mode, when posting the reply [would need your approval](#when-claude-code-asks-before-publishing), you see `Comments are waiting on Artifact: <name>`. Claude then asks you for approval to read the thread, and again to post the reply.194* **Claude waits for you**: outside plan mode, when posting the reply [would need your approval](#when-claude-code-asks-before-publishing), you see `Comments are waiting on Artifact: <name>`. Claude then asks you for approval to read the thread, and again to post the reply.

193* **Claude pauses in plan mode**: you see `Comments are waiting on Artifact: <name>`, and Claude doesn't reply until you leave plan mode and ask it to read and reply.195* **Claude pauses in plan mode**: you see `Comments are waiting on Artifact: <name>`, and Claude doesn't reply until you leave plan mode and ask it to read and reply.

194 196 


202* **Stop the task in `/tasks`**: Claude stops replying on that artifact until you ask it to resume replies there. Publishing the artifact again doesn't start replies again, and the stop still applies when you resume the session later.204* **Stop the task in `/tasks`**: Claude stops replying on that artifact until you ask it to resume replies there. Publishing the artifact again doesn't start replies again, and the stop still applies when you resume the session later.

203* **Press `Ctrl+X Ctrl+K` twice within 3 seconds**: the chord that [stops every running background subagent](https://code.claude.com/docs/en/interactive-mode.md#general-controls) also stops Claude from replying on every artifact for the rest of the session. Asking Claude to resume replies doesn't undo this stop.205* **Press `Ctrl+X Ctrl+K` twice within 3 seconds**: the chord that [stops every running background subagent](https://code.claude.com/docs/en/interactive-mode.md#general-controls) also stops Claude from replying on every artifact for the rest of the session. Asking Claude to resume replies doesn't undo this stop.

204 206 

205A watch that Claude Code started on its own can end after the artifact goes several hours without activity. You see `Stopped watching Artifact: <name> (idle)`. To start the watch again, publish the artifact again or ask Claude to watch it. If you see `(made room for a newer watch)` in place of `(idle)`, your session reached its limit of 25 watches. Publish again to restart that watch.207If you see `Stopped watching Artifact: <name>` followed by `(idle)`, `(connection lost)`, or `(made room for a newer watch)`, ask Claude to republish the artifact to restart the watch. A watch that Claude Code started on its own can end after several hours without activity.

206 

207If the service that delivers comments becomes unavailable or stops answering, Claude Code keeps trying to reconnect for a while, then stops watching each artifact your session was watching.

208 208 

209## Pull live data with MCP connectors209## Pull live data with MCP connectors

210 210 


328To use a template from Claude Code, you need:328To use a template from Claude Code, you need:

329 329 

330* A session where [artifacts are available](#availability)330* A session where [artifacts are available](#availability)

331* On Team and Enterprise plans, the template turned on for your organization. If it's off, ask an Owner to [turn the template on](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_6e06d8f1a8) under **Organization settings > Artifacts** on claude.ai.331* On Team and Enterprise plans, the template turned on for your organization. If it's off, ask an Owner to [turn the template on](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_6e06d8f1a8) under [**Organization settings > Artifacts**](https://claude.ai/admin-settings/artifacts) on claude.ai.

332* On Enterprise plans with custom roles, a role that [includes the template](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_d830917488)332* On Enterprise plans with custom roles, a role that [includes the template](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_d830917488)

333* For the Docs and Sheets templates, the [Claude Docs connector](#write-a-document-with-claude-docs), which Claude uses to write the content of both. If you [turned the connector off](https://code.claude.com/docs/en/mcp.md#disable-claude-ai-connectors), turn it back on first.333* For the Docs and Sheets templates, the [Claude Docs connector](#write-a-document-with-claude-docs), which Claude uses to write the content of both. If you [turned the connector off](https://code.claude.com/docs/en/mcp.md#disable-claude-ai-connectors), turn it back on first.

334* Claude Code v2.1.265 or later, if you start the Design template with its [`/design` command](#draft-a-design-canvas)334* Claude Code v2.1.265 or later, if you start the Design template with its [`/design` command](#draft-a-design-canvas)


355 355 

356## Page constraints356## Page constraints

357 357 

358Each artifact is one self-contained page. Claude Code wraps the file you publish in an HTML document shell and serves it under a strict Content Security Policy (CSP), which shapes what the page can do.358Each artifact is served under a strict Content Security Policy (CSP) that limits what the page can do.

359 359 

360| Constraint | Effect |360| Constraint | Effect |

361| :- | :- |361| :- | :- |


386 386 

387Whether artifacts are allowed for your organization comes from your organization's policy, which Claude Code loads from `api.anthropic.com`. When Claude Code can't load the policy, artifacts are unavailable. When you ask for one, Claude says why.387Whether artifacts are allowed for your organization comes from your organization's policy, which Claude Code loads from `api.anthropic.com`. When Claude Code can't load the policy, artifacts are unavailable. When you ask for one, Claude says why.

388 388 

389If a proxy, VPN, or web filter is involved, ask your IT admin to let `api.anthropic.com` through. Claude Code keeps retrying in the background, and artifacts become available once the policy loads and allows them.389If a proxy, VPN, or web filter is involved, ask whoever runs it to let `api.anthropic.com` through. Claude Code keeps retrying in the background, and artifacts become available once the policy loads and allows them.

390 390 

391## Disable artifacts391## Disable artifacts

392 392 

Details

25 25 

26* **Claude Pro, Max, or Ultra subscription**: log in with your claude.ai account. Subscribe at [claude.com/pricing](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=authentication_pro_max).26* **Claude Pro, Max, or Ultra subscription**: log in with your claude.ai account. Subscribe at [claude.com/pricing](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=authentication_pro_max).

27* **Claude for Teams or Enterprise**: log in with the claude.ai account your team admin invited you to.27* **Claude for Teams or Enterprise**: log in with the claude.ai account your team admin invited you to.

28* **Claude Console**: log in with your Console credentials. Your admin must have [invited you](#claude-console-authentication) first. You can sign in with or without [creating an API key](#sign-in-without-an-api-key).28* **Claude Console**: log in with your [Console credentials](#claude-console-authentication). You can sign in with or without [creating an API key](#sign-in-without-an-api-key).

29* **Cloud providers**: if your organization uses [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), set the required environment variables before running `claude`. You can also select **3rd-party platform** at the login prompt, which launches an interactive setup wizard for Bedrock and Agent Platform.29* **Cloud providers**: if you use [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), set the required environment variables before running `claude`. You can also select **3rd-party platform** at the login prompt, which launches an interactive setup wizard for Bedrock and Agent Platform.

30* **Cloud gateway**: if your organization runs a self-hosted [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), sign in with corporate SSO through `/login` or [from VS Code](https://code.claude.com/docs/en/vs-code.md#sign-in-to-a-claude-apps-gateway). The gateway-issued token is the session's only credential.30* **Cloud gateway**: if your organization runs a self-hosted [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), sign in with corporate SSO through `/login` or [from VS Code](https://code.claude.com/docs/en/vs-code.md#sign-in-to-a-claude-apps-gateway). The gateway-issued token is the session's only credential.

31* **Enterprise Admin Console**: if an Owner [turned on this sign-in](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#turn-on-sign-in-from-claude-code) for your organization's provider or gateway, run `claude auth login` in your shell and select your organization in the browser. To confirm, look for `Signed in to the organization` in the terminal. For the Claude Code version you need, see [Before you start](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#before-you-start).31* **Enterprise Admin Console**: if an Owner [turned on this sign-in](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#turn-on-sign-in-from-claude-code) for your organization's provider or gateway, run `claude auth login` in your shell and select your organization in the browser. To confirm, look for `Signed in to the organization` in the terminal. For the Claude Code version you need, see [Before you start](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#before-you-start).

32 32 

Details

40 40 

41Every instruction you give Claude Code is one of these:41Every instruction you give Claude Code is one of these:

42 42 

431. Non-deterministic: you write the instruction, and Claude (the model) reads it. This can be your prompt, `CLAUDE.md`, or a skill. The model then decides what to do with this information. It usually follows your commands, and current models are good at understanding your intent without much context, but there's no *guarantee* that it'll follow your instructions. It can still decide not to do things, or do other things.431. Non-deterministic: you write the instruction, and Claude (the model) reads it. This can be your prompt, `CLAUDE.md`, or a skill. The model then decides what to do with this information. It usually follows your commands, and current models are good at understanding your intent without much context, but there's no *guarantee* that it'll follow your instructions.

442. Deterministic: you configure the instruction, and Claude Code (the harness) *has* to execute this. This can be a hook, a deny rule, or a managed setting. Claude Code applies this every time, no matter what the model decided to do.442. Deterministic: you configure the instruction, and Claude Code (the harness) *has* to execute this. This can be a hook, a deny rule, or a managed setting. Claude Code applies this every time, no matter what the model decided to do.

45 45 

46Most things in Claude Code come in both forms:46Most things in Claude Code come in both forms:


596You rarely have to clean any of this up yourself:596You rarely have to clean any of this up yourself:

597 597 

598* When you exit an unnamed worktree session, Claude Code [removes a worktree it created with git](https://code.claude.com/docs/en/worktrees.md#clean-up-worktrees) if there's nothing in it. For a named session, or one with changes, it asks what to do.598* When you exit an unnamed worktree session, Claude Code [removes a worktree it created with git](https://code.claude.com/docs/en/worktrees.md#clean-up-worktrees) if there's nothing in it. For a named session, or one with changes, it asks what to do.

599* Subagent worktrees disappear when the subagent finishes without changes.599* Subagent and background-session worktrees that get left behind [can be removed automatically](https://code.claude.com/docs/en/worktrees.md#clean-up-subagent-and-background-session-worktrees) once they're older than `cleanupPeriodDays` and hold no work.

600* Subagent and background-session worktrees that do get left behind are swept once they're older than `cleanupPeriodDays` and hold no work.

601 600 

602> [!NOTE]601> [!NOTE]

603>602>

champion-kit.md +1 −1

Details

130 130 

131### Thirty-day playbook131### Thirty-day playbook

132 132 

133If a loose plan is helpful, the sequence below reflects what tends to work across most teams. Adjust freely to fit your context.133If a loose plan is helpful, the sequence below reflects what tends to work across most teams.

134 134 

135**1. Week 1: Seed the channel**135**1. Week 1: Seed the channel**

136 136 

channels.md +1 −1

Details

355| Feature | What it does | Good for |355| Feature | What it does | Good for |

356| - | - | - |356| - | - | - |

357| [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) | Run tasks in a fresh cloud sandbox, cloned from GitHub | Delegating self-contained async work you check on later |357| [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) | Run tasks in a fresh cloud sandbox, cloned from GitHub | Delegating self-contained async work you check on later |

358| [Claude in Slack](https://code.claude.com/docs/en/slack.md) | Spawns a cloud session from an `@Claude` mention in a channel or thread | Starting tasks directly from a team conversation |358| [Claude Tag](https://claude.com/docs/claude-tag/overview) | Spawns a cloud session from an `@Claude` mention in a channel or thread | Starting tasks directly from a team conversation |

359| Standard [MCP server](https://code.claude.com/docs/en/mcp.md) | Claude queries it during a task; nothing is pushed to the session | Giving Claude on-demand access to read or query a system |359| Standard [MCP server](https://code.claude.com/docs/en/mcp.md) | Claude queries it during a task; nothing is pushed to the session | Giving Claude on-demand access to read or query a system |

360| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | You drive your local session from claude.ai or the Claude mobile app | Steering an in-progress session while away from your desk |360| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | You drive your local session from claude.ai or the Claude mobile app | Steering an in-progress session while away from your desk |

361 361 

Details

17Claude Code tracks all changes made by its file editing tools:17Claude Code tracks all changes made by its file editing tools:

18 18 

19* Every prompt you send that starts a turn creates a new checkpoint19* Every prompt you send that starts a turn creates a new checkpoint

20* Claude Code keeps file snapshots for the 100 most recent checkpoints in a session. Discarding an older checkpoint deletes the snapshot files that no remaining checkpoint references, except each file's first snapshot, which the VS Code extension uses as the baseline for its session diffs.20* Claude Code keeps file snapshots for the 100 most recent checkpoints in a session. Discarding an older checkpoint deletes the snapshot files that no remaining checkpoint references, except each file's first snapshot.

21* Claude Code saves checkpoints with the conversation, so you can still run `/rewind` after you resume a session21* Claude Code saves checkpoints with the conversation, so you can still run `/rewind` after you resume a session

22* Claude Code deletes a session's file snapshots in the [retention sweep](https://code.claude.com/docs/en/claude-directory.md#cleaned-up-automatically), by default about 30 days after the session last saved one. Rewinding to a checkpoint whose snapshots are gone can fail with [`No files were restored`](https://code.claude.com/docs/en/errors#no-files-were-restored). To keep snapshots longer, set [`cleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#cleanupperioddays).22* Claude Code deletes a session's file snapshots in the [retention sweep](https://code.claude.com/docs/en/claude-directory.md#cleaned-up-automatically), by default about 30 days after the session last saved one. Rewinding to a checkpoint whose snapshots are gone can fail with [`No files were restored`](https://code.claude.com/docs/en/errors#no-files-were-restored). To keep snapshots longer, set [`cleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#cleanupperioddays).

23 23 

Details

236 236 

237* **You're signed in with an API key or Console account**: run `claude auth login` in your shell, then sign in with claude.ai237* **You're signed in with an API key or Console account**: run `claude auth login` in your shell, then sign in with claude.ai

238* **The error names your provider**: cloud sessions aren't available through third-party providers. See the [error table](#errors-when-sending-to-a-cloud-session)238* **The error names your provider**: cloud sessions aren't available through third-party providers. See the [error table](#errors-when-sending-to-a-cloud-session)

239* **You're already signed in via claude.ai**: your organization may have disabled cloud sessions239* **You sign in to claude.ai through an organization**: ask an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) whether [cloud sessions are turned on](https://code.claude.com/docs/en/errors.md#cloud-sessions-are-disabled-by-your-organizations-policy)

240 240 

241## Work with sessions241## Work with sessions

242 242 

Details

6 6 

7> Where Claude Code reads CLAUDE.md, settings.json, hooks, skills, commands, subagents, workflows, rules, and auto memory. Explore the .claude directory in your project and ~/.claude in your home directory.7> Where Claude Code reads CLAUDE.md, settings.json, hooks, skills, commands, subagents, workflows, rules, and auto memory. Explore the .claude directory in your project and ~/.claude in your home directory.

8 8 

9Claude Code reads instructions, settings, skills, subagents, and memory from your project directory and from `~/.claude` in your home directory. Commit project files to git to share them with your team; files in `~/.claude` are personal configuration that applies across all your projects.9Claude Code reads instructions, settings, skills, subagents, and memory from your project directory and from `~/.claude` in your home directory. Commit project files to git to share them; files in `~/.claude` are personal configuration that applies across all your projects.

10 10 

11On Windows, `~/.claude` resolves to `%USERPROFILE%\.claude`. If you set [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/en/env-vars), every `~/.claude` path on this page lives under that directory instead. The same applies to `.claude.json`, which otherwise sits at `~/.claude.json`.11On Windows, `~/.claude` resolves to `%USERPROFILE%\.claude`. If you set [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/en/env-vars), every `~/.claude` path on this page lives under that directory instead. The same applies to `.claude.json`, which otherwise sits at `~/.claude.json`.

12 12 


38 38 

39**`.claude/`**39**`.claude/`**

40 40 

41Project settings, rules, skills, subagents, and other configuration. If you use git, commit most of these files so your team shares them, and keep personal ones such as `settings.local.json` out of your commits.41Project settings, rules, skills, subagents, and other configuration. If you use git, commit most of these files to share them, and keep personal ones such as `settings.local.json` out of your commits.

42 42 

43**`.claude/settings.json`**43**`.claude/settings.json`**

44 44 


78 78 

79**When it loads**: Read at startup in the terminal, so restart Claude Code after you add or edit a style79**When it loads**: Read at startup in the terminal, so restart Claude Code after you add or edit a style

80 80 

81Each Markdown file defines an [output style](https://code.claude.com/docs/en/output-styles.md#how-output-styles-work), a set of instructions that adjusts how Claude works. Put a style here if your team shares it, like a review mode everyone uses. See [`~/.claude/output-styles/`](#ce-global-output-styles) for how to select one.81Each Markdown file defines an [output style](https://code.claude.com/docs/en/output-styles.md#how-output-styles-work), a set of instructions that adjusts how Claude works. To share a style, such as a review mode, with everyone on the project, commit it here. See [`~/.claude/output-styles/`](#ce-global-output-styles) for how to select one.

82 82 

83**`.claude/agents/`**83**`.claude/agents/`**

84 84 

Details

84 84 

85### Start a new project from scratch85### Start a new project from scratch

86 86 

87Starting a project from scratch means opening the **New project** dialog, naming the stream of work, and optionally giving it a goal and the repositories and files it works on. Only the name is required, so you can create the project first and fill in the rest as the work takes shape.87Starting a project from scratch means opening the **New project** dialog, naming the stream of work, and optionally giving it a goal and the repositories and files it works on.

88 88 

89**1. Open Projects**89**1. Open Projects**

90 90 


270 270 

271The thread runs in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), so Claude runs commands and edits files in that folder without asking you each time. If auto mode is unavailable or turned off in that computer's Claude Code, the thread runs without it, and any permission prompt it raises waits for your answer in the thread, as [Unblock a thread waiting on approval](#unblock-a-thread-waiting-on-approval) describes.271The thread runs in [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), so Claude runs commands and edits files in that folder without asking you each time. If auto mode is unavailable or turned off in that computer's Claude Code, the thread runs without it, and any permission prompt it raises waits for your answer in the thread, as [Unblock a thread waiting on approval](#unblock-a-thread-waiting-on-approval) describes.

272 272 

273To run the thread in another mode, start `claude remote-control` with [`--settings`](https://code.claude.com/docs/en/remote-control#start-a-remote-control-session). Then [`permissions.defaultMode`](https://code.claude.com/docs/en/permission-modes#start-in-a-different-mode), in that file or in that computer's settings, can pick another mode.273To run the thread in another mode, start `claude remote-control` with [`--settings`](https://code.claude.com/docs/en/remote-control#start-a-remote-control-session) and a file that sets [`disableAutoMode`](https://code.claude.com/docs/en/settings-reference#disableautomode) to `"disable"`. Then [`permissions.defaultMode`](https://code.claude.com/docs/en/permission-modes#start-in-a-different-mode), in that file or in that computer's settings, can pick another mode, such as `default`, `plan`, or `dontAsk`.

274 274 

275While the thread runs, a laptop icon in its header shows whether your computer is connected. Click it to see which folder the thread is using or to turn the connection off. The thread pauses while that computer is asleep, and stops if the desktop app or `claude remote-control` quits.275While the thread runs, a laptop icon in its header shows whether your computer is connected. Click it to see which folder the thread is using or to turn the connection off. The thread pauses while that computer is asleep, and stops if the desktop app or `claude remote-control` quits.

276 276 

Details

172 * **Saved CLI default**: if the environment was your saved [CLI default](#select-an-environment-from-the-cli), Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one. Otherwise, it starts them in the first environment in your list that isn't a [Remote Control bridge environment](#the-default-environment).172 * **Saved CLI default**: if the environment was your saved [CLI default](#select-an-environment-from-the-cli), Claude Code starts CLI cloud sessions in the Anthropic-hosted environment when your list has one. Otherwise, it starts them in the first environment in your list that isn't a [Remote Control bridge environment](#the-default-environment).

173 * **Configured explicitly**: anything configured with the environment explicitly, such as a [cloud scheduled task](https://code.claude.com/docs/en/routines.md#environments-and-network-access), can't start new sessions in it. Point it at another environment.173 * **Configured explicitly**: anything configured with the environment explicitly, such as a [cloud scheduled task](https://code.claude.com/docs/en/routines.md#environments-and-network-access), can't start new sessions in it. Point it at another environment.

174 174 

175When you no longer need an Anthropic-hosted environment, archive it. Neither the environment dialog nor the **Cloud environments** admin page has an option to delete an Anthropic-hosted environment. If the environment is [self-hosted](https://code.claude.com/docs/en/self-hosted-environments), an Owner can delete it from the **Cloud environments** page in admin settings. If you aren't an Owner, ask one to delete it.175When you no longer need an Anthropic-hosted environment, archive it. Neither the environment dialog nor the **Cloud environments** admin page has an option to delete an Anthropic-hosted environment. If the environment is [self-hosted](https://code.claude.com/docs/en/self-hosted-environments), an Owner can delete it from the **Cloud environments** page in admin settings.

176 176 

177### Organization-shared environments177### Organization-shared environments

178 178 

code-mode.md +8 −0

Details

126>126>

127> To resume a Code Mode session later, keep `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` set to `1` when you run `claude --continue` or `claude --resume`. With Code Mode off, Claude Code refuses to resume the session. Sessions that you started without Code Mode resume without Code Mode, even with the variable set.127> To resume a Code Mode session later, keep `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` set to `1` when you run `claude --continue` or `claude --resume`. With Code Mode off, Claude Code refuses to resume the session. Sessions that you started without Code Mode resume without Code Mode, even with the variable set.

128 128 

129### Use Code Mode in subagents

130 

131If your [subagent](https://code.claude.com/docs/en/sub-agents.md) has a `tools` list, add [`REPL`](https://code.claude.com/docs/en/tools-reference) to the list so that the subagent uses Code Mode:

132 

133```yaml theme={null}

134tools: Read, Bash, REPL

135```

136 

129### Turn off Code Mode137### Turn off Code Mode

130 138 

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.139Remove `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.

code-review.md +1 −1

Details

20 20 

21## Availability21## Availability

22 22 

23Check that your organization qualifies before you set up Code Review:23Check these requirements before setting up Code Review:

24 24 

25* **Plans**: [Team and Enterprise](https://code.claude.com/docs/en/feature-availability.md)25* **Plans**: [Team and Enterprise](https://code.claude.com/docs/en/feature-availability.md)

26* **Code hosts**: repositories hosted on GitHub, including [GitHub Enterprise Server](https://code.claude.com/docs/en/github-enterprise-server.md) and GitHub Enterprise Cloud with data residency. For data residency, have an Owner follow the [GitHub Enterprise Server admin setup](https://code.claude.com/docs/en/github-enterprise-server.md#admin-setup) and enter your enterprise's `ghe.com` hostname.26* **Code hosts**: repositories hosted on GitHub, including [GitHub Enterprise Server](https://code.claude.com/docs/en/github-enterprise-server.md) and GitHub Enterprise Cloud with data residency. For data residency, have an Owner follow the [GitHub Enterprise Server admin setup](https://code.claude.com/docs/en/github-enterprise-server.md#admin-setup) and enter your enterprise's `ghe.com` hostname.

Details

12 12 

13> [!NOTE]13> [!NOTE]

14>14>

15> To have every pull request in a repository reviewed automatically on GitHub, see [Code Review](https://code.claude.com/docs/en/code-review.md), a managed service that an Owner turns on for your organization.15> To have every pull request in a repository reviewed automatically on GitHub, see [Code Review](https://code.claude.com/docs/en/code-review.md), a managed service that an Owner of a Claude organization turns on.

16 16 

17`/review` is an alias of `/code-review`.17`/review` is an alias of `/code-review`.

18 18 

Details

117 117 

118### What developers can change118### What developers can change

119 119 

120Developers come to you to change the review level, the **Review runs** setting, or which repositories get reviews. From GitHub, without the Owner role, they can do these:120Developers ask an Owner to change the review level, the **Review runs** setting, or which repositories get reviews. From GitHub, without the Owner role, they can do these:

121 121 

122* **Request a review**: comment [`@claude review`](https://code.claude.com/docs/en/code-review-pull-requests#comment-commands) on a pull request. This needs write access to the repository, and it works on [drafts and pull requests from forks](https://code.claude.com/docs/en/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks), which automatic reviews skip.122* **Request a review**: comment [`@claude review`](https://code.claude.com/docs/en/code-review-pull-requests#comment-commands) on a pull request. This needs write access to the repository, and it works on [drafts and pull requests from forks](https://code.claude.com/docs/en/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks), which automatic reviews skip.

123* **Subscribe one pull request to a review on each push**: comment `@claude review always` on a pull request that isn't [a draft or from a fork](https://code.claude.com/docs/en/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks), such as in a repository set to Manual123* **Subscribe one pull request to a review on each push**: comment `@claude review always` on a pull request that isn't [a draft or from a fork](https://code.claude.com/docs/en/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks), such as in a repository set to Manual

commands.md +2 −2

Details

50| `/add-dir <path>` | Add a working directory for file access. Type a partial path to see matching directory suggestions; press `Tab` to accept one. Most `.claude/` configuration [isn't discovered](https://code.claude.com/docs/en/permissions.md#additional-directories-grant-file-access-not-configuration) from the added directory. You can't add most [network paths](https://code.claude.com/docs/en/errors.md#working-directory-is-a-network-path), such as `\\server\share`. After a successful add, your [`DirectoryAdded` hooks](https://code.claude.com/docs/en/hooks#directoryadded) run. If you run `/add-dir` while Claude is responding, Claude's next tool call can access the directory once you confirm the add |50| `/add-dir <path>` | Add a working directory for file access. Type a partial path to see matching directory suggestions; press `Tab` to accept one. Most `.claude/` configuration [isn't discovered](https://code.claude.com/docs/en/permissions.md#additional-directories-grant-file-access-not-configuration) from the added directory. You can't add most [network paths](https://code.claude.com/docs/en/errors.md#working-directory-is-a-network-path), such as `\\server\share`. After a successful add, your [`DirectoryAdded` hooks](https://code.claude.com/docs/en/hooks#directoryadded) run. If you run `/add-dir` while Claude is responding, Claude's next tool call can access the directory once you confirm the add |

51| `/advisor [model\|off]` | Enable or disable the [advisor tool](https://code.claude.com/docs/en/advisor.md), which consults a second model for guidance at key moments during a task. Accepts `fable`, `opus`, `sonnet`, or a full model ID. `fable` requires [Fable access](https://code.claude.com/docs/en/advisor.md#choose-an-advisor-model). Without an argument, opens a picker. In a session without an interactive terminal, or over [Remote Control](https://code.claude.com/docs/en/remote-control.md#limitations), pass the model or `off` as an argument; with no argument there, the command prints the current advisor as text. These forms require Claude Code v2.1.260 or later |51| `/advisor [model\|off]` | Enable or disable the [advisor tool](https://code.claude.com/docs/en/advisor.md), which consults a second model for guidance at key moments during a task. Accepts `fable`, `opus`, `sonnet`, or a full model ID. `fable` requires [Fable access](https://code.claude.com/docs/en/advisor.md#choose-an-advisor-model). Without an argument, opens a picker. In a session without an interactive terminal, or over [Remote Control](https://code.claude.com/docs/en/remote-control.md#limitations), pass the model or `off` as an argument; with no argument there, the command prints the current advisor as text. These forms require Claude Code v2.1.260 or later |

52| `/agents` | Print a reminder to ask Claude to create or manage [subagents](https://code.claude.com/docs/en/sub-agents.md), or to edit `.claude/agents/` or `~/.claude/agents/` directly. On v2.1.197 and earlier, opens an interactive interface for creating and managing subagent configurations |52| `/agents` | Print a reminder to ask Claude to create or manage [subagents](https://code.claude.com/docs/en/sub-agents.md), or to edit `.claude/agents/` or `~/.claude/agents/` directly. On v2.1.197 and earlier, opens an interactive interface for creating and managing subagent configurations |

53| `/artifact-capabilities` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Load the reference for the runtime capabilities a published [artifact](https://code.claude.com/docs/en/artifacts.md) can use, such as [calling your connectors](https://code.claude.com/docs/en/artifacts.md#pull-live-data-with-mcp-connectors) or [offering a file download](https://code.claude.com/docs/en/artifacts.md#offer-a-file-download), including which ones your account has. Claude normally loads it on its own before building a page that uses one. Available where [artifacts](https://code.claude.com/docs/en/artifacts.md#availability) are |53| `/artifact-capabilities` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Load the reference for the runtime capabilities a published [artifact](https://code.claude.com/docs/en/artifacts.md) can use, such as [calling your connectors](https://code.claude.com/docs/en/artifacts.md#pull-live-data-with-mcp-connectors) or [offering a file download](https://code.claude.com/docs/en/artifacts.md#offer-a-file-download), including which ones your account has. Requires [artifacts](https://code.claude.com/docs/en/artifacts.md#availability) |

54| `/artifact-diagramming` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Load diagramming guidance for Claude to follow in [artifacts](https://code.claude.com/docs/en/artifacts.md): when a diagram helps, what to draw, and how to write inline SVG that stays legible in light and dark themes. Requires Claude Code v2.1.221 or later |54| `/artifact-diagramming` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Load diagramming guidance for Claude to follow in [artifacts](https://code.claude.com/docs/en/artifacts.md): when a diagram helps, what to draw, and how to write inline SVG that stays legible in light and dark themes. Requires Claude Code v2.1.221 or later |

55| `/artifacts` | List the [artifacts](https://code.claude.com/docs/en/artifacts.md#find-an-artifact-again) you own or that are shared with you, then attach one to the session, open it in your browser, or copy its link. Available where [artifacts](https://code.claude.com/docs/en/artifacts.md#availability) are |55| `/artifacts` | List the [artifacts](https://code.claude.com/docs/en/artifacts.md#find-an-artifact-again) you own or that are shared with you, then attach one to the session, open it in your browser, or copy its link. Available where [artifacts](https://code.claude.com/docs/en/artifacts.md#availability) are |

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) |


120| `/plugin-authoring` | Load the reference Claude works from to [write a mod](https://code.claude.com/docs/en/plugins/mods/create.md#ask-claude-for-a-mod). Claude can load it on its own when you ask for a mod. This is a skill from a [built-in plugin](https://code.claude.com/docs/en/plugins/mods/overview.md#mods-built-into-claude-code), which you can turn off in `/plugin`. Requires Claude Code v2.1.287 or later |120| `/plugin-authoring` | Load the reference Claude works from to [write a mod](https://code.claude.com/docs/en/plugins/mods/create.md#ask-claude-for-a-mod). Claude can load it on its own when you ask for a mod. This is a skill from a [built-in plugin](https://code.claude.com/docs/en/plugins/mods/overview.md#mods-built-into-claude-code), which you can turn off in `/plugin`. Requires Claude Code v2.1.287 or later |

121| `/powerup` | Discover Claude Code features through quick interactive lessons with animated demos |121| `/powerup` | Discover Claude Code features through quick interactive lessons with animated demos |

122| `/pr-comments [PR]` | Removed in v2.1.91. Ask Claude directly to view pull request comments instead. On earlier versions, fetches and displays comments from a GitHub pull request; automatically detects the PR for the current branch, or pass a PR URL or number. Requires the `gh` CLI |122| `/pr-comments [PR]` | Removed in v2.1.91. Ask Claude directly to view pull request comments instead. On earlier versions, fetches and displays comments from a GitHub pull request; automatically detects the PR for the current branch, or pass a PR URL or number. Requires the `gh` CLI |

123| `/privacy-settings` | View and update your privacy settings. Only available for Pro, Max, and Ultra plan subscribers |123| `/privacy-settings` | View and update your privacy settings or get a link to them on claude.ai. Only available for Pro, Max, and Ultra plan subscribers |

124| `/radio` | Open Claude FM lo-fi radio in your browser. Prints the stream URL when no browser is available |124| `/radio` | Open Claude FM lo-fi radio in your browser. Prints the stream URL when no browser is available |

125| `/rate-limit-options` | Show ways to keep working when a claude.ai usage limit blocks a request: wait and [continue automatically when the limit resets](https://code.claude.com/docs/en/interactive-mode.md#wait-for-a-usage-limit-to-reset), add [usage credits](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription), or upgrade your plan. Claude Code can also open this menu on its own when you hit a limit at your own terminal. See [Turn automatic continue off](https://code.claude.com/docs/en/interactive-mode.md#turn-automatic-continue-off). Requires a claude.ai subscription. The wait-and-continue rows require Claude Code v2.1.234 or later |125| `/rate-limit-options` | Show ways to keep working when a claude.ai usage limit blocks a request: wait and [continue automatically when the limit resets](https://code.claude.com/docs/en/interactive-mode.md#wait-for-a-usage-limit-to-reset), add [usage credits](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription), or upgrade your plan. Claude Code can also open this menu on its own when you hit a limit at your own terminal. See [Turn automatic continue off](https://code.claude.com/docs/en/interactive-mode.md#turn-automatic-continue-off). Requires a claude.ai subscription. The wait-and-continue rows require Claude Code v2.1.234 or later |

126| `/recap` | Generate a one-line summary of the current session on demand. See [Session recap](https://code.claude.com/docs/en/interactive-mode.md#session-recap) for the automatic recap that appears after you've been away |126| `/recap` | Generate a one-line summary of the current session on demand. See [Session recap](https://code.claude.com/docs/en/interactive-mode.md#session-recap) for the automatic recap that appears after you've been away |

costs.md +1 −1

Details

296 296 

297> [tab] settings.json297> [tab] settings.json

298>298>

299> Add this to your [settings.json](https://code.claude.com/docs/en/settings.md#where-settings-live) to run the hook before every Bash command:299> Add this to your [settings.json](https://code.claude.com/docs/en/settings.md#where-settings-live) to run the hook before every Bash tool call:

300>300>

301> ```json theme={null}301> ```json theme={null}

302> {302> {

Details

62Run `/hooks` to list every hook registered for the current session, grouped by event. If a hook you defined doesn't appear, Claude Code didn't load it. Check for these causes:62Run `/hooks` to list every hook registered for the current session, grouped by event. If a hook you defined doesn't appear, Claude Code didn't load it. Check for these causes:

63 63 

64* The hook is defined in a standalone file. Hooks go under the `"hooks"` key in a [settings file](https://code.claude.com/docs/en/settings.md#settings-files).64* The hook is defined in a standalone file. Hooks go under the `"hooks"` key in a [settings file](https://code.claude.com/docs/en/settings.md#settings-files).

65* The `matcher` value is an array instead of a single string. Claude Code lists the entry as an invalid setting when you start an interactive session and in `claude doctor`. If the array is under `PreToolUse` or `PermissionRequest`, none of that file's other hooks load either.65* The `matcher` value is an array instead of a single string. Claude Code lists the entry as an invalid setting when you start an interactive session and in `claude doctor`. If the array is under `PreToolUse`, `PermissionRequest`, or `PreSkillShellCommand`, none of that file's other hooks load either.

66* The hook is in a skill's frontmatter, and neither you nor Claude has invoked the skill yet in this session. Invoke it or ask Claude to, then run `/hooks` again. If the hook still doesn't appear, check for other causes, such as [frontmatter that didn't parse](https://code.claude.com/docs/en/skills.md#skill-not-triggering) or one of the [limits on skill hooks](https://code.claude.com/docs/en/hooks.md#limits-on-skill-hooks).66* The hook is in a skill's frontmatter, and neither you nor Claude has invoked the skill yet in this session. Invoke it or ask Claude to, then run `/hooks` again. If the hook still doesn't appear, check for other causes, such as [frontmatter that didn't parse](https://code.claude.com/docs/en/skills.md#skill-not-triggering) or one of the [limits on skill hooks](https://code.claude.com/docs/en/hooks.md#limits-on-skill-hooks).

67 67 

68If the hook appears but doesn't fire, the matcher is the usual cause. Check it for these mistakes:68If the hook appears but doesn't fire, the matcher is the usual cause. Check it for these mistakes:

desktop.md +21 −1

Details

1901* **A broken settings file**: while your own settings file is broken, your administrator's entries may be gray, with a message that names the file. [Fix the file](https://code.claude.com/docs/en/settings.md#fix-a-broken-settings-file).1901* **A broken settings file**: while your own settings file is broken, your administrator's entries may be gray, with a message that names the file. [Fix the file](https://code.claude.com/docs/en/settings.md#fix-a-broken-settings-file).

1902* **A new host**: [**Create another**](#create-another-machine) is gray for one minute after Desktop saves a host. Select it after that minute. Before Claude Desktop v4.4212.0, **Replace Dev box's host** is gray for 10 minutes.1902* **A new host**: [**Create another**](#create-another-machine) is gray for one minute after Desktop saves a host. Select it after that minute. Before Claude Desktop v4.4212.0, **Replace Dev box's host** is gray for 10 minutes.

1903* **Hooks are off or restricted**: your own entries work only where your own hooks can run. Remove `disableAllHooks` from your settings, or ask your administrator.1903* **Hooks are off or restricted**: your own entries work only where your own hooks can run. Remove `disableAllHooks` from your settings, or ask your administrator.

1904* **Settings are still loading**: every entry is gray until Desktop has loaded your organization's [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), usually a few seconds after launch. If the entries stay gray, check your connection to claude.ai.1904* **Settings are still loading**: every entry is gray until Desktop has loaded any [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md), usually a few seconds after launch. If the entries stay gray, check your connection to claude.ai.

1905 1905 

1906#### Pre-configure SSH connections for your team1906#### Pre-configure SSH connections for your team

1907 1907 


2099 2099 

2100For the permission, plugin, and delivery keys only a managed source can set, see [Keys only managed settings can set](https://code.claude.com/docs/en/managed-settings.md#managed-only-settings).2100For the permission, plugin, and delivery keys only a managed source can set, see [Keys only managed settings can set](https://code.claude.com/docs/en/managed-settings.md#managed-only-settings).

2101 2101 

2102#### Deploy skills for all users

2103 

2104To give every user the same skills in local and SSH sessions, deploy them as [enterprise skills](https://code.claude.com/docs/en/skills.md#where-skills-live), which you install once on a machine for all of its users. Install them on the machine where the session runs:

2105 

2106* **Local sessions**: each user's computer

2107* **SSH sessions**: each remote host

2108 

2109Install each skill at the path for that machine's platform:

2110 

2111| Platform | Path |

2112| :- | :- |

2113| macOS | `/Library/Application Support/ClaudeCode/.claude/skills/<skill-name>/SKILL.md` |

2114| Linux | `/etc/claude-code/.claude/skills/<skill-name>/SKILL.md` |

2115| Windows | `C:\Program Files\ClaudeCode\.claude\skills\<skill-name>\SKILL.md` |

2116 

2117To confirm that your skills load, test with a skill whose [frontmatter](https://code.claude.com/docs/en/skills.md#frontmatter-reference) sets only `name` and `description`. Start a new session and send a message, then type `/` and the first letters of the skill's name in the prompt box. The skill appears in the list.

2118 

2102#### Claude Code settings that behave differently in the Code tab2119#### Claude Code settings that behave differently in the Code tab

2103 2120 

2104In a local session, these keys, among others, have a different effect or no visible one, because the Code tab replaces the terminal interface. They still apply in the terminal, so you can leave them set.2121In a local session, these keys, among others, have a different effect or no visible one, because the Code tab replaces the terminal interface. They still apply in the terminal, so you can leave them set.


2320* **Linux (beta)**: Computer Use isn't yet available in the Linux desktop app. See [Claude Desktop on Linux](https://code.claude.com/docs/en/desktop-linux.md).2337* **Linux (beta)**: Computer Use isn't yet available in the Linux desktop app. See [Claude Desktop on Linux](https://code.claude.com/docs/en/desktop-linux.md).

2321* **Inline code suggestions**: Desktop doesn't offer autocomplete-style code completions. It works through conversational prompts and explicit code changes, and can [suggest your next prompt](#accept-a-suggested-prompt) after Claude replies.2338* **Inline code suggestions**: Desktop doesn't offer autocomplete-style code completions. It works through conversational prompts and explicit code changes, and can [suggest your next prompt](#accept-a-suggested-prompt) after Claude replies.

2322* **Agent teams**: coordinated teams, where Claude as the team lead assigns tasks to teammates from a shared task list, are available in the [CLI](https://code.claude.com/docs/en/agent-teams.md), not in Desktop. For multi-agent work inside one session, use [dynamic workflows](https://code.claude.com/docs/en/workflows.md), which run in Desktop; Claude can also [message and manage your other sessions](#work-across-sessions) directly.2339* **Agent teams**: coordinated teams, where Claude as the team lead assigns tasks to teammates from a shared task list, are available in the [CLI](https://code.claude.com/docs/en/agent-teams.md), not in Desktop. For multi-agent work inside one session, use [dynamic workflows](https://code.claude.com/docs/en/workflows.md), which run in Desktop; Claude can also [message and manage your other sessions](#work-across-sessions) directly.

2340* **Code Mode**: Desktop sessions start without the experimental [Code Mode](https://code.claude.com/docs/en/code-mode.md), even if you turn it on in your settings. To use it, run the CLI in a terminal.

2323* **Terminal-dialog commands**: built-in commands that open an interactive panel in the terminal behave differently in the Code tab. Edit [settings files](https://code.claude.com/docs/en/settings.md) directly to manage permission rules and configuration, or run the commands from the standalone CLI.2341* **Terminal-dialog commands**: built-in commands that open an interactive panel in the terminal behave differently in the Code tab. Edit [settings files](https://code.claude.com/docs/en/settings.md) directly to manage permission rules and configuration, or run the commands from the standalone CLI.

2324 * Commands with no argument form, such as `/permissions`, reply with `isn't available in this environment`.2342 * Commands with no argument form, such as `/permissions`, reply with `isn't available in this environment`.

2325 * `/config` opens **Settings > Code** or **Settings > Claude Code**.2343 * `/config` opens **Settings > Code** or **Settings > Claude Code**.


2359 2377 

2360### 403 or authentication errors in the Code tab2378### 403 or authentication errors in the Code tab

2361 2379 

2380For a card that says `For security, Claude Code needs a recent sign-in.`, see [Claude Code needs a recent sign-in](https://code.claude.com/docs/en/errors.md#claude-code-needs-a-recent-sign-in).

2381 

2362If you see `Error 403: Forbidden` or other authentication failures when using the Code tab:2382If you see `Error 403: Forbidden` or other authentication failures when using the Code tab:

2363 2383 

23641. Sign out and back in from the app menu. This is the most common fix.23841. Sign out and back in from the app menu. This is the most common fix.

Details

106 106 

107## Grant Claude access to a device107## Grant Claude access to a device

108 108 

109Claude asks for your consent before it controls a device, while building or launching the app or opening a URL on it follows your session's permission mode. You or your organization can also turn Claude's access off entirely.109Claude asks for your consent before it controls a device, while building or launching the app or opening a URL on it follows your session's permission mode. To remove Claude's access entirely, [turn off simulator access](#turn-off-simulator-access).

110 110 

111### Allow a device the first time111### Allow a device the first time

112 112 

env-vars.md +5 −4

Details

206| `CLAUDE_CODE_ALWAYS_ENABLE_EFFORT` | Set to `1` to send the [effort](https://code.claude.com/docs/en/model-config.md#adjust-effort-level) parameter with every request, even when Claude Code does not recognize the model ID as effort-capable. Use this when routing through an [LLM gateway](https://code.claude.com/docs/en/llm-gateway) or third-party provider that serves models under custom identifiers. Models that reject the effort parameter at the API, including Claude Opus 4.1, Claude Sonnet 4.5, Claude Haiku 4.5, and earlier models, are still excluded so requests do not fail |206| `CLAUDE_CODE_ALWAYS_ENABLE_EFFORT` | Set to `1` to send the [effort](https://code.claude.com/docs/en/model-config.md#adjust-effort-level) parameter with every request, even when Claude Code does not recognize the model ID as effort-capable. Use this when routing through an [LLM gateway](https://code.claude.com/docs/en/llm-gateway) or third-party provider that serves models under custom identifiers. Models that reject the effort parameter at the API, including Claude Opus 4.1, Claude Sonnet 4.5, Claude Haiku 4.5, and earlier models, are still excluded so requests do not fail |

207| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using [`apiKeyHelper`](https://code.claude.com/docs/en/settings-reference#apikeyhelper)) |207| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using [`apiKeyHelper`](https://code.claude.com/docs/en/settings-reference#apikeyhelper)) |

208| `CLAUDE_CODE_ARTIFACT_AUTO_OPEN` | Set to `0` to stop Claude Code from opening the browser automatically when a new [artifact](https://code.claude.com/docs/en/artifacts.md#create-an-artifact) is published |208| `CLAUDE_CODE_ARTIFACT_AUTO_OPEN` | Set to `0` to stop Claude Code from opening the browser automatically when a new [artifact](https://code.claude.com/docs/en/artifacts.md#create-an-artifact) is published |

209| `CLAUDE_CODE_ARTIFACT_COMMENTS` | Set to `0` to stop Claude reading and replying to [comments on an artifact](https://code.claude.com/docs/en/artifacts.md#collect-comments-on-an-artifact). Has no effect when `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` has [turned artifacts off](https://code.claude.com/docs/en/artifacts.md#availability). Requires Claude Code v2.1.221 or later |209| `CLAUDE_CODE_ARTIFACT_COMMENTS` | Set to `0` to stop the [`Artifact` tool](https://code.claude.com/docs/en/tools-reference) from reading and replying to [comments on an artifact](https://code.claude.com/docs/en/artifacts.md#collect-comments-on-an-artifact). Has no effect when `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` has [turned artifacts off](https://code.claude.com/docs/en/artifacts.md#availability). Requires Claude Code v2.1.221 or later |

210| `CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT` | Set to `0` to stop Claude [replying on its own to comments sent to it](https://code.claude.com/docs/en/artifacts.md#let-claude-reply-to-comments-on-its-own). Requires Claude Code v2.1.228 or later |210| `CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT` | Set to `0` to stop Claude [replying on its own to comments sent to it](https://code.claude.com/docs/en/artifacts.md#let-claude-reply-to-comments-on-its-own). Requires Claude Code v2.1.228 or later |

211| `CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS` | Set to `0` to stop Claude from [applying small changes](https://code.claude.com/docs/en/artifacts.md#turn-off-one-step-artifact-updates) to an artifact's file as part of publishing it. Claude then edits the file with its file-editing tools and publishes it as a separate step. Requires Claude Code v2.1.300 or later |211| `CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS` | Set to `0` to stop Claude from [applying small changes](https://code.claude.com/docs/en/artifacts.md#turn-off-one-step-artifact-updates) to an artifact's local file as part of publishing it. Requires Claude Code v2.1.300 or later |

212| `CLAUDE_CODE_ATTRIBUTION_HEADER` | Set to `0` to omit the [attribution block](https://code.claude.com/docs/en/llm-gateway-protocol.md#system-prompt-attribution-block), which carries the client version and a prompt fingerprint, from the start of the system prompt. Caching on a direct connection to the Anthropic API is unaffected either way. In some direct-connection setups, Claude Code keeps the block on [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) classifier requests even when you set `0`. In [System prompt attribution block](https://code.claude.com/docs/en/llm-gateway-protocol.md#system-prompt-attribution-block), check which connections and credentials this covers. Before v2.1.181 the block included a per-request token on custom base URLs and Microsoft Foundry connections, so on those versions set it to `0` when your LLM gateway caches on the request body or forwards requests to a third-party provider, or when you connect to Microsoft Foundry directly |212| `CLAUDE_CODE_ATTRIBUTION_HEADER` | Set to `0` to omit the [attribution block](https://code.claude.com/docs/en/llm-gateway-protocol.md#system-prompt-attribution-block), which carries the client version and a prompt fingerprint, from the start of the system prompt. Caching on a direct connection to the Anthropic API is unaffected either way. In some direct-connection setups, Claude Code keeps the block on [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) classifier requests even when you set `0`. In [System prompt attribution block](https://code.claude.com/docs/en/llm-gateway-protocol.md#system-prompt-attribution-block), check which connections and credentials this covers. Before v2.1.181 the block included a per-request token on custom base URLs and Microsoft Foundry connections, so on those versions set it to `0` when your LLM gateway caches on the request body or forwards requests to a third-party provider, or when you connect to Microsoft Foundry directly |

213| `CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS` | Removed in v2.1.283. Use `CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE` instead |213| `CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS` | Removed in v2.1.283. Use `CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE` instead |

214| `CLAUDE_CODE_AUTO_COMPACT_WINDOW` | Set the auto-compact window, which is how full the context gets before compaction, to a token count of `100000` or more. Suffixed values such as `200k` require v2.1.304 or later. For precedence over the other ways to set the window and the effect on the status line's `used_percentage`, see [Set the auto-compact window](https://code.claude.com/docs/en/model-config.md#set-the-auto-compact-window) |214| `CLAUDE_CODE_AUTO_COMPACT_WINDOW` | Set the auto-compact window, which is how full the context gets before compaction, to a token count of `100000` or more. Suffixed values such as `200k` require v2.1.304 or later. For precedence over the other ways to set the window and the effect on the status line's `used_percentage`, see [Set the auto-compact window](https://code.claude.com/docs/en/model-config.md#set-the-auto-compact-window) |


276| `CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY` | Set to `1` to turn off the [PowerShell tool](https://code.claude.com/docs/en/tools-reference.md#powershell-tool) check that denies the `cmd` built-ins `rd`, `rmdir`, `del`, and `erase` on a [system path](https://code.claude.com/docs/en/permission-modes.md#remove-item-in-powershell), such as a drive root or your home directory. Claude Code ignores this variable in a settings file's `env` block. Requires Claude Code v2.1.283 or later |276| `CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY` | Set to `1` to turn off the [PowerShell tool](https://code.claude.com/docs/en/tools-reference.md#powershell-tool) check that denies the `cmd` built-ins `rd`, `rmdir`, `del`, and `erase` on a [system path](https://code.claude.com/docs/en/permission-modes.md#remove-item-in-powershell), such as a drive root or your home directory. Claude Code ignores this variable in a settings file's `env` block. Requires Claude Code v2.1.283 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 |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_RESPONSE_COMPRESSION` | Set to `1` to request uncompressed model responses if your [proxy](https://code.claude.com/docs/en/network-config.md#proxy-configuration) leaves compressed ones unfinished. Not recommended for self-hosted runners or Remote Control. Ignored in project and local settings. Requires Claude Code v2.1.331 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_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 |281| `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 |

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 |282| `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 |


465| `DEBUG` | Set to `1` to enable debug mode, equivalent to launching with [`--debug`](https://code.claude.com/docs/en/cli-reference#cli-flags). Debug logs are written to `~/.claude/debug/<session-id>.txt`, or to the path set by `CLAUDE_CODE_DEBUG_LOGS_DIR`. Only the truthy values `1`, `true`, `yes`, and `on` enable debug mode, so namespace patterns like `DEBUG=express:*` set for other tools do not trigger it |466| `DEBUG` | Set to `1` to enable debug mode, equivalent to launching with [`--debug`](https://code.claude.com/docs/en/cli-reference#cli-flags). Debug logs are written to `~/.claude/debug/<session-id>.txt`, or to the path set by `CLAUDE_CODE_DEBUG_LOGS_DIR`. Only the truthy values `1`, `true`, `yes`, and `on` enable debug mode, so namespace patterns like `DEBUG=express:*` set for other tools do not trigger it |

466| `DISABLE_AUTOUPDATER` | Set to `1` to disable automatic background updates. Manual `claude update` still works. Use `DISABLE_UPDATES` to block both |467| `DISABLE_AUTOUPDATER` | Set to `1` to disable automatic background updates. Manual `claude update` still works. Use `DISABLE_UPDATES` to block both |

467| `DISABLE_AUTO_COMPACT` | Set to `1` to disable automatic compaction when approaching the context limit, along with [idle compaction](https://code.claude.com/docs/en/settings-reference.md#idlecompaction). The manual `/compact` command remains available. Use when you want explicit control over when compaction occurs. Overrides the [`autoCompactEnabled`](https://code.claude.com/docs/en/settings-reference#autocompactenabled) setting |468| `DISABLE_AUTO_COMPACT` | Set to `1` to disable automatic compaction when approaching the context limit, along with [idle compaction](https://code.claude.com/docs/en/settings-reference.md#idlecompaction). The manual `/compact` command remains available. Use when you want explicit control over when compaction occurs. Overrides the [`autoCompactEnabled`](https://code.claude.com/docs/en/settings-reference#autocompactenabled) setting |

468| `DISABLE_COMPACT` | Set to `1` to disable all compaction: both automatic compaction and the manual `/compact` command |469| `DISABLE_COMPACT` | Set to `1` to disable all compaction, including `/compact` and the [rewind menu's summarize options](https://code.claude.com/docs/en/checkpointing.md#rewind-and-summarize) |

469| `DISABLE_COST_WARNINGS` | Set to `1` to disable cost warning messages |470| `DISABLE_COST_WARNINGS` | Set to `1` to disable cost warning messages |

470| `DISABLE_DOCTOR_COMMAND` | Set to `1` to hide the [`/doctor`](https://code.claude.com/docs/en/commands#all-commands) setup checkup skill and its `/checkup` alias. Useful for managed deployments where users shouldn't run setup diagnostics from a session. Doesn't affect the `claude doctor` terminal command. Before v2.1.205, this variable hid the `/doctor` diagnostics screen command |471| `DISABLE_DOCTOR_COMMAND` | Set to `1` to hide the [`/doctor`](https://code.claude.com/docs/en/commands#all-commands) setup checkup skill and its `/checkup` alias. Useful for managed deployments where users shouldn't run setup diagnostics from a session. Doesn't affect the `claude doctor` terminal command. Before v2.1.205, this variable hid the `/doctor` diagnostics screen command |

471| `DISABLE_ERROR_REPORTING` | Set to any non-empty value, such as `1`, to opt out of error reporting. **Setting it to `0` or `false` still opts out**, unlike most on/off variables; unset the variable to turn error reporting back on |472| `DISABLE_ERROR_REPORTING` | Set to any non-empty value, such as `1`, to opt out of error reporting. **Setting it to `0` or `false` still opts out**, unlike most on/off variables; unset the variable to turn error reporting back on |


518| `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` | Standard OpenTelemetry SDK limit on attribute value length. Claude Code caps content-bearing telemetry attributes at the smaller of this and `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH`, so the truncation marker stays within the SDK limit. Claude Code reads the `OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT` and `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` variants the same way, and the smallest set value applies to all signals. Requires Claude Code v2.1.214 or later. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#common-configuration-variables) |519| `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` | Standard OpenTelemetry SDK limit on attribute value length. Claude Code caps content-bearing telemetry attributes at the smaller of this and `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH`, so the truncation marker stays within the SDK limit. Claude Code reads the `OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT` and `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` variants the same way, and the smallest set value applies to all signals. Requires Claude Code v2.1.214 or later. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#common-configuration-variables) |

519| `OTEL_LOG_ASSISTANT_RESPONSES` | Set to `1` to include the model's response text on `assistant_response` OpenTelemetry log events. When unset, Claude Code uses the value of `OTEL_LOG_USER_PROMPTS` instead. Set to `0` to keep responses redacted even when `OTEL_LOG_USER_PROMPTS` is set. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env). Requires Claude Code v2.1.193 or later. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#assistant-response-event) |520| `OTEL_LOG_ASSISTANT_RESPONSES` | Set to `1` to include the model's response text on `assistant_response` OpenTelemetry log events. When unset, Claude Code uses the value of `OTEL_LOG_USER_PROMPTS` instead. Set to `0` to keep responses redacted even when `OTEL_LOG_USER_PROMPTS` is set. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env). Requires Claude Code v2.1.193 or later. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#assistant-response-event) |

520| `OTEL_LOG_MANAGED_SETTINGS` | Set to `1` to add the redacted managed settings, and a SHA-256 digest of the settings before redaction, to `managed_settings_resolved` OpenTelemetry log events. Disabled by default. Set it in your shell, user settings, or managed settings; a value in project or local settings doesn't turn it on. Requires Claude Code v2.1.274 or later. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#managed-settings-resolved-event) |521| `OTEL_LOG_MANAGED_SETTINGS` | Set to `1` to add the redacted managed settings, and a SHA-256 digest of the settings before redaction, to `managed_settings_resolved` OpenTelemetry log events. Disabled by default. Set it in your shell, user settings, or managed settings; a value in project or local settings doesn't turn it on. Requires Claude Code v2.1.274 or later. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#managed-settings-resolved-event) |

521| `OTEL_LOG_RAW_API_BODIES` | Emit Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events. Set to `1` for inline bodies truncated at the content limit, or `file:<dir>` to write untruncated bodies to disk and emit a `body_ref` path instead. `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` configures the content limit, 60 KB by default. Disabled by default; bodies include the entire conversation history. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env). See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#api-request-body-event) |522| `OTEL_LOG_RAW_API_BODIES` | Emit Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events. Set to `1` for inline bodies truncated at the [content limit](https://code.claude.com/docs/en/monitoring-usage.md#common-configuration-variables), or `file:<dir>` to write untruncated bodies to disk and emit a `body_ref` path instead. Disabled by default; bodies can include the entire conversation history. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env). See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#api-request-body-event) |

522| `OTEL_LOG_TOOL_CONTENT` | Set to `1` to include tool content in the `tool.output` OpenTelemetry span event. Span attributes carry tool content under [their own gates](https://code.claude.com/docs/en/monitoring-usage.md#new-context-gates). Requires [tracing](https://code.claude.com/docs/en/monitoring-usage.md#traces-beta). Disabled by default to protect sensitive data. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env), apart from the off values that section describes. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#tool-output-span-event) |523| `OTEL_LOG_TOOL_CONTENT` | Set to `1` to include tool content in the `tool.output` OpenTelemetry span event. Span attributes carry tool content under [their own gates](https://code.claude.com/docs/en/monitoring-usage.md#new-context-gates). Requires [tracing](https://code.claude.com/docs/en/monitoring-usage.md#traces-beta). Disabled by default to protect sensitive data. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env), apart from the off values that section describes. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md#tool-output-span-event) |

523| `OTEL_LOG_TOOL_DETAILS` | Set to `1` to include tool input arguments; MCP server names; user-authored workflow names; raw error strings on tool failures; the refusal `category` on `api_refusal` events; real agent, skill, plugin, and MCP server names on [cost and token metrics](https://code.claude.com/docs/en/monitoring-usage.md#cost-counter); and other tool details in OpenTelemetry metrics, traces, and logs. Disabled by default to protect PII. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env), apart from the off values that section describes. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md) |524| `OTEL_LOG_TOOL_DETAILS` | Set to `1` to include tool input arguments; MCP server names; user-authored workflow names; raw error strings on tool failures; the refusal `category` on `api_refusal` events; real agent, skill, plugin, and MCP server names on [cost and token metrics](https://code.claude.com/docs/en/monitoring-usage.md#cost-counter); and other tool details in OpenTelemetry metrics, traces, and logs. Disabled by default to protect PII. Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env), apart from the off values that section describes. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md) |

524| `OTEL_LOG_USER_PROMPTS` | Set to `1` to include user prompt text in OpenTelemetry traces and logs. Disabled by default (prompts are redacted). Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env), apart from the off values that section describes. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md) |525| `OTEL_LOG_USER_PROMPTS` | Set to `1` to include user prompt text in OpenTelemetry traces and logs. Disabled by default (prompts are redacted). Set it in your shell, user settings, or managed settings. Ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env), apart from the off values that section describes. See [Monitoring](https://code.claude.com/docs/en/monitoring-usage.md) |

errors.md +51 −2

Details

60| `Sign in again to take your previous account or API key off the config file.` | [Authentication](#sign-in-again-to-take-your-previous-account-or-api-key-off-the-config-file) |60| `Sign in again to take your previous account or API key off the config file.` | [Authentication](#sign-in-again-to-take-your-previous-account-or-api-key-off-the-config-file) |

61| `Your account or API key may still be in the config file. Run claude auth logout.` | [Authentication](#your-account-or-api-key-may-still-be-in-the-config-file) |61| `Your account or API key may still be in the config file. Run claude auth logout.` | [Authentication](#your-account-or-api-key-may-still-be-in-the-config-file) |

62| `Authentication required · Sign in again to continue` | [Authentication](#not-logged-in) |62| `Authentication required · Sign in again to continue` | [Authentication](#not-logged-in) |

63| `Sign in again to continue` followed by `For security, Claude Code needs a recent sign-in.` | [Wrapper and IDE errors](#claude-code-needs-a-recent-sign-in) |

64| `Claude Code needs a recent sign-in. Signing in won’t stop sessions.` | [Wrapper and IDE errors](#claude-code-needs-a-recent-sign-in) |

63| `Could not resolve authentication method` | [Authentication](#could-not-resolve-authentication-method) |65| `Could not resolve authentication method` | [Authentication](#could-not-resolve-authentication-method) |

64| `Invalid API key` | [Authentication](#invalid-api-key) |66| `Invalid API key` | [Authentication](#invalid-api-key) |

65| `Your apiKeyHelper script is failing` | [Authentication](#your-apikeyhelper-script-is-failing) |67| `Your apiKeyHelper script is failing` | [Authentication](#your-apikeyhelper-script-is-failing) |


99| `Your account does not have access to Claude. Please login again or contact your administrator.` | [Authentication](#oauth-token-revoked-or-expired) |101| `Your account does not have access to Claude. Please login again or contact your administrator.` | [Authentication](#oauth-token-revoked-or-expired) |

100| `API Error: 401 Invalid authentication credentials` | [Authentication](#api-error-401-invalid-authentication-credentials) |102| `API Error: 401 Invalid authentication credentials` | [Authentication](#api-error-401-invalid-authentication-credentials) |

101| `Login expired · Please run /login` | [Authentication](#login-expired) |103| `Login expired · Please run /login` | [Authentication](#login-expired) |

104| `Authentication error · This may be a temporary network issue` in a cloud session | Send your message again. |

105| `login required — run /login` in agent view | If a message listed in this table follows it, use that row. Otherwise run `/login`. |

102| `Warning: this sign-in` | [Check when a stored login ends](https://code.claude.com/docs/en/authentication.md#check-when-a-stored-login-ends) |106| `Warning: this sign-in` | [Check when a stored login ends](https://code.claude.com/docs/en/authentication.md#check-when-a-stored-login-ends) |

103| `The browser can't return the sign-in to Claude Code automatically` | [Authentication](#couldnt-start-the-local-sign-in-listener) |107| `The browser can't return the sign-in to Claude Code automatically` | [Authentication](#couldnt-start-the-local-sign-in-listener) |

104| `Couldn't start the local listener that receives the browser sign-in. Try again.` | [Authentication](#couldnt-start-the-local-sign-in-listener) |108| `Couldn't start the local listener that receives the browser sign-in. Try again.` | [Authentication](#couldnt-start-the-local-sign-in-listener) |

105| `Failed to start OAuth callback server` | [Authentication](#failed-to-start-oauth-callback-server) |109| `Failed to start OAuth callback server` | [Authentication](#failed-to-start-oauth-callback-server) |

106| `Claude login not accepted · Run /login, then try again` | [Authentication](#claude-login-not-accepted) |110| `Claude login not accepted · Run /login, then try again` | [Authentication](#claude-login-not-accepted) |

107| `Artifacts need a claude.ai login` | [Authentication](#artifacts-need-a-claude-ai-login) |111| `Artifacts need a claude.ai login` | [Authentication](#artifacts-need-a-claude-ai-login) |

112| `Your authentication token belongs to organization` | [Restrict login to your organization](https://code.claude.com/docs/en/authentication.md#restrict-login-to-your-organization) |

108| `Not signed in to the Cloud gateway — run /login.` | [Authentication](#administrator-policy-requires-a-cloud-gateway-sign-in) |113| `Not signed in to the Cloud gateway — run /login.` | [Authentication](#administrator-policy-requires-a-cloud-gateway-sign-in) |

109| `Administrator policy requires a Cloud gateway sign-in on this machine` | [Authentication](#administrator-policy-requires-a-cloud-gateway-sign-in) |114| `Administrator policy requires a Cloud gateway sign-in on this machine` | [Authentication](#administrator-policy-requires-a-cloud-gateway-sign-in) |

110| `Managed settings on this machine configure a Cloud gateway sign-in; run interactive /login to authenticate.` | [`claude auth login`](https://code.claude.com/docs/en/cli-reference#cli-commands) |115| `Managed settings on this machine configure a Cloud gateway sign-in; run interactive /login to authenticate.` | [`claude auth login`](https://code.claude.com/docs/en/cli-reference#cli-commands) |

111| `You chose an organization that is managed in Anthropic's Enterprise Admin Console` | [Turn on sign-in from Claude Code](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#turn-on-sign-in-from-claude-code) |116| `You chose an organization that is managed in Anthropic's Enterprise Admin Console` | [Turn on sign-in from Claude Code](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#turn-on-sign-in-from-claude-code) |

112| `The organization's settings won't apply on this computer` | [Which settings take priority](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority) |117| `The organization's settings won't apply on this computer` | [Which settings take priority](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority) |

113| `no usable organization sign-in` / `no readable organization sign-in` | [When a sign-in ends](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#when-a-sign-in-ends) |118| `no usable organization sign-in` / `no readable organization sign-in` | [When a sign-in ends](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#when-a-sign-in-ends) |

114| `the session no longer runs under that sign-in` / `This Claude Code process ran under your organization` / `After a sign-in to your organization, only a new session sends requests` | [Log in to Claude Code](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code) |119| `the session no longer runs under that sign-in` / `This Claude Code process ran under your organization` / `After a sign-in to your organization, only a new session sends requests` / `Claude Code needs to restart to use it` | [Log in to Claude Code](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code) |

115| `This conversation ran under organization` / `This conversation ran under more than one organization` | [Log in to Claude Code](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code) |120| `This conversation ran under organization` / `This conversation ran under more than one organization` | [Log in to Claude Code](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code) |

116| `Claude Code could not read the managed settings that apply to this computer, which may require a sign-in to Anthropic` | [`enforceAnthropicSignIn`](https://code.claude.com/docs/en/settings-reference#enforceanthropicsignin) |121| `Claude Code could not read the managed settings that apply to this computer, which may require a sign-in to Anthropic` | [`enforceAnthropicSignIn`](https://code.claude.com/docs/en/settings-reference#enforceanthropicsignin) |

117| `This computer's managed settings require a sign-in to Anthropic` / `This computer's settings require a sign-in to Anthropic that this app cannot use` | [Require the sign-in](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#require-the-sign-in-with-managed-settings) |122| `This computer's managed settings require a sign-in to Anthropic` / `This computer's settings require a sign-in to Anthropic that this app cannot use` | [Require the sign-in](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#require-the-sign-in-with-managed-settings) |


304| `Shell command failed for pattern "..."`, from `/security-review` or any skill that injects dynamic context | [Command-line errors](#security-review-fails-without-origin-head) |309| `Shell command failed for pattern "..."`, from `/security-review` or any skill that injects dynamic context | [Command-line errors](#security-review-fails-without-origin-head) |

305| `Shell command permission check failed for pattern "..."`, from a skill that injects dynamic context | [Command-line errors](#security-review-fails-without-origin-head) |310| `Shell command permission check failed for pattern "..."`, from a skill that injects dynamic context | [Command-line errors](#security-review-fails-without-origin-head) |

306| ``Couldn't run `<command>` for <name>. A file named HEAD or .git in this folder or one above it may not be yours``, from a skill that injects dynamic context | [Permission checks on injected commands](https://code.claude.com/docs/en/skills.md#permission-checks-on-injected-commands) |311| ``Couldn't run `<command>` for <name>. A file named HEAD or .git in this folder or one above it may not be yours``, from a skill that injects dynamic context | [Permission checks on injected commands](https://code.claude.com/docs/en/skills.md#permission-checks-on-injected-commands) |

312| `Not run in /<name>` / `Ran anyway in /<name>` / `[not run: blocked by hook`, from `/security-review` or a skill that injects dynamic context | [PreSkillShellCommand decision control](https://code.claude.com/docs/en/hooks.md#preskillshellcommand-decision-control) |

307| ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found`` | [Command-line errors](#security-review-fails-without-origin-head) |313| ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found`` | [Command-line errors](#security-review-fails-without-origin-head) |

308| `No shell command in <name> was run, because the <tool> tool does not accept one of them` | [Command-line errors](#no-shell-command-was-run) |314| `No shell command in <name> was run, because the <tool> tool does not accept one of them` | [Command-line errors](#no-shell-command-was-run) |

309| `This skill, command or hook and the arguments filled into it add up to more than 4,000,000 characters` | [Command-line errors](#skill-command-or-hook-over-the-4000000-character-limit) |315| `This skill, command or hook and the arguments filled into it add up to more than 4,000,000 characters` | [Command-line errors](#skill-command-or-hook-over-the-4000000-character-limit) |


349| `/feedback is disabled by your organization's policy`, or the same for `/bug` or `/share` | [Command-line errors](#feedback-is-disabled-by-your-organizations-policy) |355| `/feedback is disabled by your organization's policy`, or the same for `/bug` or `/share` | [Command-line errors](#feedback-is-disabled-by-your-organizations-policy) |

350| `` `plugin eval` is currently in early access `` / `` `plugin eval` is currently unavailable `` | [Plugin errors](#plugin-eval-is-currently-in-early-access) |356| `` `plugin eval` is currently in early access `` / `` `plugin eval` is currently unavailable `` | [Plugin errors](#plugin-eval-is-currently-in-early-access) |

351| `credential store on this machine holds a symbolic link inside it` | [Grant tools](https://code.claude.com/docs/en/plugin-evals.md#grant-tools) |357| `credential store on this machine holds a symbolic link inside it` | [Grant tools](https://code.claude.com/docs/en/plugin-evals.md#grant-tools) |

358| `cannot be disallowed`, from `claude plugin eval` | Use a built-in tool's [exact name](https://code.claude.com/docs/en/plugin-evals.md#disallow-tools), and [put the target before `--disallow-tools`](https://code.claude.com/docs/en/plugin-evals#choose-what-to-evaluate) |

352| `cannot be evaluated where sessions load it` | [Test plugins with evals](https://code.claude.com/docs/en/plugin-evals.md#cannot-be-evaluated-where-sessions-load-it) |359| `cannot be evaluated where sessions load it` | [Test plugins with evals](https://code.claude.com/docs/en/plugin-evals.md#cannot-be-evaluated-where-sessions-load-it) |

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

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


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

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

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

385| `Couldn't load hooks from <path>` / `Failed to load hooks from <path>` / `Hook load failed` | [Plugin troubleshooting](https://code.claude.com/docs/en/plugins/troubleshooting.md#failed-to-load-hooks-from-and-hooks-that-dont-fire) |

386| `hooks.json declares PreToolUse/PermissionRequest` | Put the events under a `hooks` key, as in the [plugin hooks example](https://code.claude.com/docs/en/plugins/components.md#hooks). |

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

379| `Plugin source path refused` | [Plugin errors](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |388| `Plugin source path refused` | [Plugin errors](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |

380| `Failed to load marketplace configuration` | [Plugin errors](#failed-to-load-marketplace-configuration) |389| `Failed to load marketplace configuration` | [Plugin errors](#failed-to-load-marketplace-configuration) |


388| `Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)` | [Plugin errors](#skipping-connection-recent-failure-cached) |397| `Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)` | [Plugin errors](#skipping-connection-recent-failure-cached) |

389| `is not added on this machine, so your organization's marketplace policy keeps its plugins off` | [Add a marketplace](https://code.claude.com/docs/en/plugins/install.md#add-a-marketplace) |398| `is not added on this machine, so your organization's marketplace policy keeps its plugins off` | [Add a marketplace](https://code.claude.com/docs/en/plugins/install.md#add-a-marketplace) |

390| `A mod's http.fetch hook stopped this request` | [Turn mods on or off](https://code.claude.com/docs/en/plugins/mods/overview.md#turn-mods-on-or-off) |399| `A mod's http.fetch hook stopped this request` | [Turn mods on or off](https://code.claude.com/docs/en/plugins/mods/overview.md#turn-mods-on-or-off) |

400| `hook was skipped. "<mod>" runs first and sent the event on past it.` | If you listed the quoted mod in [`prependPlugins`](https://code.claude.com/docs/en/settings-reference#prependplugins) in your user settings, change that mod. Otherwise, ask your administrator. |

401| `<file>: changed while it was read` | If `claude plugin validate` printed this, rerun it. Otherwise, restart the session. |

402| `installed mods are off for now` | [Check whether mods can load](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#check-whether-mods-can-load) |

403| `the hooks worker was lost with <mod>'s <event> hook in flight` | Fix the named mod. For one cause, see [`it crashed the hooks worker`](https://code.claude.com/docs/en/plugins/mods/troubleshoot#it-crashed-the-hooks-worker). |

404| `dispatches in a row for fills by <mods>` | Change the named mods so they fill the prompt box at most eight times in a row. |

391| `Error: No such tool available: <tool name>` | [Tool errors](#no-such-tool-available) |405| `Error: No such tool available: <tool name>` | [Tool errors](#no-such-tool-available) |

392| `MCP server "<name>" connection closed before the tool call was answered` | [Tool errors](#connection-closed-before-the-tool-call-was-answered) |406| `MCP server "<name>" connection closed before the tool call was answered` | [Tool errors](#connection-closed-before-the-tool-call-was-answered) |

393| `MCP server "<name>" is disabled — re-enable it via /mcp to use its tools` | [Tool errors](#mcp-server-is-disabled) |407| `MCP server "<name>" is disabled — re-enable it via /mcp to use its tools` | [Tool errors](#mcp-server-is-disabled) |

394| `MCP server "<name>" tool "<tool>" timed out after <N>s. The server asked the user a question, and no answer came before the time limit.` | [Tool errors](#mcp-tool-call-timed-out-with-the-servers-question-unanswered) |408| `MCP server "<name>" tool "<tool>" timed out after <N>s. The server asked the user a question, and no answer came before the time limit.` | [Tool errors](#mcp-tool-call-timed-out-with-the-servers-question-unanswered) |

409| `The server's response is not a valid MCP response, so it was not read` | Before retrying, check whether the request ran. Report the error to the MCP server's author. |

395| `Permission prompt tool returned an invalid result` | [Tool errors](#permission-prompt-tool-returned-an-invalid-result) |410| `Permission prompt tool returned an invalid result` | [Tool errors](#permission-prompt-tool-returned-an-invalid-result) |

396| `would be spawned with zero tools — refusing` | [Tool errors](#agent-would-be-spawned-with-zero-tools) |411| `would be spawned with zero tools — refusing` | [Tool errors](#agent-would-be-spawned-with-zero-tools) |

397| `File is covered by a Read deny rule in your permission settings` | [Tool errors](#file-is-covered-by-a-read-deny-rule) |412| `File is covered by a Read deny rule in your permission settings` | [Tool errors](#file-is-covered-by-a-read-deny-rule) |


437| `Disk full: this computer's volume holding <dir> (Claude Code's temporary directory) has <n> MB free` / `Nearly out of inodes: this computer's volume holding <dir>` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |452| `Disk full: this computer's volume holding <dir> (Claude Code's temporary directory) has <n> MB free` / `Nearly out of inodes: this computer's volume holding <dir>` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |

438| `Disk full: a test write beside this command's output file` / `Disk quota used up: a test write beside this command's output file` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |453| `Disk full: a test write beside this command's output file` / `Disk quota used up: a test write beside this command's output file` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |

439| `The command was not started: this computer's disk is full (ENOSPC)` / `the user's disk quota is used up (EDQUOT)` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |454| `The command was not started: this computer's disk is full (ENOSPC)` / `the user's disk quota is used up (EDQUOT)` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |

455| `The sandbox could not create <dir>, a folder it must protect from the command, because the temp disk is full` | Free space on the temp disk or repair it, then have Claude run the command again. |

440| `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)` / `The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |456| `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)` / `The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |

441| `Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |457| `Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes` | [Tool errors](#disk-quota-or-temp-filesystem-is-full) |

442| `File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary` | [Tool errors](#file-is-not-valid-utf-8) |458| `File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary` | [Tool errors](#file-is-not-valid-utf-8) |


489| `Subprocess initialization did not complete within 60000ms` | [Wrapper and IDE errors](#subprocess-initialization-did-not-complete-within-60000ms) |505| `Subprocess initialization did not complete within 60000ms` | [Wrapper and IDE errors](#subprocess-initialization-did-not-complete-within-60000ms) |

490| `Claude Code did not finish starting` | [Wrapper and IDE errors](#subprocess-initialization-did-not-complete-within-60000ms) |506| `Claude Code did not finish starting` | [Wrapper and IDE errors](#subprocess-initialization-did-not-complete-within-60000ms) |

491| `The connection to Claude Code ended before this message completed` | [Wrapper and IDE errors](#the-connection-to-claude-code-ended-before-this-message-completed) |507| `The connection to Claude Code ended before this message completed` | [Wrapper and IDE errors](#the-connection-to-claude-code-ended-before-this-message-completed) |

508| `Dictation error: The speech service refused the connection` / `Dictation error: The connection to the speech service was lost` / `Dictation error: Couldn’t connect to the speech service`, in VS Code | Run **Claude Code: Show Logs** from the Command Palette and search for `Speech-to-text`. |

509| `The last request was refused`, on the VS Code sign-in screen | Select **Cancel**, then look up the conversation's error in this table. |

510| `Plan not copied: The new session starts without a plan file.`, in VS Code | If you need the plan, ask Claude to write it again in the new session. |

511| `A message is still queued` / `A /clear is still queued`, when you rewind code in VS Code | Stop Claude, then follow the rest of the message. |

512| `Couldn’t load the diff view or code colors`, in VS Code | Click a diff to try again, or reload the window. |

513| `Settings file is empty, and another program may still be writing it: <path>`, in VS Code | Try again in a minute. If the message repeats, put `{}` in the file. |

492| `Could not locate the Claude CLI on PATH` | [Wrapper and IDE errors](#could-not-locate-the-claude-cli-on-path) |514| `Could not locate the Claude CLI on PATH` | [Wrapper and IDE errors](#could-not-locate-the-claude-cli-on-path) |

493| `Claude Code could not be started from <command>: it is the <system> build, and this computer needs the <build> build` | If you set [`claudeCode.claudeProcessWrapper`](https://code.claude.com/docs/en/vs-code#extension-settings), point it at a program built for `<build>`. Otherwise, install the VS Code extension package for `<build>`. |515| `Claude Code could not be started from <command>: it is the <system> build, and this computer needs the <build> build` | If you set [`claudeCode.claudeProcessWrapper`](https://code.claude.com/docs/en/vs-code#extension-settings), point it at a program built for `<build>`. Otherwise, install the VS Code extension package for `<build>`. |

494| `The Claude Code program for this computer, the <build> build, could not be found` | [Wrapper and IDE errors](#the-claude-code-program-for-this-computer-could-not-be-found) |516| `The Claude Code program for this computer, the <build> build, could not be found` | [Wrapper and IDE errors](#the-claude-code-program-for-this-computer-could-not-be-found) |

495| `Restored the code, but skipped N files` | [Rewind warnings and errors](#restored-the-code-but-skipped-files) |517| `Restored the code, but skipped N files` | [Rewind warnings and errors](#restored-the-code-but-skipped-files) |

496| `No files were restored: N files failed (backup missing, or the file could not be updated)` | [Rewind warnings and errors](#no-files-were-restored) |518| `No files were restored: N files failed (backup missing, or the file could not be updated)` | [Rewind warnings and errors](#no-files-were-restored) |

497| `Couldn't restore N files: the backup is missing or the file can't be written` | Make the files that failed writable, then restore them from version control. |519| `Couldn't restore N files: the backup is missing or the file can't be written` | Make the files that failed writable, then restore them from version control. |

520| `Kept N files created since then, because a restore failed` | If you don't want the files Claude created after the checkpoint, delete them. |

498| `The file backups are still being copied. Nothing was changed. Try again in a moment.` | Select the same point in [`/rewind`](https://code.claude.com/docs/en/checkpointing) again. When you restore code soon after [`/branch`](https://code.claude.com/docs/en/sessions#branch-a-session), Claude Code can still be copying the file backups to the new session. |521| `The file backups are still being copied. Nothing was changed. Try again in a moment.` | Select the same point in [`/rewind`](https://code.claude.com/docs/en/checkpointing) again. When you restore code soon after [`/branch`](https://code.claude.com/docs/en/sessions#branch-a-session), Claude Code can still be copying the file backups to the new session. |

499| `Transcript writes are failing (...)` | [Session saving warnings](#transcript-writes-are-failing) |522| `Transcript writes are failing (...)` | [Session saving warnings](#transcript-writes-are-failing) |

500| `Transcript saving is off — CLAUDE_CODE_SKIP_PROMPT_HISTORY is set` | [Session saving warnings](#transcript-saving-is-off-skip-prompt-history) |523| `Transcript saving is off — CLAUDE_CODE_SKIP_PROMPT_HISTORY is set` | [Session saving warnings](#transcript-saving-is-off-skip-prompt-history) |


539| `headersHelper not run — this workspace has no persisted trust` | [Configuration warnings](#headershelper-not-run) |562| `headersHelper not run — this workspace has no persisted trust` | [Configuration warnings](#headershelper-not-run) |

540| `Invalid permission rule "..." was skipped: Malformed Tool(content) rule` | [Configuration warnings](#malformed-tool-content-rule) |563| `Invalid permission rule "..." was skipped: Malformed Tool(content) rule` | [Configuration warnings](#malformed-tool-content-rule) |

541| `matches no tool · check for typos` / `matches no known tool — check for typos` | [Configuration warnings](#matches-no-tool) |564| `matches no tool · check for typos` / `matches no known tool — check for typos` | [Configuration warnings](#matches-no-tool) |

565| `lets <tool> run without asking only in the working directories` / `adds nothing to <tool>'s default` | [Allow a file tool outside the working directories](https://code.claude.com/docs/en/permissions.md#allow-a-file-tool-outside-the-working-directories) |

542| `... is not matched by file permission checks` | [Configuration warnings](#is-not-matched-by-file-permission-checks) |566| `... is not matched by file permission checks` | [Configuration warnings](#is-not-matched-by-file-permission-checks) |

543| `Write(<path>) never matches · use Edit(<path>)` / `Glob(<path>) never matches · use Read(<path>)` | [Configuration warnings](#is-not-matched-by-file-permission-checks) |567| `Write(<path>) never matches · use Edit(<path>)` / `Glob(<path>) never matches · use Read(<path>)` | [Configuration warnings](#is-not-matched-by-file-permission-checks) |

544| `... has a wildcard before the rest of the command` | [Configuration warnings](#has-a-wildcard-before-the-rest-of-the-command) |568| `... has a wildcard before the rest of the command` | [Configuration warnings](#has-a-wildcard-before-the-rest-of-the-command) |


5973* Send the message again. The next message starts a fresh `claude` process that resumes the conversation.5997* Send the message again. The next message starts a fresh `claude` process that resumes the conversation.

5974* If it repeats, run `claude` in a terminal in the same project. A failure that keeps ending the process usually reproduces there with its real error message.5998* If it repeats, run `claude` in a terminal in the same project. A failure that keeps ending the process usually reproduces there with its real error message.

5975 5999 

6000### Claude Code needs a recent sign-in

6001 

6002When a local, WSL, or SSH session in the Code tab needs a new saved sign-in and you haven't signed in recently, the [Claude Desktop app](https://code.claude.com/docs/en/desktop.md) shows this message:

6003 

6004```text theme={null}

6005For security, Claude Code needs a recent sign-in.

6006```

6007 

6008For these sessions, being asked up to about once a month for each account and organization on each computer is routine, with or without single sign-on (SSO).

6009 

6010**What to do:**

6011 

6012* Click **Sign in again** on the card, then sign in

6013* If a banner at the top of the Code tab says `Claude Code needs a recent sign-in. Signing in won’t stop sessions.`, click **Sign in again** on the banner

6014* If you're asked again within three weeks for these sessions, with the same account and organization on the same computer, [check your version](https://code.claude.com/docs/en/desktop.md#check-your-version) of Claude Desktop. If it's older than v5.11492.0, update it:

6015 * **macOS**: select **Claude > Check for Updates…**

6016 * **Windows**: select **Help > Check for Updates…**, or update through the Microsoft Store if you installed the app from there

6017 * **Linux**: [update through apt](https://code.claude.com/docs/en/desktop-linux.md#update)

6018 * **Managed updates**: if your organization [turns off auto-updates](https://code.claude.com/docs/en/desktop.md#device-management-policies), ask your administrator for v5.11492.0 or later

6019* If that continues on v5.11492.0 or later, [contact support](https://code.claude.com/docs/en/desktop.md#still-stuck)

6020 

6021If you see the card in a Remote Control session, see [Trusted Devices](https://code.claude.com/docs/en/remote-control.md#trusted-devices), which can ask for a more recent sign-in.

6022 

6023Before Claude Desktop v5.11492.0, the Code tab could lose its saved sign-in when a company proxy or gateway answered its background renewal with a JSON error.

6024 

5976## Rewind warnings and errors6025## Rewind warnings and errors

5977 6026 

5978These messages come from a [`/rewind`](https://code.claude.com/docs/en/checkpointing) code restore. `Restored the code, but skipped N files` is a warning that Claude Code skipped some paths. `No files were restored` is an error that means it restored nothing.6027These messages come from a [`/rewind`](https://code.claude.com/docs/en/checkpointing) code restore. `Restored the code, but skipped N files` is a warning that Claude Code skipped some paths. `No files were restored` is an error that means it restored nothing.


5999 6048 

6000### No files were restored6049### No files were restored

6001 6050 

6002Claude Code shows this message when you restore code with [`/rewind`](https://code.claude.com/docs/en/checkpointing) and it can't restore any of the files in that checkpoint. For each file, either the backup Claude Code saved before editing it is missing, or Claude Code couldn't write to or delete the file.6051You see this message when a [`/rewind`](https://code.claude.com/docs/en/checkpointing) code restore fails on at least one file and restores no files.

6003 6052 

6004```text theme={null}6053```text theme={null}

6005Failed to restore the code:6054Failed to restore the code:

fast-mode.md +1 −1

Details

259* Availability and pricing are subject to change259* Availability and pricing are subject to change

260* The underlying API configuration may evolve260* The underlying API configuration may evolve

261 261 

262Report issues or feedback through your usual Anthropic support channels.262Report issues or feedback through Anthropic support.

263 263 

264## See also264## See also

265 265 

Details

47These require signing in with a claude.ai account and are not reachable with an Anthropic Console API key or from a third-party provider:47These require signing in with a claude.ai account and are not reachable with an Anthropic Console API key or from a third-party provider:

48 48 

49* [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) and Claude Code on mobile49* [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) and Claude Code on mobile

50* [Claude Code in Slack](https://code.claude.com/docs/en/slack.md): Pro, Max, and Ultra plans

51* [Claude Code Desktop](https://code.claude.com/docs/en/desktop.md)50* [Claude Code Desktop](https://code.claude.com/docs/en/desktop.md)

52* [Cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) (`/schedule`)51* [Cloud scheduled tasks](https://code.claude.com/docs/en/routines.md) (`/schedule`)

53* [Ultrareview](https://code.claude.com/docs/en/ultrareview.md)52* [Ultrareview](https://code.claude.com/docs/en/ultrareview.md)

Details

123>123>

124> **Use an output style** if it's about the response itself and you might want it off again: length, format, how much Claude explains, or a different role such as a writing assistant. Claude Code includes [built-in styles](https://code.claude.com/docs/en/output-styles.md#built-in-output-styles), and you can write your own.124> **Use an output style** if it's about the response itself and you might want it off again: length, format, how much Claude explains, or a different role such as a writing assistant. Claude Code includes [built-in styles](https://code.claude.com/docs/en/output-styles.md#built-in-output-styles), and you can write your own.

125>125>

126> **They combine.** CLAUDE.md stays loaded whichever style you pick. Claude follows both as instructions, so neither is enforced. For anything that has to happen every time, use a [hook](https://code.claude.com/docs/en/hooks-guide.md).126> **They combine.** Claude follows both as instructions, so neither is enforced. For anything that has to happen every time, use a [hook](https://code.claude.com/docs/en/hooks-guide.md).

127 127 

128> [tab] CLAUDE.md vs Rules vs Skills128> [tab] CLAUDE.md vs Rules vs Skills

129>129>


252 252 

253> [tab] Skills253> [tab] Skills

254>254>

255> Skills are extra capabilities in Claude's toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](https://code.claude.com/docs/en/commands.md) like `/code-review`, `/batch`, and `/debug` that work without setup. You can also create your own.255> Skills are extra capabilities in Claude's toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](https://code.claude.com/docs/en/commands.md) like `/code-review`, `/batch`, and `/debug`. You can also create your own.

256>256>

257> **When:** Depends on the skill's configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.257> **When:** Depends on the skill's configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.

258>258>

hooks.md +87 −9

Details

24* per turn: `UserPromptSubmit`, `Stop`, and `StopFailure`24* per turn: `UserPromptSubmit`, `Stop`, and `StopFailure`

25* on every tool call inside the agentic loop: `PreToolUse` and `PostToolUse`, except [`EndConversation`](https://code.claude.com/docs/en/tools-reference#endconversation-tool-behavior) calls, which skip both25* on every tool call inside the agentic loop: `PreToolUse` and `PostToolUse`, except [`EndConversation`](https://code.claude.com/docs/en/tools-reference#endconversation-tool-behavior) calls, which skip both

26 26 

27![Hook lifecycle diagram showing optional Setup feeding into SessionStart, then a per-turn loop containing UserPromptSubmit, UserPromptExpansion for slash commands, the nested agentic loop (PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, PostToolBatch, SubagentStart/Stop, TaskCreated, TaskCompleted), and Stop or StopFailure, followed by TeammateIdle, PreCompact, PostCompact, and SessionEnd, with Elicitation and ElicitationResult nested inside MCP tool execution, PermissionDenied as a side branch from PermissionRequest for auto-mode denials, WorktreeCreate, WorktreeRemove, Notification, ConfigChange, InstructionsLoaded, CwdChanged, FileChanged, and DirectoryAdded as standalone async events, PreModelSwitch as a standalone sequential event that runs before a requested model switch, PostModelSwitch as a standalone async event that runs after the session's model changes, and MessageDisplay as a display-only event that runs while assistant message text streams](https://mintcdn.com/claude-code/x7pO8l4XcvAXCoVc/images/hooks-lifecycle.svg?fit=max\&auto=format\&n=x7pO8l4XcvAXCoVc\&q=85\&s=81b9256c1bbe8832553485f5d9e9c746)27![Hook lifecycle diagram showing optional Setup feeding into SessionStart, then a per-turn loop containing UserPromptSubmit, UserPromptExpansion for slash commands, the nested agentic loop (PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, PostToolBatch, SubagentStart/Stop, TaskCreated, TaskCompleted), and Stop or StopFailure, followed by TeammateIdle, PreCompact, PostCompact, and SessionEnd, with Elicitation and ElicitationResult nested inside MCP tool execution, PermissionDenied as a side branch from PermissionRequest for auto-mode denials, WorktreeCreate, WorktreeRemove, Notification, ConfigChange, InstructionsLoaded, CwdChanged, FileChanged, and DirectoryAdded as standalone async events, PreSkillShellCommand as a standalone blocking event that runs before a shell command in a loading skill, PreModelSwitch as a standalone sequential event that runs before a requested model switch, PostModelSwitch as a standalone async event that runs after the session's model changes, and MessageDisplay as a display-only event that runs while assistant message text streams](https://mintcdn.com/claude-code/IWhl7FXSx6ARoVoo/images/hooks-lifecycle.svg?fit=max\&auto=format\&n=IWhl7FXSx6ARoVoo\&q=85\&s=a8adf56a3d13b8a8ba9c446bbd7171f8)

28 28 

29The table below summarizes when each event fires. The [Hook events](#hook-events) section documents the full input schema and decision control options for each one.29The table below summarizes when each event fires. The [Hook events](#hook-events) section documents the full input schema and decision control options for each one.

30 30 


34| `Setup` | When you start Claude Code with `--init-only`, or with `--init` or `--maintenance` in `-p` mode. For one-time preparation in CI or scripts |34| `Setup` | When you start Claude Code with `--init-only`, or with `--init` or `--maintenance` in `-p` mode. For one-time preparation in CI or scripts |

35| `UserPromptSubmit` | When a prompt is submitted, before Claude processes it. Also fires on [turns Claude Code starts on its own](https://code.claude.com/docs/en/hooks.md#userpromptsubmit) |35| `UserPromptSubmit` | When a prompt is submitted, before Claude processes it. Also fires on [turns Claude Code starts on its own](https://code.claude.com/docs/en/hooks.md#userpromptsubmit) |

36| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |36| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |

37| `PreSkillShellCommand` | Before a skill's [injected shell command](https://code.claude.com/docs/en/skills.md#inject-dynamic-context) runs. Can block the command |

37| `PreToolUse` | Before a tool call executes. Can block it |38| `PreToolUse` | Before a tool call executes. Can block it |

38| `PermissionRequest` | When a tool call needs a permission decision |39| `PermissionRequest` | When a tool call needs a permission decision |

39| `PermissionDenied` | When auto mode denies a tool call, including denials without a classifier verdict. Use JSON `hookSpecificOutput.retry: true` to tell the model it may retry the denied tool call. Claude Code ignores `retry` when the classifier produced no verdict |40| `PermissionDenied` | When auto mode denies a tool call, including denials without a classifier verdict. Use JSON `hookSpecificOutput.retry: true` to tell the model it may retry the denied tool call. Claude Code ignores `retry` when the classifier produced no verdict |


308| `StopFailure` | error type | `rate_limit`, `authentication_failed`, `oauth_org_not_allowed`, `account_on_hold`, `billing_error`, `invalid_request`, `model_not_found`, `server_error`, `max_output_tokens`, `cloud_credential_error`, `unknown` |309| `StopFailure` | error type | `rate_limit`, `authentication_failed`, `oauth_org_not_allowed`, `account_on_hold`, `billing_error`, `invalid_request`, `model_not_found`, `server_error`, `max_output_tokens`, `cloud_credential_error`, `unknown` |

309| `InstructionsLoaded` | load reason | `session_start`, `nested_traversal`, `path_glob_match`, `include`, `compact` |310| `InstructionsLoaded` | load reason | `session_start`, `nested_traversal`, `path_glob_match`, `include`, `compact` |

310| `UserPromptExpansion` | command name | your skill or command names |311| `UserPromptExpansion` | command name | your skill or command names |

312| `PreSkillShellCommand` | tool that runs the command | `Bash`, `PowerShell` |

311| `Elicitation` | MCP server name | your configured MCP server names |313| `Elicitation` | MCP server name | your configured MCP server names |

312| `ElicitationResult` | MCP server name | same values as `Elicitation` |314| `ElicitationResult` | MCP server name | same values as `Elicitation` |

313| `UserPromptSubmit`, `PostToolBatch`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, `MessageDisplay` | no matcher support | always fires on every occurrence |315| `UserPromptSubmit`, `PostToolBatch`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, `MessageDisplay` | no matcher support | always fires on every occurrence |


421| Field | Required | Description |423| Field | Required | Description |

422| :- | :- | :- |424| :- | :- | :- |

423| `type` | yes | `"command"`, `"http"`, `"mcp_tool"`, `"prompt"`, or `"agent"` |425| `type` | yes | `"command"`, `"http"`, `"mcp_tool"`, `"prompt"`, or `"agent"` |

424| `if` | no | [Permission rule syntax](https://code.claude.com/docs/en/permissions.md#permission-rule-syntax) to filter when this hook runs, such as `"Bash(git *)"` or `"Edit(*.ts)"`. The hook command only runs if the tool call matches the pattern. See the [Bash matching table](#bash-if-matching) for how Bash patterns evaluate against subcommands, `$()`, and backticks. Only evaluated on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, and `PermissionDenied`. On other events, a hook with `if` set never runs |426| `if` | no | [Permission rule syntax](https://code.claude.com/docs/en/permissions.md#permission-rule-syntax) to filter when this hook runs, such as `"Bash(git *)"` or `"Edit(*.ts)"`. The hook command only runs if the tool call matches the pattern. See the [Bash matching table](#bash-if-matching) for how Bash patterns evaluate against subcommands, `$()`, and backticks. Only evaluated on `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied`, and `PreSkillShellCommand`. On other events, a hook with `if` set doesn't run |

425| `timeout` | no | Seconds before canceling. Claude Code doesn't enforce it on a command hook you run with [`async: true`](#run-hooks-in-the-background). Defaults: 600 for `command`, `http`, and `mcp_tool`; 30 for `prompt`; 60 for `agent`. Claude Code lowers the `command`, `http`, and `mcp_tool` default to 30 on [`UserPromptSubmit`](#userpromptsubmit), [`PreModelSwitch`](#premodelswitch), and [`PostModelSwitch`](#postmodelswitch), and to 10 on [`MessageDisplay`](#messagedisplay). [`SessionEnd`](#sessionend) hooks share a 1.5-second budget; if your settings set a longer per-hook `timeout`, Claude Code raises the budget to match, up to 60 seconds |427| `timeout` | no | Seconds before canceling. Claude Code doesn't enforce it on a command hook you run with [`async: true`](#run-hooks-in-the-background). Defaults: 600 for `command`, `http`, and `mcp_tool`; 30 for `prompt`; 60 for `agent`. Claude Code lowers the `command`, `http`, and `mcp_tool` default to 30 on [`UserPromptSubmit`](#userpromptsubmit), [`PreModelSwitch`](#premodelswitch), and [`PostModelSwitch`](#postmodelswitch), and to 10 on [`MessageDisplay`](#messagedisplay). [`SessionEnd`](#sessionend) hooks share a 1.5-second budget; if your settings set a longer per-hook `timeout`, Claude Code raises the budget to match, up to 60 seconds |

426| `statusMessage` | no | Custom spinner message displayed while the hook runs |428| `statusMessage` | no | Custom spinner message displayed while the hook runs |

427| `once` | no | If `true`, Claude Code removes the hook after its first successful run. A run that fails, blocks with exit code 2, or times out leaves the hook in place, so it runs again on the next matching event. Only honored for hooks declared in [skill frontmatter](#hooks-in-skills-and-agents); ignored in settings files and agent frontmatter |429| `once` | no | If `true`, Claude Code removes the hook after its first successful run. A run that fails, blocks with exit code 2, or times out leaves the hook in place, so it runs again on the next matching event. Only honored for hooks declared in [skill frontmatter](#hooks-in-skills-and-agents); ignored in settings files and agent frontmatter |


708 710 

709When a skill's frontmatter hooks don't fire after you or Claude invoke the skill, run [`/hooks`](#the-%2Fhooks-menu) in that session. If it lists them, see [Hook not firing](https://code.claude.com/docs/en/hooks-guide.md#hook-not-firing). If it lists none of them, the skill may be under a plugin-only lock or past a hook limit, and runs without any of its frontmatter hooks. Check for each case:711When a skill's frontmatter hooks don't fire after you or Claude invoke the skill, run [`/hooks`](#the-%2Fhooks-menu) in that session. If it lists them, see [Hook not firing](https://code.claude.com/docs/en/hooks-guide.md#hook-not-firing). If it lists none of them, the skill may be under a plugin-only lock or past a hook limit, and runs without any of its frontmatter hooks. Check for each case:

710 712 

711* **Plugin-only lock**: your organization's administrator can lock hooks to plugins and managed settings with the [`strictPluginOnlyCustomization`](https://code.claude.com/docs/en/settings-reference#strictpluginonlycustomization-hooks) managed setting. A skill keeps its frontmatter hooks under that lock only if it's a plugin skill, a [bundled skill](https://code.claude.com/docs/en/skills.md#bundled-skills), or a skill in the [managed settings directory](https://code.claude.com/docs/en/managed-settings.md#delivery-mechanisms). The hooks in your own settings files don't run either.713* **Plugin-only lock**: if you're in an organization, your administrator can lock hooks to plugins and managed settings with the [`strictPluginOnlyCustomization`](https://code.claude.com/docs/en/settings-reference#strictpluginonlycustomization-hooks) managed setting. A skill keeps its frontmatter hooks under that lock only if it's a plugin skill, a [bundled skill](https://code.claude.com/docs/en/skills.md#bundled-skills), or a skill in the [managed settings directory](https://code.claude.com/docs/en/managed-settings.md#delivery-mechanisms). The hooks in your own settings files don't run either.

712 * **Check**: type `/status` in a Claude Code session. If the [`Setting sources` line](https://code.claude.com/docs/en/settings#check-what-your-organization-enforces) includes `Enterprise managed settings`, ask your administrator whether `strictPluginOnlyCustomization` locks hooks.714 * **Check**: type `/status` in a Claude Code session. If the [`Setting sources` line](https://code.claude.com/docs/en/settings#check-what-your-organization-enforces) includes `Enterprise managed settings`, ask your administrator whether `strictPluginOnlyCustomization` locks hooks.

713 * **Fix**: move the skill into a [plugin](https://code.claude.com/docs/en/plugins/create.md#convert-an-existing-claude-setup), because plugin skills keep their frontmatter hooks. List the plugin in a [marketplace](https://code.claude.com/docs/en/plugins/create-marketplace.md#create-a-marketplace), then install it from there. If Claude Code refuses the marketplace with [`is blocked by enterprise policy`](https://code.claude.com/docs/en/plugins/troubleshooting#marketplace-source-is-blocked-by-enterprise-policy), ask your administrator to allow that marketplace.715 * **Fix**: move the skill into a [plugin](https://code.claude.com/docs/en/plugins/create.md#convert-an-existing-claude-setup), because plugin skills keep their frontmatter hooks. List the plugin in a [marketplace](https://code.claude.com/docs/en/plugins/create-marketplace.md#create-a-marketplace), then install it from there. If Claude Code refuses the marketplace with [`is blocked by enterprise policy`](https://code.claude.com/docs/en/plugins/troubleshooting#marketplace-source-is-blocked-by-enterprise-policy), ask your administrator to allow that marketplace.

714* **Hook limit**: in Claude Code v2.1.304 or later, each source of skills has its own limit per session. Your project, your personal skills folder, and each plugin count as separate sources. The skills from one source can register at most 1,024 hooks. Those hooks' matchers can total at most 16,384 characters. A matcher with several hooks under it counts once for each hook.716* **Hook limit**: in Claude Code v2.1.304 or later, each source of skills has its own limit per session. Your project, your personal skills folder, and each plugin count as separate sources. The skills from one source can register at most 1,024 hooks. Those hooks' matchers can total at most 16,384 characters. A matcher with several hooks under it counts once for each hook.


943 945 

944> [!NOTE]946> [!NOTE]

945>947>

946> On Windows without Git Bash, a shell-form `PreToolUse` or `PermissionRequest` command hook that fails with `onFailure` unset can instead [block the tool call](#failed-hooks-on-windows-without-git-bash).948> On Windows without Git Bash, a shell-form `PreToolUse`, `PermissionRequest`, or `PreSkillShellCommand` command hook that fails with `onFailure` unset can instead [block the action](#failed-hooks-on-windows-without-git-bash).

947 949 

948This `PreToolUse` hook in `.claude/settings.json` runs a project script before each Bash command, and blocks the command if the script fails:950This `PreToolUse` hook in `.claude/settings.json` runs a project script before each Bash tool call, and blocks the command if the script fails:

949 951 

950```json theme={null}952```json theme={null}

951{953{


998 1000 

999#### Failed hooks on Windows without Git Bash1001#### Failed hooks on Windows without Git Bash

1000 1002 

1001If the error for a blocked tool call includes this text, a `PreToolUse` or `PermissionRequest` command hook failed or timed out and blocked the call:1003If the error for a blocked tool call or [injected command](#preskillshellcommand) includes this text, a command hook on `PreToolUse`, `PermissionRequest`, or `PreSkillShellCommand` failed or timed out and blocked it:

1002 1004 

1003```text theme={null}1005```text theme={null}

1004blocking because Git Bash wasn't found, so only exit code 0 or 2 counts as this hook's verdict.1006blocking because Git Bash wasn't found, so only exit code 0 or 2 counts as this hook's verdict.


1037| `PermissionRequest` | No | Not read as a decision. Deny through the [`decision` object](#permissionrequest-decision-control) instead |1039| `PermissionRequest` | No | Not read as a decision. Deny through the [`decision` object](#permissionrequest-decision-control) instead |

1038| `UserPromptSubmit` | Yes | Blocks the prompt. See [What a blocked prompt leaves behind](#what-a-blocked-prompt-leaves-behind) |1040| `UserPromptSubmit` | Yes | Blocks the prompt. See [What a blocked prompt leaves behind](#what-a-blocked-prompt-leaves-behind) |

1039| `UserPromptExpansion` | Yes | Blocks the expansion |1041| `UserPromptExpansion` | Yes | Blocks the expansion |

1042| `PreSkillShellCommand` | Yes | Blocks the command, and the skill loads without its output |

1040| `Stop` | Yes | Prevents Claude from stopping, continues the conversation |1043| `Stop` | Yes | Prevents Claude from stopping, continues the conversation |

1041| `SubagentStop` | Yes | Prevents the subagent from stopping |1044| `SubagentStop` | Yes | Prevents the subagent from stopping |

1042| `TeammateIdle` | Yes | Prevents the teammate from going idle, so it continues working |1045| `TeammateIdle` | Yes | Prevents the teammate from going idle, so it continues working |


1213| TaskCreated | Exit code or top-level `decision` | Exit code 2 or `decision: "block"` [cancels the task](#taskcreated-decision-control) and returns the message to Claude. `continue: false` is ignored |1216| TaskCreated | Exit code or top-level `decision` | Exit code 2 or `decision: "block"` [cancels the task](#taskcreated-decision-control) and returns the message to Claude. `continue: false` is ignored |

1214| PreToolUse | `hookSpecificOutput` | `permissionDecision` (allow/deny/ask/defer), `permissionDecisionReason` |1217| PreToolUse | `hookSpecificOutput` | `permissionDecision` (allow/deny/ask/defer), `permissionDecisionReason` |

1215| PreModelSwitch | `hookSpecificOutput` or top-level `decision` | `permissionDecision` (allow/deny/ask), `permissionDecisionReason`. `decision: "block"` also [cancels the switch](#premodelswitch-decision-control) |1218| PreModelSwitch | `hookSpecificOutput` or top-level `decision` | `permissionDecision` (allow/deny/ask), `permissionDecisionReason`. `decision: "block"` also [cancels the switch](#premodelswitch-decision-control) |

1219| PreSkillShellCommand | `hookSpecificOutput` or top-level `decision` | `permissionDecision`, `permissionDecisionReason`. The hook [can only block](#preskillshellcommand-decision-control) |

1216| PermissionRequest | `hookSpecificOutput` | `decision.behavior` (allow/deny) |1220| PermissionRequest | `hookSpecificOutput` | `decision.behavior` (allow/deny) |

1217| PermissionDenied | `hookSpecificOutput` | `retry: true` tells the model it may retry the denied tool call; Claude Code ignores it for [no-verdict denials](#permissiondenied-decision-control) |1221| PermissionDenied | `hookSpecificOutput` | `retry: true` tells the model it may retry the denied tool call; Claude Code ignores it for [no-verdict denials](#permissiondenied-decision-control) |

1218| WorktreeCreate | path return | Command hook prints path on stdout; HTTP hook returns `hookSpecificOutput.worktreePath`. Hook failure or missing path fails creation |1222| WorktreeCreate | path return | Command hook prints path on stdout; HTTP hook returns `hookSpecificOutput.worktreePath`. Hook failure or missing path fails creation |


1229* `PostToolUse`: `updatedToolOutput` replaces the tool's result. See [PostToolUse decision control](#posttooluse-decision-control), including limits in a [Cowork](https://claude.com/docs/cowork/overview) cloud session1233* `PostToolUse`: `updatedToolOutput` replaces the tool's result. See [PostToolUse decision control](#posttooluse-decision-control), including limits in a [Cowork](https://claude.com/docs/cowork/overview) cloud session

1230* `UserPromptSubmit`: can't replace the prompt; it only injects `additionalContext` alongside it1234* `UserPromptSubmit`: can't replace the prompt; it only injects `additionalContext` alongside it

1231 1235 

1232For redaction or transformation use cases, intercept at `PreToolUse` for outbound tool inputs and `PostToolUse` for the results of successful calls. `PostToolUseFailure` can't rewrite a result, so it can't redact a failing command's output.

1233 

1234Here are examples of each pattern in action:1236Here are examples of each pattern in action:

1235 1237 

1236> [tab] Top-level decision1238> [tab] Top-level decision


1654}1656}

1655```1657```

1656 1658 

1659### PreSkillShellCommand

1660 

1661Runs before an [injected command](https://code.claude.com/docs/en/skills.md#inject-dynamic-context), a shell command that runs while a skill or a command such as `/security-review` loads. [PreToolUse](#pretooluse) hooks don't fire for injected commands. To log or block them with a script you already run on PreToolUse, add the script to this event too. In a skill's file, injected commands appear as `` !`<command>` `` or in a ` ```! ` block.

1662 

1663Requires Claude Code v2.1.332 or later, including in the desktop app and VS Code extension. Update before you add the hook, because earlier versions run injected commands without calling it. If you add it to a settings file first, an earlier version such as v2.1.331 opens each interactive terminal session with a [warning dialog](https://code.claude.com/docs/en/settings.md#fix-a-broken-settings-file): `Unknown hook event "PreSkillShellCommand" was ignored`. To enforce a minimum version, see [`requiredMinimumVersion`](https://code.claude.com/docs/en/settings-reference#requiredminimumversion).

1664 

1665For a hook that has to block commands, set the matcher, type, location, and failure handling this way:

1666 

1667* **Matcher**: use `Bash|PowerShell` to cover [both tools that run injected commands](https://code.claude.com/docs/en/skills.md#how-injected-commands-run).

1668* **Type**: use a `command`, `http`, or `mcp_tool` hook that isn't [async](#run-hooks-in-the-background), because an async hook can't block. If you configure a `prompt` or `agent` hook on this event, Claude Code can't run it and blocks each command the hook matches.

1669* **Location**: define the hook in a [settings file](#hook-locations), such as managed settings, or in a plugin. A skill's injected commands run without the hooks in its own frontmatter on its first load in a session and on loads inside a subagent. A [forked skill](https://code.claude.com/docs/en/skills.md#run-skills-in-a-subagent)'s injected commands run without the hooks in its own frontmatter or in its subagent's definition.

1670* **Failures**: set [`onFailure: "block"`](#block-the-action-when-a-hook-fails) so the command doesn't run when the hook fails or times out.

1671 

1672You can reuse the blocking script from [How a hook resolves](#how-a-hook-resolves).

1673 

1674On macOS and Linux, this entry in `.claude/settings.json` runs the script in [exec form](#exec-form-and-shell-form):

1675 

1676```json theme={null}

1677{

1678 "hooks": {

1679 "PreSkillShellCommand": [

1680 {

1681 "matcher": "Bash|PowerShell",

1682 "hooks": [

1683 { "type": "command", "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh", "args": [], "onFailure": "block" }

1684 ]

1685 }

1686 ]

1687 }

1688}

1689```

1690 

1691On Windows, replace `command` and `args` in this entry with the ones in the Windows tab of [How a hook resolves](#how-a-hook-resolves).

1692 

1693To test this example on macOS or Linux, create `.claude/skills/hook-test/SKILL.md` with the single line `` !`echo 'rm -rf'` ``. This [read-only command](https://code.claude.com/docs/en/permissions.md#read-only-commands) needs no approval and deletes nothing. Start a session in your terminal and type `/hook-test`. You see `Not run in /hook-test: echo 'rm -rf' (blocked by hook: Destructive command blocked by hook)`.

1694 

1695#### Commands that reach a PreSkillShellCommand hook

1696 

1697Your script runs after the [permission check on injected commands](https://code.claude.com/docs/en/skills.md#permission-checks-on-injected-commands), so it gets the commands that passed. It also runs in `bypassPermissions` mode.

1698 

1699In auto mode, a command that would otherwise need approval doesn't run while the skill loads. Claude can run it afterward as a tool call, which fires `PreToolUse` and not this event, so keep your script on both events.

1700 

1701#### PreSkillShellCommand input

1702 

1703In addition to the [common input fields](#common-input-fields), which include `permission_mode`, PreSkillShellCommand hooks receive the fields in this table:

1704 

1705| Field | Description |

1706| :- | :- |

1707| `tool_name` | The tool that runs the command, `Bash` or `PowerShell` |

1708| `tool_input.command` | The shell command as it would run |

1709| `tool_use_id` | ID of this command, which names no tool call in the transcript |

1710| `command_name` | Name of the skill or command that is loading, such as `pr-summary`, or `my-plugin:deploy` for a plugin's skill |

1711| `command_source` | Where the skill or command comes from, such as `userSettings`, `projectSettings`, `policySettings`, `plugin`, or `builtin` |

1712| `invoked_by` | `"user"` when you typed the skill's name or an Agent SDK app sent it, or `"claude"` when Claude or a [session-scoped scheduled task](https://code.claude.com/docs/en/scheduled-tasks.md) invoked the skill. `"other"` for anything else, such as a subagent that [preloads the skill](https://code.claude.com/docs/en/sub-agents.md#preload-skills-into-subagents). |

1713 

1714#### PreSkillShellCommand decision control

1715 

1716To block an injected command, have your script exit 2 or return `permissionDecision: "deny"`, and the skill loads without running that command. You can block a command from this hook, but you can't approve or change one.

1717 

1718For a JSON response, use the [PreToolUse format](#pretooluse-decision-control). To use one script on both events, leave `hookEventName` as `PreToolUse`. For a script you run only on this event, you can set `hookEventName` to `PreSkillShellCommand`.

1719 

1720| Hook outcome | What happens |

1721| :- | :- |

1722| Exit 0 with no decision, or `permissionDecision: "allow"` | The command runs unless another hook blocks it |

1723| Exit 2, `permissionDecision: "deny"`, or top-level `decision: "block"` | The command doesn't run. The skill still loads, and Claude reads `[not run: blocked by hook: <reason>]` in place of the command's output. |

1724| `permissionDecision: "ask"` or `"defer"`, or any `updatedInput` | Claude Code blocks the command the same way as `"deny"` |

1725| `continue: false` | Invoking the skill fails with `Operation stopped by hook: <stopReason>`. None of its injected commands runs, because Claude Code collects your hooks' answers before it runs the first one. |

1726| A `command`, `http`, or `mcp_tool` hook fails, for example by exiting 1 with no JSON output, or times out | The command runs unless the hook is [one whose failure blocks the action](#block-the-action-when-a-hook-fails). In a [Code Mode](https://code.claude.com/docs/en/code-mode.md#tool-call-refused-by-a-hook) session where Claude has already run code, a timeout blocks the command by default. |

1727 

1728When you type a skill's name in your terminal, a `Not run in /<name>` line reports a blocked command. A `Ran anyway in /<name>` line reports a command that ran after its hook failed or timed out.

1729 

1730To give a reason for a block, write it to stderr when you exit 2. In JSON, put it in `permissionDecisionReason`, or in `reason` beside a top-level `decision`. While [Remote Control](https://code.claude.com/docs/en/remote-control.md) is connected, the hook still blocks, and neither you nor Claude sees the reason. Find it in the [debug log](#debug-hooks).

1731 

1657### MessageDisplay1732### MessageDisplay

1658 1733 

1659Runs while an assistant message streams to the screen. Claude Code displays the message in increments: each time a batch of newly completed lines is ready to render, the hook runs once with those lines and Claude Code renders the hook's replacement text in their place. A long message produces several calls; a short message may produce only one.1734Runs while an assistant message streams to the screen. Claude Code displays the message in increments: each time a batch of newly completed lines is ready to render, the hook runs once with those lines and Claude Code renders the hook's replacement text in their place. A long message produces several calls; a short message may produce only one.


1791 1866 

1792> [!WARNING]1867> [!WARNING]

1793>1868>

1794> PreToolUse runs only when Claude calls a tool. By default, files you [reference with `@` in your prompt](https://code.claude.com/docs/en/common-workflows#reference-files-and-directories) are added without any tool call. Claude Code inserts their contents while building the prompt, so no PreToolUse hook fires for them, including hooks matching `Read`. PreToolUse also doesn't fire for [`EndConversation`](https://code.claude.com/docs/en/tools-reference#endconversation-tool-behavior).1869> PreToolUse runs when Claude calls a tool. It doesn't fire for [injected commands](https://code.claude.com/docs/en/skills.md#inject-dynamic-context), the shell commands that pass a [permission check](https://code.claude.com/docs/en/skills.md#permission-checks-on-injected-commands) and run while a skill loads. To log or block those, add a [PreSkillShellCommand](#preskillshellcommand) hook.

1870>

1871> By default, files you [reference with `@` in your prompt](https://code.claude.com/docs/en/common-workflows#reference-files-and-directories) are added without any tool call. Claude Code inserts their contents while building the prompt, so no PreToolUse hook fires for them, including hooks matching `Read`. PreToolUse also doesn't fire for [`EndConversation`](https://code.claude.com/docs/en/tools-reference#endconversation-tool-behavior).

1795>1872>

1796> You can block specific paths from `@` references, or turn the insertion off:1873> You can block specific paths from `@` references, or turn the insertion off:

1797>1874>


4032* `PostModelSwitch`4109* `PostModelSwitch`

4033* `PreCompact`4110* `PreCompact`

4034* `PreModelSwitch`4111* `PreModelSwitch`

4112* `PreSkillShellCommand`

4035* `SessionEnd`4113* `SessionEnd`

4036* `StopFailure`4114* `StopFailure`

4037* `SubagentStart`4115* `SubagentStart`

hooks-guide.md +5 −1

Details

475| `Setup` | When you start Claude Code with `--init-only`, or with `--init` or `--maintenance` in `-p` mode. For one-time preparation in CI or scripts |475| `Setup` | When you start Claude Code with `--init-only`, or with `--init` or `--maintenance` in `-p` mode. For one-time preparation in CI or scripts |

476| `UserPromptSubmit` | When a prompt is submitted, before Claude processes it. Also fires on [turns Claude Code starts on its own](https://code.claude.com/docs/en/hooks.md#userpromptsubmit) |476| `UserPromptSubmit` | When a prompt is submitted, before Claude processes it. Also fires on [turns Claude Code starts on its own](https://code.claude.com/docs/en/hooks.md#userpromptsubmit) |

477| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |477| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |

478| `PreSkillShellCommand` | Before a skill's [injected shell command](https://code.claude.com/docs/en/skills.md#inject-dynamic-context) runs. Can block the command |

478| `PreToolUse` | Before a tool call executes. Can block it |479| `PreToolUse` | Before a tool call executes. Can block it |

479| `PermissionRequest` | When a tool call needs a permission decision |480| `PermissionRequest` | When a tool call needs a permission decision |

480| `PermissionDenied` | When auto mode denies a tool call, including denials without a classifier verdict. Use JSON `hookSpecificOutput.retry: true` to tell the model it may retry the denied tool call. Claude Code ignores `retry` when the classifier produced no verdict |481| `PermissionDenied` | When auto mode denies a tool call, including denials without a classifier verdict. Use JSON `hookSpecificOutput.retry: true` to tell the model it may retry the denied tool call. Claude Code ignores `retry` when the classifier produced no verdict |


694| `ElicitationResult` | MCP server name | same values as `Elicitation` |695| `ElicitationResult` | MCP server name | same values as `Elicitation` |

695| `FileChanged` | literal filenames to watch (see [FileChanged](https://code.claude.com/docs/en/hooks.md#filechanged)) | `.envrc\|.env` |696| `FileChanged` | literal filenames to watch (see [FileChanged](https://code.claude.com/docs/en/hooks.md#filechanged)) | `.envrc\|.env` |

696| `UserPromptExpansion` | command name | your skill or command names |697| `UserPromptExpansion` | command name | your skill or command names |

698| `PreSkillShellCommand` | tool that runs the command | `Bash`, `PowerShell` |

697| `UserPromptSubmit`, `PostToolBatch`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, `CwdChanged`, `MessageDisplay` | no matcher support | always fires on every occurrence |699| `UserPromptSubmit`, `PostToolBatch`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, `CwdChanged`, `MessageDisplay` | no matcher support | always fires on every occurrence |

698 700 

699The tabs below show a few more matchers on different event types.701The tabs below show a few more matchers on different event types.


805 807 

806The `if` field accepts the same patterns as permission rules: `"Bash(git *)"`, `"Edit(*.ts)"`, and so on. To match multiple tool names, use separate handlers each with its own `if` value, or match at the `matcher` level where pipe alternation is supported.808The `if` field accepts the same patterns as permission rules: `"Bash(git *)"`, `"Edit(*.ts)"`, and so on. To match multiple tool names, use separate handlers each with its own `if` value, or match at the `matcher` level where pipe alternation is supported.

807 809 

808`if` only works on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, and `PermissionDenied`. Adding it to any other event prevents the hook from running.810> [!NOTE]

811>

812> `if` only works on `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied`, and `PreSkillShellCommand`. If you add it on any other event, the hook doesn't run.

809 813 

810### Configure hook location814### Configure hook location

811 815 

Details

18 18 

19The loop adapts to what you ask. A question about your codebase might only need context gathering. A bug fix cycles through all three phases repeatedly. A refactor might involve extensive verification. Claude decides what each step requires based on what it learned from the previous step, chaining dozens of actions together and course-correcting along the way.19The loop adapts to what you ask. A question about your codebase might only need context gathering. A bug fix cycles through all three phases repeatedly. A refactor might involve extensive verification. Claude decides what each step requires based on what it learned from the previous step, chaining dozens of actions together and course-correcting along the way.

20 20 

21You're part of this loop too. You can interrupt at any point to steer Claude in a different direction, provide additional context, or ask it to try a different approach. Claude works autonomously but stays responsive to your input.21You're part of this loop too. You can interrupt at any point to steer Claude in a different direction, provide additional context, or ask it to try a different approach.

22 22 

23The agentic loop is powered by two components: [models](#models) that reason and [tools](#tools) that act. Claude Code is the layer around the model that provides the tools and manages the context the model sees. This surrounding layer is what the term agentic harness refers to.23The agentic loop is powered by two components: [models](#models) that reason and [tools](#tools) that act. Claude Code is the layer around the model that provides the tools and manages the context the model sees. This surrounding layer is what the term agentic harness refers to.

24 24 


88 88 

89### Interfaces89### Interfaces

90 90 

91You can access Claude Code through the terminal, the [desktop app](https://code.claude.com/docs/en/desktop.md), [IDE extensions](https://code.claude.com/docs/en/vs-code.md), [claude.ai/code](https://claude.ai/code), [Remote Control](https://code.claude.com/docs/en/remote-control.md), [Slack](https://code.claude.com/docs/en/slack.md), and [CI/CD pipelines](https://code.claude.com/docs/en/github-actions.md). The interface determines how you see and interact with Claude, but the underlying agentic loop is identical. See [Use Claude Code everywhere](https://code.claude.com/docs/en/overview.md#use-claude-code-everywhere) for the full list.91You can access Claude Code through the terminal, the [desktop app](https://code.claude.com/docs/en/desktop.md), [IDE extensions](https://code.claude.com/docs/en/vs-code.md), [claude.ai/code](https://claude.ai/code), [Remote Control](https://code.claude.com/docs/en/remote-control.md), and [CI/CD pipelines](https://code.claude.com/docs/en/github-actions.md). The interface determines how you see and interact with Claude, but the underlying agentic loop is identical. See [Use Claude Code everywhere](https://code.claude.com/docs/en/overview.md#use-claude-code-everywhere) for the list.

92 92 

93## Work with sessions93## Work with sessions

94 94 


131 131 

132#### When context fills up132#### When context fills up

133 133 

134Claude Code manages context automatically as you approach the limit. It compacts the conversation into a summary. The summary keeps your requests and key code snippets, but detailed instructions from early in the conversation may be lost. Put persistent rules in CLAUDE.md rather than relying on conversation history.134Claude Code manages context automatically as you approach the limit. It compacts the conversation into a summary. The summary keeps your requests and key code snippets, but detailed instructions from early in the conversation may be lost. Put persistent rules in CLAUDE.md.

135 135 

136To control what's preserved during compaction, add a "Compact Instructions" section to CLAUDE.md or run `/compact` with a focus (like `/compact focus on the API changes`).136To control what's preserved during compaction, add a "Compact Instructions" section to CLAUDE.md or run `/compact` with a focus (like `/compact focus on the API changes`).

137 137 

Details

35 35 

36### The example monorepo36### The example monorepo

37 37 

38The examples throughout this page refer to a monorepo with three packages. The same patterns work in a large single-tree codebase: where an example uses `packages/api/`, substitute your own subsystem directory such as `src/backend/` or `lib/core/`.38The examples throughout this page refer to a monorepo with three packages. Where an example uses `packages/api/`, substitute your own subsystem directory such as `src/backend/` or `lib/core/`.

39 39 

40```text theme={null}40```text theme={null}

41monorepo/41monorepo/

Details

162 162 

163## Configure each surface163## Configure each surface

164 164 

165The CLI reads the environment variables and settings files above. The other surfaces are the VS Code extension, the desktop app, GitHub Actions, the Agent SDK, and the cloud surfaces such as Slack and the web; the sections below cover whether those settings reach each one.165The CLI reads the environment variables and settings files above. The other surfaces are the VS Code extension, the desktop app, GitHub Actions, the Agent SDK, and the cloud surfaces such as Claude Tag and the web. The sections below cover whether those settings reach each one.

166 166 

167### VS Code extension167### VS Code extension

168 168 


255)255)

256```256```

257 257 

258### Slack, cloud sessions, and Remote Control258### Cloud sessions, Claude Tag, and Remote Control

259 259 

260[Claude Code in Slack](https://code.claude.com/docs/en/slack.md) and [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) aren't part of a gateway deployment. Gateway variables set in a cloud session's environment configuration are not applied. If your traffic must stay on the gateway, don't enable these surfaces for those users.260[Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) and [Claude Tag](https://claude.com/docs/claude-tag/overview) aren't part of a gateway deployment. If your traffic must stay on the gateway, turn these surfaces off.

261 261 

262[Remote Control](https://code.claude.com/docs/en/remote-control.md) and [voice dictation](https://code.claude.com/docs/en/voice-dictation.md) both rely on a claude.ai identity: Remote Control to pair a live session with your account, and voice dictation to reach the claude.ai transcription endpoint. They are unavailable while `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or an `apiKeyHelper` is active. Remote Control is also disabled while `ANTHROPIC_BASE_URL` points at a non-Anthropic host, so signing in with claude.ai isn't enough on its own.262[Remote Control](https://code.claude.com/docs/en/remote-control.md) and [voice dictation](https://code.claude.com/docs/en/voice-dictation.md) both rely on a claude.ai identity: Remote Control to pair a live session with your account, and voice dictation to reach the claude.ai transcription endpoint. They are unavailable while `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, or an `apiKeyHelper` is active. Remote Control is also disabled while `ANTHROPIC_BASE_URL` points at a non-Anthropic host, so signing in with claude.ai isn't enough on its own.

263 263 

Details

123 123 

124## How Claude Code combines managed sources124## How Claude Code combines managed sources

125 125 

126If you set your provider or gateway at claude.ai under **Organization settings > Desktop 3P**, first read [which settings take priority](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority) in the Enterprise Admin Console guide.126If you set your provider or gateway at claude.ai under [**Organization settings > Desktop 3P**](https://claude.ai/admin-settings/desktop-deployment), first read [which settings take priority](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority) in the Enterprise Admin Console guide.

127 127 

128When your organization delivers more than one managed source to the same machine, the [`managedSourcesBehavior`](https://code.claude.com/docs/en/settings-reference#managedsourcesbehavior) key decides what Claude Code does with the others:128When your organization delivers more than one managed source to the same machine, the [`managedSourcesBehavior`](https://code.claude.com/docs/en/settings-reference#managedsourcesbehavior) key decides what Claude Code does with the others:

129 129 


333* An empty managed settings file counts as `{}`.333* An empty managed settings file counts as `{}`.

334* A malformed value in the user-writable HKCU registry key never blocks launch. Claude Code reports it as a notice in `/status` and `claude doctor` instead.334* A malformed value in the user-writable HKCU registry key never blocks launch. Claude Code reports it as a notice in `/status` and `claude doctor` instead.

335 335 

336When a managed settings file, drop-in file, `managed-settings.d/` directory, MDM profile, or HKLM registry value exists but can't be read, and no admin source supplies a policy, what happens depends on why the read failed:336If a managed settings file, drop-in file, `managed-settings.d/` directory, or MDM profile exists but can't be read and no admin source supplies a policy, sessions exit unless access was denied:

337 337 

338* If the operating system denied the read, for example on a root-only file, every session starts without that source's policies. `/status` and `claude doctor` record the failure, and a run with `-p` also prints it to stderr.338* If the operating system denied the read, for example on a root-only file, every session starts without that source's policies. `/status` and `claude doctor` record the failure, and a run with `-p` also prints it to stderr.

339* For any other read failure, such as an I/O error, every session exits at startup with [a message to contact an administrator](https://code.claude.com/docs/en/errors.md#unable-to-read-managed-policy-settings).339* For any other read failure, such as an I/O error, every session exits at startup with [a message to contact an administrator](https://code.claude.com/docs/en/errors.md#unable-to-read-managed-policy-settings).

mcp.md +1 −1

Details

1231 1231 

1232### Restrict OAuth scopes1232### Restrict OAuth scopes

1233 1233 

1234Set `oauth.scopes` to pin the scopes Claude Code requests during the authorization flow. This is the supported way to restrict an MCP server to a security-team-approved subset when the upstream authorization server advertises more scopes than you want to grant. The value is a single space-separated string, matching the `scope` parameter format in RFC 6749 §3.3.1234Set `oauth.scopes` to pin the scopes Claude Code requests during the authorization flow. This is the supported way to restrict an MCP server to an approved subset when the upstream authorization server advertises more scopes than you want to grant. The value is a single space-separated string, matching the `scope` parameter format in RFC 6749 §3.3.

1235 1235 

1236```json theme={null}1236```json theme={null}

1237{1237{

memory.md +2 −2

Details

67 67 

68### Set up a project CLAUDE.md68### Set up a project CLAUDE.md

69 69 

70A project CLAUDE.md can be stored in either `./CLAUDE.md` or `./.claude/CLAUDE.md`. Create this file and add instructions that apply to anyone working on the project: build and test commands, coding standards, architectural decisions, naming conventions, and common workflows. These instructions are shared with your team through version control, so focus on project-level standards rather than personal preferences.70A project CLAUDE.md can be stored in either `./CLAUDE.md` or `./.claude/CLAUDE.md`. Create this file and add instructions that apply to anyone working on the project: build and test commands, coding standards, architectural decisions, naming conventions, and common workflows. These instructions are shared through version control, so focus on project-level standards rather than personal preferences.

71 71 

72To confirm the file loaded, run [`/context all`](https://code.claude.com/docs/en/commands#all-commands) in a session and check the list under **Memory files**. In [fullscreen mode](https://code.claude.com/docs/en/fullscreen.md), `/context` alone collapses that list.72To confirm the file loaded, run [`/context all`](https://code.claude.com/docs/en/commands#all-commands) in a session and check the list under **Memory files**. In [fullscreen mode](https://code.claude.com/docs/en/fullscreen.md), `/context` alone collapses that list.

73 73 


393| `claude-md-or-agents-md` | Your `CLAUDE.md` files, or your `AGENTS.md` files when you have no `CLAUDE.md` or `CLAUDE.local.md` in your working directory or above it. This is the default |393| `claude-md-or-agents-md` | Your `CLAUDE.md` files, or your `AGENTS.md` files when you have no `CLAUDE.md` or `CLAUDE.local.md` in your working directory or above it. This is the default |

394| `claude-md-and-agents-md` | Your `CLAUDE.md` and `AGENTS.md` files together, each directory's `CLAUDE.md` files first and its `AGENTS.md` after them. Claude Code skips an `AGENTS.md` it has already loaded, so one that your `CLAUDE.md` imports or symlinks to isn't read twice |394| `claude-md-and-agents-md` | Your `CLAUDE.md` and `AGENTS.md` files together, each directory's `CLAUDE.md` files first and its `AGENTS.md` after them. Claude Code skips an `AGENTS.md` it has already loaded, so one that your `CLAUDE.md` imports or symlinks to isn't read twice |

395| `claude-md` | Your `CLAUDE.md` files only |395| `claude-md` | Your `CLAUDE.md` files only |

396| `managed-only` | Only your organization's managed `CLAUDE.md` and [auto memory](#auto-memory) at launch. Your project, local, and user `CLAUDE.md` files, your `.claude/rules/` files, and every `AGENTS.md` are left out. A subdirectory's `CLAUDE.md` and `.claude/rules/` files, and [path-scoped rules](#path-specific-rules), still load on demand |396| `managed-only` | Only the managed `CLAUDE.md` and [auto memory](#auto-memory) at launch. Your project, local, and user `CLAUDE.md` files, your `.claude/rules/` files, and every `AGENTS.md` are excluded. A subdirectory's `CLAUDE.md` and `.claude/rules/` files, and [path-scoped rules](#path-specific-rules), still load on demand |

397 397 

398You can also set the value in a settings file instead of `/config`. Add it to [`pluginConfigs`](https://code.claude.com/docs/en/settings-reference#pluginconfigs) under `cc-plugin-agents-md@builtin`, the ID of the built-in plugin that reads `AGENTS.md`. Claude Code reads the entry from `~/.claude/settings.json`, a `--settings` file, or [managed settings](https://code.claude.com/docs/en/managed-settings.md), and ignores it in project and local settings files. This example has Claude read both files:398You can also set the value in a settings file instead of `/config`. Add it to [`pluginConfigs`](https://code.claude.com/docs/en/settings-reference#pluginconfigs) under `cc-plugin-agents-md@builtin`, the ID of the built-in plugin that reads `AGENTS.md`. Claude Code reads the entry from `~/.claude/settings.json`, a `--settings` file, or [managed settings](https://code.claude.com/docs/en/managed-settings.md), and ignores it in project and local settings files. This example has Claude read both files:

399 399 

mobile.md +1 −2

Details

24 24 

25**2. Sign in**25**2. Sign in**

26 26 

27Sign in with the same claude.ai account and organization you use for Claude Code. Cloud sessions and Remote Control require a claude.ai account, so they aren't reachable with an Anthropic Console API key or from a third-party provider such as Amazon Bedrock.27Sign in with the same claude.ai account you use for Claude Code, and the same organization if you belong to one. Cloud sessions and Remote Control require a claude.ai account, so they aren't reachable with an Anthropic Console API key or from a third-party provider such as Amazon Bedrock.

28 28 

29**3. Open the Code tab**29**3. Open the Code tab**

30 30 


86* [Remote Control](https://code.claude.com/docs/en/remote-control.md): continue a local session from any device86* [Remote Control](https://code.claude.com/docs/en/remote-control.md): continue a local session from any device

87* [Sessions from Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch): how Dispatch tasks become Code sessions in the Desktop app87* [Sessions from Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch): how Dispatch tasks become Code sessions in the Desktop app

88* [Channels](https://code.claude.com/docs/en/channels.md): ask Claude something from your phone via Telegram, Discord, or iMessage while the work runs on your machine88* [Channels](https://code.claude.com/docs/en/channels.md): ask Claude something from your phone via Telegram, Discord, or iMessage while the work runs on your machine

89* [Claude Code in Slack](https://code.claude.com/docs/en/slack.md): delegate coding tasks from your Slack workspace by mentioning `@Claude`

model-config.md +2 −2

Details

252When you pick a model with `/model` and your next session starts on something else, these are the usual causes:252When you pick a model with `/model` and your next session starts on something else, these are the usual causes:

253 253 

254* **You chose it for one session.** Pressing `s` in the picker, launching with `--model`, and running `/model` in non-interactive mode all apply to the current session and leave your saved default alone.254* **You chose it for one session.** Pressing `s` in the picker, launching with `--model`, and running `/model` in non-interactive mode all apply to the current session and leave your saved default alone.

255* **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an [organization default](#organization-default-model) your admin set to override user choices applies again at every new-session launch. Your `/model` choice is still saved; it's outranked. When project or managed settings set the model, the startup header names the file.255* **Something with higher priority sets the model.** A `model` value in project or managed settings, `ANTHROPIC_MODEL` in your shell, or an [organization default](#organization-default-model) set to override user choices applies again at every new-session launch. Your `/model` choice is still saved; it's outranked. When project or managed settings set the model, the startup header names the file.

256* **Claude Code couldn't save your choice.** `/model` writes `model` to `~/.claude/settings.json`. If you can't write to that file, for example because another tool generates it or links it to a read-only copy, the model you chose lasts for the session and the next launch reads the old value. Set `model` in the tool that generates the file, or make the file writable. See [A change you made in Claude Code is lost in new sessions](https://code.claude.com/docs/en/settings.md#a-change-you-made-in-claude-code-is-lost-in-new-sessions).256* **Claude Code couldn't save your choice.** `/model` writes `model` to `~/.claude/settings.json`. If you can't write to that file, for example because another tool generates it or links it to a read-only copy, the model you chose lasts for the session and the next launch reads the old value. Set `model` in the tool that generates the file, or make the file writable. See [A change you made in Claude Code is lost in new sessions](https://code.claude.com/docs/en/settings.md#a-change-you-made-in-claude-code-is-lost-in-new-sessions).

257* **You resumed a session.** A session you resume with `claude --resume` or `--continue` usually [keeps the model it was using](#which-model-a-resumed-session-uses) rather than your current default.257* **You resumed a session.** A session you resume with `claude --resume` or `--continue` usually [keeps the model it was using](#which-model-a-resumed-session-uses) rather than your current default.

258 258 


742If the word isn't rainbow when you start a new turn, try one of these:742If the word isn't rainbow when you start a new turn, try one of these:

743 743 

744* Retype it outside anything such as quotes, brackets, a path, or a command, in a prompt that doesn't start with `/`744* Retype it outside anything such as quotes, brackets, a path, or a command, in a prompt that doesn't start with `/`

745* Unset `CLAUDE_CODE_EFFORT_LEVEL` if it's set below `xhigh`, raise your own [`maxEffortLevel`](https://code.claude.com/docs/en/settings-reference#maxeffortlevel) to `xhigh` or above, or ask an organization admin to raise your [organization's limit](#organization-effort-limits)745* Unset `CLAUDE_CODE_EFFORT_LEVEL` if it's set below `xhigh`, or raise your own [`maxEffortLevel`](https://code.claude.com/docs/en/settings-reference#maxeffortlevel) to `xhigh` or above. If you're in an organization with an [effort limit](#organization-effort-limits), ask an organization admin to raise it

746* Run `/model` in your session to switch to an Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2, or Fable 5.1 model. Where the word can't raise a turn, such as on Amazon Bedrock, Google Cloud's Agent Platform, or a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), [set the effort level](#set-the-effort-level) instead746* Run `/model` in your session to switch to an Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2, or Fable 5.1 model. Where the word can't raise a turn, such as on Amazon Bedrock, Google Cloud's Agent Platform, or a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), [set the effort level](#set-the-effort-level) instead

747 747 

748To turn the keyword off, including its in-context instruction, set `CLAUDE_CODE_DISABLE_ULTRATHINK` to `1` in your shell or in a [settings file](https://code.claude.com/docs/en/env-vars.md#in-settings-files). Requires Claude Code v2.1.316 or later.748To turn the keyword off, including its in-context instruction, set `CLAUDE_CODE_DISABLE_ULTRATHINK` to `1` in your shell or in a [settings file](https://code.claude.com/docs/en/env-vars.md#in-settings-files). Requires Claude Code v2.1.316 or later.

Details

126| `OTEL_LOG_TOOL_DETAILS` | Enable logging of tool parameters and input arguments in tool events and trace span attributes: Bash commands, MCP server and tool names, skill names, user-authored workflow names, and tool input. Also enables custom, plugin, and MCP command names on `user_prompt` events, and real agent, skill, plugin, and MCP server and tool names on the [cost and token counters](#cost-counter) (default: disabled). For Claude Desktop's built-in servers, in sessions Claude Desktop owns, `mcp_server_name`/`mcp_tool_name` emit on `tool_decision`/`tool_result` even with the flag off. The exception requires Claude Code v2.1.214 or later | `1` to enable |126| `OTEL_LOG_TOOL_DETAILS` | Enable logging of tool parameters and input arguments in tool events and trace span attributes: Bash commands, MCP server and tool names, skill names, user-authored workflow names, and tool input. Also enables custom, plugin, and MCP command names on `user_prompt` events, and real agent, skill, plugin, and MCP server and tool names on the [cost and token counters](#cost-counter) (default: disabled). For Claude Desktop's built-in servers, in sessions Claude Desktop owns, `mcp_server_name`/`mcp_tool_name` emit on `tool_decision`/`tool_result` even with the flag off. The exception requires Claude Code v2.1.214 or later | `1` to enable |

127| `OTEL_LOG_TOOL_CONTENT` | Enable logging of tool content in the [`tool.output` span event](#tool-output-span-event) (default: disabled). Span attributes carry tool content under [their own gates](#new-context-gates). Requires [tracing](#traces-beta). Content is truncated at the content limit (60 KB by default) | `1` to enable |127| `OTEL_LOG_TOOL_CONTENT` | Enable logging of tool content in the [`tool.output` span event](#tool-output-span-event) (default: disabled). Span attributes carry tool content under [their own gates](#new-context-gates). Requires [tracing](#traces-beta). Content is truncated at the content limit (60 KB by default) | `1` to enable |

128| `OTEL_LOG_MANAGED_SETTINGS` | Add the redacted managed settings, and a SHA-256 digest of the settings before redaction, to [managed settings resolved](#managed-settings-resolved-event) events (default: disabled). A value in project or local settings doesn't turn it on. Requires Claude Code v2.1.274 or later | `1` to enable |128| `OTEL_LOG_MANAGED_SETTINGS` | Add the redacted managed settings, and a SHA-256 digest of the settings before redaction, to [managed settings resolved](#managed-settings-resolved-event) events (default: disabled). A value in project or local settings doesn't turn it on. Requires Claude Code v2.1.274 or later | `1` to enable |

129| `OTEL_LOG_RAW_API_BODIES` | Emit the full Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events (default: disabled). Bodies include the entire conversation history. Enabling this implies consent to everything `OTEL_LOG_USER_PROMPTS`, `OTEL_LOG_TOOL_DETAILS`, and `OTEL_LOG_TOOL_CONTENT` would reveal | `1` for inline bodies truncated at the content limit (60 KB by default), or `file:<dir>` for untruncated bodies on disk with a `body_ref` pointer in the event |129| `OTEL_LOG_RAW_API_BODIES` | Emit the full Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events (default: disabled). Bodies can include the entire conversation history. Enabling this implies consent to everything `OTEL_LOG_USER_PROMPTS`, `OTEL_LOG_TOOL_DETAILS`, and `OTEL_LOG_TOOL_CONTENT` would reveal | `1` for inline bodies truncated at the content limit (60 KB by default), or `file:<dir>` for untruncated bodies on disk with a `body_ref` pointer in the event |

130| `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` | Content limit: the maximum length of content-bearing attributes such as model responses, tool content, system prompts, and raw API bodies, truncation marker included, in UTF-16 code units (default: 61440, i.e. 60 KB). The default is sized for backends that cap attribute values at 64 KB; raise it only if your backend accepts larger values, or lower it to cut telemetry volume. When an OpenTelemetry SDK attribute limit, `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` or one of its logrecord and span variants, is set lower, Claude Code truncates at that smaller value so the `[TRUNCATED ...]` marker stays within the SDK limit | `262144` |130| `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` | Content limit: the maximum length of content-bearing attributes such as model responses, tool content, system prompts, and raw API bodies, truncation marker included, in UTF-16 code units (default: 61440, i.e. 60 KB). The default is sized for backends that cap attribute values at 64 KB; raise it only if your backend accepts larger values, or lower it to cut telemetry volume. When an OpenTelemetry SDK attribute limit, `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` or one of its logrecord and span variants, is set lower, Claude Code truncates at that smaller value so the `[TRUNCATED ...]` marker stays within the SDK limit | `262144` |

131| `OTEL_RESOURCE_INCLUDE_HOST` | Add the machine's name and ID to the resource attributes of metrics, events, and traces (default: disabled). See [Identify the machine a session ran on](#identify-the-machine-a-session-ran-on). Requires Claude Code v2.1.326 or later | `1` to enable |131| `OTEL_RESOURCE_INCLUDE_HOST` | Add the machine's name and ID to the resource attributes of metrics, events, and traces (default: disabled). See [Identify the machine a session ran on](#identify-the-machine-a-session-ran-on). Requires Claude Code v2.1.326 or later | `1` to enable |

132| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | Metrics temporality preference (default: `delta`). Set to `cumulative` if your backend expects cumulative temporality | `delta`, `cumulative` |132| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | Metrics temporality preference (default: `delta`). Set to `cumulative` if your backend expects cumulative temporality | `delta`, `cumulative` |


801| - | - |801| - | - |

802| `prompt.id` | UUID v4 identifier linking all events produced while processing a single user prompt |802| `prompt.id` | UUID v4 identifier linking all events produced while processing a single user prompt |

803| `event.sequence` | 0-based counter for ordering events, counted per Claude Code process rather than per session |803| `event.sequence` | 0-based counter for ordering events, counted per Claude Code process rather than per session |

804| `message.uuid` | UUID of the message as persisted in the session transcript, the `~/.claude/projects/*/*.jsonl` files. Present on `assistant_response`, on `api_response_body`, and on `user_prompt` except for command dispatches, which can produce zero or many messages. On `assistant_response` and `api_response_body`, this is the response's final transcript entry, which the next turn's `parentUuid` chains from. Requires Claude Code v2.1.274 or later on `api_response_body` |804| `message.uuid` | UUID of the message as persisted in the session transcript, the `~/.claude/projects/*/*.jsonl` files. Present on `assistant_response`, on `api_response_body`, and on `user_prompt` except for command dispatches, which can produce zero or many messages. On `api_response_body`, and on an `assistant_response` event [without a `tool_use_id`](#assistant-response-event), this is the response's final transcript entry, which the next turn's `parentUuid` chains from. Requires Claude Code v2.1.274 or later on `api_response_body` |

805| `request_id` | Server-assigned ID of the API request, read from the `request-id` response header, such as `req_011...`. On a response with no `request-id` header, as on [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), the value comes from the `x-amzn-requestid` header instead. Present on `api_request`, `api_error`, `api_refusal`, `assistant_response`, `api_response_body`, [`tool_result`](#tool-result-event), and [`tool_decision`](#tool-decision-event) when the response carries either header. Matches the same attribute on the `llm_request` trace span. The `x-amzn-requestid` source requires Claude Code v2.1.282 or later |805| `request_id` | Server-assigned ID of the API request, read from the `request-id` response header, such as `req_011...`. On a response with no `request-id` header, as on [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), the value comes from the `x-amzn-requestid` header instead. Present on `api_request`, `api_error`, `api_refusal`, `assistant_response`, `api_response_body`, [`tool_result`](#tool-result-event), and [`tool_decision`](#tool-decision-event) when the response carries either header. Matches the same attribute on the `llm_request` trace span. The `x-amzn-requestid` source requires Claude Code v2.1.282 or later |

806| `client_request_id` | Client-generated UUID sent as the `x-client-request-id` request header. Present on `api_request` and `api_error` on first-party API connections; absent on third-party provider backends and when the request was retried through the non-streaming fallback. Pairs a request with its response and remains available for failures such as timeouts that never produced a server `request_id`. Matches the same attribute on the `llm_request` trace span |806| `client_request_id` | Client-generated UUID sent as the `x-client-request-id` request header. Present on `api_request` and `api_error` on first-party API connections; absent on third-party provider backends and when the request was retried through the non-streaming fallback. Pairs a request with its response and remains available for failures such as timeouts that never produced a server `request_id`. Matches the same attribute on the `llm_request` trace span |

807 807 


813 813 

814* `message.uuid` on `user_prompt`, `assistant_response`, and `api_response_body`814* `message.uuid` on `user_prompt`, `assistant_response`, and `api_response_body`

815* `request_id` on the API events, persisted as `requestId` on the transcript's assistant entries815* `request_id` on the API events, persisted as `requestId` on the transcript's assistant entries

816* `tool_use_id` on `tool_result` and `tool_decision` events, and on `safety_event` events except those for the [end of a turn](#safety-event)816* `tool_use_id` on `tool_result` and `tool_decision` events, on [`assistant_response`](#assistant-response-event) events for messages sent with a tool, and on `safety_event` events except those for the [end of a turn](#safety-event)

817 817 

818#### User prompt event818#### User prompt event

819 819 


836 836 

837#### Assistant response event837#### Assistant response event

838 838 

839Logged after each API request that returns text content from the model. Only the response's text blocks are included; thinking blocks and tool-use blocks are excluded.839An `assistant_response` event holds either the text of an API response or a message that Claude wrote to the user by calling a tool. The `tool_use_id` attribute tells you which:

840 

841* **Text reply, no `tool_use_id`**: logged after each API request that returns text content from the model. Only the response's text blocks are included; thinking blocks and tool-use blocks are excluded.

842* **Message sent with a tool, has `tool_use_id`**: `response` holds the message text from a successful call to `SendUserMessage` or Cowork's `mcp__cowork__send_user_message`. Claude Code logs the event before [`PostToolUse`](https://code.claude.com/docs/en/hooks#posttooluse) hooks run. Requires Claude Code v2.1.332 or later.

843 

844You receive `assistant_response` events with `tool_use_id` only while you include response text, as described under `response`.

840 845 

841**Event Name**: `claude_code.assistant_response`846**Event Name**: `claude_code.assistant_response`

842 847 


849* `response_length`: Length of the response text in characters854* `response_length`: Length of the response text in characters

850* `response`: Response text, truncated at the content limit (60 KB by default). Redacted to `<REDACTED>` by default. Set `OTEL_LOG_ASSISTANT_RESPONSES=1` to include it. When `OTEL_LOG_ASSISTANT_RESPONSES` is unset, `OTEL_LOG_USER_PROMPTS` controls it instead, so set `OTEL_LOG_ASSISTANT_RESPONSES=0` to keep responses redacted while prompt logging is on855* `response`: Response text, truncated at the content limit (60 KB by default). Redacted to `<REDACTED>` by default. Set `OTEL_LOG_ASSISTANT_RESPONSES=1` to include it. When `OTEL_LOG_ASSISTANT_RESPONSES` is unset, `OTEL_LOG_USER_PROMPTS` controls it instead, so set `OTEL_LOG_ASSISTANT_RESPONSES=0` to keep responses redacted while prompt logging is on

851* `model`: Model identifier (for example, "claude-sonnet-5")856* `model`: Model identifier (for example, "claude-sonnet-5")

852* `request_id`: API request ID, described under [Event correlation attributes](#event-correlation-attributes)857* `request_id`: API request ID, described under [Event correlation attributes](#event-correlation-attributes). On an event with `tool_use_id`, this is the ID of the API response that held the call. When that response also has text, both kinds of event share one `request_id`

853* `message.uuid`: UUID of the response's final transcript entry. An API response is persisted as one transcript entry per content block; this is the last one, which the next turn's `parentUuid` chains from.858* `tool_use_id`: Present only on an event for a message sent with a tool. Same value as on the call's [tool result event](#tool-result-event)

859* `message.uuid`: UUID of a transcript entry. An API response is persisted as one transcript entry per content block. For a text reply, this is the last one, which the next turn's `parentUuid` chains from. For an event with `tool_use_id`, this is the entry that holds the tool call.

854* `query_source`: Subsystem that issued the request, such as `"repl_main_thread"`, `"compact"`, or a subagent name860* `query_source`: Subsystem that issued the request, such as `"repl_main_thread"`, `"compact"`, or a subagent name

855 861 

856#### Tool result event862#### Tool result event


1572 * `"force_refresh_failed"`: the settings fetch that [`forceRemoteSettingsRefresh`](https://code.claude.com/docs/en/settings-reference#forceremotesettingsrefresh) requires failed1578 * `"force_refresh_failed"`: the settings fetch that [`forceRemoteSettingsRefresh`](https://code.claude.com/docs/en/settings-reference#forceremotesettingsrefresh) requires failed

1573 * `"gateway_rejected"`: a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) answered the managed settings load with HTTP 4031579 * `"gateway_rejected"`: a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) answered the managed settings load with HTTP 403

1574 * `"version_below_minimum"`: this version of Claude Code is below [`requiredMinimumVersion`](https://code.claude.com/docs/en/settings-reference#requiredminimumversion) or above [`requiredMaximumVersion`](https://code.claude.com/docs/en/settings-reference#requiredmaximumversion)1580 * `"version_below_minimum"`: this version of Claude Code is below [`requiredMinimumVersion`](https://code.claude.com/docs/en/settings-reference#requiredminimumversion) or above [`requiredMaximumVersion`](https://code.claude.com/docs/en/settings-reference#requiredmaximumversion)

1575 * `"_OTHER"`: the Claude apps gateway managed settings load failed for another reason1581 * `"_OTHER"`: a cause that has no dedicated value, such as a gateway settings load that failed for another reason

1576* `managed_settings.sources`: every managed source that delivers at least one [policy key](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources), highest priority first, including sources whose keys don't take effect under `first-wins`. Values are `"remote"`, `"plist"` or `"hklm"` for the MDM or OS-level policy, `"file"` for managed settings files and drop-ins, `"parent"` when an [embedding host](https://code.claude.com/docs/en/managed-settings.md#let-an-embedding-host-add-policy) supplies settings, and `"hkcu"` for the [Windows HKCU registry value](https://code.claude.com/docs/en/managed-settings.md#where-each-mechanism-stores-the-policy) when Claude Code [reads it](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources). A source that carries only control keys, or that Claude Code couldn't read, isn't listed. Emitted as an array of strings, empty when no managed source delivers a policy key1582* `managed_settings.sources`: every managed source that delivers at least one [policy key](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources), highest priority first, including sources whose keys don't take effect under `first-wins`. Values are `"remote"`, `"plist"` or `"hklm"` for the MDM or OS-level policy, `"file"` for managed settings files and drop-ins, `"parent"` when an [embedding host](https://code.claude.com/docs/en/managed-settings.md#let-an-embedding-host-add-policy) supplies settings, and `"hkcu"` for the [Windows HKCU registry value](https://code.claude.com/docs/en/managed-settings.md#where-each-mechanism-stores-the-policy) when Claude Code [reads it](https://code.claude.com/docs/en/managed-settings.md#how-claude-code-combines-managed-sources). A source that carries only control keys, or that Claude Code couldn't read, isn't listed. Emitted as an array of strings, empty when no managed source delivers a policy key

1577* `managed_settings.source_behavior`: the [`managedSourcesBehavior`](https://code.claude.com/docs/en/settings-reference#managedsourcesbehavior) value Claude Code read, `"first-wins"` or `"merge"`. `"first-wins"` when no source sets the key1583* `managed_settings.source_behavior`: the [`managedSourcesBehavior`](https://code.claude.com/docs/en/settings-reference#managedsourcesbehavior) value Claude Code read, `"first-wins"` or `"merge"`. `"first-wins"` when no source sets the key

1578* `managed_settings.helper.state`: state of the policy helper that the selected MDM or file source configures:1584* `managed_settings.helper.state`: state of the policy helper that the selected MDM or file source configures:


1876 * The [cost and token counters](#cost-counter) and the `api_request`, `api_error`, and `api_refusal` events carry real agent, skill, plugin, and MCP server and tool names in their attribution attributes1882 * The [cost and token counters](#cost-counter) and the `api_request`, `api_error`, and `api_refusal` events carry real agent, skill, plugin, and MCP server and tool names in their attribution attributes

1877 * The `claude_code.tool` span carries input-derived attributes such as `file_path`. Under detailed beta tracing it also carries a [`tool_input`](#new-context-gates) attribute1883 * The `claude_code.tool` span carries input-derived attributes such as `file_path`. Under detailed beta tracing it also carries a [`tool_input`](#new-context-gates) attribute

1878* Tool content is not logged in trace spans by default. To include it, set `OTEL_LOG_TOOL_CONTENT=1`. The `claude_code.tool` span then carries a [`tool.output` span event](#tool-output-span-event) with raw file contents, Bash command output, and what MCP tools, WebFetch, and WebSearch return, truncated at the content limit (60 KB by default) per attribute. Results from MCP tools, WebFetch, and WebSearch require Claude Code v2.1.283 or later. Tool content also reaches spans through [`new_context`, whose gate differs per span](#new-context-gates). Configure your telemetry backend to filter or redact these attributes as needed1884* Tool content is not logged in trace spans by default. To include it, set `OTEL_LOG_TOOL_CONTENT=1`. The `claude_code.tool` span then carries a [`tool.output` span event](#tool-output-span-event) with raw file contents, Bash command output, and what MCP tools, WebFetch, and WebSearch return, truncated at the content limit (60 KB by default) per attribute. Results from MCP tools, WebFetch, and WebSearch require Claude Code v2.1.283 or later. Tool content also reaches spans through [`new_context`, whose gate differs per span](#new-context-gates). Configure your telemetry backend to filter or redact these attributes as needed

1879* Raw Anthropic Messages API request and response bodies are not logged by default. To include them, set `OTEL_LOG_RAW_API_BODIES` in your shell, user settings, or managed settings. It's ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env). The bodies contain the full conversation history, including the system prompt, every prior user and assistant turn, and tool results, so enabling this implies consent to everything the other `OTEL_LOG_*` content flags would reveal. Claude Code always redacts Claude's extended-thinking content from these bodies, regardless of other settings. The value you set determines how Claude Code delivers the bodies:1885* Raw Anthropic Messages API request and response bodies aren't logged by default. To include them, set `OTEL_LOG_RAW_API_BODIES` in your shell, user settings, or managed settings. It's ignored in [project and local settings](https://code.claude.com/docs/en/settings-reference.md#variables-claude-code-ignores-in-env).

1886 

1887 The bodies can contain the full conversation history, including the system prompt, every prior user and assistant turn, and tool results. Enabling this implies consent to everything the other `OTEL_LOG_*` content flags would reveal. Claude Code always redacts Claude's extended-thinking content from these bodies, regardless of other settings. The value you set determines how Claude Code delivers the bodies:

1888 

1880 * With `=1`, Claude Code emits `api_request_body` and `api_response_body` log events for each API call. The events' `body` attribute carries the JSON-serialized payload, truncated at the content limit (60 KB by default)1889 * With `=1`, Claude Code emits `api_request_body` and `api_response_body` log events for each API call. The events' `body` attribute carries the JSON-serialized payload, truncated at the content limit (60 KB by default)

1881 * With `=file:<dir>`, Claude Code writes untruncated bodies to `.request.json` and `.response.json` files under that directory, and the events carry a `body_ref` path instead of the inline body. Ship the directory with a log collector or sidecar rather than through the telemetry stream.1890 * With `=file:<dir>`, Claude Code writes untruncated bodies to `.request.json` and `.response.json` files under that directory, and the events carry a `body_ref` path instead of the inline body. Ship the directory with a log collector or sidecar rather than through the telemetry stream.

1882 1891 

Details

85 85 

86## Custom CA certificates86## Custom CA certificates

87 87 

88If your enterprise environment uses a custom CA, configure Claude Code to trust it directly:88If your environment uses a custom CA, configure Claude Code to trust it directly:

89 89 

90```bash theme={null}90```bash theme={null}

91export NODE_EXTRA_CA_CERTS=/path/to/ca-cert.pem91export NODE_EXTRA_CA_CERTS=/path/to/ca-cert.pem


242| `storage.googleapis.com` | Native installer and native auto-updater on versions prior to 2.1.116 |242| `storage.googleapis.com` | Native installer and native auto-updater on versions prior to 2.1.116 |

243| `registry.npmjs.org` | Plugin installs (fetching npm-source plugin packages and installing plugins' Node.js package dependencies), `npx`-launched MCP servers, and the package registry for npm and bun installs of Claude Code itself |243| `registry.npmjs.org` | Plugin installs (fetching npm-source plugin packages and installing plugins' Node.js package dependencies), `npx`-launched MCP servers, and the package registry for npm and bun installs of Claude Code itself |

244| `bridge.claudeusercontent.com` | [Claude in Chrome](https://code.claude.com/docs/en/chrome.md) extension WebSocket bridge |244| `bridge.claudeusercontent.com` | [Claude in Chrome](https://code.claude.com/docs/en/chrome.md) extension WebSocket bridge |

245| `*.frame.claudeusercontent.com` | [Artifact](https://code.claude.com/docs/en/artifacts.md) content reads. The CLI fetches an artifact's files from this host when Claude opens one, and only when the Artifact tool is [available](https://code.claude.com/docs/en/artifacts.md#availability) for your account. To turn the tool off and drop this requirement, set [`"enableArtifact": false`](https://code.claude.com/docs/en/settings-reference#enableartifact) or [`CLAUDE_CODE_DISABLE_ARTIFACT=1`](https://code.claude.com/docs/en/env-vars) |245| `*.frame.claudeusercontent.com` | [Artifact](https://code.claude.com/docs/en/artifacts.md) content reads. The CLI fetches an artifact's files from this host when Claude opens one. You need it only when the Artifact tool is [available](https://code.claude.com/docs/en/artifacts.md#availability) for your account. To turn the tool off and drop this requirement, set [`"enableArtifact": false`](https://code.claude.com/docs/en/settings-reference#enableartifact) or [`CLAUDE_CODE_DISABLE_ARTIFACT=1`](https://code.claude.com/docs/en/env-vars) |

246| `github.com` | Cloning GitHub-hosted [plugin marketplaces](https://code.claude.com/docs/en/plugins/overview.md) and plugins, including the official Anthropic marketplace, over HTTPS or SSH. To clone GitHub `owner/repo` sources over HTTPS only, set [`CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`](https://code.claude.com/docs/en/env-vars) |246| `github.com` | Cloning GitHub-hosted [plugin marketplaces](https://code.claude.com/docs/en/plugins/overview.md) and plugins, including the official Anthropic marketplace, over HTTPS or SSH. To clone GitHub `owner/repo` sources over HTTPS only, set [`CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`](https://code.claude.com/docs/en/env-vars) |

247| `raw.githubusercontent.com` | Changelog feed for [`/release-notes`](https://code.claude.com/docs/en/commands). In interactive sessions, Claude Code also fetches it in the background at startup when its cached changelog doesn't yet cover the running version, such as the first start after an update; non-interactive and cloud sessions never fetch it |247| `raw.githubusercontent.com` | Changelog feed for [`/release-notes`](https://code.claude.com/docs/en/commands). In interactive sessions, Claude Code also fetches it in the background at startup when its cached changelog doesn't yet cover the running version, such as the first start after an update; non-interactive and cloud sessions never fetch it |

248| `*-review.googlesource.com` | Gerrit change lookup on `googlesource.com` checkouts. When a Claude Desktop Code tab session starts or resumes on a [trusted](https://code.claude.com/docs/en/permissions.md#project-allow-rules-and-workspace-trust) checkout whose `origin` is a `googlesource.com` host, Claude Code asks that host's `-review` server anonymously for the open change matching HEAD's `Change-Id`, once per start or resume. Other session types skip the lookup, and no other Gerrit host is contacted. Optional: disable with [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](https://code.claude.com/docs/en/env-vars) |248| `*-review.googlesource.com` | Gerrit change lookup on `googlesource.com` checkouts. When a Claude Desktop Code tab session starts or resumes on a [trusted](https://code.claude.com/docs/en/permissions.md#project-allow-rules-and-workspace-trust) checkout whose `origin` is a `googlesource.com` host, Claude Code asks that host's `-review` server anonymously for the open change matching HEAD's `Change-Id`, once per start or resume. Other session types skip the lookup, and no other Gerrit host is contacted. Optional: disable with [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](https://code.claude.com/docs/en/env-vars) |

overview.md +2 −2

Details

210> * Message [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) a task from your phone and open the Desktop session it creates210> * Message [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) a task from your phone and open the Desktop session it creates

211> * Start a long-running task on the [web](https://code.claude.com/docs/en/claude-code-on-the-web.md) or the [Claude mobile app](https://code.claude.com/docs/en/mobile.md), then pull it into your terminal with `claude --teleport`. Teleport requires a claude.ai subscription.211> * Start a long-running task on the [web](https://code.claude.com/docs/en/claude-code-on-the-web.md) or the [Claude mobile app](https://code.claude.com/docs/en/mobile.md), then pull it into your terminal with `claude --teleport`. Teleport requires a claude.ai subscription.

212> * Run `/desktop` to continue your current terminal session in the [Desktop app](https://code.claude.com/docs/en/desktop.md), where you can review diffs visually. The `/desktop` handoff requires a claude.ai subscription. Available on macOS and x64 Windows.212> * Run `/desktop` to continue your current terminal session in the [Desktop app](https://code.claude.com/docs/en/desktop.md), where you can review diffs visually. The `/desktop` handoff requires a claude.ai subscription. Available on macOS and x64 Windows.

213> * Route tasks from team chat: mention `@Claude` in [Slack](https://code.claude.com/docs/en/slack.md) with a bug report and get a pull request back213> * Route tasks from team chat on Team and Enterprise plans: mention `@Claude` in [Slack](https://claude.com/docs/claude-tag/overview) with a bug report and get a pull request back

214 214 

215## Use Claude Code everywhere215## Use Claude Code everywhere

216 216 


226| Run Claude on a recurring schedule | [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) |226| Run Claude on a recurring schedule | [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) |

227| Automate PR reviews and issue triage | [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) or [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md) |227| Automate PR reviews and issue triage | [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) or [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md) |

228| Get automatic code review on every PR | [GitHub Code Review](https://code.claude.com/docs/en/code-review.md) |228| Get automatic code review on every PR | [GitHub Code Review](https://code.claude.com/docs/en/code-review.md) |

229| Route bug reports from Slack to pull requests | [Slack](https://code.claude.com/docs/en/slack.md) |229| Route bug reports from Slack to pull requests | [Claude Tag](https://claude.com/docs/claude-tag/overview), on Team and Enterprise plans |

230| Debug live web applications | [Chrome](https://code.claude.com/docs/en/chrome.md) |230| Debug live web applications | [Chrome](https://code.claude.com/docs/en/chrome.md) |

231| Build custom agents for your own workflows | [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) |231| Build custom agents for your own workflows | [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) |

232 232 

Details

310 310 

311When the plan is ready, Claude presents it and asks how to proceed. From that prompt you can choose:311When the plan is ready, Claude presents it and asks how to proceed. From that prompt you can choose:

312 312 

313* **Yes, and use auto mode**: approve and start in [auto mode](#eliminate-prompts-with-auto-mode). If auto mode isn't [available to your session](#eliminate-prompts-with-auto-mode), for example because your organization turned it off, this option reads **Yes, auto-accept edits**. If you started the session with bypass permissions enabled, the option reads **Yes, and switch to BYPASS PERMISSIONS (no further prompts) for this session** instead.313* **Yes, and use auto mode**: approve and start in [auto mode](#eliminate-prompts-with-auto-mode). If auto mode isn't [available to your session](#eliminate-prompts-with-auto-mode), this option reads **Yes, auto-accept edits**. If you started the session with bypass permissions enabled, the option reads **Yes, and switch to BYPASS PERMISSIONS (no further prompts) for this session** instead.

314* **Yes, manually approve edits**: approve and review each edit individually.314* **Yes, manually approve edits**: approve and review each edit individually.

315* **No, keep planning**: stay in plan mode and tell Claude what to change.315* **No, keep planning**: stay in plan mode and tell Claude what to change.

316 316 


400| Runs on Claude Sonnet 4.6 | Sonnet 4.6 |400| Runs on Claude Sonnet 4.6 | Sonnet 4.6 |

401| Has [`ANTHROPIC_DEFAULT_SONNET_MODEL`](https://code.claude.com/docs/en/model-config#environment-variables) set | Its value, or Sonnet 5 if its value is Claude Sonnet 5.5 or Claude Opus 5.5 |401| Has [`ANTHROPIC_DEFAULT_SONNET_MODEL`](https://code.claude.com/docs/en/model-config#environment-variables) set | Its value, or Sonnet 5 if its value is Claude Sonnet 5.5 or Claude Opus 5.5 |

402 402 

403If Sonnet 5 or the model in `ANTHROPIC_DEFAULT_SONNET_MODEL` is unavailable from your provider or excluded by your organization's [model policy](https://code.claude.com/docs/en/model-config.md#restrict-model-selection), Claude Code uses a fallback model. That's your session's model, or an Opus model in a [Fable session](https://code.claude.com/docs/en/model-config.md#work-with-fable).403If Sonnet 5 or the model in `ANTHROPIC_DEFAULT_SONNET_MODEL` is unavailable from your provider or excluded by a [model policy](https://code.claude.com/docs/en/model-config.md#restrict-model-selection), Claude Code uses a fallback model. That's your session's model, or an Opus model in a [Fable session](https://code.claude.com/docs/en/model-config.md#work-with-fable).

404 404 

405### Choose the classifier model405### Choose the classifier model

406 406 


419| Situation | What happens | What to do |419| Situation | What happens | What to do |

420| - | - | - |420| - | - | - |

421| The [debug log](#classifier-model-check) reports an Anthropic-configured classifier model | That model reviews | None needed |421| The [debug log](#classifier-model-check) reports an Anthropic-configured classifier model | That model reviews | None needed |

422| You set Claude Opus 5, Sonnet 5.5, Opus 5.5 or one your organization's [model policy](https://code.claude.com/docs/en/model-config.md#restrict-model-selection) excludes | The [default classifier model](#default-classifier-model) reviews | Set another model |422| You set Claude Opus 5, Sonnet 5.5, Opus 5.5, or one that a [model policy](https://code.claude.com/docs/en/model-config.md#restrict-model-selection) excludes | The [default classifier model](#default-classifier-model) reviews | Set another model |

423| Your provider can't serve the model | Classifier checks fail, so Claude Code [denies each action it checks](https://code.claude.com/docs/en/errors.md#auto-mode-cannot-determine-the-safety-of-an-action) | Set a model it serves, or remove the variable |423| Your provider can't serve the model | Classifier checks fail, so Claude Code [denies each action it checks](https://code.claude.com/docs/en/errors.md#auto-mode-cannot-determine-the-safety-of-an-action) | Set a model it serves, or remove the variable |

424| In a session, `/status` shows [`Auto mode server`](#server-side-classifier-review) as `Enabled` | The server reviews without your model | None needed |424| In a session, `/status` shows [`Auto mode server`](#server-side-classifier-review) as `Enabled` | The server reviews without your model | None needed |

425 425 


679 679 

680`bypassPermissions` mode disables permission prompts and safety checks so tool calls execute immediately, including writes to [protected paths](#protected-paths).680`bypassPermissions` mode disables permission prompts and safety checks so tool calls execute immediately, including writes to [protected paths](#protected-paths).

681 681 

682Even in `bypassPermissions` mode, each of the [actions no mode auto-approves](#actions-no-mode-auto-approves) gets a prompt or a denial, though you can [turn off the prompt for dangerous `rm` commands](#turn-off-the-critical-path-removal-prompt-in-bypasspermissions-mode). Reading [another organization's public artifact](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you) needs your approval, and this mode doesn't ask for it, so Claude can't read one. The [Remove-Item in PowerShell](#remove-item-in-powershell) denies also apply in this mode.682Even in `bypassPermissions` mode, each of the [actions no mode auto-approves](#actions-no-mode-auto-approves) ends in a prompt or a denial, though you can [turn off the prompt for dangerous `rm` commands](#turn-off-the-critical-path-removal-prompt-in-bypasspermissions-mode). The Artifact tool can't read [another organization's public artifact](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you) that you haven't approved in this conversation. The [Remove-Item in PowerShell](#remove-item-in-powershell) denies also apply in this mode.

683 683 

684Two [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md) safeguards still apply in this mode, and in interactive terminal plan-mode sessions where bypass permissions are available:684Two [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md) safeguards still apply in this mode, and in interactive terminal plan-mode sessions where bypass permissions are available:

685 685 


704 704 

705The first time you start an interactive session with this mode enabled, Claude Code shows a warning dialog asking you to accept responsibility for actions taken without permission checks:705The first time you start an interactive session with this mode enabled, Claude Code shows a warning dialog asking you to accept responsibility for actions taken without permission checks:

706 706 

707* **If you accept**: Claude Code sets `skipDangerousModePermissionPrompt` to `true` in `~/.claude/settings.json`, so later sessions skip the dialog. To see the dialog again, remove the key from that file or set it to `false`. The [`skipDangerousModePermissionPrompt` reference](https://code.claude.com/docs/en/settings-reference#skipdangerousmodepermissionprompt) lists the other settings files where you or your organization can set it.707* **If you accept**: Claude Code sets `skipDangerousModePermissionPrompt` to `true` in `~/.claude/settings.json`, so later sessions skip the dialog. To see the dialog again, remove the key from that file or set it to `false`. If the dialog still doesn't appear, check the other settings files that the [`skipDangerousModePermissionPrompt` reference](https://code.claude.com/docs/en/settings-reference#skipdangerousmodepermissionprompt) lists.

708* **If you decline**: Claude Code exits.708* **If you decline**: Claude Code exits.

709 709 

710If you pass [`--setting-sources`](https://code.claude.com/docs/en/cli-reference#cli-flags) without `user`, the dialog can appear again although you accepted it earlier. To skip it, add `user`, as in `--setting-sources user,project`.710If you pass [`--setting-sources`](https://code.claude.com/docs/en/cli-reference#cli-flags) without `user`, the dialog can appear again although you accepted it earlier. To skip it, add `user`, as in `--setting-sources user,project`.

permissions.md +11 −1

Details

106 106 

107The label shown for a tool in the transcript and permission dialog can differ from its canonical name. For example, the tool labeled `Stop Task` in the transcript has the canonical name `TaskStop`. Permission rules and [hook matchers](https://code.claude.com/docs/en/hooks.md) don't match the label, so a rule written as `Stop Task` doesn't match. For deny and ask rules, a [startup warning](https://code.claude.com/docs/en/errors.md#matches-no-tool) says so. Use the canonical names listed in the [tools reference](https://code.claude.com/docs/en/tools-reference.md).107The label shown for a tool in the transcript and permission dialog can differ from its canonical name. For example, the tool labeled `Stop Task` in the transcript has the canonical name `TaskStop`. Permission rules and [hook matchers](https://code.claude.com/docs/en/hooks.md) don't match the label, so a rule written as `Stop Task` doesn't match. For deny and ask rules, a [startup warning](https://code.claude.com/docs/en/errors.md#matches-no-tool) says so. Use the canonical names listed in the [tools reference](https://code.claude.com/docs/en/tools-reference.md).

108 108 

109#### Allow a file tool outside the working directories

110 

111With an `Edit(*)`, `Write(*)`, or `NotebookEdit(*)` allow rule, you pre-approve the tool only in the [working directories](#working-directories). To pre-approve paths outside them too, write the bare name of each tool you want, such as `Edit` or `Read`. Some calls still aren't pre-approved, such as writes to [protected paths](https://code.claude.com/docs/en/permission-modes.md#protected-paths) and reads from [network paths](#network-paths).

112 

113When the startup warning says your `Read(*)` rule `adds nothing to Read's default`, you can delete the rule from your settings file.

114 

115> [!WARNING]

116>

117> Don't rely on a file-tool `(*)` allow rule to keep the tool in the working directories. Versions before v2.1.317 treat the rule as the bare name, and later versions can too if Anthropic turns the working-directory limit off. Instead, [block file-tool reads and writes outside the working directories](#block-file-tool-reads-and-writes-outside-the-working-directories).

118 

109### Use specifiers for fine-grained control119### Use specifiers for fine-grained control

110 120 

111Add a specifier in parentheses to match specific tool uses:121Add a specifier in parentheses to match specific tool uses:


564| `WebFetch` | Claude fetches without prompting you. Doesn't change which hosts sandboxed commands can reach. | Claude Code removes the `WebFetch` tool, so Claude can't fetch at all. Doesn't change which hosts sandboxed commands can reach. |574| `WebFetch` | Claude fetches without prompting you. Doesn't change which hosts sandboxed commands can reach. | Claude Code removes the `WebFetch` tool, so Claude can't fetch at all. Doesn't change which hosts sandboxed commands can reach. |

565| `WebFetch(domain:*)` | Claude fetches without prompting you, and sandboxed commands can reach any host. | Claude Code keeps the tool and refuses each fetch, and sandboxed commands can't reach any host. |575| `WebFetch(domain:*)` | Claude fetches without prompting you, and sandboxed commands can reach any host. | Claude Code keeps the tool and refuses each fetch, and sandboxed commands can't reach any host. |

566 576 

567The two forms also differ on reads of [artifacts](https://code.claude.com/docs/en/artifacts.md), the pages the Artifact tool publishes on claude.ai. A bare `WebFetch` deny or ask rule doesn't apply to those reads. A `domain:` rule covering `claude.ai` or the `*.claudeusercontent.com` content host, such as `WebFetch(domain:claude.ai)` or `WebFetch(domain:*)`, denies each read or prompts before it. An [`Artifact` rule](https://code.claude.com/docs/en/artifacts#disable-artifacts) does the same.577The two forms also differ on reads of [artifacts](https://code.claude.com/docs/en/artifacts.md), the pages the Artifact tool publishes on claude.ai. A bare `WebFetch` deny or ask rule doesn't apply to Artifact tool reads. A `domain:` rule covering `claude.ai` or the `*.claudeusercontent.com` content host, such as `WebFetch(domain:claude.ai)` or `WebFetch(domain:*)`, denies each read or prompts before it.

568 578 

569When a rule blocks a read, the denial names the rule. Before v2.1.268, a bare `WebFetch` deny rule blocked every artifact read, and a bare ask rule prompted before each one.579When a rule blocks a read, the denial names the rule. Before v2.1.268, a bare `WebFetch` deny rule blocked every artifact read, and a bare ask rule prompted before each one.

570 580 

platforms.md +1 −4

Details

35| [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) | Runs Claude in your CI pipeline | Automated PR reviews, issue triage, scheduled maintenance |35| [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) | Runs Claude in your CI pipeline | Automated PR reviews, issue triage, scheduled maintenance |

36| [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md) | Same as GitHub Actions for GitLab | CI-driven automation on GitLab |36| [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md) | Same as GitHub Actions for GitLab | CI-driven automation on GitLab |

37| [Code Review](https://code.claude.com/docs/en/code-review.md) | Reviews every PR automatically | Catching bugs before human review |37| [Code Review](https://code.claude.com/docs/en/code-review.md) | Reviews every PR automatically | Catching bugs before human review |

38| [Slack](https://code.claude.com/docs/en/slack.md) | Responds to `@Claude` mentions in your channels, under your own account | Turning bug reports into pull requests from team chat on Pro, Max, and Ultra plans |38| [Claude Tag](https://claude.com/docs/claude-tag) | Runs `@Claude` as your organization's shared identity with admin-configured access | Shared team access on Team and Enterprise plans |

39| [Claude Tag](https://claude.com/docs/claude-tag) | Runs `@Claude` as your organization's shared identity with admin-configured access | Shared team access on Team and Enterprise plans, instead of per-user Slack sessions |

40 39 

41For integrations not listed here, [MCP servers](https://code.claude.com/docs/en/mcp.md) and [connectors](https://code.claude.com/docs/en/desktop.md#connect-external-tools) let you connect almost anything: Linear, Notion, Google Drive, or your own internal APIs.40For integrations not listed here, [MCP servers](https://code.claude.com/docs/en/mcp.md) and [connectors](https://code.claude.com/docs/en/desktop.md#connect-external-tools) let you connect almost anything: Linear, Notion, Google Drive, or your own internal APIs.

42 41 


49| [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) | Message a task from the Claude mobile app | Your machine (Desktop) | [Pair the mobile app with Desktop](https://support.claude.com/en/articles/13947068) | Delegating work while you're away, minimal setup |48| [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) | Message a task from the Claude mobile app | Your machine (Desktop) | [Pair the mobile app with Desktop](https://support.claude.com/en/articles/13947068) | Delegating work while you're away, minimal setup |

50| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | Drive a running session from [claude.ai/code](https://claude.ai/code) or the Claude mobile app | Your machine (CLI, Desktop, or VS Code) | Run [`claude remote-control` or `/remote-control`](https://code.claude.com/docs/en/remote-control#start-a-remote-control-session) | Steering in-progress work from another device |49| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | Drive a running session from [claude.ai/code](https://claude.ai/code) or the Claude mobile app | Your machine (CLI, Desktop, or VS Code) | Run [`claude remote-control` or `/remote-control`](https://code.claude.com/docs/en/remote-control#start-a-remote-control-session) | Steering in-progress work from another device |

51| [Channels](https://code.claude.com/docs/en/channels.md) | Push events from a chat app like Telegram or Discord, or your own server | Your machine (CLI) | [Install a channel plugin](https://code.claude.com/docs/en/channels.md#quickstart) or [build your own](https://code.claude.com/docs/en/channels-reference.md) | Reacting to external events like CI failures or chat messages |50| [Channels](https://code.claude.com/docs/en/channels.md) | Push events from a chat app like Telegram or Discord, or your own server | Your machine (CLI) | [Install a channel plugin](https://code.claude.com/docs/en/channels.md#quickstart) or [build your own](https://code.claude.com/docs/en/channels-reference.md) | Reacting to external events like CI failures or chat messages |

52| [Slack](https://code.claude.com/docs/en/slack.md) | Mention `@Claude` in a team channel | Anthropic cloud | [Install the Slack app](https://code.claude.com/docs/en/slack.md#setting-up-claude-code-in-slack) with [Claude Code on the web](https://code.claude.com/docs/en/claude-code-on-the-web.md) enabled, on Pro, Max, and Ultra plans | PRs and reviews from team chat |

53| [Self-hosted environments](https://code.claude.com/docs/en/self-hosted-environments) | Start a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) and pick your organization's environment | Your organization's infrastructure | [Deploy runners](https://code.claude.com/docs/en/self-hosted-environments-quickstart.md), on Team and Enterprise plans | Cloud sessions that must run inside your network |51| [Self-hosted environments](https://code.claude.com/docs/en/self-hosted-environments) | Start a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) and pick your organization's environment | Your organization's infrastructure | [Deploy runners](https://code.claude.com/docs/en/self-hosted-environments-quickstart.md), on Team and Enterprise plans | Cloud sessions that must run inside your network |

54| [Scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks.md) | Set a schedule | [CLI](https://code.claude.com/docs/en/scheduled-tasks.md), [Desktop](https://code.claude.com/docs/en/desktop-scheduled-tasks.md), or [cloud](https://code.claude.com/docs/en/routines.md) | Pick a frequency | Recurring automation like daily reviews |52| [Scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks.md) | Set a schedule | [CLI](https://code.claude.com/docs/en/scheduled-tasks.md), [Desktop](https://code.claude.com/docs/en/desktop-scheduled-tasks.md), or [cloud](https://code.claude.com/docs/en/routines.md) | Pick a frequency | Recurring automation like daily reviews |

55 53 


74* [GitHub Actions](https://code.claude.com/docs/en/github-actions.md): run Claude in your CI pipeline72* [GitHub Actions](https://code.claude.com/docs/en/github-actions.md): run Claude in your CI pipeline

75* [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md): the same for GitLab73* [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md): the same for GitLab

76* [Code Review](https://code.claude.com/docs/en/code-review.md): automatic review on every pull request74* [Code Review](https://code.claude.com/docs/en/code-review.md): automatic review on every pull request

77* [Slack](https://code.claude.com/docs/en/slack.md): send tasks from team chat and get PRs back, on Pro, Max, and Ultra plans

78* [Claude Tag](https://claude.com/docs/claude-tag): run `@Claude` as your organization's shared identity on Team and Enterprise plans75* [Claude Tag](https://claude.com/docs/claude-tag): run `@Claude` as your organization's shared identity on Team and Enterprise plans

79 76 

80### Remote access77### Remote access

plugin-evals.md +32 −6

Details

199 199 

200### Set run limits and tools in prompt.md200### Set run limits and tools in prompt.md

201 201 

202Set a case's `max_turns`, `timeout_seconds`, `model`, `tags`, and the `allowed_tools` it may use in `prompt.md` frontmatter; the [prompt.md frontmatter](#prompt-md-fields) reference lists every field and its default.202Set a case's `max_turns`, `timeout_seconds`, `model`, `tags`, and `allowed_tools` in `prompt.md` frontmatter. For the other fields and the defaults, see the [prompt.md frontmatter](#prompt-md-fields) reference.

203 203 

204Claude receives the body exactly as you wrote it. `@path` mentions in it aren't expanded into file attachments, so if Claude needs to read a file, grant a tool for it in `allowed_tools`.204Claude receives the body exactly as you wrote it. `@path` mentions in it aren't expanded into file attachments, so if Claude needs to read a file, grant a tool for it in `allowed_tools`.

205 205 


338 338 

339Add `--case <glob>` to filter by case name and `--tag <tag>` to keep cases with any of the given tags.339Add `--case <glob>` to filter by case name and `--tag <tag>` to keep cases with any of the given tags.

340 340 

341Put the target before `--tag`, `--allow-tools`, and `--json`. The first two take a list and `--json` takes an optional path, so each of them reads a target that follows as its own value.341Put the target before `--tag`, `--allow-tools`, `--disallow-tools`, and `--json`. The first three take a list and `--json` takes an optional path, so each of them reads a target that follows as its own value.

342 342 

343### Grant tools343### Grant tools

344 344 

345Runs never stop to ask for permission. Built-in tools that need a grant you didn't give, such as `Bash`, `Write`, `Edit`, `WebFetch`, and `WebSearch`, are removed from the session, so Claude can't call them at all.345Runs never stop to ask for permission. Built-in tools that need a grant you didn't give, such as `Bash`, `Write`, `Edit`, `WebFetch`, and `WebSearch`, are removed from the session, so Claude can't call them at all.

346 346 

347A run allows only the read-only tools the case lists in `allowed_tools`, from `Read`, `Glob`, `Grep`, `NotebookRead`, `Skill`, `AskUserQuestion`, `Agent`, `TodoWrite`, and the task tools `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, and `TaskStop`, plus whatever you grant with `--allow-tools`. That grant applies to every case in the run. To let cases use `Bash`, `Write`, `Edit`, `WebFetch`, or `WebSearch`, grant them yourself:347A run pre-approves the read-only tools the case lists in `allowed_tools`, from `Read`, `Glob`, `Grep`, `NotebookRead`, `Skill`, `AskUserQuestion`, `Agent`, `TodoWrite`, and the task tools `TaskCreate`, `TaskGet`, `TaskList`, `TaskUpdate`, and `TaskStop`, plus whatever you grant with `--allow-tools`. That grant applies to every case in the run.

348 

349To let cases use `Bash`, `Write`, `Edit`, `WebFetch`, or `WebSearch`, grant them with `--allow-tools`:

348 350 

349```bash theme={null}351```bash theme={null}

350claude plugin eval . --allow-tools Write Edit "Bash(npm test *)"352claude plugin eval . --allow-tools Write Edit "Bash(npm test *)"


352 354 

353When a case asked for a tool you didn't grant, the progress output lists it as `not granted`. Tools on a [mocked](#mock-mcp-servers) MCP server need no grant. Tools on a real plugin MCP server need both the server started, with `--allow-real-servers` or `--mocks off`, and a grant by name, such as `--allow-tools "mcp__plugin_my-plugin_github__*"`; a plugin's MCP tools are named `mcp__plugin_<plugin>_<server>__<tool>`.355When a case asked for a tool you didn't grant, the progress output lists it as `not granted`. Tools on a [mocked](#mock-mcp-servers) MCP server need no grant. Tools on a real plugin MCP server need both the server started, with `--allow-real-servers` or `--mocks off`, and a grant by name, such as `--allow-tools "mcp__plugin_my-plugin_github__*"`; a plugin's MCP tools are named `mcp__plugin_<plugin>_<server>__<tool>`.

354 356 

357#### Pre-approve reads from another path

358 

359To pre-approve reads under a folder such as `/data`, grant a [`Read` rule](https://code.claude.com/docs/en/permissions#read-and-edit) with a leading `//`, as in `--allow-tools "Read(//data/**)"`. On native Windows, the same grant for `C:\data` is `Read(//c/data/**)`. Listing `Read`, `Glob`, or `Grep` alone doesn't pre-approve every path on your machine.

360 

355#### Shell grants need a sandbox361#### Shell grants need a sandbox

356 362 

357When you grant `Bash` in any form, every command runs under Claude Code's [OS-level sandbox](https://code.claude.com/docs/en/sandboxing.md). Writes are confined to the run's workspace, your home directory and Claude Code configuration are unreadable, and network access is limited to domains you grant with `--allow-tools "WebFetch(domain:example.com)"`. If you grant Bash or PowerShell on a machine with no sandbox backend, Claude Code refuses each run rather than running it unconfined, and the case shows a run error and usually scores 0. Native Windows has no backend, so run shell-granting suites under WSL2; on Linux, install `bubblewrap` and `socat` first. See the [sandboxing prerequisites](https://code.claude.com/docs/en/sandboxing.md).363When you grant `Bash` in any form, every command runs under Claude Code's [OS-level sandbox](https://code.claude.com/docs/en/sandboxing.md). Writes are confined to the run's workspace, your home directory and Claude Code configuration are unreadable, and network access is limited to domains you grant with `--allow-tools "WebFetch(domain:example.com)"`. If you grant Bash or PowerShell on a machine with no sandbox backend, Claude Code refuses each run rather than running it unconfined, and the case shows a run error and usually scores 0. Native Windows has no backend, so run shell-granting suites under WSL2; on Linux, install `bubblewrap` and `socat` first. See the [sandboxing prerequisites](https://code.claude.com/docs/en/sandboxing.md).


367 373 

368Ask your administrator whether that setting can change for your machine, or drop the shell grant from that run.374Ask your administrator whether that setting can change for your machine, or drop the shell grant from that run.

369 375 

376### Remove a built-in tool from runs

377 

378To remove a built-in tool from every case, pass its [exact name](https://code.claude.com/docs/en/tools-reference.md) to `--disallow-tools`. For one case, list the name in that case's [`disallowed_tools`](#prompt-md-fields) field. Requires Claude Code v2.1.299 or later.

379 

380If you only omit `Agent` from `allowed_tools`, Claude can still call it.

381 

382To remove `Agent` and `TaskStop` from every case, run this in your shell:

383 

384```bash theme={null}

385claude plugin eval . --disallow-tools Agent TaskStop

386```

387 

388The output lists both tools after `Removed from Claude's tools in every case`.

389 

370### Command options390### Command options

371 391 

372This table covers the options for run count, models, scoring, cost, tool grants, mocks, and output. Run `claude plugin eval --help` for the complete list, which also includes `--case`, `--tag`, `--eval-dir`, `--no-scaffold`, `--report`, and `--verbose`.392This table covers the options for run count, models, scoring, cost, tool grants, mocks, and output. Run `claude plugin eval --help` for the complete list, which also includes `--case`, `--tag`, `--eval-dir`, `--no-scaffold`, `--report`, and `--verbose`.


381| `--threshold <0..1>` | `1.0` | A case passes when its with-arm score is at least this. Any case below it makes the command exit 1 |401| `--threshold <0..1>` | `1.0` | A case passes when its with-arm score is at least this. Any case below it makes the command exit 1 |

382| `--max-cost-usd <usd>` | No ceiling | A ceiling on the run's list-price cost estimate, not on plan usage. Checked before each run starts. Once spent, nothing further starts; runs that already started finish, so spend can pass the ceiling by those runs. If any run is left unstarted, the command exits 2 with partial results |402| `--max-cost-usd <usd>` | No ceiling | A ceiling on the run's list-price cost estimate, not on plan usage. Checked before each run starts. Once spent, nothing further starts; runs that already started finish, so spend can pass the ceiling by those runs. If any run is left unstarted, the command exits 2 with partial results |

383| `--allow-tools <tools...>` | None | Grant tools beyond the read-only set. See [Grant tools](#grant-tools) |403| `--allow-tools <tools...>` | None | Grant tools beyond the read-only set. See [Grant tools](#grant-tools) |

404| `--disallow-tools <tools...>` | None | Remove built-in tools from every case. See [Remove a built-in tool from runs](#disallow-tools) |

384| `--scaffold` | Off | Run each case's [`scaffold_script`](#add-setup-or-history-with-case-yaml) |405| `--scaffold` | Off | Run each case's [`scaffold_script`](#add-setup-or-history-with-case-yaml) |

385| `--trust-plugin` | Off | Skip the first-run trust prompt for a plugin whose code and suite you'd run yourself. Pass it in CI so the job is never refused by or left waiting at the prompt. See [What a run can access](#security) |406| `--trust-plugin` | Off | Skip the first-run trust prompt for a plugin whose code and suite you'd run yourself. Pass it in CI so the job is never refused by or left waiting at the prompt. See [What a run can access](#security) |

386| `--mocks <mode>` | `record` | `record` answers MCP tool calls from [mocks](#mock-mcp-servers), doesn't start the plugin's real servers, and saves agent-mock answers for replay. `off` ignores mocks and starts the plugin's real MCP servers |407| `--mocks <mode>` | `record` | `record` answers MCP tool calls from [mocks](#mock-mcp-servers), doesn't start the plugin's real servers, and saves agent-mock answers for replay. `off` ignores mocks and starts the plugin's real MCP servers |


541| `model` | The child session's default | Model for the agent under test. `--model` overrides it |562| `model` | The child session's default | Model for the agent under test. `--model` overrides it |

542| `max_turns` | `10` | Turn cap, up to 200. Hitting it is recorded as a run error and usually lowers the score, so set it generously |563| `max_turns` | `10` | Turn cap, up to 200. Hitting it is recorded as a run error and usually lowers the score, so set it generously |

543| `timeout_seconds` | `300` | Wall-clock cap per run, up to 3600 |564| `timeout_seconds` | `300` | Wall-clock cap per run, up to 3600 |

544| `allowed_tools` | `[]` | Tools the case wants, such as `[Read, Glob, Grep, Skill]`. Read-only tools are granted when listed here; for anything else, see [Grant tools](#grant-tools) |565| `allowed_tools` | `[]` | Tools the case wants, such as `[Read, Glob, Grep, Skill]`. See [Grant tools](#grant-tools) |

566| `disallowed_tools` | | Exact built-in tool names to [remove from this case](#disallow-tools), such as `[Agent, TaskStop]` |

545| `append_system_prompt` | | Text appended to the child session's system prompt |567| `append_system_prompt` | | Text appended to the child session's system prompt |

546| `env` | `{}` | Extra environment variables for the child session. Keys must match `EVAL_[A-Z0-9_]*`; any other key fails the run. The run inherits only an allowlist from your shell: basics such as `PATH` and locale, proxy and certificate settings, the variables that select and authenticate your model provider, most `ANTHROPIC_*` and `CLAUDE_CODE_*` configuration, and `EVAL_*`. To pass the plugin anything else, such as a toolchain setting, export it as an `EVAL_*` variable |568| `env` | `{}` | Extra environment variables for the child session. Keys must match `EVAL_[A-Z0-9_]*`; any other key fails the run. The run inherits only an allowlist from your shell: basics such as `PATH` and locale, proxy and certificate settings, the variables that select and authenticate your model provider, most `ANTHROPIC_*` and `CLAUDE_CODE_*` configuration, and `EVAL_*`. To pass the plugin anything else, such as a toolchain setting, export it as an `EVAL_*` variable |

547 569 

548### case.yaml fields570### case.yaml fields

549 571 

550`case.yaml` is an alternative or companion to `prompt.md`: it describes a case in YAML and adds the fields that point at other files. It requires `schema_version: "1.1"` and `name`. The `prompt.md` fields `description`, `tags`, `plugins`, `runs`, and `expected_outcome` go at the top level; `model`, `max_turns`, `timeout_seconds`, `allowed_tools`, `append_system_prompt`, and `env` go under `execution:`. When both files exist, `prompt.md` frontmatter overrides the matching `case.yaml` fields, the `prompt.md` body is the prompt, and `graders/*.md` are added after any graders listed in `case.yaml`.572`case.yaml` is an alternative or companion to `prompt.md`: it describes a case in YAML and adds the fields that point at other files. It requires `schema_version: "1.1"` and `name`. The `prompt.md` fields `description`, `tags`, `plugins`, `runs`, and `expected_outcome` go at the top level; `model`, `max_turns`, `timeout_seconds`, `allowed_tools`, `disallowed_tools`, `append_system_prompt`, and `env` go under `execution:`.

573 

574When both files exist, `prompt.md` frontmatter overrides the matching `case.yaml` fields other than `disallowed_tools`, where the two lists combine. The `prompt.md` body is the prompt, and `graders/*.md` are added after any graders listed in `case.yaml`.

551 575 

552These fields exist only in `case.yaml`:576These fields exist only in `case.yaml`:

553 577 


681 705 

682The error is expected, since `Δ` compares your plugin's runs against the baseline. In the JSON result, the baseline runs are under `cases[].arms.without`.706The error is expected, since `Δ` compares your plugin's runs against the baseline. In the JSON result, the baseline runs are under `cases[].arms.without`.

683 707 

684In runs with your plugin loaded, a case that lists `Agent` in `allowed_tools` can dispatch one of your plugin's agents by its namespaced name, such as `my-plugin:code-reviewer` for the `code-reviewer` agent in a plugin named `my-plugin`. To skip the baseline runs, pass `--ablation none`.708> [!NOTE]

709>

710> In runs with your plugin loaded, Claude can dispatch one of your plugin's agents by its namespaced name, such as `my-plugin:code-reviewer` for the `code-reviewer` agent in a plugin named `my-plugin`. To skip the baseline runs, pass `--ablation none`.

685 711 

686### Everything scores zero although the right files were produced712### Everything scores zero although the right files were produced

687 713 

Details

493* An installed plugin as `name` or `name@marketplace`493* An installed plugin as `name` or `name@marketplace`

494* `name@skills-dir`494* `name@skills-dir`

495 495 

496Put the target before `--tag`, `--allow-tools`, and `--json`. Each of these options takes the words that follow it as its value, so a target written after one of them is read as a tag, a tool name, or the JSON output path instead of as the target.496Put the target before `--tag`, `--allow-tools`, [`--disallow-tools`](https://code.claude.com/docs/en/plugin-evals#disallow-tools), and `--json`. A target written after one of them can be read as a tag, a tool name, or the JSON output path.

497 497 

498This table lists the options most runs use. Run `claude plugin eval --help` for the complete set, including `--case`, `--tag`, `--output-dir`, `--report`, `--allow-real-servers`, `--keep-temp`, and `--verbose`.498This table lists the options most runs use. Run `claude plugin eval --help` for the complete set, including `--case`, `--tag`, `--output-dir`, `--report`, `--allow-real-servers`, `--keep-temp`, and `--verbose`.

499 499 

Details

6 6 

7> Build your first Claude Code plugin from an empty directory, test it without a marketplace, and convert an existing .claude/ setup.7> Build your first Claude Code plugin from an empty directory, test it without a marketplace, and convert an existing .claude/ setup.

8 8 

9A plugin is a directory of skills, agents, hooks, and MCP servers, plus a `plugin.json` file, called the manifest, that names the plugin. Claude Code loads the directory as one unit, so you can share it with teammates, install it in several projects, or publish it to a marketplace.9A plugin is a directory of skills, agents, hooks, and MCP servers, plus a `plugin.json` file, called the manifest, that names the plugin. Claude Code loads the directory as one unit, so you can share it with others, install it in several projects, or publish it to a marketplace.

10 10 

11This page is for people writing their own plugins.11This page is for people writing their own plugins.

12 12 


25 25 

26## Decide when to use a plugin26## Decide when to use a plugin

27 27 

28Skills, agents, hooks, and MCP servers all work standalone in your project or home directory. Keep that standalone setup while it serves one project or only you. Make a plugin when you want to share the setup with teammates, install it in several projects, or publish versioned releases.28Skills, agents, hooks, and MCP servers all work standalone in your project or home directory. Keep that standalone setup while it serves one project or only you. Make a plugin when you want to share the setup with others, install it in several projects, or publish versioned releases.

29 29 

30When you move standalone skills, agents, hooks, and MCP config into a plugin, their location and names change:30When you move standalone skills, agents, hooks, and MCP config into a plugin, their location and names change:

31 31 

Details

15> These cases are covered on other pages:15> These cases are covered on other pages:

16>16>

17> * **You haven't written the catalog file yet**: start with [Create a marketplace](https://code.claude.com/docs/en/plugins/create-marketplace.md)17> * **You haven't written the catalog file yet**: start with [Create a marketplace](https://code.claude.com/docs/en/plugins/create-marketplace.md)

18> * **You're an admin requiring, restricting, or pre-installing marketplaces across your organization's machines**: read [Manage plugins for your organization](https://code.claude.com/docs/en/plugins/org.md)18> * **You want to require, restrict, or pre-install marketplaces across an organization's machines**: read [Manage plugins for your organization](https://code.claude.com/docs/en/plugins/org.md)

19 19 

20Start with [Host your marketplace](#host-your-marketplace) to pick a host and the command your users run. Read [Keep users up to date](#keep-users-up-to-date) before your first release. Read [Rename or remove a plugin](#rename-or-remove-a-plugin) before you change a plugin's `name`.20Start with [Host your marketplace](#host-your-marketplace) to pick a host and the command your users run. Read [Keep users up to date](#keep-users-up-to-date) before your first release. Read [Rename or remove a plugin](#rename-or-remove-a-plugin) before you change a plugin's `name`.

21 21 


113 113 

114For a GitHub Enterprise Server host, users need git access to that host from their machine. See [Plugin marketplaces on GHES](https://code.claude.com/docs/en/github-enterprise-server.md#plugin-marketplaces-on-ghes) for what each Claude Code surface needs to reach a GHES-hosted marketplace.114For a GitHub Enterprise Server host, users need git access to that host from their machine. See [Plugin marketplaces on GHES](https://code.claude.com/docs/en/github-enterprise-server.md#plugin-marketplaces-on-ghes) for what each Claude Code surface needs to reach a GHES-hosted marketplace.

115 115 

116If you distribute through **Organization settings > Plugins & skills** on claude.ai instead, your users' git credentials aren't involved. See [Distribute through organization settings](#distribute-through-organization-settings).116If you distribute through [**Organization settings > Plugins & skills**](https://claude.ai/admin-settings/skills?tab=inventory) on claude.ai instead, your users' git credentials aren't involved. See [Distribute through organization settings](#distribute-through-organization-settings).

117 117 

118### Serve users who have no git-host account118### Serve users who have no git-host account

119 119 

Details

200 200 

201> [!NOTE]201> [!NOTE]

202>202>

203> If the marketplace isn't on your machine yet, [add it](https://code.claude.com/docs/en/plugins/install.md#add-a-marketplace) before you install. Find its source in the `extraKnownMarketplaces` setting of `.claude/settings.json`, or ask your maintainer.203> If the marketplace isn't on your machine yet, [add it](https://code.claude.com/docs/en/plugins/install.md#add-a-marketplace) before you install. Find its source in the `extraKnownMarketplaces` setting of `.claude/settings.json`, or ask the project's maintainer.

204 204 

205To install, run this in a shell from the project, using the plugin's key in `enabledPlugins`:205To install, run this in a shell from the project, using the plugin's key in `enabledPlugins`:

206 206 

Details

298 298 

299Check the `hooks:` line for the events your module hooks, each with its filter in braces, and `calls:` for every mods API method it calls. If your module reads or sets environment variables, look for `env reads:` and `env writes:` lines too, and `state reads:` and `state writes:` if it uses [`$.state`](https://code.claude.com/docs/en/plugins/mods/interface#keep-state). You also see one line for each hook that can refuse an action, such as `gating hook without .catch: tool.call`, which says whether that hook has a [`.catch` handler](https://code.claude.com/docs/en/plugins/mods/events#handle-a-hook-that-fails).299Check the `hooks:` line for the events your module hooks, each with its filter in braces, and `calls:` for every mods API method it calls. If your module reads or sets environment variables, look for `env reads:` and `env writes:` lines too, and `state reads:` and `state writes:` if it uses [`$.state`](https://code.claude.com/docs/en/plugins/mods/interface#keep-state). You also see one line for each hook that can refuse an action, such as `gating hook without .catch: tool.call`, which says whether that hook has a [`.catch` handler](https://code.claude.com/docs/en/plugins/mods/events#handle-a-hook-that-fails).

300 300 

301If an event you meant to handle is missing from the `hooks:` lines, Claude Code won't call that hook either. The usual cause is a misspelled event name, which the command reports as an error such as `"tool.calls" is not an event`.301If an event you meant to handle is missing from the `hooks:` lines, Claude Code won't call that hook either. Check each event name against [the types for your build](#get-the-types-for-your-build), because validation doesn't catch every typo. For example, `tool.calls` fails with `"tool.calls" is not an event`, but `tol.call` passes validation and the mod then doesn't load.

302 302 

303Follow these rules so that static analysis can find every hook and call:303Follow these rules so that static analysis can find every hook and call:

304 304 

305* Write each mods API call in full: `$`, the namespace, then the method, as in `$.store.get('notes')`. You can pass `$` to a function declared at the top level of the same file, and for a function of yours named `loadNotes`, the `calls:` line then reads `$.store.get (via loadNotes)`. Passing `$` to a method, a function defined inside the hook, or a function you import from another of your files fails validation. The `read` and `update` functions that [`$.state`](https://code.claude.com/docs/en/plugins/mods/interface#keep-state) uses are the imports that can take it. Don't assign `$` or one of its namespaces to a variable, destructure it, or index it with a computed name. `const ui = $.ui` fails with `$.ui is used as a value`.305* Write each mods API call in full: `$`, the namespace, then the method, as in `$.store.get('notes')`. Don't assign `$` or one of its namespaces to a variable, destructure it, or index it with a computed name. `const ui = $.ui` fails with `$.ui is used as a value`.

306* Write the event name in each `on` call as a string literal, such as `'tool.call'`. A variable, or a loop over a list of names, fails with `the event name passed to on() is not a string literal`.306* Write the event name in each `on` call as a string literal, such as `'tool.call'`. A variable, or a loop over a list of names, fails with `the event name passed to on() is not a string literal`.

307* Inside `register`, don't declare a second variable or parameter named `on`. Validation fails with `"on" is declared again (shadowed)`.307* Inside `register`, don't declare a second variable or parameter named `on`. Validation fails with `"on" is declared again (shadowed)`.

308* Import only from files inside the plugin directory, by relative path. The one bare import allowed is `claude-code`, for types and a few helpers.308* Import only from files inside the plugin directory, by relative path. The one bare import allowed is `claude-code`, for types and a few helpers.

309* Use `import` declarations at the top of the file, as in `import { name } from './file.js'`. A dynamic `import()` fails with `a dynamic import(); a hooks module imports its own files with an import declaration`.309* Use `import` declarations at the top of the file, as in `import { name } from './file.js'`. A dynamic `import()` fails with `a dynamic import(); a hooks module imports its own files with an import declaration`.

310* Write every file as an ES module, with `import` and not `require`. The [reference](https://code.claude.com/docs/en/plugins/mods/reference.md#files) lists the file extensions Claude Code loads.310* Write every file as an ES module, with `import` and not `require`. The [reference](https://code.claude.com/docs/en/plugins/mods/reference.md#files) lists the file extensions Claude Code loads.

311 311 

312#### Pass `$` to your functions

313 

314You can pass `$` to a function declared at the top level of your hook's file, and to the `read` and `update` functions that [`$.state`](https://code.claude.com/docs/en/plugins/mods/interface#keep-state) uses. For a function named `loadNotes` that calls `$.store.get`, the `calls:` line reads `$.store.get (via loadNotes)`. Passing `$` to a method or to a function defined inside the hook fails validation.

315 

316On Claude Code v2.1.299 or later, you can also pass `$` to a function you import from another of your files. Declare it there with the `function` keyword, as in `export function loadNotes($) { ... }`. An imported arrow function fails with `a name bound to a function expression, outside the hook's own file`.

317 

312### Test the mod318### Test the mod

313 319 

314You can write automated tests for a mod and run them from your shell with `claude plugin test`, with no session, sign-in, or network. A test fires the events your hooks handle and checks what the hooks did.320You can write automated tests for a mod and run them from your shell with `claude plugin test`, with no session, sign-in, or network. A test fires the events your hooks handle and checks what the hooks did.


362 368 

363Before you do, check the plugin's `name`: `claude plugin validate` fails a name that [looks like one of Anthropic's own](https://code.claude.com/docs/en/plugins/manifest-reference.md#name), such as one that starts with `claude-`. The events and methods can change between releases, so your README is the place to say which Claude Code version you tested with.369Before you do, check the plugin's `name`: `claude plugin validate` fails a name that [looks like one of Anthropic's own](https://code.claude.com/docs/en/plugins/manifest-reference.md#name), such as one that starts with `claude-`. The events and methods can change between releases, so your README is the place to say which Claude Code version you tested with.

364 370 

365Keep developing against the directory with `--plugin-dir`, not against an installed copy. Claude Code caches an installed plugin by version, so your edits don't reach the installed copy until you increment the version and install again.371Keep developing against the directory with `--plugin-dir`, not against an [installed copy](https://code.claude.com/docs/en/plugins/loading.md#in-place-and-copied-plugins).

366 372 

367## Next steps373## Next steps

368 374 

Details

46 46 

47### Rewrite an event47### Rewrite an event

48 48 

49To change what Claude Code acts on, such as the text of a prompt, call `next` with a modified copy of the event. The event itself is immutable: it's deeply frozen, and assigning to a field throws. This hook trims each prompt before it's sent:49To change what Claude Code acts on, call `next` with a modified copy of the event.

50 

51This hook trims a prompt before it's sent:

50 52 

51```javascript theme={null}53```javascript theme={null}

52on('prompt.submit', async ($, e, next) => {54on('prompt.submit', async ($, e, next) => {


55})57})

56```58```

57 59 

58Later handlers and Claude Code receive the trimmed prompt and never see the original. You can also change the result: `await next(e)`, then return a copy of the result with a field replaced.60For a prompt typed as plain text, later handlers and Claude receive the trimmed prompt.

59 61 

60### Answer an event62### Answer an event

61 63 


150* **Answer the call yourself**: return an object with a `result` field, without calling `next`, and for a built-in tool, give `result` the shape that tool's own result has in [the types for your build](https://code.claude.com/docs/en/plugins/mods/create.md#get-the-types-for-your-build). No permission prompt appears and the tool doesn't run, so the result you return is all Claude learns about what happened.152* **Answer the call yourself**: return an object with a `result` field, without calling `next`, and for a built-in tool, give `result` the shape that tool's own result has in [the types for your build](https://code.claude.com/docs/en/plugins/mods/create.md#get-the-types-for-your-build). No permission prompt appears and the tool doesn't run, so the result you return is all Claude learns about what happened.

151* **Withhold the result from Claude**: return `{ deny: reason }` after `await next(e)`. Claude reads your reason in place of what `next` returned. When the tool ran, the deny keeps its result from Claude and undoes nothing the tool did. When the tool ran and succeeded, the reason follows a note such as `Bash ran, and a plugin withheld its result:`.153* **Withhold the result from Claude**: return `{ deny: reason }` after `await next(e)`. Claude reads your reason in place of what `next` returned. When the tool ran, the deny keeps its result from Claude and undoes nothing the tool did. When the tool ran and succeeded, the reason follows a note such as `Bash ran, and a plugin withheld its result:`.

152 154 

153Hooks in your organization's [managed settings](https://code.claude.com/docs/en/server-managed-settings.md) run before any mod's `tool.call` hook. When a managed hook blocks the call, no mod's `tool.call` hook runs for that call.155Hooks in [managed settings](https://code.claude.com/docs/en/server-managed-settings.md) run before any mod's `tool.call` hook. When a managed hook blocks the call, no mod's `tool.call` hook runs for that call.

154 156 

155#### Hold a tool call until the user decides157#### Hold a tool call until the user decides

156 158 


260 262 

261### Rewrite or add to a prompt263### Rewrite or add to a prompt

262 264 

263A `prompt.submit` hook sees each prompt before the turn starts, so it can rewrite the text or add to it. `e.text` is what was typed.265To rewrite a prompt or add to it, handle `prompt.submit`, read the prompt from `e.text`, and return a value from this table:

264 266 

265| To do this | Return this |267| To do this | Return this |

266| :- | :- |268| :- | :- |

267| Rewrite the prompt. The transcript and your [prompt history](https://code.claude.com/docs/en/interactive-mode.md#command-history) show the new text. | `next({ ...e, text: newText })` |269| Rewrite a prompt typed as plain text. The transcript and your [prompt history](https://code.claude.com/docs/en/interactive-mode.md#command-history) show the new text. | `next({ ...e, text: newText })` |

268| Add text only Claude reads, after the prompt | `next({ ...e, context: [...(e.context ?? []), extraText] })` |270| Add text only Claude reads, after the prompt | `next({ ...e, context: [...(e.context ?? []), extraText] })` |

269| Stop the prompt from being sent | `{ drop: 'the reason' }` |271| Stop the prompt from being sent | `{ drop: 'the reason' }` |

270 272 

271This hook adds the current branch name for Claude whenever a prompt mentions a pull request:273This hook adds the current branch name for Claude when a prompt mentions a pull request:

272 274 

273```javascript theme={null}275```javascript theme={null}

274on('prompt.submit', async ($, e, next) => {276on('prompt.submit', async ($, e, next) => {


284 286 

285When you send a prompt such as `open a PR for this change`, your message looks the same in the transcript, and Claude also reads a line such as `Current branch: feature/auth` after it. A prompt that doesn't mention a pull request goes through unchanged, and `git` doesn't run.287When you send a prompt such as `open a PR for this change`, your message looks the same in the transcript, and Claude also reads a line such as `Current branch: feature/auth` after it. A prompt that doesn't mention a pull request goes through unchanged, and `git` doesn't run.

286 288 

287To stop a prompt, return `{ drop: 'the reason' }` without calling `next`. The text goes back into the user's prompt input, and they see `Prompt dropped by a hook:` followed by your reason, so address the reason to them. The prompt still goes through in these cases:289To stop a prompt, return `{ drop: 'the reason' }` without calling `next`. The text goes back into the user's prompt input, and they see `Prompt dropped by a hook:` followed by your reason, so address the reason to them. Don't rely on `drop` to stop every prompt. For example, a prompt goes through in these cases:

288 290 

289* **Your hook returns a `drop` after its `next(e)` call let the prompt through**: the turn still runs, and the hook [fails](#handle-a-hook-that-fails) with a message that includes `a drop after its next() was answered`291* **Your hook returns a `drop` after its `next(e)` call let the prompt through**: the turn still runs, and the hook [fails](#handle-a-hook-that-fails) with a message that includes `a drop after its next() was answered`

290* **Your hook throws or times out**: Claude Code skips it and sends the prompt. [Add a `.catch` handler](#handle-a-hook-that-fails) so that a failure doesn't send a prompt the hook would have stopped.292* **Your hook throws or times out**: Claude Code skips it and sends the prompt. [Add a `.catch` handler](#handle-a-hook-that-fails) so that a failure doesn't send a prompt the hook would have stopped.

293* **The prompt is the `/command` for a [skill with `context: fork`](https://code.claude.com/docs/en/skills#run-skills-in-a-subagent)**: your hook doesn't run. To stop the command, return `{ text: 'the reason' }` from a [`command.run`](https://code.claude.com/docs/en/plugins/mods/api#add-a-command) hook without calling `next`.

291 294 

292[Other events](https://code.claude.com/docs/en/plugins/mods/reference.md#prompts-and-what-claude-reads) cover the rest of what Claude reads: `prompt.section` for each section of the system prompt, `prompt.context` for the context sent with the first message, and `skill.prompt` for a skill's text. To change a section after a conversation has started, see [Send a changed system prompt section or tool description](https://code.claude.com/docs/en/plugins/mods/reference.md#break-prompt-cache). In a `skill.prompt` hook, you can also read [which plugin or file the skill came from](https://code.claude.com/docs/en/plugins/mods/reference.md#skill-prompt-fields).295[Other events](https://code.claude.com/docs/en/plugins/mods/reference.md#prompts-and-what-claude-reads) cover the rest of what Claude reads: `prompt.section` for each section of the system prompt, `prompt.context` for the context sent with the first message, and `skill.prompt` for a skill's text. To change a section after a conversation has started, see [Send a changed system prompt section or tool description](https://code.claude.com/docs/en/plugins/mods/reference.md#break-prompt-cache). In a `skill.prompt` hook, you can also read [which plugin or file the skill came from](https://code.claude.com/docs/en/plugins/mods/reference.md#skill-prompt-fields).

293 296 


297 300 

298| Event | When it fires | What a hook can do |301| Event | When it fires | What a hook can do |

299| :- | :- | :- |302| :- | :- | :- |

300| `turn.start` | A turn begins | Observe. `e.turnId` identifies the turn in the other two events. |303| `turn.start` | A turn begins. A subagent's turn fires it with `e.agentId` set, which requires Claude Code v2.1.299 or later. | Observe. `e.turnId` identifies the turn in the other two events. |

301| `turn.step` | Claude Code is about to send one request to the model. A turn with tool calls has several. `e.agentId` is set for a subagent's request. | Read each request's token usage, send it to a different model with `next({ ...e, model })`, or answer without calling the model |304| `turn.step` | Claude Code is about to send one request to the model. A turn with tool calls has several. `e.agentId` is set for a subagent's request. | Read each request's token usage, send it to a different model with `next({ ...e, model })`, or answer without calling the model |

302| `turn.complete` | The turn ended, including a turn the user interrupted, where `e.isAborted` is `true`. `e.answer` is Claude's final text, `e.durationMs` how long it took, and `e.usage` the turn's token totals. A subagent's turn fires it with `e.agentId` set. | Observe, or return an object with a `text` field, such as `{ text: 'Done in 12 seconds' }`, to show a line under the answer |305| `turn.complete` | The turn ended, including a turn the user interrupted, where `e.isAborted` is `true`. `e.answer` is Claude's final text, `e.durationMs` how long it took, and `e.usage` the turn's token totals. A subagent's turn fires it with `e.agentId` set. | Observe. In the main conversation, return an object with a `text` field, such as `{ text: 'Done in 12 seconds' }`, to show a line under the answer. |

303 306 

304Write a `turn.step` hook as an async generator, because the event streams. `yield* next(e)` forwards the response as it streams and evaluates to the finished result. This hook logs how much of each request the Claude API served from the [prompt cache](https://code.claude.com/docs/en/prompt-caching.md):307Write a `turn.step` hook as an async generator, because the event streams. `yield* next(e)` forwards the response as it streams and evaluates to the finished result. This hook logs how much of each request the Claude API served from the [prompt cache](https://code.claude.com/docs/en/prompt-caching.md):

305 308 

Details

201 201 

202### Change what Claude Code already draws202### Change what Claude Code already draws

203 203 

204Claude Code draws most of its interface itself: messages, tool call rows, the spinner, and more. Each of those parts is a render site too, so a mod can restyle or replace it. To change one, filter your `ui.render` hook on its name from this table:204To change a part Claude Code draws, filter your `ui.render` hook on a render site from this table:

205 205 

206| Site | What it is |206| Site | What it is |

207| :- | :- |207| :- | :- |

208| `UserMessage`, `AssistantMessage` | A message in the transcript |208| `UserMessage`, `AssistantMessage` | A message in the transcript |

209| `ToolUse`, `ToolResult`, `ToolGroup` | A tool call's row, its result, and a collapsed group of calls |209| `ToolUse`, `ToolResult`, `ToolGroup` | A tool call's row, its result, and a collapsed group of calls |

210| `CommandOutput` | The row a command printed |210| `CommandOutput` | The row a command printed |

211| `AskUserQuestion` | The dialog Claude opens to ask you a question |211| `AskUserQuestion` | The dialog Claude opens to ask you a question. A `ui.render` hook can't replace it. |

212| `Spinner`, `ToolProgress`, `TurnDuration` | Status lines for a turn: the line that animates while Claude works, a running tool's live progress line, and the line that closes a turn |212| `Spinner`, `ToolProgress`, `TurnDuration` | Status lines for a turn: the line that animates while Claude works, a running tool's live progress line, and the line that closes a turn |

213| `InfoNotice`, `SessionMode`, `PromptHint` | Status lines under the logo, the mode labels in the footer, and the hint line under the prompt |213| `InfoNotice`, `SessionMode`, `PromptHint` | Status lines under the logo, the mode labels in the footer, and the hint line under the prompt |

214| `AgentRow` | A subagent's or teammate's row in the agent panel |214| `AgentRow` | A subagent's or teammate's row in the agent panel |

215 215 

216`Pane`, `AskUserQuestion`, `Spinner`, `UserMessage`, `AssistantMessage`, and the tool call sites work in the terminal, the Desktop app, and the VS Code extension. The [render sites table](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites) lists where each of the others is raised.216`Pane`, `AbovePrompt`, `AskUserQuestion`, `Spinner`, `UserMessage`, `AssistantMessage`, and the tool call sites work in the terminal, the Desktop app, and the VS Code extension. The [render sites table](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites) lists where each of the others is raised. To change the bubbles and font of messages in the Desktop app without a `ui.render` hook, [style the messages with a theme](#style-messages-in-the-desktop-app).

217 217 

218At a site Claude Code already draws, your hook can change a detail, replace the drawing, or leave it alone. Select a tab to see each one applied to the spinner. The examples read a `calls` variable that another hook counts, as in the [tutorial mod](https://code.claude.com/docs/en/plugins/mods/create.md#write-a-mod-yourself).218Select a tab to see a hook change a spinner detail, replace the spinner, or leave it alone. The examples read a `calls` variable that another hook counts, as in the [tutorial mod](https://code.claude.com/docs/en/plugins/mods/create.md#write-a-mod-yourself).

219 219 

220> [tab] Change a detail220> [tab] Change a detail

221>221>


439 439 

440* **The `backdrop` fields**: `scene` is a [name](https://code.claude.com/docs/en/plugins/mods/reference.md#limits) you choose for a backdrop your hook draws. For the other fields and `overrideColorScheme`, see [the types for your build](https://code.claude.com/docs/en/plugins/mods/create.md#get-the-types-for-your-build).440* **The `backdrop` fields**: `scene` is a [name](https://code.claude.com/docs/en/plugins/mods/reference.md#limits) you choose for a backdrop your hook draws. For the other fields and `overrideColorScheme`, see [the types for your build](https://code.claude.com/docs/en/plugins/mods/create.md#get-the-types-for-your-build).

441* **Whether the backdrop is drawn**: `$.theme.set` resolves with `isDrawn: true` when a Desktop or mobile app connected to the session says it draws backdrops. Otherwise `isDrawn` is `false` and `reason` says why.441* **Whether the backdrop is drawn**: `$.theme.set` resolves with `isDrawn: true` when a Desktop or mobile app connected to the session says it draws backdrops. Otherwise `isDrawn` is `false` and `reason` says why.

442* **One theme for each session**: a mod that calls `$.theme.set` replaces the session's backdrop and [colors](#change-the-colors-of-the-desktop-app), and a mod that calls `$.theme.clear()` removes them, whichever mod set them. Call `$.theme.clear()` only when the user asks for it.442* **One theme for each session**: a mod that calls `$.theme.set` replaces the session's backdrop, [colors](#change-the-colors-of-the-desktop-app), [message style](#style-messages-in-the-desktop-app), and [sound](#add-sound-to-a-theme), and a mod that calls `$.theme.clear()` removes them, whichever mod set them. Call `$.theme.clear()` only when the user asks for it.

443 

444### Animate a backdrop with a shader

445 

446To make a [backdrop](#put-a-backdrop-behind-the-conversation) that moves and follows the user's pointer in the Desktop app's Code tab, wrap an `Svg` in a [`Shader`](https://code.claude.com/docs/en/plugins/mods/reference#elements) element. The element names a shader file, which is code that computes each pixel's color on the GPU. The app draws the result over the `Svg`. `Shader` requires Claude Code v2.1.326 or later in the Code tab, so [check the version there](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab) first.

447 

448These steps create a mod named `glow`. It draws a light under the pointer, and a click on the backdrop changes the color of the light.

449 

450**1. Save the manifest and hooks.json**

451 

452From [Write a mod yourself](https://code.claude.com/docs/en/plugins/mods/create.md#write-a-mod-yourself), save `.claude-plugin/plugin.json` and `hooks/hooks.json` in `~/.claude/skills/glow/`, and change `first-mod` to `glow` in both files. A mod [under `~/.claude/skills/`](https://code.claude.com/docs/en/plugins/create#scaffold-a-plugin-that-loads-every-session) loads when you start a session.

453 

454**2. Write the shader**

455 

456Save this file as `~/.claude/skills/glow/hooks/glow.ts`. Claude Code provides the `claude-code/shader` module it imports.

457 

458The shader draws a light around the pointer, blue when `warm` is `0` and orange when it's `1`:

459 

460```typescript glow/hooks/glow.ts theme={null}

461import {

462 length, max, min, mix, picture, pointers, shader, smoothstep, values, vec2, vec3, vec4,

463} from 'claude-code/shader'

464 

465// Declare each number the mod sets through the Shader's values, with its range

466const { warm } = values({ warm: [0, 1] })

467 

468// This function runs once for every pixel and returns that pixel's color

469const glow = picture(pixel => {

470 let light = 0

471 // The loop sees the mouse, each finger, and for one second each pointer that lifted

472 // A mouse that rests for half a second counts as lifted

473 for (const pointer of pointers) {

474 // Subtracting two positions subtracts their x and their y, in points

475 // The result is typed as a plain number, so vec2() marks it as a position again

476 const near = smoothstep(200, 0, length(vec2(pixel.point - pointer.at)))

477 // A pointer fades in over a quarter second, then out as gone counts from 0 to 1

478 const fade = min(pointer.age * 4, 1) * (1 - pointer.gone)

479 light = max(light, near * near * fade)

480 }

481 const color = mix(vec3(0.25, 0.55, 1), vec3(1, 0.45, 0), warm)

482 const alpha = 0.7 * light

483 // The color is premultiplied: red, green and blue are multiplied by alpha

484 return vec4(color * alpha, alpha)

485})

486 

487// A shader runs its passes in order, and this one has a single pass

488export default shader({ passes: [glow] })

489```

490 

491**3. Draw the backdrop**

492 

493Save this file as `~/.claude/skills/glow/hooks/register.js`. The mod sets the theme when a session starts, and draws a `Shader` with one `Svg` child.

494 

495The mod's [`ui.pointer`](https://code.claude.com/docs/en/plugins/mods/reference#interface) hook runs after a click, flips `warm`, and asks for a redraw:

496 

497```javascript glow/hooks/register.js theme={null}

498const STILL =

499 '<svg xmlns="http://www.w3.org/2000/svg"' +

500 ' viewBox="0 0 1 1" preserveAspectRatio="none">' +

501 '<rect width="1" height="1" fill="#1a3a9c"/>' +

502 '</svg>'

503 

504let warm = 0

505 

506export function register(on) {

507 on('session.start', async ($, e, next) => {

508 // The scene is a name you choose for the backdrop your hook draws

509 await $.theme.set({ backdrop: { scene: 'glow' }, overrideColorScheme: 'dark' })

510 return next(e)

511 })

512 

513 on('ui.render', { component: 'Backdrop' }, async ($, e, next) => {

514 // This hook runs for every mod's backdrop, so pass on the others

515 if (e.props.plugin !== $.plugin.name || e.props.scene !== 'glow') return next(e)

516 const { Shader, Svg } = $.ui.resolve(e)

517 // module must be a string literal, relative to this file

518 return Shader({

519 module: './glow.ts',

520 values: { warm },

521 children: [Svg({ source: STILL, alt: 'A dark blue background' })],

522 })

523 })

524 

525 on('ui.pointer', async ($, e, next) => {

526 warm = 1 - warm

527 $.ui.invalidate('ui.render')

528 return next(e)

529 })

530}

531```

532 

533**4. Check the shader**

534 

535This step is optional and needs [the CLI](https://code.claude.com/docs/en/quickstart.md), which has its own version number. Go to `~/.claude/skills/` in your shell, run `claude plugin validate ./glow`, and look for `shader hooks/glow.ts: runs on any GPU` in the output. If the output names a line in `glow.ts` as an error, fix that line.

536 

537A CLI older than v2.1.326 reports `"ui.pointer" is not an event`. If yours does, [update it](https://code.claude.com/docs/en/setup.md#update-claude-code) and run the command again.

538 

539**5. Try the backdrop**

540 

541Start a new local session in the Code tab by sending a message. The background turns dark blue. If it doesn't, turn off any other mod that sets a theme and start a new session, because a session has [one theme](#put-a-backdrop-behind-the-conversation). If the background still doesn't change, [find out why the mod does nothing](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#find-out-why-a-mod-does-nothing).

542 

543Move the pointer. A blue light follows it, and fades when you stop. If no light appears, see [Fix a backdrop that shows only the `Svg`](#fix-a-backdrop-that-shows-only-the-svg). Click the empty space beside the conversation, then move the pointer again. The light is now orange. If it's still blue, answer any permission prompt or question from Claude, then click again quickly without dragging, away from messages and buttons.

544 

545To try a change, save `glow.ts` or `register.js`, and the mod reloads in the running session. If the change doesn't show within a few seconds, send a message to load it. To turn the mod off, move `glow` out of `~/.claude/skills/` and start a new session.

546 

547Follow these rules for pointer input, the shader, and the `Svg` when you build on the example:

548 

549* **Clicks**: your mod gets `ui.pointer` when it has set the theme and the user clicks a part of the backdrop that the app doesn't cover. The app sends two clicks a second at most and drops the rest. To draw a press effect without changing your mod's state, use `pointer.down * (1 - pointer.gone)` in the shader, which is `1` during a press and then fades.

550* **Click position**: `e.x` and `e.y` run from `0` to `1`, starting at the backdrop's top left. In the shader, `pixel.uv` has the same scale and starts at the bottom left. To draw at the click, send `e.x` and `1 - e.y` through `values`.

551* **Movement**: read pointer movement from `pointers` in the shader, because moving the pointer doesn't fire `ui.pointer`. For motion over time, import `time`, the seconds since the shader started.

552* **Presses**: to time an effect from a press, check every pointer in the loop for `down` at `1` and read its `age`, the seconds since the press. A press arrives as a new pointer, so it isn't always first in `pointers`.

553* **`values`**: declare up to eight numbers in the shader file, and set them with the `values` prop. When your mod's state changes, call `$.ui.invalidate('ui.render')` to send the new numbers.

554* **The shader file**: write a subset of TypeScript without `while` loops, recursion, or imports from other files. For the full rules and the functions you can call, [get the type definitions with the CLI](https://code.claude.com/docs/en/plugins/mods/create.md#get-the-types-for-your-build) and search them for `claude-code/shader`.

555* **The `Svg`**: draw it as a finished picture, because users see it alone when the shader can't run.

556 

557#### Fix a backdrop that shows only the `Svg`

558 

559Check reduced motion first, because it keeps any shader from running, then these other causes:

560 

561* **Reduced motion is on**: if you don't need reduced motion, turn it off in your system settings and set **Motion** to **System** in the Desktop app's **Settings > General**.

562* **The shader file breaks a rule**: in your shell, run `claude plugin validate` on the mod's directory and fix the line the output names.

563* **The shader is too heavy for the GPU**: if `claude plugin validate` prints `needs a fast GPU`, simplify the shader until the output says `runs on any GPU`. Start with the lines the output ranks as costing the most.

564* **The `Svg` holds content that blocks shaders**: replace the `Svg` source with `STILL` from the [`glow` example](#animate-a-backdrop-with-a-shader). If the shader then runs, restore your source without the content that blocks it, such as a lighting filter or `feTile`.

565* **A shader from any mod ran and then stopped**: after the app stops a shader for flashing or running too slowly, it starts no shader for up to five minutes. Keep large changes in brightness or color under three a second, or simplify a slow shader. Then wait five minutes and start a new session.

443 566 

444### Change the colors of the Desktop app567### Change the colors of the Desktop app

445 568 


510* **Old version**: [update the Desktop app](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab), restart it, and start a new local session in the Code tab. If Claude wrote the mod, ask for it again there.633* **Old version**: [update the Desktop app](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab), restart it, and start a new local session in the Code tab. If Claude wrote the mod, ask for it again there.

511* **Mod not loaded**: if Claude wrote the mod, see when it loads in [Ask Claude for a mod](https://code.claude.com/docs/en/plugins/mods/create.md#ask-claude-for-a-mod). If you wrote it, compare your files and their paths with [Write a colors mod yourself](#write-a-colors-mod-yourself).634* **Mod not loaded**: if Claude wrote the mod, see when it loads in [Ask Claude for a mod](https://code.claude.com/docs/en/plugins/mods/create.md#ask-claude-for-a-mod). If you wrote it, compare your files and their paths with [Write a colors mod yourself](#write-a-colors-mod-yourself).

512* **Refused theme**: ask Claude to run the mod's [`makeColors`](#write-a-colors-mod-yourself) call. If the call throws an error, or its `problems` list has an entry that starts `Desktop won't paint this theme`, have Claude fix the theme. If you installed the mod, send what Claude finds to its author.635* **Refused theme**: ask Claude to run the mod's [`makeColors`](#write-a-colors-mod-yourself) call. If the call throws an error, or its `problems` list has an entry that starts `Desktop won't paint this theme`, have Claude fix the theme. If you installed the mod, send what Claude finds to its author.

513* **Another `$.theme` call**: when any mod in the session calls `$.theme.set` or `$.theme.clear()`, the colors and [backdrop](#put-a-backdrop-behind-the-conversation) from an earlier call disappear. In your own mod, pass `colors` and `backdrop` in the same `$.theme.set` call. Use one mod at a time that sets a theme.636* **Another `$.theme` call**: when any mod in the session calls `$.theme.set` or `$.theme.clear()`, the colors, [backdrop](#put-a-backdrop-behind-the-conversation), [message style](#style-messages-in-the-desktop-app), and [sound](#add-sound-to-a-theme) from an earlier call disappear. In your own mod, pass every part of the theme in the same `$.theme.set` call. Use one mod at a time that sets a theme.

514 637 

515### Remove mod colors from the Desktop app638### Remove mod colors from the Desktop app

516 639 


530 653 

531If the colors are still there, open **Settings** from the Code tab, and search there for `code appearance`. Open the result, and select **Remove colors**.654If the colors are still there, open **Settings** from the Code tab, and search there for `code appearance`. Open the result, and select **Remove colors**.

532 655 

656### Style messages in the Desktop app

657 

658To give messages in the Desktop app's Code tab their own bubbles, font, and text size, write a mod that calls `$.theme.set` with a `style` object. This requires Claude Code v2.1.329 or later in the Code tab, so [check the version there](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab) first. The terminal, the VS Code extension, and the mobile app show messages without the style.

659 

660This mod sets a serif font for messages and puts each message in a rounded bubble. If `$.theme.set` rejects the style, the mod writes the error to the transcript:

661 

662```javascript theme={null}

663const style = {

664 Text: { fontFamily: ['serif'], fontSize: 15, lineHeight: 22 },

665 // The corners run top left, top right, bottom right, bottom left

666 UserMessage: { backgroundColor: '#1d5fd1', color: '#ffffff', radius: [18, 18, 4, 18], padding: 12 },

667 AssistantMessage: { backgroundColor: '#e9e9ec', color: '#1c1c1f', radius: [18, 18, 18, 4], padding: 12 },

668}

669 

670export function register(on) {

671 on('session.start', async ($, e, next) => {

672 try {

673 await $.theme.set({ style })

674 } catch (error) {

675 $.ui.log(error.message)

676 }

677 return next(e)

678 })

679}

680```

681 

682To try the example:

683 

684**1. Save the mod**

685 

686Save the code as `~/.claude/skills/bubbles/hooks/register.js`. From [Write a mod yourself](https://code.claude.com/docs/en/plugins/mods/create.md#write-a-mod-yourself), save `.claude-plugin/plugin.json` and `hooks/hooks.json` in `~/.claude/skills/bubbles/`, and change `first-mod` to `bubbles` in both files.

687 

688**2. Turn off other theme mods**

689 

690[Turn off any other mod](#remove-mod-colors-from-the-desktop-app) that calls `$.theme.set`, because each call replaces the whole theme. To use a style and colors together, see [Combine a style with colors or a backdrop](#combine-a-style-with-colors-or-a-backdrop).

691 

692**3. Check the style**

693 

694Start a new local session in the Code tab and send a message. Your message appears in a blue bubble and Claude's reply in a light gray one, both in a serif font. If nothing changes, see [Fix a missing message style](#fix-a-missing-message-style-in-the-desktop-app).

695 

696To take the style off, move `~/.claude/skills/bubbles/` out of `~/.claude/skills/` and start a new session.

697 

698#### Combine a style with colors or a backdrop

699 

700To use a message style with [colors](#write-a-colors-mod-yourself) or a [backdrop](#put-a-backdrop-behind-the-conversation), pass them all in one call from one mod, as in `$.theme.set({ colors: theme, style })`. Claude Code versions before v2.1.329 reject a call that includes `style` or [`sound`](#add-sound-to-a-theme). To keep your colors and backdrop on those versions, catch the error, log it, and repeat the call without `style` and `sound`.

701 

702#### Choose which parts of the conversation to style

703 

704Each key in the `style` object you pass to `$.theme.set` names a part of the conversation.

705 

706| Key | What it styles | What you can set |

707| :- | :- | :- |

708| `Text` | The words of your messages and Claude's replies, where `UserMessage` or `AssistantMessage` doesn't set the same property | Text properties |

709| `Heading` | Headings in Claude's replies, which otherwise use the reply's font | Text properties |

710| `UserMessage` | Your messages | Text properties, box properties, and `rotate` |

711| `AssistantMessage` | Each block of text in Claude's replies | Text properties, box properties, and `rotate` |

712| `ToolUse` | A tool call's row | `color`, `fontFamily`, and box properties |

713 

714Other parts keep the app's look, such as permission prompts, the questions Claude asks in a dialog, code blocks, and the prompt box.

715 

716Write sizes as numbers of points, such as `lineHeight: 22`. For the format and range of every value, see `ThemeStyle` in [the types for your build](https://code.claude.com/docs/en/plugins/mods/create.md#get-the-types-for-your-build).

717 

718* **Text properties**: `color`, `fontFamily`, `fontSize`, `fontWeight`, `italic`, `letterSpacing`, and `lineHeight`. Write `fontFamily` as a one-item list, such as `['serif']`. The item must be `sans`, `serif`, `mono`, `cursive`, or `code`, and `$.theme.set` rejects any other value. Use `code` for the app's code font.

719* **Box properties**: `backgroundColor`, `radius`, `borderColor`, `borderWidth`, `shadow`, `fill`, and padding such as `padding` or `paddingTop`. Write a shadow as `{ x: 0, y: 2, blur: 8, color: 'rgba(0, 0, 0, 0.15)' }`. Use `fill` to draw a gradient or a vector drawing behind the text, as in `{ gradient: { stops: ['#dbe8ff', '#c4d6f5'] } }`.

720* **`rotate`**: the number of degrees to tilt a message, from `-3` to `3`

721 

722To vary the bubbles, set `UserMessage` or `AssistantMessage` to a list of up to four objects. Each message gets one of the objects, in no set order, and keeps it.

723 

724#### Set message colors for light mode and dark mode

725 

726To give messages different colors in light mode and dark mode, add these message colors to `inputs.light` and `inputs.dark` in the theme that [`makeColors`](#write-a-colors-mod-yourself) returns:

727 

728* **Your messages**: `bg-user-message` for the bubble and `text-user-message` for the text

729* **Claude's replies**: `bg-assistant-message` for the bubble and `text-assistant-message` for the text

730 

731Before you add them to a mod that passes `style`, remove `color` and `backgroundColor` from the matching `UserMessage` or `AssistantMessage`, because those properties take precedence over message colors.

732 

733This example colors your messages in the `paper` mod from [Write a colors mod yourself](#write-a-colors-mod-yourself). In that mod's `register.js`, add these lines between the `makeColors` call and the `register` function:

734 

735```javascript theme={null}

736Object.assign(theme.inputs.light, { 'bg-user-message': '#d9c4a0', 'text-user-message': '#2a241d' })

737Object.assign(theme.inputs.dark, { 'bg-user-message': '#4a3a2b', 'text-user-message': '#f0e7d7' })

738```

739 

740Put `paper` under `~/.claude/skills/`, and move other theme mods, such as `bubbles`, out of that directory. Start a new local session and send a message. Your bubble is tan in light mode and brown in dark mode. If it isn't, see [Fix missing mod colors](#fix-missing-mod-colors-in-the-desktop-app) and [Fix a missing message style](#fix-a-missing-message-style-in-the-desktop-app).

741 

742#### Fix a missing message style in the Desktop app

743 

744If all or part of a message style doesn't appear in the Code tab, check for these causes:

745 

746* **Mod not loaded**: [find out why the mod does nothing](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#find-out-why-a-mod-does-nothing)

747* **Rejected call**: catch the error from `$.theme.set` and write it to the transcript, as the [example](#style-messages-in-the-desktop-app) does. If the error includes `theme.set does not know the attribute "style"`, [update Claude Code](https://code.claude.com/docs/en/plugins/mods/overview.md#turn-mods-on-or-off) in the app that shows the error. If it names a property, as in `style.Text.fontSize is a number of points, 11 to 28`, change that property's value.

748* **Another `$.theme` call**: if any mod in the session calls `$.theme.clear()`, or calls `$.theme.set` without your `style`, the style disappears. In your own mod, [pass the whole theme in one call](#combine-a-style-with-colors-or-a-backdrop). Turn off any other mod that sets a theme.

749* **Low contrast**: when text has less than 3:1 contrast with its background, that message, heading, or tool row shows in the app's own colors. `$.theme.set` reports no error. Pick colors that are further apart, and check both light mode and dark mode.

750* **Backdrop**: over a [backdrop](#put-a-backdrop-behind-the-conversation), a text color shows only on a background that's solid or nearly solid. Set a solid `backgroundColor` on `UserMessage`, `AssistantMessage`, and `ToolUse` wherever you color their text, including through `Text` or `Heading`.

751* **Accessibility settings**: with higher contrast turned on in the app or the operating system, messages show without the style. With an accessibility font such as OpenDyslexic, messages keep that font. To see the whole style, turn these settings off.

752* **Open prompt**: a new style waits while a permission prompt or a question from Claude is on screen. Answer it to see the style.

753 

754### Add sound to a theme

755 

756To give your theme background sound and short sounds for events in the Desktop app's Code tab, pass `sound` to [`$.theme.set`](https://code.claude.com/docs/en/plugins/mods/reference#mods-api-methods). `sound` requires Claude Code v2.1.329 or later in the Code tab, so [check the version there](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab) first. The terminal, the VS Code extension, and the mobile app play no theme sound.

757 

758You describe each sound as layers of tones and noise, with no audio file, and the Desktop app makes the audio.

759 

760This mod sets dark mode, plays soft noise in the background, and plays three bell notes when Claude finishes a turn:

761 

762```javascript theme={null}

763// The rest of the theme, which still works without sound

764const look = { overrideColorScheme: 'dark' }

765 

766const sound = {

767 ambience: {

768 // A layer with drone: true plays without a break

769 // A layer with scatter plays now and then

770 // gain is how loud a layer is, from 0 to 1

771 layers: [{ wave: 'brown', drone: true, gain: 0.2 }],

772 },

773 cues: {

774 done: {

775 // step is the seconds from one note to the next

776 layers: [{ wave: 'bell', notes: ['C5', 'E5', 'G5'], step: 0.15, gain: 0.3 }],

777 },

778 },

779}

780 

781export function register(on) {

782 on('session.start', async ($, e, next) => {

783 try {

784 await $.theme.set({ ...look, sound })

785 } catch (error) {

786 // A refused call sets nothing, so set the theme again without sound

787 $.ui.log(error.message)

788 await $.theme.set(look)

789 }

790 return next(e)

791 })

792}

793```

794 

795For the other waves, fields, and ranges, see `ThemeSound` in [the types for your build](https://code.claude.com/docs/en/plugins/mods/create.md#get-the-types-for-your-build). To hear the example:

796 

797**1. Start a session**

798 

799Put the code in a [mod](https://code.claude.com/docs/en/plugins/mods/create.md#write-a-mod-yourself), and save the mod's directory [under `~/.claude/skills/`](https://code.claude.com/docs/en/plugins/create#scaffold-a-plugin-that-loads-every-session) so that it loads when you start a session. In the Code tab, send a first message to [start a local session](https://code.claude.com/docs/en/desktop.md#start-a-session). If no speaker button appears in the session's title bar, see [Fix a missing speaker button](#fix-a-missing-speaker-button).

800 

801**2. Turn on theme sound**

802 

803If the speaker button is crossed out, select it. The three notes play once to confirm that sound is on, and the noise fades in. To change the volume or turn off the noise, open the menu beside the button.

804 

805**3. Hear the cue**

806 

807Send another message. The three notes play when Claude finishes.

808 

809#### When each theme sound plays

810 

811Theme sound is off until the user turns it on with the speaker button. It then stays on for other sessions and themes on that device until the user turns it off, signs out, or switches accounts. Choose a `gain` that suits a user who hears your theme as soon as it loads.

812 

813The Desktop app plays each sound by itself at these moments, and a mod can't trigger one:

814 

815| Sound | When it plays |

816| :- | :- |

817| `ambience` | While the session's window has focus. It pauses after 10 minutes with no input and resumes at the next input. |

818| `cues.send` | The user sends a message |

819| `cues.tool` | Claude starts a tool call |

820| `cues.compact` | The conversation is compacted |

821| `cues.done` | Claude finishes a turn, unless the user stopped it or queued another message |

822| `cues.ask` | A permission prompt or a question appears |

823| `cues.error` | A turn ends in an error |

824| `cues.click` | The user clicks the background where no message, control, or panel covers it |

825 

826When the user turns on sound or picks a volume, they also hear one cue, the first the theme has in this order: `send`, `done`, `tool`, `compact`, `ask`, `error`.

827 

828Expect fewer of the table's sounds during an unanswered prompt, during speech, and in a window without focus. To hear all of them again:

829 

830* **A permission prompt or a question is waiting**: answer it. Until then, only `cues.ask` can play.

831* **Dictation, a voice call, or a reply read aloud is in progress**: end it. Until then, the ambience and cues stay silent.

832* **The window doesn't have focus**: click in the window. Until then, only `cues.done` can play.

833 

834#### Fix a missing speaker button

835 

836If the session's title bar shows no speaker button, check your version, whether the mod loaded, and the `$.theme` calls in the session:

837 

838* **Old version**: if `/status` in the Code tab shows a version before v2.1.329, [update the Desktop app](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab) and start a new local session. On those versions, the call fails with an error such as `theme.set does not know the attribute "sound"`.

839* **Mod not loaded**: follow [Find out why a mod does nothing](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#find-out-why-a-mod-does-nothing).

840* **Value out of range**: the call fails, so with the example's `catch` block the theme loads without sound. Find the error that the example logs in the transcript, and fix the field it names, as in `sound.cues.done.layers[0].gain is a number, 0 to 1`.

841* **Another `$.theme` call**: when any mod makes a later `$.theme.set` call without `sound`, or calls `$.theme.clear()`, the sound and the button disappear. In your own mod, pass `sound` in the same call as the rest of the theme. Turn off any other mod that sets a theme.

842 

533## Build a tree from elements843## Build a tree from elements

534 844 

535What a `ui.render` hook returns is an element tree: a description of what to draw, made of boxes, text, and controls nested inside each other.845What a `ui.render` hook returns is an element tree: a description of what to draw, made of boxes, text, and controls nested inside each other.


613| `Button` | A control that calls `onPress` | Everywhere |923| `Button` | A control that calls `onPress` | Everywhere |

614| `Link`, `Code`, `Markdown` | A link with `href` and an optional `label`, a code block, and text formatted the way Claude's replies are. `Markdown` takes its content in a `text` prop, not in `children`, and needs a `key` when you pass `onLinkPress`. | Everywhere |924| `Link`, `Code`, `Markdown` | A link with `href` and an optional `label`, a code block, and text formatted the way Claude's replies are. `Markdown` takes its content in a `text` prop, not in `children`, and needs a `key` when you pass `onLinkPress`. | Everywhere |

615| `Input`, `Select` | A text field and a dropdown | Terminal, Desktop, VS Code |925| `Input`, `Select` | A text field and a dropdown | Terminal, Desktop, VS Code |

926| `Shader` | A [backdrop drawn on the GPU](#animate-a-backdrop-with-a-shader) over an `Svg` | Desktop |

616| `Svg` | An SVG document | Desktop, VS Code |927| `Svg` | An SVG document | Desktop, VS Code |

617| `Client` | A region drawn by a second file of yours, for animation and pointer input. That file gets no mods API. It reaches your hooks by posting data, which arrives as a `ui.message` event. If it fails to load, draw, or run, your hooks receive a [`ui.fault`](https://code.claude.com/docs/en/plugins/mods/reference#interface) event. | Terminal, Desktop |928| `Client` | A region drawn by a second file of yours, for animation and pointer input. That file gets no mods API. It reaches your hooks by posting data, which arrives as a `ui.message` event. If it fails to load, draw, or run, your hooks receive a [`ui.fault`](https://code.claude.com/docs/en/plugins/mods/reference#interface) event. | Terminal, Desktop |

618| `Raster`, `Image` | A [grid of colored cells](#draw-a-grid-of-colored-cells), and a picture | Terminal |929| `Raster`, `Image` | A [grid of colored cells](#draw-a-grid-of-colored-cells), and a picture | Terminal |

Details

17Settings hooks, skills, status lines, and MCP servers work from outside Claude Code: each one runs a script, or gives Claude text or tools. A mod runs inside Claude Code, so it can do things they can't:17Settings hooks, skills, status lines, and MCP servers work from outside Claude Code: each one runs a script, or gives Claude text or tools. A mod runs inside Claude Code, so it can do things they can't:

18 18 

19* **Draw an interface you can use**: a pane beside the transcript or a band above the prompt, with tabs, buttons, and text fields. See [Draw in the interface](https://code.claude.com/docs/en/plugins/mods/interface.md).19* **Draw an interface you can use**: a pane beside the transcript or a band above the prompt, with tabs, buttons, and text fields. See [Draw in the interface](https://code.claude.com/docs/en/plugins/mods/interface.md).

20* **Redraw Claude Code's own interface**: replace or restyle parts Claude Code draws itself, such as a tool call's row, the spinner, or the dialog Claude asks questions in. See [Change what Claude Code already draws](https://code.claude.com/docs/en/plugins/mods/interface.md#change-what-claude-code-already-draws).20* **Redraw Claude Code's interface**: replace or restyle parts Claude Code draws itself, such as a tool call's row or the spinner. See [Change what Claude Code already draws](https://code.claude.com/docs/en/plugins/mods/interface.md#change-what-claude-code-already-draws).

21* **Step into a tool call or a request**: for example, hold a tool call while you ask the user a question, answer it without running the tool, or send one request to a different model. See [Guard or change a tool call](https://code.claude.com/docs/en/plugins/mods/events.md#guard-or-change-a-tool-call) and [Follow a turn](https://code.claude.com/docs/en/plugins/mods/events.md#follow-a-turn).21* **Step into a tool call or a request**: for example, hold a tool call while you ask the user a question, answer it without running the tool, or send one request to a different model. See [Guard or change a tool call](https://code.claude.com/docs/en/plugins/mods/events.md#guard-or-change-a-tool-call) and [Follow a turn](https://code.claude.com/docs/en/plugins/mods/events.md#follow-a-turn).

22* **Run your own code on a command**: a `/command` that runs your function at once, with no Claude turn, even while Claude is working. See [Add a command or a tool](https://code.claude.com/docs/en/plugins/mods/api.md#add-a-command-or-a-tool).22* **Run your own code on a command**: a `/command` that runs your function at once, with no Claude turn, even while Claude is working. See [Add a command or a tool](https://code.claude.com/docs/en/plugins/mods/api.md#add-a-command-or-a-tool).

23* **Share data between hooks**: a mod's hooks share the variables in its file, so what one hook records, another can show. For example, one hook can count tool calls while another shows the count beside the spinner, or one can read each request's token usage while another charts it in a pane. See [React to events](https://code.claude.com/docs/en/plugins/mods/events.md).23* **Share data between hooks**: a mod's hooks share the variables in its file, so what one hook records, another can show. For example, one hook can count tool calls while another shows the count beside the spinner, or one can read each request's token usage while another charts it in a pane. See [React to events](https://code.claude.com/docs/en/plugins/mods/events.md).

Details

33| Argument | What it is |33| Argument | What it is |

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

35| [`$`](https://code.claude.com/docs/en/plugins/mods/events#how-a-hook-handles-an-event) | The mods API: every method in [mods API methods](#mods-api-methods). Write each call in full, namespace then method, as in `$.fs.read('notes.md')`. |35| [`$`](https://code.claude.com/docs/en/plugins/mods/events#how-a-hook-handles-an-event) | The mods API: every method in [mods API methods](#mods-api-methods). Write each call in full, namespace then method, as in `$.fs.read('notes.md')`. |

36| [`e`](https://code.claude.com/docs/en/plugins/mods/events#how-a-hook-handles-an-event) | The event's input, as deeply frozen plain data. To change it, pass a copy to `next`. |36| [`e`](https://code.claude.com/docs/en/plugins/mods/events#how-a-hook-handles-an-event) | The event's input. To change it, pass a copy to `next`. |

37| [`next(e)`](https://code.claude.com/docs/en/plugins/mods/events#how-a-hook-handles-an-event) | The next handler, as in middleware. Runs the hooks after this one, then Claude Code's behavior. Resolves to the event's result. |37| [`next(e)`](https://code.claude.com/docs/en/plugins/mods/events#how-a-hook-handles-an-event) | The next handler, as in middleware. Runs the hooks after this one, then Claude Code's behavior. Resolves to the event's result. |

38| [`next.signal`](https://code.claude.com/docs/en/plugins/mods/api#stop-background-work) | An `AbortSignal` that aborts when the event is abandoned |38| [`next.signal`](https://code.claude.com/docs/en/plugins/mods/api#stop-background-work) | An `AbortSignal` that aborts when the event is abandoned |

39| `next.origin` | `{ plugin, tier }` of whoever fired the event. Claude Code itself is `{ plugin: 'engine', tier: 'core' }`. A mod's `tier` is its priority group in the [order mods run in](https://code.claude.com/docs/en/plugins/mods/events.md#the-order-mods-run-in): `prepend`, `user`, `append`, or `builtin`. |39| `next.origin` | `{ plugin, tier }` of whoever fired the event. Claude Code itself is `{ plugin: 'engine', tier: 'core' }`. A mod's `tier` is its priority group in the [order mods run in](https://code.claude.com/docs/en/plugins/mods/events.md#the-order-mods-run-in): `prepend`, `user`, `append`, or `builtin`. |


59| `tool.judge` | [Auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) is about to ask its classifier about a call. Requires Claude Code v2.1.326 or later. | `next(e)` or `{ decision }` |59| `tool.judge` | [Auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) is about to ask its classifier about a call. Requires Claude Code v2.1.326 or later. | `next(e)` or `{ decision }` |

60| `tool.run` | An allowed call is about to run. Requires Claude Code v2.1.326 or later. | `next(e)`, `{ deny: reason }`, or `{ result }` |60| `tool.run` | An allowed call is about to run. Requires Claude Code v2.1.326 or later. | `next(e)`, `{ deny: reason }`, or `{ result }` |

61| `tool.describe` | Once for each tool, when its description is first sent to Claude. A second time for an MCP tool when Claude loads it through [tool search](https://code.claude.com/docs/en/mcp.md#scale-with-mcp-tool-search), with `e.description` set to the text Claude reads for the loaded tool. | `{ description }`, optionally with `isDeferred` set to `true` to put the tool behind tool search or `false` to load it upfront. Add [`breakPromptCache: true`](#break-prompt-cache) to send a changed description on the next turn. |61| `tool.describe` | Once for each tool, when its description is first sent to Claude. A second time for an MCP tool when Claude loads it through [tool search](https://code.claude.com/docs/en/mcp.md#scale-with-mcp-tool-search), with `e.description` set to the text Claude reads for the loaded tool. | `{ description }`, optionally with `isDeferred` set to `true` to put the tool behind tool search or `false` to load it upfront. Add [`breakPromptCache: true`](#break-prompt-cache) to send a changed description on the next turn. |

62| `tool.offer` | Claude Code builds Claude's tool list, and again when Claude calls a tool. Requires Claude Code v2.1.328 or later. | `next(e)`, or `{ isOffered: false }` to withhold the tool from Claude. See [Send a changed tool list](#send-a-changed-tool-list). |

62 63 

63#### Agent and organization fields on `tool.check`64#### Agent and organization fields on `tool.check`

64 65 


115 116 

116The changed text reaches Claude on the next turn, and the [prompt cache](https://code.claude.com/docs/en/prompt-caching.md) starts over, so that turn is slower and more expensive. The field requires Claude Code v2.1.321 or later. From v2.1.299 until v2.1.321, a running conversation got the changed text on the next turn.117The changed text reaches Claude on the next turn, and the [prompt cache](https://code.claude.com/docs/en/prompt-caching.md) starts over, so that turn is slower and more expensive. The field requires Claude Code v2.1.321 or later. From v2.1.299 until v2.1.321, a running conversation got the changed text on the next turn.

117 118 

119#### Send a changed tool list

120 

121To change the main conversation's tool list, call `$.ui.invalidate('tool.offer')` and return `{ isOffered, breakPromptCache: true }` from your `tool.offer` hook. The [prompt cache](https://code.claude.com/docs/en/prompt-caching.md) then starts over. Requires Claude Code v2.1.331 or later.

122 

118### Commands and configuration123### Commands and configuration

119 124 

120| Event | Fires when | A hook can return |125| Event | Fires when | A hook can return |


138| :- | :- | :- |143| :- | :- | :- |

139| [`turn.start`](https://code.claude.com/docs/en/plugins/mods/events#follow-a-turn) | A turn begins | `next(e)` |144| [`turn.start`](https://code.claude.com/docs/en/plugins/mods/events#follow-a-turn) | A turn begins | `next(e)` |

140| [`turn.step`](https://code.claude.com/docs/en/plugins/mods/events#follow-a-turn) | One request is about to go to the model | `yield* next(e)`, or `next({ ...e, model })`, `next({ ...e, effort })` |145| [`turn.step`](https://code.claude.com/docs/en/plugins/mods/events#follow-a-turn) | One request is about to go to the model | `yield* next(e)`, or `next({ ...e, model })`, `next({ ...e, effort })` |

141| [`turn.complete`](https://code.claude.com/docs/en/plugins/mods/events#follow-a-turn) | A turn ended | `next(e)`, or `{ text }` to show a line under the answer |146| [`turn.complete`](https://code.claude.com/docs/en/plugins/mods/events#follow-a-turn) | A turn ended | `next(e)`, or `{ text }` to show a line under the main conversation's answer |

142 147 

143### Session148### Session

144 149 


181| [`ui.render`](https://code.claude.com/docs/en/plugins/mods/interface#pick-where-to-draw) | A [render site](#render-sites) is about to be drawn |186| [`ui.render`](https://code.claude.com/docs/en/plugins/mods/interface#pick-where-to-draw) | A [render site](#render-sites) is about to be drawn |

182| `ui.resolve` | Mods load, once for each app, render site, and mod. The result is the element table that `$.ui.resolve(e)` reads. |187| `ui.resolve` | Mods load, once for each app, render site, and mod. The result is the element table that `$.ui.resolve(e)` reads. |

183| [`ui.press`](https://code.claude.com/docs/en/plugins/mods/interface#respond-to-presses-and-typing), [`ui.input`](https://code.claude.com/docs/en/plugins/mods/interface#respond-to-presses-and-typing), [`ui.select`](https://code.claude.com/docs/en/plugins/mods/interface#respond-to-presses-and-typing) | A `Button`, `Input`, or `Select` a mod drew is used |188| [`ui.press`](https://code.claude.com/docs/en/plugins/mods/interface#respond-to-presses-and-typing), [`ui.input`](https://code.claude.com/docs/en/plugins/mods/interface#respond-to-presses-and-typing), [`ui.select`](https://code.claude.com/docs/en/plugins/mods/interface#respond-to-presses-and-typing) | A `Button`, `Input`, or `Select` a mod drew is used |

189| [`ui.pointer`](https://code.claude.com/docs/en/plugins/mods/interface#animate-a-backdrop-with-a-shader) | The user clicks a part of your mod's backdrop that the app doesn't cover. Requires Claude Code v2.1.326 or later. |

184| `ui.focus`, `ui.scroll` | The focused control or the scroll position of a pane or the band is about to change |190| `ui.focus`, `ui.scroll` | The focused control or the scroll position of a pane or the band is about to change |

185| `ui.close` | A pane is about to close. `e.id` is the pane and `e.origin.kind` is `plugin`, `person`, or `unload`. |191| `ui.close` | A pane is about to close. `e.id` is the pane and `e.origin.kind` is `plugin`, `person`, or `unload`. |

186| [`ui.message`](https://code.claude.com/docs/en/plugins/mods/interface#build-a-tree-from-elements) | A `Client` element posts data to its mod |192| [`ui.message`](https://code.claude.com/docs/en/plugins/mods/interface#build-a-tree-from-elements) | A `Client` element posts data to its mod |


236| :- | :- |242| :- | :- |

237| `$.plugin` | `name`, `root`: this plugin's name and directory |243| `$.plugin` | `name`, `root`: this plugin's name and directory |

238| [`$.ui`](https://code.claude.com/docs/en/plugins/mods/interface#pick-where-to-draw) | `resolve`, `invalidate`, `open`, `close`, `panes`, [`place`](https://code.claude.com/docs/en/plugins/mods/interface#place-a-row-in-the-transcript), `focus`, `scroll`, `toast`, `notify`, `status`, `log`, `notice`, `ask`, `copy`, `selection`, `blit`, `view`. `view` requires Claude Code v2.1.300 or later and `place` v2.1.314 or later. |244| [`$.ui`](https://code.claude.com/docs/en/plugins/mods/interface#pick-where-to-draw) | `resolve`, `invalidate`, `open`, `close`, `panes`, [`place`](https://code.claude.com/docs/en/plugins/mods/interface#place-a-row-in-the-transcript), `focus`, `scroll`, `toast`, `notify`, `status`, `log`, `notice`, `ask`, `copy`, `selection`, `blit`, `view`. `view` requires Claude Code v2.1.300 or later and `place` v2.1.314 or later. |

239| [`$.theme`](https://code.claude.com/docs/en/plugins/mods/interface#put-a-backdrop-behind-the-conversation) | `set`, `clear`: set a backdrop for the Desktop or mobile app to draw, and take the backdrop off. Requires Claude Code v2.1.319 or later. |245| [`$.theme`](https://code.claude.com/docs/en/plugins/mods/interface#put-a-backdrop-behind-the-conversation) | `set`, `clear`: set a backdrop for the Desktop or mobile app to draw, and take the backdrop off. Requires Claude Code v2.1.319 or later. [Message styles](https://code.claude.com/docs/en/plugins/mods/interface.md#style-messages-in-the-desktop-app) and [sound](https://code.claude.com/docs/en/plugins/mods/interface.md#add-sound-to-a-theme) require v2.1.329 or later. |

240| [`$.command`](https://code.claude.com/docs/en/plugins/mods/api#add-a-command) | `register`, `run`, `list` |246| [`$.command`](https://code.claude.com/docs/en/plugins/mods/api#add-a-command) | `register`, `run`, `list` |

241| [`$.tool`](https://code.claude.com/docs/en/plugins/mods/api#add-a-tool) | `register`, `call`, `check`, `list` |247| [`$.tool`](https://code.claude.com/docs/en/plugins/mods/api#add-a-tool) | `register`, `call`, `check`, `list` |

242| `$.agent` | `register`, `spawn`, `call`, `list`, `limits`. `call` and `limits` require Claude Code v2.1.326 or later. `list()` returns this session's subagents and teammates, each with a `status` of `pending`, `running`, `waiting`, `idle`, `completed`, `failed`, or `killed`, where `idle` and `waiting` require Claude Code v2.1.289 or later. |248| `$.agent` | `register`, `spawn`, `call`, `list`, `limits`. `call` and `limits` require Claude Code v2.1.326 or later. `list()` returns this session's subagents and teammates, each with a `status` of `pending`, `running`, `waiting`, `idle`, `completed`, `failed`, or `killed`, where `idle` and `waiting` require Claude Code v2.1.289 or later. |

243| [`$.model`](https://code.claude.com/docs/en/plugins/mods/api#call-a-model) | `complete`, `fork`, `classify` |249| [`$.model`](https://code.claude.com/docs/en/plugins/mods/api#call-a-model) | `complete`, `fork`, `classify` |

244| [`$.prompt`](https://code.claude.com/docs/en/plugins/mods/api#start-a-turn-from-a-background-job) | `submit`, `read`, `fill`, `suggest`, `compose`. Claude reads text from `submit({ text })` after a sentence that names your mod as the sender. `submit({ text, asUser: true })` sends the text as the user's own words, without that sentence. |250| [`$.prompt`](https://code.claude.com/docs/en/plugins/mods/api#start-a-turn-from-a-background-job) | `submit`, `read`, `fill`, `suggest`, `compose`. Claude reads text from `submit({ text })` after a sentence that names your mod as the sender. `submit({ text, asUser: true })` sends the text as the user's own words, without that sentence. |

245| `$.turn` | `abort` |251| `$.turn` | `abort` |

246| [`$.session`](https://code.claude.com/docs/en/plugins/mods/api#send-and-receive-messages-between-sessions) | `messages`, `cwd`, `root`, `model`, `turns`, `id`, `repo`, `surfaces`, `usage`, `version`, `info`, `compact`, `send`, `append`, `authorize`. `info` requires Claude Code v2.1.326 or later. `usage()` returns `{ startedAt, context, rateLimits, cost }`: `context` has `tokens`, `window`, and `percent`, and `rateLimits` is a list of `{ kind, percentUsed, resetsAt }`. |252| [`$.session`](https://code.claude.com/docs/en/plugins/mods/api#send-and-receive-messages-between-sessions) | `messages`, `cwd`, `root`, `model`, `turns`, `id`, `repo`, `surfaces`, `usage`, `version`, `info`, `compact`, `send`, `append`, `authorize`, `redact`. `info` requires Claude Code v2.1.326 or later. `redact`, a best-effort mask for credentials only, requires v2.1.331 or later. `usage()` returns `{ startedAt, context, rateLimits, cost }`: `context` has `tokens`, `window`, and `percent`, and `rateLimits` is a list of `{ kind, percentUsed, resetsAt }`. |

247| `$.config` | `list`, `set` |253| `$.config` | `list`, `set` |

248| [`$.settings`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `read` |254| [`$.settings`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `read` |

249| [`$.env`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `get`, `set` |255| [`$.env`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `get`, `set`. A refused `set` either rejects or resolves to `{ deny }`. The `{ deny }` result requires Claude Code v2.1.301 or later. |

250| [`$.fs`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `read`, `write`, `list`, `exists`, `stat`, `ancestors`. `write` isn't atomic: it replaces the file's content in place, so another process can read a partly written file. Keep data that several sessions change in `$.store`. |256| [`$.fs`](https://code.claude.com/docs/en/plugins/mods/api#reach-files-processes-and-the-network) | `read`, `write`, `list`, `exists`, `stat`, `ancestors`. `write` isn't atomic: it replaces the file's content in place, so another process can read a partly written file. Keep data that several sessions change in `$.store`. |

251| [`$.store`](https://code.claude.com/docs/en/plugins/mods/interface#keep-state) | `get`, `set`, `delete`, `keys`. A key-value store that every session on the machine shares. See [Save from more than one session](https://code.claude.com/docs/en/plugins/mods/interface.md#save-from-more-than-one-session). |257| [`$.store`](https://code.claude.com/docs/en/plugins/mods/interface#keep-state) | `get`, `set`, `delete`, `keys`. A key-value store that every session on the machine shares. See [Save from more than one session](https://code.claude.com/docs/en/plugins/mods/interface.md#save-from-more-than-one-session). |

252| [`$.state`](https://code.claude.com/docs/en/plugins/mods/interface#keep-a-value-in-\$-state) | Reactive state: `get`, `set`, with the helpers `atom`, `read`, `update`, `derive`, and `memberOf` imported from `claude-code` |258| [`$.state`](https://code.claude.com/docs/en/plugins/mods/interface#keep-a-value-in-\$-state) | Reactive state: `get`, `set`, with the helpers `atom`, `read`, `update`, `derive`, and `memberOf` imported from `claude-code` |


258| `$.audio` | `play`, `speak` |264| `$.audio` | `play`, `speak` |

259| `$.telemetry` | `log`, `mark`. A record is sent only when Claude Code or a built-in mod makes the call. |265| `$.telemetry` | `log`, `mark`. A record is sent only when Claude Code or a built-in mod makes the call. |

260 266 

267In the terminal, `$.ui.view({ agentId })` shows an agent's transcript and `$.ui.view({})` switches back. Call either from a command or button. A timer's call resolves to `{ deny: 'not person-initiated' }`.

268 

261## Render sites269## Render sites

262 270 

263A render site is an extension point in Claude Code's interface. Each row is a value of `e.component` in a `ui.render` hook, with the fields of `e.props` and the apps that render it. `e.surface` names the app that's drawing, such as `terminal`, `desktop`, or `vscode`. [Change what Claude Code already draws](https://code.claude.com/docs/en/plugins/mods/interface.md#change-what-claude-code-already-draws) shows what a hook can do at a site, with an example of each choice.271A render site is an extension point in Claude Code's interface. Each row is a value of `e.component` in a `ui.render` hook, with the fields of `e.props` and the apps that render it. `e.surface` names the app that's drawing, such as `terminal`, `desktop`, or `vscode`. [Change what Claude Code already draws](https://code.claude.com/docs/en/plugins/mods/interface.md#change-what-claude-code-already-draws) shows what a hook can do at a site, with an example of each choice.


267| Site | `e.props` | `e.requestId` | Rendered on |275| Site | `e.props` | `e.requestId` | Rendered on |

268| :- | :- | :- | :- |276| :- | :- | :- | :- |

269| [`Pane`](https://code.claude.com/docs/en/plugins/mods/interface#pick-where-to-draw) | `title`, `isFocused`, `bodyColumns`, `placement`, `scroll`, `view` | The pane's `id` | Terminal, Desktop, VS Code |277| [`Pane`](https://code.claude.com/docs/en/plugins/mods/interface#pick-where-to-draw) | `title`, `isFocused`, `bodyColumns`, `placement`, `scroll`, `view` | The pane's `id` | Terminal, Desktop, VS Code |

270| [`AbovePrompt`](https://code.claude.com/docs/en/plugins/mods/interface#pick-where-to-draw) | `hasSurvey`, [`isCollapsed`](https://code.claude.com/docs/en/plugins/mods/interface#when-the-user-collapses-the-band), `isWorking`, `maxRows`, `bodyColumns`, `scroll`, `view` | One instance | Terminal, Desktop |278| [`AbovePrompt`](https://code.claude.com/docs/en/plugins/mods/interface#pick-where-to-draw) | `hasSurvey`, [`isCollapsed`](https://code.claude.com/docs/en/plugins/mods/interface#when-the-user-collapses-the-band), `isWorking`, `maxRows`, `bodyColumns`, `scroll`, `view` | One instance | Terminal, Desktop, VS Code |

271| `AbovePromptList`, the stack of `AbovePrompt` rows | `rows`, a list with one `{ plugin, tree }` for each mod's row, plus the `AbovePrompt` props | One instance | Terminal, Desktop. Requires Claude Code v2.1.323 or later. |279| `AbovePromptList`, the stack of `AbovePrompt` rows | `rows`, a list with one `{ plugin, tree }` for each mod's row, plus the `AbovePrompt` props | One instance | Terminal, Desktop, VS Code. Requires Claude Code v2.1.323 or later. |

280| `BesidePrompt`, a cell to the right of the prompt | `maxColumns`, `floatRows`, `floatColumns`, `isWorking`, `view` | One instance | Terminal in [fullscreen rendering](https://code.claude.com/docs/en/fullscreen.md), Desktop. Requires Claude Code v2.1.331 or later. |

281| `Underlay`, a layer visible only where the interface is blank | `columns`, `rows`, `isWorking`, `view` | `site:underlay` | Terminal in fullscreen rendering. Requires Claude Code v2.1.331 or later. |

282| `BesidePromptList` and `UnderlayList`, the order of the `BesidePrompt` cells and `Underlay` layers | `plugins` | One instance | The same apps as the site it orders. Requires Claude Code v2.1.331 or later. |

272| [`Placed`](https://code.claude.com/docs/en/plugins/mods/interface#place-a-row-in-the-transcript) | `id`, `plugin`, `onScreen` | The `requestId` that `$.ui.place` returned | Terminal |283| [`Placed`](https://code.claude.com/docs/en/plugins/mods/interface#place-a-row-in-the-transcript) | `id`, `plugin`, `onScreen` | The `requestId` that `$.ui.place` returned | Terminal |

273| [`Backdrop`](https://code.claude.com/docs/en/plugins/mods/interface#put-a-backdrop-behind-the-conversation) | `scene`, `plugin`, `glass`, `overrideColorScheme`. Before v2.1.323, `scene` was `id` and `overrideColorScheme` was `colorScheme`. | `backdrop` | `desktop` and `mobile` surfaces. Your hook runs when the Desktop or mobile app asks to draw a backdrop. |284| [`Backdrop`](https://code.claude.com/docs/en/plugins/mods/interface#put-a-backdrop-behind-the-conversation) | `scene`, `plugin`, `glass`, `overrideColorScheme`. Before v2.1.323, `scene` was `id` and `overrideColorScheme` was `colorScheme`. | `backdrop` | `desktop` and `mobile` surfaces. Your hook runs when the Desktop or mobile app asks to draw a backdrop. |

274| `UserMessage` | `text`, `origin`, `isExpanded`, and `task` or `from` by origin | The drawn row's id | Terminal, Desktop, VS Code |285| `UserMessage` | `text`, `origin`, `isExpanded`, and `task` or `from` by origin | The drawn row's id | Terminal, Desktop, VS Code |


309| [`Input`](https://code.claude.com/docs/en/plugins/mods/interface#take-typed-input-and-draw-a-row-for-each-item) | `key`, `label`, `placeholder`, `value`, `submitLabel`, [`rows`](https://code.claude.com/docs/en/plugins/mods/gallery#input), `onSubmit`, `onInput`, `autoFocus` | ✓ | ✓ | ✓ |320| [`Input`](https://code.claude.com/docs/en/plugins/mods/interface#take-typed-input-and-draw-a-row-for-each-item) | `key`, `label`, `placeholder`, `value`, `submitLabel`, [`rows`](https://code.claude.com/docs/en/plugins/mods/gallery#input), `onSubmit`, `onInput`, `autoFocus` | ✓ | ✓ | ✓ |

310| `Select` | `key`, `label`, `options`, `value`, `onSelect`, `autoFocus` | ✓ | ✓ | ✓ |321| `Select` | `key`, `label`, `options`, `value`, `onSelect`, `autoFocus` | ✓ | ✓ | ✓ |

311| `Svg` | a `source` of SVG markup up to 131,072 characters, `alt` text, `width`, `height`, and `isInteractive` | | ✓ | ✓ |322| `Svg` | a `source` of SVG markup up to 131,072 characters, `alt` text, `width`, `height`, and `isInteractive` | | ✓ | ✓ |

323| [`Shader`](https://code.claude.com/docs/en/plugins/mods/interface#animate-a-backdrop-with-a-shader) | `module`, `values`, and one `Svg` child. Draws in a [`Backdrop`](#render-sites) only. Requires Claude Code v2.1.326 or later. | | ✓ | |

312| [`Client`](https://code.claude.com/docs/en/plugins/mods/interface#build-a-tree-from-elements) | `module`, `key`, `props`, `width`, `height`, `flexGrow` | ✓ | ✓ | |324| [`Client`](https://code.claude.com/docs/en/plugins/mods/interface#build-a-tree-from-elements) | `module`, `key`, `props`, `width`, `height`, `flexGrow` | ✓ | ✓ | |

313| [`Raster`](https://code.claude.com/docs/en/plugins/mods/interface#draw-a-grid-of-colored-cells) | `key`, `columns` up to 512, `rows` up to 256, `cells`. See [Draw a grid of colored cells](https://code.claude.com/docs/en/plugins/mods/interface.md#draw-a-grid-of-colored-cells). | ✓ | | |325| [`Raster`](https://code.claude.com/docs/en/plugins/mods/interface#draw-a-grid-of-colored-cells) | `key`, `columns` up to 512, `rows` up to 256, `cells`. See [Draw a grid of colored cells](https://code.claude.com/docs/en/plugins/mods/interface.md#draw-a-grid-of-colored-cells). | ✓ | | |

314| `Image` | `key`, a `source` such as PNG or RGBA bytes up to 2 MiB, or a file path, `columns` and `rows` up to 255, and `alt` text. See [which terminals draw it](https://code.claude.com/docs/en/plugins/mods/gallery.md#image-and-client). | ✓ | | |326| `Image` | `key`, a `source` such as PNG or RGBA bytes up to 2 MiB, or a file path, `columns` and `rows` up to 255, and `alt` text. See [which terminals draw it](https://code.claude.com/docs/en/plugins/mods/gallery.md#image-and-client). | ✓ | | |


413| `$.model.complete` `maxTokens` | 1024 by default, up to 64,000 or the model's output limit |425| `$.model.complete` `maxTokens` | 1024 by default, up to 64,000 or the model's output limit |

414| `$.fs.read` and `$.fs.write` | 4 MiB for one file. On v2.1.326 or later, read a larger file in parts with `$.fs.read(path, { offset, length })`, both in bytes. |426| `$.fs.read` and `$.fs.write` | 4 MiB for one file. On v2.1.326 or later, read a larger file in parts with `$.fs.read(path, { offset, length })`, both in bytes. |

415| A `$.http.fetch` request body | 4 MiB, counted in characters. A call with a larger body rejects. |427| A `$.http.fetch` request body | 4 MiB, counted in characters. A call with a larger body rejects. |

416| A `$.http.fetch` response body | 4 MiB. `text` holds the first 4 MiB and the rest isn't read. When the `Content-Length` header declares more, the call rejects instead, with a reason that ends `is over the 4194304-byte limit`, except when the last request after any redirects uses the `HEAD` method. The `HEAD` exemption requires Claude Code v2.1.296 or later. |428| A `$.http.fetch` response body | 4 MiB. `text` holds the first 4 MiB and the rest isn't read. When the `Content-Length` header declares more, the call rejects instead, with a reason that ends `is over the 4194304-byte limit`. The call ignores that header on a 204, 205, or 304 response, and when its last request after any redirects uses `HEAD`. The `HEAD` case requires Claude Code v2.1.296 or later, and the others v2.1.299 or later. |

417| One `$.http.fetch` call, redirects and body included | 30 seconds |429| One `$.http.fetch` call, redirects and body included | 30 seconds |

418| Redirects one `$.http.fetch` call follows | 5 |430| Redirects one `$.http.fetch` call follows | 5 |

419| A hook's `drop` reason or `config.set` `deny` reason | 4,096 characters. The end of a longer reason is cut, and the drop or deny still applies. The cut requires Claude Code v2.1.292 or later, and on earlier versions the hook [fails](https://code.claude.com/docs/en/plugins/mods/events.md#handle-a-hook-that-fails) instead. |431| A hook's `drop` reason or `config.set` `deny` reason | 4,096 characters. The end of a longer reason is cut, and the drop or deny still applies. The cut requires Claude Code v2.1.292 or later, and on earlier versions the hook [fails](https://code.claude.com/docs/en/plugins/mods/events.md#handle-a-hook-that-fails) instead. |

432| All mods' elements [above the question dialog](https://code.claude.com/docs/en/plugins/mods/interface.md#change-what-claude-code-already-draws) | 12 rows in the terminal and 48 in the Desktop app or the VS Code extension, counted at a 40-column width. Over the limit, the dialog appears without your elements. |

433| A call to a method another mod added in [`engine.create`](#other-mods) | 10 seconds. After that, the call rejects with a reason that ends `did not answer within 10000ms`. |

420| Text in one tree | The first 100,000 characters are drawn |434| Text in one tree | The first 100,000 characters are drawn |

421| A `Code`'s `language` or `path`, a `Select` option's `value`, or a `Client`'s `module` | 10,000 characters. If one is longer, the `ui.render` hook that returned it [fails](https://code.claude.com/docs/en/plugins/mods/events.md#handle-a-hook-that-fails). |435| A `Code`'s `language` or `path`, a `Select` option's `value`, or a `Client`'s `module` | 10,000 characters. If one is longer, the `ui.render` hook that returned it [fails](https://code.claude.com/docs/en/plugins/mods/events.md#handle-a-hook-that-fails). |

422| A `Link`'s `href` | 2,048 characters. If it's longer, the `ui.render` hook that returned it [fails](https://code.claude.com/docs/en/plugins/mods/events.md#handle-a-hook-that-fails). |436| A `Link`'s `href` | 2,048 characters. If it's longer, the `ui.render` hook that returned it [fails](https://code.claude.com/docs/en/plugins/mods/events.md#handle-a-hook-that-fails). |


428| PNG or RGBA bytes of all the `Image`s in one tree | 2 MiB |442| PNG or RGBA bytes of all the `Image`s in one tree | 2 MiB |

429| `$.store` | 4 MiB of JSON in total |443| `$.store` | 4 MiB of JSON in total |

430| `$.session.messages()` | The newest 4,096 entries |444| `$.session.messages()` | The newest 4,096 entries |

445| Text passed to `$.session.redact` | 100,000 characters. A call with longer text rejects. |

431| `$.ui.invalidate('ui.render')` redraws | Throttled to 10 a second, or 30 in the terminal for the visible pane, the expanded band, and the hint line under the prompt. Calls that come sooner are coalesced. |446| `$.ui.invalidate('ui.render')` redraws | Throttled to 10 a second, or 30 in the terminal for the visible pane, the expanded band, and the hint line under the prompt. Calls that come sooner are coalesced. |

447| [`ui.pointer`](https://code.claude.com/docs/en/plugins/mods/interface#animate-a-backdrop-with-a-shader) clicks | Two a second. The app drops the rest. |

448| A [`Shader`](https://code.claude.com/docs/en/plugins/mods/interface#animate-a-backdrop-with-a-shader)'s `values` | Eight numbers |

432| `$.ui.toast` | Shown for 4 seconds unless you pass `{ timeoutMs }`. In the [classic renderer](https://code.claude.com/docs/en/fullscreen.md#enable-fullscreen-rendering), a mod's newer toast can [take the place of its older one](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#a-toast-doesn’t-appear) that's showing or waiting to show. |449| `$.ui.toast` | Shown for 4 seconds unless you pass `{ timeoutMs }`. In the [classic renderer](https://code.claude.com/docs/en/fullscreen.md#enable-fullscreen-rendering), a mod's newer toast can [take the place of its older one](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#a-toast-doesn’t-appear) that's showing or waiting to show. |

433| A pane opened without the user asking | Placed from 144 terminal columns, 110 after they've opened it once |450| A pane opened without the user asking | Placed from 144 terminal columns, 110 after they've opened it once |

434| Rows from `$.ui.place` that one mod has in a conversation at one time | 500. At the limit, a call with a new `id` resolves to `{ isPlaced: false, reason: 'a plugin holds at most 500 placed rows' }`. |451| Rows from `$.ui.place` that one mod has in a conversation at one time | 500. At the limit, a call with a new `id` resolves to `{ isPlaced: false, reason: 'a plugin holds at most 500 placed rows' }`. |


468| [`/plugin`](https://code.claude.com/docs/en/plugins/mods/overview#see-which-mods-a-session-loaded) | Shows a line such as `1 mod active · first-mod` under its tabs when a mod that isn't built in has loaded |485| [`/plugin`](https://code.claude.com/docs/en/plugins/mods/overview#see-which-mods-a-session-loaded) | Shows a line such as `1 mod active · first-mod` under its tabs when a mod that isn't built in has loaded |

469| [`claude plugin validate <directory>`](https://code.claude.com/docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod) | Reads a plugin's manifest and hooks module and reports errors, the events it handles, and the mods API calls it makes. `--strict` treats warnings as errors and `--json` prints a machine-readable report. |486| [`claude plugin validate <directory>`](https://code.claude.com/docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod) | Reads a plugin's manifest and hooks module and reports errors, the events it handles, and the mods API calls it makes. `--strict` treats warnings as errors and `--json` prints a machine-readable report. |

470| [`claude plugin test [directory]`](https://code.claude.com/docs/en/plugins/mods/test#write-a-test) | Runs every file under the directory, or the current directory when you give none, whose name ends in `.test.ts` or `.test.tsx`. Exits with status 1 when a test fails. |487| [`claude plugin test [directory]`](https://code.claude.com/docs/en/plugins/mods/test#write-a-test) | Runs every file under the directory, or the current directory when you give none, whose name ends in `.test.ts` or `.test.tsx`. Exits with status 1 when a test fails. |

471| [`claude --plugin-dir <directory>`](https://code.claude.com/docs/en/plugins/mods/create#write-a-mod-yourself) | Loads a plugin directory for one session and reloads its hooks module when you save. Repeat the flag to load several. |488| [`claude --plugin-dir <directory>`](https://code.claude.com/docs/en/plugins/mods/create#write-a-mod-yourself) | Loads a plugin directory for one session. In an interactive terminal session, reloads the hooks module when you save. Repeat the flag to load several. |

472| `/reload-plugins` | Reloads plugins when you run it |489| `/reload-plugins` | Reloads plugins when you run it |

Details

163 163 

164### Look up what a stub returns164### Look up what a stub returns

165 165 

166Every mods API call your mod makes in a test needs a stub that answers in Claude Code's place, except the few the kit answers itself: [`$.ui.invalidate`](https://code.claude.com/docs/en/plugins/mods/interface#redraw-when-something-changes), [`$.state`](https://code.claude.com/docs/en/plugins/mods/interface#keep-state), and `$.session.append` calls. For `$.clock` calls, use `mock.clock(on)`, or your mod's `$.clock.now()` fails with `no implementation for clock.now`.166[`$.ui.invalidate`](https://code.claude.com/docs/en/plugins/mods/interface#redraw-when-something-changes), [`$.state`](https://code.claude.com/docs/en/plugins/mods/interface#keep-state), and `$.session.append` calls need no stub. For `$.clock` calls, use `mock.clock(on)`, or your mod's `$.clock.now()` fails with `no implementation for clock.now`. A passing test [can hide](#follow-the-test-kit’s-rules) a `no implementation for` error, and each call that fails with it needs a stub.

167 167 

168This table lists the ones mods use most. The first column is the call your mod makes or the event it passes on with `next(e)`. The second is the function to pass to `on` under that name, so the `$.store.get` row becomes `on('store.get', ($, e) => ({ value: saved.get(e.key) }))`. A `'...'` in a stub marks text for you to fill in:168This table lists the ones mods use most. The first column is the call your mod makes or the event it passes on with `next(e)`. The second is the function to pass to `on` under that name, so the `$.store.get` row becomes `on('store.get', ($, e) => ({ value: saved.get(e.key) }))`. A `'...'` in a stub marks text for you to fill in:

169 169 


176| `$.ui.ask` | A `tool.call` stub, because the question reaches it as a call to the `AskUserQuestion` tool: `($, e) => ({ result: { answers: { [e.questions[0].question]: 'Run it' } } })`. Check `e.tool` first if your mod passes on other tool calls. |176| `$.ui.ask` | A `tool.call` stub, because the question reaches it as a call to the `AskUserQuestion` tool: `($, e) => ({ result: { answers: { [e.questions[0].question]: 'Run it' } } })`. Check `e.tool` first if your mod passes on other tool calls. |

177| `$.model.complete` | `() => ({ value: { isAnswered: true, text: '...', usage } })` |177| `$.model.complete` | `() => ({ value: { isAnswered: true, text: '...', usage } })` |

178| `$.process.run` | `($, e) => ({ value: { exitCode: 0, stdout: '...', stderr: '' } })`. `e.argv` is the argument list and `e.init` holds `cwd` and `timeoutMs`. |178| `$.process.run` | `($, e) => ({ value: { exitCode: 0, stdout: '...', stderr: '' } })`. `e.argv` is the argument list and `e.init` holds `cwd` and `timeoutMs`. |

179| Any mods API call that should fail | `() => ({ deny: 'the reason' })`, which makes the call reject in your mod. A stub that throws is skipped instead. |179| To fail a call whose stub returns `{ value }` | `() => ({ deny: 'the reason' })`, which makes the call reject in your mod. `ui.toast`, `ui.log`, and `ui.status` don't reject. A stub that throws is skipped. |

180| `session.start` | `() => ({ cwd: '/work' })` |180| `session.start` | `() => ({ cwd: '/work' })` |

181| `turn.start` | `($, e) => ({ turnId: e.turnId })` |181| `turn.start` | `($, e) => ({ turnId: e.turnId })` |

182| `tool.call` | `() => ({ result: '...' })` |182| `tool.call` | `() => ({ result: '...' })` |


316| `select({ key: 'size', value: 'large' })` | Picks the option with that value in the `Select` with that key |316| `select({ key: 'size', value: 'large' })` | Picks the option with that value in the `Select` with that key |

317| `keepsBeneath()` | In a test with no `ui.render` stub, it resolves to `true` when the drawing includes what `next(e)` returned, and `false` when your hook left it out. In a test that registers one, use `find` to look for what the stub drew. Requires Claude Code v2.1.321 or later. |317| `keepsBeneath()` | In a test with no `ui.render` stub, it resolves to `true` when the drawing includes what `next(e)` returned, and `false` when your hook left it out. In a test that registers one, use `find` to look for what the stub drew. Requires Claude Code v2.1.321 or later. |

318| `find({ key: 'more' })` or `find({ type: 'Text', text: 'Count: 2' })` | Returns the first matching element as `{ type, props, children }`, or `undefined`. `text` can be a string or a regular expression. |318| `find({ key: 'more' })` or `find({ type: 'Text', text: 'Count: 2' })` | Returns the first matching element as `{ type, props, children }`, or `undefined`. `text` can be a string or a regular expression. |

319| `drawn()` | Returns the whole tree as last drawn |

319| `unmount()` | Removes the drawing |320| `unmount()` | Removes the drawing |

320 321 

321Each method resolves after your handler has finished, so you can check the result on the next line. Set `props` to what Claude Code would pass for that site. The [render sites table](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites) lists each site's props, and [the types for your build](https://code.claude.com/docs/en/plugins/mods/create.md#get-the-types-for-your-build) have their types.322Each method resolves after your handler has finished, so you can check the result on the next line. Set `props` to what Claude Code would pass for that site. The [render sites table](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites) lists each site's props, and [the types for your build](https://code.claude.com/docs/en/plugins/mods/create.md#get-the-types-for-your-build) have their types.

Details

10 10 

11## Find out why a mod does nothing11## Find out why a mod does nothing

12 12 

13When a mod does nothing, check what Claude Code reads from the mod's files, and the line it writes when it skips something. For the first, in your shell run [`claude plugin validate`](https://code.claude.com/docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod) with the mod's directory, as in `claude plugin validate ./first-mod`. It catches a misspelled event, a bad manifest, and a module Claude Code can't read, without starting a session.13When a mod does nothing, check what Claude Code reads from the mod's files, and the line it writes when it skips something. To check the files, in your shell run [`claude plugin validate`](https://code.claude.com/docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod) with the mod's directory, as in `claude plugin validate ./first-mod`. It catches a bad manifest and a module Claude Code can't read, without starting a session.

14 14 

15When a module doesn't load, a hook is skipped, or another mod refuses yours, Claude Code writes one line that names your mod. Where you read that line depends on the session:15Claude Code writes one line naming your mod in cases such as a code error that stops it from loading, a skipped hook, or a refusal by another mod. Look for that line in the transcript, the debug log, or stderr, by session type:

16 16 

17* **A session that hot-reloads a plugin directory**: a dim line in the transcript. That's an interactive session you started with `--plugin-dir`, or one where [hot reloading is on](https://code.claude.com/docs/en/plugins/mods/create.md#ask-claude-for-a-mod) for mods Claude wrote.17* **A session that hot-reloads a plugin directory**: a dim line in the transcript. That's an interactive session you started with `--plugin-dir`, or one where [hot reloading is on](https://code.claude.com/docs/en/plugins/mods/create.md#ask-claude-for-a-mod) for mods Claude wrote.

18* **Any other interactive session, such as one that runs a mod you installed from a marketplace**: the [debug log](#read-the-debug-log). To get one, start the session with `claude --debug`.18* **Any other interactive session, such as one that runs a mod you installed from a marketplace**: the [debug log](#read-the-debug-log). To get one, start the session with `claude --debug`.


61| :- | :- |61| :- | :- |

62| `hooks modules are turned off for installed plugins in this process: the rollout switch served off` | Anthropic has turned installed mods off remotely. |62| `hooks modules are turned off for installed plugins in this process: the rollout switch served off` | Anthropic has turned installed mods off remotely. |

63| `hooks modules are turned off for installed plugins in this process: the rollout switch was saved off by an earlier session` | The session used a value an earlier session saved, which may be out of date. Start Claude Code again to refresh it. |63| `hooks modules are turned off for installed plugins in this process: the rollout switch was saved off by an earlier session` | The session used a value an earlier session saved, which may be out of date. Start Claude Code again to refresh it. |

64| `hooks modules a person installed wait for the rollout switch in this process` | In a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md), your mods are waiting to load, so send another message. If the line includes `could not be read`, or you see `Mods you installed aren't running in this session`, start a new session instead. |

64| `disableAllHooks in managed settings` | Your organization turned off hooks from installed plugins |65| `disableAllHooks in managed settings` | Your organization turned off hooks from installed plugins |

65| `only managed plugins and built-in plugins run` | `allowManagedHooksOnly` is set, or `disableAllHooks` is set in a settings file other than managed settings |66| `only managed plugins and built-in plugins run` | `allowManagedHooksOnly` is set, or `disableAllHooks` is set in a settings file other than managed settings |

66| `installed plugins that are not managed load no hooks module in this mode (--bare)` | You started Claude Code with `--bare` |67| `installed plugins that are not managed load no hooks module in this mode (--bare)` | You started Claude Code with `--bare` |


145 146 

146Fix the error. The debug log has a line for every occurrence.147Fix the error. The debug log has a line for every occurrence.

147 148 

149### `call refused` or `result withheld`

150 

151Either line means Claude Code couldn't copy a value to or from a hook that checks an action, such as a `tool.call` hook. Match the [transcript or debug log line](#find-out-why-a-mod-does-nothing) to see whether the action ran:

152 

153* `call refused`: Claude Code refused the action in your hook's place

154* `result withheld`: what the tool did stays done, and Claude reads a note in place of its result

155 

156What Claude gets back can include `could not be given to a hook that checks it` or `a hook that checks this result could not hand back its answer`.

157 

158If the line includes `could not be given its argument`, your hook didn't run, so leave it as it is. If it includes `is not plain data: nesting deeper than 28000 levels`, reduce the nesting in the values your hook returns or passes on.

159 

148### `no command.run hook answered it`160### `no command.run hook answered it`

149 161 

150You run a command your mod added, and the reply names the mod and the command, as in `first-mod registered /tally but no command.run hook answered it`, then tells you to add a hook. Claude Code prints that reply when the command reaches the end of the chain with no answer, which happens in two cases:162You run a command your mod added, and the reply names the mod and the command, as in `first-mod registered /tally but no command.run hook answered it`, then tells you to add a hook. Claude Code prints that reply when the command reaches the end of the chain with no answer, which happens in two cases:


296 308 

297### `$.ui.open` runs and no pane appears309### `$.ui.open` runs and no pane appears

298 310 

299The call didn't come from something the user did, and the terminal is narrower than [the width that pane needs](https://code.claude.com/docs/en/plugins/mods/interface.md#when-a-pane-waits-for-a-wider-terminal).311Check the call's result. When `isPlaced` is `false`, the start of `reason` says why, as in these cases:

300 312 

301Open the pane from a command or a button, or check the call's `isPlaced` result. See [Open a pane at the right time](https://code.claude.com/docs/en/plugins/mods/interface.md#open-a-pane-at-the-right-time).313* **`unasked below`**: open the pane from a command or a button, or use [a wider terminal](https://code.claude.com/docs/en/plugins/mods/interface.md#when-a-pane-waits-for-a-wider-terminal).

314* **`no-surface`**: nothing is attached to draw on, as in a `claude -p` or Agent SDK run. From a `command.run` hook, return `{ text }` instead.

302 315 

303### A toast doesn't appear316### A toast doesn't appear

304 317 


341 354 

342### Your edits don't take effect355### Your edits don't take effect

343 356 

344You're editing a plugin you installed. Claude Code runs the cached copy for the installed version.357If your plugin was [copied at install](https://code.claude.com/docs/en/plugins/loading.md#in-place-and-copied-plugins), Claude Code runs that copy.

345 358 

346Develop with `--plugin-dir` pointed at your working copy, as in `claude --plugin-dir ./first-mod`, which reloads when you save.359Develop with `--plugin-dir` pointed at your working copy, as in `claude --plugin-dir ./first-mod`, which reloads when you save.

347 360 


369| `settings.read bypassed by cc-plugin-sec-default`, on a line that names your mod ahead of it | The [built-in guard](https://code.claude.com/docs/en/plugins/mods/admin.md#know-what-happens-by-default) skipped your hook. Ask your organization's administrator to [install the mod as one of the organization's mods](https://code.claude.com/docs/en/plugins/mods/admin.md#install-your-organizations-mods). |382| `settings.read bypassed by cc-plugin-sec-default`, on a line that names your mod ahead of it | The [built-in guard](https://code.claude.com/docs/en/plugins/mods/admin.md#know-what-happens-by-default) skipped your hook. Ask your organization's administrator to [install the mod as one of the organization's mods](https://code.claude.com/docs/en/plugins/mods/admin.md#install-your-organizations-mods). |

370| `settings.read: the answer for <key> is no value the key can hold` | Claude Code refused the value a hook returned for that key. The hook may be yours or another mod's. Follow [the step for your case](#settings-read-key-refused). |383| `settings.read: the answer for <key> is no value the key can hold` | Claude Code refused the value a hook returned for that key. The hook may be yours or another mod's. Follow [the step for your case](#settings-read-key-refused). |

371| `settings.read: the merge never settles for <key>` | The keys the line names keep the settings sources' values. Set them in a settings file. |384| `settings.read: the merge never settles for <key>` | The keys the line names keep the settings sources' values. Set them in a settings file. |

372| `answered settings.read without next()`, after a mod's name | Your hook is affected if the named mod [runs before yours](https://code.claude.com/docs/en/plugins/mods/events.md#the-order-mods-run-in). Then your hook didn't run on that read. [Turn that mod off](https://code.claude.com/docs/en/plugins/mods/overview.md#turn-mods-on-or-off), or if your organization deployed it, ask its administrator to. |385| `answered settings.read without next()`, after a mod's name | Your hook is affected if the named mod [runs before yours](https://code.claude.com/docs/en/plugins/mods/events.md#the-order-mods-run-in). Then your hook didn't run on that read. [Turn that mod off](https://code.claude.com/docs/en/plugins/mods/overview.md#turn-mods-on-or-off), or if you're in an organization that deployed it, ask your administrator to. |

373| `settings.read: refused to the engine` | Your value didn't apply because Claude Code's own read was refused. [Find what refused it](#settings-read-refused). |386| `settings.read: refused to the engine` | Your value didn't apply because Claude Code's own read was refused. [Find what refused it](#settings-read-refused). |

374 387 

375If no line explains the key, check the mods that run before yours for a `settings.read` hook that [changes the key](https://code.claude.com/docs/en/plugins/mods/events.md#settings-read-example). Turn that mod off, or ask your organization's administrator to. If no hook does, set the key in a settings file.388If no line explains the key, check the mods that run before yours for a `settings.read` hook that [changes the key](https://code.claude.com/docs/en/plugins/mods/events.md#settings-read-example). Turn that mod off, or if you're in an organization that deployed it, ask your administrator to. If no hook does, set the key in a settings file.

376 389 

377### `the answer for <key> is no value the key can hold`390### `the answer for <key> is no value the key can hold`

378 391 


400Search your code for the reason in the parentheses:413Search your code for the reason in the parentheses:

401 414 

402* **Your code has it**: your hook refused the read. Make it return `{ value }` when [`next.origin`](https://code.claude.com/docs/en/plugins/mods/events#settings-read-origin) shows Claude Code's own read.415* **Your code has it**: your hook refused the read. Make it return `{ value }` when [`next.origin`](https://code.claude.com/docs/en/plugins/mods/events#settings-read-origin) shows Claude Code's own read.

403* **Your code doesn't have it**: [turn off](https://code.claude.com/docs/en/plugins/mods/overview.md#turn-mods-on-or-off) your other mods one at a time. If your organization deployed a mod, ask its administrator to turn it off. After each:416* **Your code doesn't have it**: [turn off](https://code.claude.com/docs/en/plugins/mods/overview.md#turn-mods-on-or-off) your other mods one at a time, or if you're in an organization that deployed one, ask your administrator to. After each:

404 1. Start the session from your shell with `claude --debug-file ./settings-read-2.log`, followed by the flags it started with. Use a new path each time.417 1. Start the session from your shell with `claude --debug-file ./settings-read-2.log`, followed by the flags it started with. Use a new path each time.

405 2. Search that file for `refused to the engine`. If the line is there, turn off the next mod. If not, the last mod you turned off refused the read, so keep it off.418 2. Search that file for `refused to the engine`. If the line is there, turn off the next mod. If not, the last mod you turned off refused the read, so keep it off.

406 419 

Details

42 42 

43Skills, subagents, hooks, and MCP servers all work on their own, without a plugin. A skill you save in `~/.claude/skills/`, for example, is available in every project on your machine. To set one up on its own, see [Skills](https://code.claude.com/docs/en/skills.md), [Subagents](https://code.claude.com/docs/en/sub-agents.md), [Hooks](https://code.claude.com/docs/en/hooks-guide.md), or [MCP](https://code.claude.com/docs/en/mcp.md).43Skills, subagents, hooks, and MCP servers all work on their own, without a plugin. A skill you save in `~/.claude/skills/`, for example, is available in every project on your machine. To set one up on its own, see [Skills](https://code.claude.com/docs/en/skills.md), [Subagents](https://code.claude.com/docs/en/sub-agents.md), [Hooks](https://code.claude.com/docs/en/hooks-guide.md), or [MCP](https://code.claude.com/docs/en/mcp.md).

44 44 

45Use a plugin when you want several skills, subagents, hooks, or MCP servers packaged as one unit. Install one to get a setup someone else built, with one command and updates from its marketplace. Make one to give your own setup to teammates, install it in many projects, or publish versioned releases.45Use a plugin when you want several skills, subagents, hooks, or MCP servers packaged as one unit. Install one to get a setup someone else built, with one command and updates from its marketplace. Make one to share your own setup, install it in many projects, or publish versioned releases.

46 46 

47### What an enabled plugin adds to your sessions47### What an enabled plugin adds to your sessions

48 48 


122 122 

123* **Share what you built**: [Publish and distribute a plugin](https://code.claude.com/docs/en/plugins/publish.md), through your own marketplace or [Anthropic's directory](https://code.claude.com/docs/en/plugins/publish.md#submit-to-anthropics-directory)123* **Share what you built**: [Publish and distribute a plugin](https://code.claude.com/docs/en/plugins/publish.md), through your own marketplace or [Anthropic's directory](https://code.claude.com/docs/en/plugins/publish.md#submit-to-anthropics-directory)

124* **Check whether it works and is used**: [Test plugins with evals](https://code.claude.com/docs/en/plugin-evals.md) and [Measure plugin cost and usage](https://code.claude.com/docs/en/plugins/measure.md)124* **Check whether it works and is used**: [Test plugins with evals](https://code.claude.com/docs/en/plugin-evals.md) and [Measure plugin cost and usage](https://code.claude.com/docs/en/plugins/measure.md)

125* **Run a marketplace for your team**: [Create a marketplace](https://code.claude.com/docs/en/plugins/create-marketplace.md), then [Host and maintain a marketplace](https://code.claude.com/docs/en/plugins/host-marketplace.md)125* **Run a marketplace**: [Create a marketplace](https://code.claude.com/docs/en/plugins/create-marketplace.md), then [Host and maintain a marketplace](https://code.claude.com/docs/en/plugins/host-marketplace.md)

126* **Set plugin policy for an organization**: [Manage plugins for your organization](https://code.claude.com/docs/en/plugins/org.md)126* **Set plugin policy for an organization**: [Manage plugins for your organization](https://code.claude.com/docs/en/plugins/org.md)

127* **Fix a problem**: [Troubleshoot plugins](https://code.claude.com/docs/en/plugins/troubleshooting.md)127* **Fix a problem**: [Troubleshoot plugins](https://code.claude.com/docs/en/plugins/troubleshooting.md)

Details

132 132 

133**1. Confirm you can submit**133**1. Confirm you can submit**

134 134 

135Submitting requires a paid claude.ai plan. On Pro, Max, and Ultra you submit from your own account. On Team and Enterprise, an Owner can submit, and on Enterprise an Owner can also grant the **Directory** permission to other members through a custom role under **Organization settings > Roles**. See [Confirm you can submit to the directory](https://claude.com/docs/directory/publish#confirm-you-can-submit-to-the-directory).135Submitting requires a paid claude.ai plan. On Pro, Max, and Ultra you submit from your own account. On Team and Enterprise, an Owner can submit, and on Enterprise an Owner can also grant the **Directory** permission to other members through a custom role under [**Organization settings > Roles**](https://claude.ai/admin-settings/roles). See [Confirm you can submit to the directory](https://claude.com/docs/directory/publish#confirm-you-can-submit-to-the-directory).

136 136 

137**2. Validate the plugin locally**137**2. Validate the plugin locally**

138 138 

Details

856 856 

857#### Hooks fail to load857#### Hooks fail to load

858 858 

859The **Errors** tab shows one of these messages:859The **Errors** tab or `claude plugin list` shows messages such as these:

860 860 

861* **`Couldn't load hooks from <path>: <reason>`** or **`Failed to load hooks from <path>: <reason>`**: fix the problem that `<reason>` names, such as invalid JSON or a missing top-level `hooks` key. To catch a JSON syntax problem in `hooks/hooks.json` before you publish the plugin, run `claude plugin validate <plugin-directory>` in your shell861* **`Couldn't load hooks from <path>`**, **`Failed to load hooks from <path>`**, or **`Hook load failed`**: fix the named problem, such as invalid JSON or a missing top-level `hooks` key. To catch a JSON syntax problem in `hooks/hooks.json` before you publish the plugin, run `claude plugin validate <plugin-directory>` in your shell

862* **`hooks path not found: <path>`**: the manifest's `hooks` field names a file that doesn't exist at that path relative to the plugin root. Fix the path or add the file862* **`hooks path not found: <path>`** or **`Path not found: <path> (hooks)`**: no file exists at `<path>`. Fix the path or add the file

863* **`hooks path escapes plugin directory: <path>`**: see [Path escapes plugin directory](https://code.claude.com/docs/en/errors.md#path-escapes-plugin-directory)863* **`hooks path escapes plugin directory: <path>`**: see [Path escapes plugin directory](https://code.claude.com/docs/en/errors.md#path-escapes-plugin-directory)

864 864 

865#### `hook error` notices in the transcript865#### `hook error` notices in the transcript


1184 1184 

1185Managed settings block this plugin, its marketplace, or a dependency it needs. Ask your administrator which entry applies. A blocked dependency means the plugin can't install until the dependency's marketplace is allowed.1185Managed settings block this plugin, its marketplace, or a dependency it needs. Ask your administrator which entry applies. A blocked dependency means the plugin can't install until the dependency's marketplace is allowed.

1186 1186 

1187When you install from `/plugin`, ask your administrator about other forms of the message too, such as:

1188 

1189* `Plugin "<name>" is blocked by your organization's policy and can't be installed`

1190* `Can't install "<name>": dependency "<dep>" is blocked by your organization's policy`

1191 

1187### `--plugin-dir is disabled by your organization's managed settings (disableSideloadFlags)`1192### `--plugin-dir is disabled by your organization's managed settings (disableSideloadFlags)`

1188 1193 

1189You started `claude` with `--plugin-dir`, `--plugin-url`, `--agents`, or `--mcp-config`. Claude Code exited with this message and `Plugins, custom agents, and MCP servers can only be loaded from sources your administrator has approved.`1194You started `claude` with `--plugin-dir`, `--plugin-url`, `--agents`, or `--mcp-config`. Claude Code exited with this message and `Plugins, custom agents, and MCP servers can only be loaded from sources your administrator has approved.`

Details

147 147 

148To add a setup script, environment variables, or different network access, use an [organization-shared environment](https://code.claude.com/docs/en/cloud-environments.md#organization-shared-environments). On the **Claude Ship** page, select a **Default environment** under **Where it runs**. To override it for one repository, click **Change** beside **Environment** in the **Edit** dialog.148To add a setup script, environment variables, or different network access, use an [organization-shared environment](https://code.claude.com/docs/en/cloud-environments.md#organization-shared-environments). On the **Claude Ship** page, select a **Default environment** under **Where it runs**. To override it for one repository, click **Change** beside **Environment** in the **Edit** dialog.

149 149 

150With neither set, PR Steward can use your organization's [default environment](https://code.claude.com/docs/en/cloud-environments.md#the-default-environment). Without one, it runs in an Anthropic-hosted environment with no setup script and no environment variables.150With neither set, PR Steward can use your organization's [default environment](https://code.claude.com/docs/en/cloud-environments.md#the-default-environment). If that default is [self-hosted](#run-pr-steward-in-a-self-hosted-environment), select it or another environment for PR Steward under **Where it runs**. Until you do, pull requests can get a [comment that PR Steward hasn't started](https://code.claude.com/docs/en/pr-steward-troubleshooting.md#pr-steward-posted-a-comment-that-says-why). If your organization has no default, PR Steward runs in an Anthropic-hosted environment with no setup script and no environment variables.

151 151 

152### Run PR Steward in a self-hosted environment152### Run PR Steward in a self-hosted environment

153 153 

154For the environment that PR Steward runs in, you can select a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments). The [limits on approvals and merges](https://code.claude.com/docs/en/pr-steward-security.md#limits-on-approvals-and-merges) are described for Anthropic-hosted sessions only. On a runner without [Anthropic-managed git](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#use-the-anthropic-git-proxy), PR Steward pushes with the runner's own git credentials.154For the environment that PR Steward runs in, you can select a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments). Its runners need Claude Code v2.1.317 or later. The [limits on approvals and merges](https://code.claude.com/docs/en/pr-steward-security.md#limits-on-approvals-and-merges) are described for Anthropic-hosted sessions only. On a runner without [Anthropic-managed git](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#use-the-anthropic-git-proxy), PR Steward pushes with the runner's own git credentials.

155 155 

156> [!WARNING]156> [!WARNING]

157>157>

Details

61| `PR Steward didn't start: only someone with write access` | Have a person with write access add the `claude-pr-steward-watching` label or comment `@claude steward` |61| `PR Steward didn't start: only someone with write access` | Have a person with write access add the `claude-pr-steward-watching` label or comment `@claude steward` |

62| `PR Steward hasn't started: your organization has no extra usage available` | Ask an Owner to add usage credits or raise the spend limit in [**Organization settings > Usage**](https://claude.ai/admin-settings/usage). If you asked PR Steward to start, it then starts when you ask again. Otherwise, it starts at the next push |62| `PR Steward hasn't started: your organization has no extra usage available` | Ask an Owner to add usage credits or raise the spend limit in [**Organization settings > Usage**](https://claude.ai/admin-settings/usage). If you asked PR Steward to start, it then starts when you ask again. Otherwise, it starts at the next push |

63| `PR Steward hasn't started: billing for PR Steward isn't set up` | Ask an Owner to pick a repository where PR Steward is on and [change its **Steward** setting](https://code.claude.com/docs/en/pr-steward-setup.md#choose-when-pr-steward-starts-in-each-repository) to another option than **Off**. They can change it back straight away |63| `PR Steward hasn't started: billing for PR Steward isn't set up` | Ask an Owner to pick a repository where PR Steward is on and [change its **Steward** setting](https://code.claude.com/docs/en/pr-steward-setup.md#choose-when-pr-steward-starts-in-each-repository) to another option than **Off**. They can change it back straight away |

64| `PR Steward hasn't started: your Claude organization hasn't picked where it runs yet` | Ask an Owner to [select an environment for PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in), then comment `@claude steward` |

65| `PR Steward hasn't started: it can't use the environment that your Claude organization picked for it` | Ask an Owner to [select another environment for PR Steward](https://code.claude.com/docs/en/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in), then comment `@claude steward` |

66| `PR Steward hasn't started: the self-hosted runners it would run on need Claude Code 2.1.317 or newer` | Ask whoever runs your [self-hosted environment](https://code.claude.com/docs/en/pr-steward-setup.md#run-pr-steward-in-a-self-hosted-environment) to [update its runners](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#pin-the-version), then comment `@claude steward` |

64| `Claude PR Steward couldn't start, so it isn't watching this pull request` | Add the label or comment `@claude steward` to try again |67| `Claude PR Steward couldn't start, so it isn't watching this pull request` | Add the label or comment `@claude steward` to try again |

65| `Claude PR Steward couldn't start on this pull request because the setup script` | Ask someone who can edit the [environment that PR Steward runs in](https://code.claude.com/docs/en/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in) to fix its setup script, then start PR Steward again |68| `Claude PR Steward couldn't start on this pull request because the setup script` | Ask someone who can edit the [environment that PR Steward runs in](https://code.claude.com/docs/en/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in) to fix its setup script, then start PR Steward again |

66| `this repository has PR Steward enabled in more than one Claude workspace` | Ask the Owners to keep the repository in one Claude organization and remove it from the others |69| `this repository has PR Steward enabled in more than one Claude workspace` | Ask the Owners to keep the repository in one Claude organization and remove it from the others |

Details

88 88 

89[Automatic model fallback](https://code.claude.com/docs/en/model-config.md#automatic-model-fallback) on Fable models, Opus 5.5, Sonnet 5.5, and Opus 5 is also a model switch. When a safety classifier flags a request in a category that has a fallback model and Claude Code re-runs the request on that model, the session continues there.89[Automatic model fallback](https://code.claude.com/docs/en/model-config.md#automatic-model-fallback) on Fable models, Opus 5.5, Sonnet 5.5, and Opus 5 is also a model switch. When a safety classifier flags a request in a category that has a fallback model and Claude Code re-runs the request on that model, the session continues there.

90 90 

91When a skill or command's frontmatter names a [`model`](https://code.claude.com/docs/en/skills#frontmatter-reference) other than the session's current model, that turn is also a model switch: the next request reads the entire conversation history with no cache hits. The session model resumes on your next prompt. A `context: fork` skill sets the [forked subagent's model](https://code.claude.com/docs/en/skills.md#run-skills-in-a-subagent) instead.91#### Skills and commands that set a model

92 

93When a skill or command's [`model` value applies](https://code.claude.com/docs/en/skills#frontmatter-reference) and differs from the session's current model, that turn is a model switch. The next request reads the entire conversation history with no cache hits. The session model resumes on your next prompt. With `context: fork`, the value goes to a [subagent](https://code.claude.com/docs/en/skills.md#run-skills-in-a-subagent) with [its own cache](#subagents-and-the-cache) instead.

92 94 

93### Changing effort level95### Changing effort level

94 96 


240 242 

241### Invoking skills and commands243### Invoking skills and commands

242 244 

243[Skills](https://code.claude.com/docs/en/skills.md) and [commands](https://code.claude.com/docs/en/commands.md) inject their instructions as user messages at the point of invocation. Nothing earlier in the conversation changes. A skill or command whose frontmatter names a `model` can be a [model switch](#switching-models) for that turn.245[Skills](https://code.claude.com/docs/en/skills.md) and [commands](https://code.claude.com/docs/en/commands.md) inject their instructions as user messages at the point of invocation. Nothing earlier in the conversation changes. A skill or command whose [`model` value applies](https://code.claude.com/docs/en/skills#frontmatter-reference) can be a [model switch](#switching-models) for that turn.

244 246 

245### Running `/recap`247### Running `/recap`

246 248 

quickstart.md +1 −1

Details

21> These cases are covered on other pages:21> These cases are covered on other pages:

22>22>

23> * **Never used a terminal before**: start with the [terminal guide](https://code.claude.com/docs/en/terminal-guide)23> * **Never used a terminal before**: start with the [terminal guide](https://code.claude.com/docs/en/terminal-guide)

24> * **Want Claude Code somewhere other than the terminal**: Claude Code is also available on the [web](https://claude.ai/code), as a [desktop app](https://code.claude.com/docs/en/desktop.md), in [VS Code](https://code.claude.com/docs/en/vs-code.md) and [JetBrains IDEs](https://code.claude.com/docs/en/jetbrains.md), in [Slack](https://code.claude.com/docs/en/slack.md), and in CI/CD with [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) and [GitLab](https://code.claude.com/docs/en/gitlab-ci-cd.md). See [all interfaces](https://code.claude.com/docs/en/overview.md#use-claude-code-everywhere).24> * **Want Claude Code somewhere other than the terminal**: Claude Code is also available on the [web](https://claude.ai/code), as a [desktop app](https://code.claude.com/docs/en/desktop.md), in [VS Code](https://code.claude.com/docs/en/vs-code.md) and [JetBrains IDEs](https://code.claude.com/docs/en/jetbrains.md), and in CI/CD with [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) and [GitLab](https://code.claude.com/docs/en/gitlab-ci-cd.md). See [all interfaces](https://code.claude.com/docs/en/overview.md#use-claude-code-everywhere).

25 25 

26## Step 1: Install Claude Code26## Step 1: Install Claude Code

27 27 

Details

325| [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) | Message a task from the Claude mobile app | Your machine (Desktop) | [Pair the mobile app with Desktop](https://support.claude.com/en/articles/13947068) | Delegating work while you're away, minimal setup |325| [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) | Message a task from the Claude mobile app | Your machine (Desktop) | [Pair the mobile app with Desktop](https://support.claude.com/en/articles/13947068) | Delegating work while you're away, minimal setup |

326| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | Drive a running session from [claude.ai/code](https://claude.ai/code) or the Claude mobile app | Your machine (CLI, Desktop, or VS Code) | Run [`claude remote-control` or `/remote-control`](https://code.claude.com/docs/en/remote-control#start-a-remote-control-session) | Steering in-progress work from another device |326| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | Drive a running session from [claude.ai/code](https://claude.ai/code) or the Claude mobile app | Your machine (CLI, Desktop, or VS Code) | Run [`claude remote-control` or `/remote-control`](https://code.claude.com/docs/en/remote-control#start-a-remote-control-session) | Steering in-progress work from another device |

327| [Channels](https://code.claude.com/docs/en/channels.md) | Push events from a chat app like Telegram or Discord, or your own server | Your machine (CLI) | [Install a channel plugin](https://code.claude.com/docs/en/channels.md#quickstart) or [build your own](https://code.claude.com/docs/en/channels-reference.md) | Reacting to external events like CI failures or chat messages |327| [Channels](https://code.claude.com/docs/en/channels.md) | Push events from a chat app like Telegram or Discord, or your own server | Your machine (CLI) | [Install a channel plugin](https://code.claude.com/docs/en/channels.md#quickstart) or [build your own](https://code.claude.com/docs/en/channels-reference.md) | Reacting to external events like CI failures or chat messages |

328| [Slack](https://code.claude.com/docs/en/slack.md) | Mention `@Claude` in a team channel | Anthropic cloud | [Install the Slack app](https://code.claude.com/docs/en/slack.md#setting-up-claude-code-in-slack) with [Claude Code on the web](https://code.claude.com/docs/en/claude-code-on-the-web.md) enabled, on Pro, Max, and Ultra plans | PRs and reviews from team chat |

329| [Self-hosted environments](https://code.claude.com/docs/en/self-hosted-environments) | Start a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) and pick your organization's environment | Your organization's infrastructure | [Deploy runners](https://code.claude.com/docs/en/self-hosted-environments-quickstart.md), on Team and Enterprise plans | Cloud sessions that must run inside your network |328| [Self-hosted environments](https://code.claude.com/docs/en/self-hosted-environments) | Start a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) and pick your organization's environment | Your organization's infrastructure | [Deploy runners](https://code.claude.com/docs/en/self-hosted-environments-quickstart.md), on Team and Enterprise plans | Cloud sessions that must run inside your network |

330| [Scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks.md) | Set a schedule | [CLI](https://code.claude.com/docs/en/scheduled-tasks.md), [Desktop](https://code.claude.com/docs/en/desktop-scheduled-tasks.md), or [cloud](https://code.claude.com/docs/en/routines.md) | Pick a frequency | Recurring automation like daily reviews |329| [Scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks.md) | Set a schedule | [CLI](https://code.claude.com/docs/en/scheduled-tasks.md), [Desktop](https://code.claude.com/docs/en/desktop-scheduled-tasks.md), or [cloud](https://code.claude.com/docs/en/routines.md) | Pick a frequency | Recurring automation like daily reviews |

331 330 

routines.md +6 −6

Details

41 41 

42* **Backlog maintenance**: a schedule trigger runs every weeknight in your repository, with your issue tracker added as a connector. The scheduled task reads issues opened since the last run, applies labels, and assigns owners based on the area of code referenced. It then posts a summary to Slack so the team starts the day with a groomed queue.42* **Backlog maintenance**: a schedule trigger runs every weeknight in your repository, with your issue tracker added as a connector. The scheduled task reads issues opened since the last run, applies labels, and assigns owners based on the area of code referenced. It then posts a summary to Slack so the team starts the day with a groomed queue.

43* **Alert triage**: your monitoring tool calls the scheduled task's API endpoint when an error threshold is crossed, passing the alert body as `text`. The task's prompt tells Claude to investigate the alert in the fire payload, so it pulls the stack trace and correlates it with recent commits in the repository. It then opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal.43* **Alert triage**: your monitoring tool calls the scheduled task's API endpoint when an error threshold is crossed, passing the alert body as `text`. The task's prompt tells Claude to investigate the alert in the fire payload, so it pulls the stack trace and correlates it with recent commits in the repository. It then opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal.

44* **Bespoke code review**: a GitHub trigger runs on `pull_request.opened`. The scheduled task applies your team's own review checklist and leaves inline comments for security, performance, and style issues. It also adds a summary comment so human reviewers can focus on design instead of mechanical checks.44* **Bespoke code review**: a GitHub trigger runs on `pull_request.opened`. The scheduled task applies your own review checklist and leaves inline comments for security, performance, and style issues. It also adds a summary comment so human reviewers can focus on design instead of mechanical checks.

45* **Deploy verification**: your CD pipeline calls the scheduled task's API endpoint after each production deploy. The task runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes.45* **Deploy verification**: your CD pipeline calls the scheduled task's API endpoint after each production deploy. The task runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes.

46* **Docs drift**: a schedule trigger runs weekly. The scheduled task scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review.46* **Docs drift**: a schedule trigger runs weekly. The scheduled task scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review.

47* **Library port**: a GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The scheduled task ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change.47* **Library port**: a GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The scheduled task ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change.


344* **Failed**: the session didn't finish normally. For example, it stopped unexpectedly, ended on an error, or was archived before the run started344* **Failed**: the session didn't finish normally. For example, it stopped unexpectedly, ended on an error, or was archived before the run started

345* **Cancelled**: the run didn't fail, and its session was archived. If you archive the session of a run that succeeded, the run changes to **Cancelled**. Nothing in the task needs to change345* **Cancelled**: the run didn't fail, and its session was archived. If you archive the session of a run that succeeded, the run changes to **Cancelled**. Nothing in the task needs to change

346 346 

347If a warning appears under **History**, see ["The last run" warnings](#the-last-run-didnt-start).347If a warning appears under **History**, see [Warnings under History](#the-last-run-didnt-start).

348 348 

349### Edit and control scheduled tasks349### Edit and control scheduled tasks

350 350 


510 510 

511Cloud scheduled tasks are off for your organization, and you can't change that from your local configuration. Ask your Team or Enterprise Owner whether they can turn on the **Scheduled tasks (Was Routines)** or **Routines** toggle at [**Organization settings > Capabilities > Remote sessions**](https://claude.ai/admin-settings/capabilities).511Cloud scheduled tasks are off for your organization, and you can't change that from your local configuration. Ask your Team or Enterprise Owner whether they can turn on the **Scheduled tasks (Was Routines)** or **Routines** toggle at [**Organization settings > Capabilities > Remote sessions**](https://claude.ai/admin-settings/capabilities).

512 512 

513### "The last run" warnings513### Warnings under History

514 514 

515When a warning under **History** begins with "The last run", find it in the first column and do what its row says. The warning clears once a later run starts.515When a warning under **History** begins with "The last run" or "This didn't run", find it in the first column and do what its row says. The warning clears once a later run starts.

516 516 

517| Warning | What to do |517| Warning | What to do |

518| :- | :- |518| :- | :- |

519| "The last run didn't start because your organization had reached its limit on cloud sessions running at once." | The task needs no change. Click **Run now** later, or wait for the next run |519| "This didn't run" followed by the run's time, then "You were at the limit for tasks Claude can work on at the same time." or "Your organization was at its limit for tasks Claude can work on at the same time." | The task needs no change. Click **Run now** later, or wait for the next run |

520| "The last run didn't start because its cloud environment couldn't be found or used." | On the task's detail page, open the menu next to its name, select **Edit**, and find the [cloud environment selector](#environments-and-network-access). If it reads **Unavailable environment**, that environment was archived or is no longer available to your account, so choose another one there and save your changes. Otherwise, retry with **Run now** on the detail page, or pick another environment in the selector and save your changes |520| "The last run didn't start because its environment couldn't be found or used." | On the task's detail page, open the menu next to its name, select **Edit**, and find the [cloud environment selector](#environments-and-network-access). If it reads **Unavailable environment**, that environment was archived or is no longer available to your account, so choose another one there and save your changes. Otherwise, retry with **Run now** on the detail page, or pick another environment in the selector and save your changes |

521| "The last run was blocked because it couldn't access something it needs, or your organization's policy doesn't allow it." | Check that your [GitHub access](#repositories-and-branch-permissions) covers the task's repositories. If it does, ask an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) of your Claude organization whether a policy blocks the task |521| "The last run was blocked because it couldn't access something it needs, or your organization's policy doesn't allow it." | Check that your [GitHub access](#repositories-and-branch-permissions) covers the task's repositories. If it does, ask an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) of your Claude organization whether a policy blocks the task |

522| "The last run didn't start because of a problem that's usually temporary." | Click **Run now** to try again, or wait for the next run |522| "The last run didn't start because of a problem that's usually temporary." | Click **Run now** to try again, or wait for the next run |

523| "The last run didn't start because its repository or branch wasn't available." | Check on GitHub that each repository in the task has the [branch the run starts from](#repositories-and-branch-permissions). Also check that your [GitHub access](#repositories-and-branch-permissions) covers each repository, and reconnect GitHub if your connection expired |523| "The last run didn't start because its repository or branch wasn't available." | Check on GitHub that each repository in the task has the [branch the run starts from](#repositories-and-branch-permissions). Also check that your [GitHub access](#repositories-and-branch-permissions) covers each repository, and reconnect GitHub if your connection expired |

Details

783# shellcheck disable=SC2086 # $base is either "" or "FETCH_HEAD", intentional word-split783# shellcheck disable=SC2086 # $base is either "" or "FETCH_HEAD", intentional word-split

784unpushed=$(git -C "$d" rev-list HEAD --not $base --remotes=origin --count 2>/dev/null) || unpushed=0784unpushed=$(git -C "$d" rev-list HEAD --not $base --remotes=origin --count 2>/dev/null) || unpushed=0

785if [ "$unpushed" -gt 0 ]; then785if [ "$unpushed" -gt 0 ]; then

786 branch=$(git -C "$d" symbolic-ref --short -q HEAD)786 # The branch name is not trusted text, so the message leaves it out.

787 if [ -n "$branch" ]; then787 # $unpushed is a count from git rev-list, or 0.

788 # $branch is attacker-influenced — git-check-ref-format(1) allows `"`788 # With -q, symbolic-ref exits 1 on a detached HEAD.

789 # in ref names. `\` is forbidden (rule 10) but escaped anyway as cheap789 git -C "$d" symbolic-ref -q HEAD >/dev/null 2>&1

790 # defense-in-depth.790 if [ $? -eq 1 ]; then

791 # Escape JSON metacharacters before interpolating into the hand-built

792 # payload so a branch like x","continue":false can't inject keys into

793 # the hook-output JSON the harness parses. $unpushed is safe — the

794 # -gt guard above rejects anything that isn't a plain integer.

795 branch_esc=$(printf '%s' "$branch" | sed 's/\\/\\\\/g; s/"/\\"/g')

796 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on branch '\''%s'\''. Please push these changes to the remote repository."}' "$unpushed" "$branch_esc"

797 else

798 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on a detached HEAD. Please create a branch and push it to the remote repository."}' "$unpushed"791 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on a detached HEAD. Please create a branch and push it to the remote repository."}' "$unpushed"

792 else

793 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on the branch checked out in the project directory. Please push these changes to the remote repository."}' "$unpushed"

799 fi794 fi

800 exit 0795 exit 0

801fi796fi


825 820 

826### Replace an earlier copy of the Stop hook script821### Replace an earlier copy of the Stop hook script

827 822 

828Search your copy of `stop-hook-nudge.sh` for `GIT_OPTIONAL_LOCKS`. If it's missing, you have an earlier copy. Replace it with the [current script](#prompt-sessions-to-push-their-work) wherever you installed it, then restart the runners. Keep your Stop hook settings, except to raise `timeout` on a large checkout.823Search your copy of `stop-hook-nudge.sh` for the text `checked out in the project directory`. If it's missing, you have an earlier copy. Replace it now with the [current script](#prompt-sessions-to-push-their-work) wherever you installed it, then restart the runners. Keep your Stop hook settings, except to raise `timeout` on a large checkout.

829 824 

830* **When**: if your sessions run with the [Bash sandbox](https://code.claude.com/docs/en/sandboxing.md) on, replace it now. Otherwise, replace it at your next image build or runner restart.825After you replace the script, the prompt about unpushed commits no longer includes the branch name. If your earlier copy prompted Claude about uncommitted files in a submodule, that prompt stops. For how the current script treats submodules, see [Submodules and the Stop hook](#submodules-and-the-stop-hook).

831* **What changes**: uncommitted files in a submodule no longer prompt Claude. A new commit in a submodule that `.gitmodules` marks `ignore = all` now does.

832 826 

833> [!WARNING]827> [!WARNING]

834>828>

835> Hooks run outside the Bash sandbox, so the current script's git calls skip some git features that can start a program named in the checkout's git settings. They don't skip them all. Don't count on the sandbox alone, and isolate sessions as [Harden your deployment](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#harden-your-deployment) describes.829> Hooks run outside the [Bash sandbox](https://code.claude.com/docs/en/sandboxing.md), so the current script's git calls skip some git features that can start a program named in the checkout's git settings. They don't skip them all. Don't count on the sandbox alone, and isolate sessions as [Harden your deployment](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#harden-your-deployment) describes.

836 830 

837## Permissions and tool approval831## Permissions and tool approval

838 832 

Details

12>12>

13> Server-managed settings are available for [Claude for Teams](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=server_settings_teams#team-&-enterprise) and [Claude for Enterprise](https://anthropic.com/contact-sales?utm_source=claude_code\&utm_medium=docs\&utm_content=server_settings_enterprise) customers.13> Server-managed settings are available for [Claude for Teams](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=server_settings_teams#team-&-enterprise) and [Claude for Enterprise](https://anthropic.com/contact-sales?utm_source=claude_code\&utm_medium=docs\&utm_content=server_settings_enterprise) customers.

14>14>

15> If you set your provider or gateway at claude.ai under **Organization settings > Desktop 3P**, follow the [Enterprise Admin Console guide](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code) instead.15> If you set your provider or gateway at claude.ai under [**Organization settings > Desktop 3P**](https://claude.ai/admin-settings/desktop-deployment), follow the [Enterprise Admin Console guide](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code) instead.

16 16 

17## Requirements17## Requirements

18 18 

settings.md +2 −2

Details

72 72 

73### Keep personal settings out of a repository73### Keep personal settings out of a repository

74 74 

75To change a setting for yourself in one project without changing it for your teammates, save it in `.claude/settings.local.json` inside the project. Claude Code applies that file over the committed `.claude/settings.json`, so if your team's file sets `"model": "claude-sonnet-5"` and you want Opus, put `"model": "claude-opus-5-5"` in your local file and only your sessions change.75To change a setting for yourself in one project, save it in `.claude/settings.local.json` inside the project. Claude Code applies that file over the committed `.claude/settings.json`, so if the committed file sets `"model": "claude-sonnet-5"` and you want Opus, put `"model": "claude-opus-5-5"` in your local file and only your sessions change.

76 76 

77Claude Code also writes to this file, keeps it out of your commits, and applies its allow rules without the trust step:77Claude Code also writes to this file, keeps it out of your commits, and applies its allow rules without the trust step:

78 78 


2301. **Managed settings**: settings your organization deploys, by a `managed-settings.json` file, an MDM policy, or [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) from the claude.ai console. Nothing in your own settings files or `--settings` overrides a managed key, and a flag such as `--model` picks only from the models your organization allows. A managed [`model`](https://code.claude.com/docs/en/settings-reference#model) is a starting default, not a lock; the locks are [`availableModels`](https://code.claude.com/docs/en/settings-reference#availablemodels) and [`deniedModels`](https://code.claude.com/docs/en/settings-reference#deniedmodels). When your organization delivers more than one managed source, the rules for [precedence within the managed tier](https://code.claude.com/docs/en/managed-settings.md#precedence-within-the-managed-tier) say what Claude Code reads from each.2301. **Managed settings**: settings your organization deploys, by a `managed-settings.json` file, an MDM policy, or [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) from the claude.ai console. Nothing in your own settings files or `--settings` overrides a managed key, and a flag such as `--model` picks only from the models your organization allows. A managed [`model`](https://code.claude.com/docs/en/settings-reference#model) is a starting default, not a lock; the locks are [`availableModels`](https://code.claude.com/docs/en/settings-reference#availablemodels) and [`deniedModels`](https://code.claude.com/docs/en/settings-reference#deniedmodels). When your organization delivers more than one managed source, the rules for [precedence within the managed tier](https://code.claude.com/docs/en/managed-settings.md#precedence-within-the-managed-tier) say what Claude Code reads from each.

2312. **Command line**: JSON you pass with `--settings <file-or-json>` when you start `claude`, for that session only; see [Change a setting for one session](#change-a-setting-for-one-session). A key you set there overrides the same key in your project and user settings files, and a key you leave out keeps its value from those files. Other flags, such as `--model`, set one thing for the session and aren't part of this stack; a key's entry on the [settings reference](https://code.claude.com/docs/en/settings-reference.md) says which flags override it.2312. **Command line**: JSON you pass with `--settings <file-or-json>` when you start `claude`, for that session only; see [Change a setting for one session](#change-a-setting-for-one-session). A key you set there overrides the same key in your project and user settings files, and a key you leave out keeps its value from those files. Other flags, such as `--model`, set one thing for the session and aren't part of this stack; a key's entry on the [settings reference](https://code.claude.com/docs/en/settings-reference.md) says which flags override it.

2323. **Project local settings** (`.claude/settings.local.json`): your personal settings for this project.2323. **Project local settings** (`.claude/settings.local.json`): your personal settings for this project.

2334. **Shared project settings** (`.claude/settings.json`): settings your team checks into source control.2334. **Shared project settings** (`.claude/settings.json`): settings checked into source control.

2345. **User settings** (`~/.claude/settings.json`): your personal settings for every project.2345. **User settings** (`~/.claude/settings.json`): your personal settings for every project.

235 235 

236Environment variables aren't a level in this stack. When a behavior has both a shell variable and a settings key, which one applies is decided per pair, not by level: `ANTHROPIC_MODEL` exported in your shell applies over the `model` key from any file, while `ANTHROPIC_DEFAULT_MODEL` applies only when no file sets `model`. The [environment variables reference](https://code.claude.com/docs/en/env-vars.md#precedence) says which keys have a pair and which one Claude Code reads first. An `env` block inside a settings file is an ordinary key and follows the levels above.236Environment variables aren't a level in this stack. When a behavior has both a shell variable and a settings key, which one applies is decided per pair, not by level: `ANTHROPIC_MODEL` exported in your shell applies over the `model` key from any file, while `ANTHROPIC_DEFAULT_MODEL` applies only when no file sets `model`. The [environment variables reference](https://code.claude.com/docs/en/env-vars.md#precedence) says which keys have a pair and which one Claude Code reads first. An `env` block inside a settings file is an ordinary key and follows the levels above.

Details

183> "Read(./secrets/**)"183> "Read(./secrets/**)"

184> ]184> ]

185> },185> },

186> // Before every Bash command, run a script in the repo that can block it186> // Before every Bash tool call, run a script in the repo that can block it

187> "hooks": {187> "hooks": {

188> "PreToolUse": [188> "PreToolUse": [

189> {189> {

Details

17| Key | Description | Topic | Scope |17| Key | Description | Topic | Scope |

18| :- | :- | :- | :- |18| :- | :- | :- | :- |

19| [`advisorModel`](#advisormodel) | Pick which model answers when Claude asks the [advisor tool](https://code.claude.com/docs/en/advisor.md) | Model and responses | Any file |19| [`advisorModel`](#advisormodel) | Pick which model answers when Claude asks the [advisor tool](https://code.claude.com/docs/en/advisor.md) | Model and responses | Any file |

20| [`agent`](#agent) | Start every session as a named [subagent](https://code.claude.com/docs/en/sub-agents.md) with its prompt, tools, and model | Agents, sessions, and worktrees | Any file |20| [`agent`](#agent) | Start sessions as a named [subagent](https://code.claude.com/docs/en/sub-agents.md) with its prompt, tools, and model | Agents, sessions, and worktrees | Any file |

21| [`agentPushNotifEnabled`](#agentpushnotifenabled) | Let Claude send a [push notification to your phone](https://code.claude.com/docs/en/remote-control.md#mobile-push-notifications) when it decides to | Remote, desktop, and notifications | Any file |21| [`agentPushNotifEnabled`](#agentpushnotifenabled) | Let Claude send a [push notification to your phone](https://code.claude.com/docs/en/remote-control.md#mobile-push-notifications) when it decides to | Remote, desktop, and notifications | Any file |

22| [`allowAllClaudeAiMcps`](#allowallclaudeaimcps) | Load the [claude.ai connectors](https://code.claude.com/docs/en/mcp.md) Claude Code fetches itself alongside a deployed [`managed-mcp.json`](https://code.claude.com/docs/en/managed-mcp#exclusive-control-with-managed-mcp-json) | MCP | Managed |22| [`allowAllClaudeAiMcps`](#allowallclaudeaimcps) | Load the [claude.ai connectors](https://code.claude.com/docs/en/mcp.md) Claude Code fetches itself alongside a deployed [`managed-mcp.json`](https://code.claude.com/docs/en/managed-mcp#exclusive-control-with-managed-mcp-json) | MCP | Managed |

23| [`allowClaudeInChromeWithManagedMcp`](#allowclaudeinchromewithmanagedmcp) | Let the built-in [Claude in Chrome](https://code.claude.com/docs/en/chrome.md) server run alongside a deployed [`managed-mcp.json`](https://code.claude.com/docs/en/managed-mcp#exclusive-control-with-managed-mcp-json) | MCP | Managed |23| [`allowClaudeInChromeWithManagedMcp`](#allowclaudeinchromewithmanagedmcp) | Let the built-in [Claude in Chrome](https://code.claude.com/docs/en/chrome.md) server run alongside a deployed [`managed-mcp.json`](https://code.claude.com/docs/en/managed-mcp#exclusive-control-with-managed-mcp-json) | MCP | Managed |


2527}2527}

2528```2528```

2529 2529 

2530In a `-p` run or an Agent SDK session, Claude Code ignores this key. The SDK turns checkpointing on with its `enableFileCheckpointing` option, and a bare `-p` run needs `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true`. See [File checkpointing in the Agent SDK](https://code.claude.com/docs/en/agent-sdk/file-checkpointing.md).2530In a `-p` run or an Agent SDK session, Claude Code ignores this key unless your organization's [managed settings](https://code.claude.com/docs/en/managed-settings.md) set it to `false`, and then checkpointing stays off. That exception requires Claude Code v2.1.331 or later. Without that `false`, turn checkpointing on with the SDK's `enableFileCheckpointing` option, or with `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true` in a bare `-p` run. See [File checkpointing in the Agent SDK](https://code.claude.com/docs/en/agent-sdk/file-checkpointing.md).

2531 2531 

2532### `idleCompaction`2532### `idleCompaction`

2533 2533 

Details

92If recipients can't open a link, check for these causes:92If recipients can't open a link, check for these causes:

93 93 

94* **Visibility**: the session is **Private**, or the recipient isn't signed in to claude.ai or is outside your organization on a **Team** link. Check [who can open the link](#share-a-session).94* **Visibility**: the session is **Private**, or the recipient isn't signed in to claude.ai or is outside your organization on a **Team** link. Check [who can open the link](#share-a-session).

95* **Free plan**: the recipient is signed in on a Free account and lands on the upgrade page. Ask them to sign in with an account that has [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md).

96* **Repository access**: the link [requires repository access](#share-a-session), and the recipient's GitHub account can't read the repository. Ask them to [connect an account](https://code.claude.com/docs/en/web-quickstart.md#connect-github) that can.95* **Repository access**: the link [requires repository access](#share-a-session), and the recipient's GitHub account can't read the repository. Ask them to [connect an account](https://code.claude.com/docs/en/web-quickstart.md#connect-github) that can.

97* **Uploaded or non-GitHub code**: the link requires repository access, and the code was [uploaded](https://code.claude.com/docs/en/claude-code-on-the-web.md#send-local-repositories-without-github) or is on a Git host such as GitLab or Bitbucket. Share from a session whose repository is on github.com and wasn't uploaded.96* **Uploaded or non-GitHub code**: the link requires repository access, and the code was [uploaded](https://code.claude.com/docs/en/claude-code-on-the-web.md#send-local-repositories-without-github) or is on a Git host such as GitLab or Bitbucket. Share from a session whose repository is on github.com and wasn't uploaded.

98* **Invalid link**: the share link may not match the address in your browser, and a **Public** link changes when you stop sharing and share again. Copy the current link from **Share** and send it.97* **Invalid link**: the share link may not match the address in your browser, and a **Public** link changes when you stop sharing and share again. Copy the current link from **Share** and send it.

99* **Organization setting**: [**Share cloud sessions** is off](#sharing-is-turned-off-for-your-organization) for the organization. Ask an Owner to turn it back on.98* **Organization setting**: [**Share cloud sessions** is off](#sharing-is-turned-off-for-your-organization) for the organization. Ask an Owner to turn it back on.

100* **Upgraded plan**: you shared a **Public** link, then upgraded your plan to Team or Enterprise. The link follows the rules for [Enterprise and Team accounts](#share-from-an-enterprise-or-team-account).99* **Upgraded plan**: you shared a **Public** link, then upgraded your plan to Team or Enterprise. The link follows the rules for [Enterprise and Team accounts](#share-from-an-enterprise-or-team-account).

100* **Downgraded plan**: you shared a **Public** link, then moved to the Free plan. [Upgrade](https://claude.ai/upgrade) to a Max, Ultra, or Pro plan, and the same link opens with no further step.

101 101 

102You can't restore the link in these cases:102You can't restore the link in these cases:

103 103 

ship-command.md +2 −2

Details

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 clone. On a host other than GitHub, see [Watch a branch on another host](#watch-a-branch-on-another-host)58* **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 starts. In plan mode, `/ship` doesn't start59* **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 [Manual mode and `acceptEdits` mode](https://code.claude.com/docs/en/permission-modes#available-modes), Claude waits at each prompt. In `bypassPermissions` mode, no watch starts. With v2.1.331 or later, `/ship` doesn't start in plan mode

60 60 

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.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 


86 86 

87* **Someone else's pull request is open for the branch**: `/ship` doesn't commit or push your work, and no watch starts87* **Someone else's pull request is open for the branch**: `/ship` doesn't commit or push your work, and no watch starts

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)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 here89* **Your own pull request is already open for the branch**: `/ship` can commit your uncommitted changes, then push them and your unpushed commits onto it. [In some cases](https://code.claude.com/docs/en/ship-command-troubleshooting.md#your-pull-request-is-already-open), such as a public repository or auto-merge turned on, it doesn't commit your changes. 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` again90* **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` again91* **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

92 92 

Details

107 107 

108| Message | What it means | What to do |108| Message | What it means | What to do |

109| :- | :- | :- |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 |110| `/ship didn't commit your uncommitted work` | Causes include a public repository, auto-merge turned on, and a merge or cherry-pick in progress. If [no watch can start](#no-watch-started), the review covers your uncommitted work. Otherwise, a review doesn't cover it, 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) | 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 |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 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).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).


239 239 

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.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.

241 241 

242### Keep a custom /ship or /steward without renaming

243 

244If you've already created your own skill or command called `/ship` or `/steward` and don't want the built-in versions to override it, you can turn them off. To do that, use the `CLAUDE_CODE_DISABLE_SHIP` environment variable, which turns off both together and requires Claude Code v2.1.331 or later. Before you set it, [remove any `"off"` entry](#a-skilloverrides-entry-turns-off-%2Fship-or-%2Fsteward) for your command under `skillOverrides`.

245 

246Add this [`env`](https://code.claude.com/docs/en/settings-reference#env) entry to your [user settings file](https://code.claude.com/docs/en/settings.md#settings-files-and-who-they-affect), or to a project's `.claude/settings.json` for everyone who starts sessions in its top folder, then restart Claude Code:

247 

248```json theme={null}

249{

250 "env": {

251 "CLAUDE_CODE_DISABLE_SHIP": "1"

252 }

253}

254```

255 

256To check that your command loaded, type `/` at the Claude Code prompt and look for its description or first line.

257 

258If your command is named `steward` and the repository has a `.claude/skills/steward/SKILL.md` file, check [which one runs](https://code.claude.com/docs/en/skills.md#resolve-skills-that-share-a-name).

259 

242## Related resources260## Related resources

243 261 

244* [`/ship` and `/steward`](https://code.claude.com/docs/en/ship-command): what the commands do, how to run them, and what limits Claude during a watch262* [`/ship` and `/steward`](https://code.claude.com/docs/en/ship-command): what the commands do, how to run them, and what limits Claude during a watch

skills.md +4 −2

Details

258* A session that doesn't use a sign-in stored by `/login`, such as one that authenticates with an API key, or one where `ANTHROPIC_AUTH_TOKEN`, `CLAUDE_CODE_OAUTH_TOKEN`, or an `apiKeyHelper` script supplies the credential258* A session that doesn't use a sign-in stored by `/login`, such as one that authenticates with an API key, or one where `ANTHROPIC_AUTH_TOKEN`, `CLAUDE_CODE_OAUTH_TOKEN`, or an `apiKeyHelper` script supplies the credential

259* A session that doesn't fetch feature flags, such as one on Amazon Bedrock or one where you set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`259* A session that doesn't fetch feature flags, such as one on Amazon Bedrock or one where you set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`

260* A session in [bare mode](https://code.claude.com/docs/en/headless.md#start-faster-with-bare-mode) or one you start with `--safe-mode`260* A session in [bare mode](https://code.claude.com/docs/en/headless.md#start-faster-with-bare-mode) or one you start with `--safe-mode`

261* A session where your organization's managed settings [lock skills to plugin sources](https://code.claude.com/docs/en/settings-reference.md#strictpluginonlycustomization-skills), or one you start with a [`--setting-sources`](https://code.claude.com/docs/en/cli-reference#cli-flags) list that leaves out `user`261* A session where managed settings [lock skills to plugin sources](https://code.claude.com/docs/en/settings-reference.md#strictpluginonlycustomization-skills), or one you start with a [`--setting-sources`](https://code.claude.com/docs/en/cli-reference#cli-flags) list that omits `user`

262 262 

263If you sign in with `/login` during a session, restart Claude Code to start syncing.263If you sign in with `/login` during a session, restart Claude Code to start syncing.

264 264 


425| `user-invocable` | No | Set to `false` when only Claude should invoke the skill: Claude Code hides it from the `/` menu and doesn't run it when you type `/name`. Use for background knowledge users shouldn't invoke directly. Default: `true`. |425| `user-invocable` | No | Set to `false` when only Claude should invoke the skill: Claude Code hides it from the `/` menu and doesn't run it when you type `/name`. Use for background knowledge users shouldn't invoke directly. Default: `true`. |

426| `allowed-tools` | No | Tools Claude can use without asking permission during the turn that invokes this skill. The grant clears when you send your next message. Accepts a space- or comma-separated string, or a YAML list. See [Pre-approve tools for a skill](#pre-approve-tools-for-a-skill). |426| `allowed-tools` | No | Tools Claude can use without asking permission during the turn that invokes this skill. The grant clears when you send your next message. Accepts a space- or comma-separated string, or a YAML list. See [Pre-approve tools for a skill](#pre-approve-tools-for-a-skill). |

427| `disallowed-tools` | No | Tools removed from Claude's available pool while this skill is active. Use for autonomous skills that should never call certain tools, such as `AskUserQuestion` for a background loop. Accepts a space- or comma-separated string, or a YAML list. The restriction clears when you send your next message. Like deny rules, the field can't remove [`EndConversation`](https://code.claude.com/docs/en/tools-reference#endconversation-tool-behavior) while any other tool remains. |427| `disallowed-tools` | No | Tools removed from Claude's available pool while this skill is active. Use for autonomous skills that should never call certain tools, such as `AskUserQuestion` for a background loop. Accepts a space- or comma-separated string, or a YAML list. The restriction clears when you send your next message. Like deny rules, the field can't remove [`EndConversation`](https://code.claude.com/docs/en/tools-reference#endconversation-tool-behavior) while any other tool remains. |

428| `model` | No | Model to use when this skill is active. The override applies for the rest of the current turn and isn't saved to settings. The session model resumes when you send your next prompt. Accepts the same values as [`/model`](https://code.claude.com/docs/en/model-config), or `inherit` to keep the active model. A value excluded by your organization's [`availableModels`](https://code.claude.com/docs/en/model-config#restrict-model-selection) allowlist isn't used, and the session keeps its current model. In [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode), and in [plan mode while the classifier reviews commands](https://code.claude.com/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode), a model that auto mode doesn't support also isn't used, and the session keeps its current model. With `context: fork`, the value sets the [forked subagent's model](#run-skills-in-a-subagent) instead, and an excluded value follows the [same rules as a subagent model override](https://code.claude.com/docs/en/model-config.md#restrict-model-selection). |428| `model` | No | Model for the turn when you [run this skill with `/name`](#where-you-write-the-skills-name). Accepts [`/model`](https://code.claude.com/docs/en/model-config) values, or `inherit` for the active model. When Claude runs the skill, the session keeps its model. The same happens when your [organization blocks the value](https://code.claude.com/docs/en/model-config.md#restrict-model-selection), a [plan-mode upgrade](https://code.claude.com/docs/en/model-config.md#opusplan-model-setting) is active, or [auto mode's classifier is on](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) and doesn't support it. With `context: fork`, the value is the forked subagent's [per-invocation model](https://code.claude.com/docs/en/sub-agents.md#choose-a-model). |

429| `effort` | No | [Effort level](https://code.claude.com/docs/en/model-config.md#adjust-effort-level) for the rest of the current turn. Overrides the session effort level, but not the [`CLAUDE_CODE_EFFORT_LEVEL`](https://code.claude.com/docs/en/env-vars#variables) environment variable. With `context: fork`, the value sets the forked subagent's effort level instead. When you omit it, the level comes from the [effort resolution order](https://code.claude.com/docs/en/model-config.md#adjust-effort-level). For a fork on another model, see [Effort level of subagents and teammates](https://code.claude.com/docs/en/model-config.md#effort-level-of-subagents-and-teammates). Options: `low`, `medium`, `high`, `xhigh`, `max`; available levels depend on the model. |429| `effort` | No | [Effort level](https://code.claude.com/docs/en/model-config.md#adjust-effort-level) for the rest of the current turn. Overrides the session effort level, but not the [`CLAUDE_CODE_EFFORT_LEVEL`](https://code.claude.com/docs/en/env-vars#variables) environment variable. With `context: fork`, the value sets the forked subagent's effort level instead. When you omit it, the level comes from the [effort resolution order](https://code.claude.com/docs/en/model-config.md#adjust-effort-level). For a fork on another model, see [Effort level of subagents and teammates](https://code.claude.com/docs/en/model-config.md#effort-level-of-subagents-and-teammates). Options: `low`, `medium`, `high`, `xhigh`, `max`; available levels depend on the model. |

430| `context` | No | Set to `fork` to run in a forked subagent context. See [Run skills in a subagent](#run-skills-in-a-subagent). |430| `context` | No | Set to `fork` to run in a forked subagent context. See [Run skills in a subagent](#run-skills-in-a-subagent). |

431| `agent` | No | Which subagent type to use when `context: fork` is set. |431| `agent` | No | Which subagent type to use when `context: fork` is set. |


821 821 

822In auto mode, a command that would otherwise need your approval doesn't abort the invocation. The skill loads with an instruction telling Claude to run the command first, and Claude's own call then goes through [auto mode's usual checks](https://code.claude.com/docs/en/permission-modes.md#how-the-classifier-evaluates-actions). The invocation still aborts in a [forked skill](#run-skills-in-a-subagent) that sets `agent`, and in a session where Claude doesn't have the [shell tool that runs injected commands](#how-injected-commands-run).822In auto mode, a command that would otherwise need your approval doesn't abort the invocation. The skill loads with an instruction telling Claude to run the command first, and Claude's own call then goes through [auto mode's usual checks](https://code.claude.com/docs/en/permission-modes.md#how-the-classifier-evaluates-actions). The invocation still aborts in a [forked skill](#run-skills-in-a-subagent) that sets `agent`, and in a session where Claude doesn't have the [shell tool that runs injected commands](#how-injected-commands-run).

823 823 

824`PreToolUse` hooks don't fire for injected commands that run as the skill loads. To log or block the ones that pass the permission check, use a [`PreSkillShellCommand` hook](https://code.claude.com/docs/en/hooks#preskillshellcommand).

825 

824### Run skills in a subagent826### Run skills in a subagent

825 827 

826Add `context: fork` to your frontmatter when you want a skill to run in isolation. Claude Code starts a new subagent of the type set in the `agent` field and gives it the skill content as its prompt. The subagent doesn't see your conversation history, so the skill's instructions have to stand on their own.828Add `context: fork` to your frontmatter when you want a skill to run in isolation. Claude Code starts a new subagent of the type set in the `agent` field and gives it the skill content as its prompt. The subagent doesn't see your conversation history, so the skill's instructions have to stand on their own.

slack.md +4 −245

Details

4 4 

5# Claude Code in Slack5# Claude Code in Slack

6 6 

7> Delegate coding tasks from Slack. This earlier version answers mentions only from Pro, Max, and Ultra accounts in workspaces not connected to Claude Tag.7> What to use in place of the earlier Claude Code in Slack, on Team, Enterprise, Pro, Max, and Ultra plans.

8 8 

9> [!WARNING]9The earlier Claude Code in Slack is retired. In a workspace that isn't connected to Claude Tag, `@Claude` replies that the workspace isn't set up for Claude Tag.

10>

11> This earlier Claude Code in Slack answers channel @mentions only from Pro, Max, and Ultra accounts, and only in a Slack workspace that no organization has connected to [Claude Tag](https://claude.com/product/tag). Each session runs under an individual user's account. Claude Tag runs @Claude as your organization's shared identity with admin-configured access.

12>

13> * **Pro, Max, and Ultra plans:** Claude Tag isn't available on individual plans, so [set up this version](#setting-up-claude-code-in-slack) in a workspace that isn't connected to Claude Tag.

14> * **Team and Enterprise plans:** your existing Slack app and @Claude handle stay. [Set up Claude Tag](https://claude.com/docs/claude-tag/overview) for a new workspace; to move one that already uses this version, see [Migrate from the earlier Claude in Slack](https://claude.com/docs/claude-tag/admins/migrate-from-earlier).

15> * **Notice instead of an answer:** look up the [setup notice](#this-workspace-isnt-set-up-for-claude-tag-yet) or the [retirement notice](#the-legacy-claude-in-slack-bot-is-retired) that @Claude replied with.

16 10 

17Claude Code in Slack brings the power of Claude Code directly into your Slack workspace. When you mention `@Claude` with a coding task, Claude automatically detects the intent and creates a Claude Code cloud session, allowing you to delegate development work without leaving your team conversations.11* **Team and Enterprise plans:** use [Claude Tag](https://claude.com/docs/claude-tag/overview) if it's in your channel. If it isn't, see [how to set it up](https://claude.com/docs/claude-tag/admins/setup-overview). To move a workspace from the earlier version, see [the migration guide](https://claude.com/docs/claude-tag/admins/migrate-from-earlier).

18 12* **Pro, Max, and Ultra plans:** Claude Tag isn't available on individual plans. Start tasks in [Projects](https://code.claude.com/docs/en/claude-projects.md) if your account has them, or in [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md).

19This integration is built on the existing Claude for Slack app but adds intelligent routing to Claude Code cloud sessions for coding-related requests. Each session runs under your own Claude account, using your connected repositories and your plan limits.

20 

21## Use cases

22 

23* **Bug investigation and fixes**: Describe a bug and ask Claude to investigate and fix it.

24* **Quick code reviews and modifications**: Have Claude implement small features or refactor code.

25* **Parallel task execution**: Kick off coding tasks in Slack while you continue other work, receiving notifications when complete.

26 

27## Prerequisites

28 

29Before using Claude Code in Slack, ensure you have the following:

30 

31| Requirement | Details |

32| :- | :- |

33| Claude Plan | Pro, Max, or Ultra |

34| Slack workspace | Not connected to [Claude Tag](https://claude.com/docs/claude-tag/overview) by any organization. If @Claude replies with the [retirement notice](#the-legacy-claude-in-slack-bot-is-retired), the workspace is connected |

35| Cloud sessions | [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) are enabled for your account |

36| GitHub Account | Connected at [claude.ai/code](https://claude.ai/code) with at least one repository authenticated |

37| Slack Authentication | Your Slack account linked to your Claude account via the Claude app |

38 

39## Setting up Claude Code in Slack

40 

41**1. Install the Claude App in Slack**

42 

43A workspace administrator must install the Claude app from the Slack App Marketplace. Visit the [Slack App Marketplace](https://slack.com/marketplace/A08SF47R6P4) and click "Add to Slack" to begin the installation process.

44 

45**2. Connect your Claude account**

46 

47After the app is installed, authenticate your individual Claude account:

48 

491. Open the Claude app in Slack by clicking on "Claude" in your Apps section

502. Open the App Home tab

513. Click **Connect Claude account** to link your Slack account with your Claude account

524. Complete the authentication flow in your browser

53 

54**3. Configure cloud sessions**

55 

56Ensure cloud sessions are properly configured for your account:

57 

58* Visit [claude.ai/code](https://claude.ai/code) and sign in with the same account you connected to Slack

59* Connect your GitHub account if not already connected

60* Authenticate at least one repository that you want Claude to work with

61 

62**4. Choose your routing mode**

63 

64After connecting your accounts, configure how Claude handles your messages in Slack. Open the Claude App Home in Slack to find the **Routing Mode** setting.

65 

66| Mode | Behavior |

67| :- | :- |

68| **Code only** | Claude routes all @mentions to Claude Code sessions. Best for teams using Claude in Slack exclusively for development tasks. |

69| **Code + Chat** | Claude analyzes each message and intelligently routes between Claude Code (for coding tasks) and Claude Chat (for writing, analysis, and general questions). Best for teams who want a single @Claude entry point for all types of work. |

70 

71> [!NOTE]

72>

73> In Code + Chat mode, if Claude answers in Chat but you wanted a coding session, click **Switch to code repo...** on the reply and select a repository. Claude then starts a Claude Code session with your message instead.

74 

75**5. Add Claude to channels**

76 

77Claude is not automatically added to any channels after installation. To use Claude in a channel, invite it by typing `/invite @Claude` in that channel. Claude can only respond to @mentions in channels where it has been added.

78 

79## How it works

80 

81### Automatic detection

82 

83In Code + Chat routing mode, when you mention @Claude in a Slack channel or thread, Claude automatically detects whether your message is a coding task. Coding tasks go to a Claude Code cloud session. Anything else gets a regular chat reply. In Code only mode, every @mention goes to Claude Code.

84 

85You can also explicitly tell Claude to handle a request as a coding task, even if it doesn't automatically detect it.

86 

87> [!NOTE]

88>

89> Claude Code in Slack only works in channels (public or private). It does not work in direct messages (DMs).

90 

91### Context gathering

92 

93* **From threads**: when you first @mention Claude in a thread, it gathers context from your messages and its own in that thread.

94* **From channels**: when you @mention Claude directly in a channel, it looks at your recent messages and its own in that channel, and at the channel's name, topic, and description.

95 

96This context helps Claude understand the problem, select the appropriate repository, and inform its approach to the task. To give Claude something a teammate wrote, such as an error report, paste its text into the message where you @mention Claude.

97 

98> [!WARNING]

99>

100> When @Claude is invoked in Slack, Claude is given access to the conversation context to better understand your request. Claude may follow directions from other messages in the context, so users should make sure to only use Claude in trusted Slack conversations.

101 

102### Session flow

103 

1041. **Initiation**: You @mention Claude with a coding request

1052. **Detection**: Claude analyzes your message and detects coding intent

1063. **Session creation**: A new Claude Code session is created on claude.ai/code

1074. **Progress updates**: Claude posts status updates to your Slack thread as work progresses

1085. **Completion**: When finished, Claude updates its message in the thread with its final response and action buttons, and sends you a direct message linking to it

1096. **Review**: Click **View session** to see the full transcript, or **Create PR** to open a pull request

110 

111## User interface elements

112 

113### Message actions

114 

115* **View session**: Opens the full Claude Code session in your browser where you can see all work performed, continue the session, or make additional requests.

116* **Create PR**: Opens GitHub's compare page for the session's branch, where you create the pull request. It appears on the status message Claude posted when the session started, once the session finishes.

117* **Switch to code repo...**: If Claude responds in Chat but you wanted a coding session, click this button and select a repository, and Claude starts a Claude Code session with your original request.

118 

119### Repository selection

120 

121Claude automatically selects a repository based on context from your Slack conversation. If Claude can't tell which repository you mean, it asks you to choose: click **Select repository** and select one from the list.

122 

123## Access and permissions

124 

125### User-level access

126 

127| Access Type | Requirement |

128| :- | :- |

129| Claude Code Sessions | Each user runs sessions under their own Claude account |

130| Usage & Rate Limits | Sessions count against the individual user's plan limits |

131| Repository Access | Users can only access repositories they've personally connected |

132| Session History | Sessions appear in your Claude Code history on claude.ai/code |

133 

134### Workspace-level access

135 

136Slack workspace administrators control whether the Claude app is available in their workspace:

137 

138| Control | Description |

139| :- | :- |

140| App installation | Workspace admins decide whether to install the Claude app from the Slack App Marketplace |

141| Enterprise Grid distribution | For Enterprise Grid organizations, organization admins can control which workspaces have access to the Claude app |

142| App removal | Removing the app from a workspace immediately revokes access for all users in that workspace |

143 

144### Channel-based access control

145 

146Installing the app doesn't add Claude to any channels. Claude responds to @mentions only in channels where it has been added; invite it with `/invite @Claude`. It works in both public and private channels. Admins can control who uses Claude Code by managing which channels Claude is invited to and who has access to those channels. This adds a layer of access control beyond workspace-level permissions.

147 

148## What's accessible where

149 

150**In Slack**: You'll see status updates, completion summaries, and action buttons. The full transcript is preserved and always accessible.

151 

152**At claude.ai/code**: The complete Claude Code session with full conversation history, all code changes, and file operations. Sessions stay in your Claude Code history at [claude.ai/code](https://claude.ai/code), where you can continue past sessions, reference them, or create pull requests.

153 

154For Enterprise and Team accounts, sessions created from Claude in Slack are

155automatically visible to the organization. See [cloud session sharing](https://code.claude.com/docs/en/claude-code-on-the-web.md#share-sessions)

156for more details.

157 

158## Best practices

159 

160### Writing effective requests

161 

162* **Be specific**: Include file names, function names, or error messages when relevant.

163* **Provide context**: Mention the repository or project.

164* **Define success**: Explain what "done" looks like. Should Claude write tests? Update documentation? Create a PR?

165 

166### When to use Slack vs. web

167 

168**Use Slack when**: You want to start a task asynchronously, or you're collaborating with teammates who need visibility.

169 

170**Use the web directly when**: You need to upload files, want real-time interaction during development, or are working on longer, more complex tasks.

171 

172## Troubleshooting

173 

174### "This workspace isn't set up for Claude Tag yet"

175 

176@Claude replies in the thread with this notice instead of an answer when both of these are true:

177 

178* No organization has connected your Slack workspace to [Claude Tag](https://claude.com/docs/claude-tag/overview).

179* The Claude account you linked in Slack isn't on a Pro, Max, or Ultra plan.

180 

181Claude Tag is available on Team and Enterprise plans. To connect the workspace, start with the `@Claude connect` command the notice names, then follow [Set up Claude Tag](https://claude.com/docs/claude-tag/overview).

182 

183### "The legacy Claude in Slack bot is retired"

184 

185The notice opens with `The legacy Claude in Slack bot is retired effective October 5, 2026 and no longer responds in channels.` Your Slack workspace is connected to a Claude organization. The earlier version is still selected for the channel, the workspace, or the organization default in that organization's Claude Tag settings. The notice doesn't depend on your own plan, so Pro, Max, and Ultra accounts get it too.

186 

187If you're an Owner of that organization, open [Claude admin settings](https://claude.ai/admin-settings/claude-tag) and turn on Claude Tag for the channel. To fix every channel that inherits the setting, change it on the workspace or the organization default instead. For the full move, see [Migrate from the earlier Claude in Slack](https://claude.com/docs/claude-tag/admins/migrate-from-earlier). If you're not an Owner, send this entry to one.

188 

189### "Claude Code is not enabled for your account"

190 

191This error means your Claude account has no cloud environment yet. Sign in at [claude.ai/code](https://claude.ai/code) once with the same account you connected to Slack and finish [web onboarding](https://code.claude.com/docs/en/web-quickstart.md#connect-github), which creates your default cloud environment or asks you to create it. The error clears on your next mention. Each user must do this individually.

192 

193### Sessions not starting

194 

1951. Verify your Claude account is connected in the Claude App Home

1962. Check that cloud sessions are enabled for your account

1973. Ensure you have at least one GitHub repository connected to Claude Code

198 

199### Sessions from a Claude Tag channel fail to start

200 

201This entry applies to workspaces using [Claude Tag](https://claude.com/docs/claude-tag/overview). If you created the channel's cloud environment at [claude.ai/code](https://claude.ai/code), it belongs to your personal account, and Claude can't start channel sessions in a personal environment. Claude Code fails the session immediately, and retrying doesn't help.

202 

203If you're an Owner and the environment is your own, [share it with the organization](https://code.claude.com/docs/en/cloud-environments.md#organization-shared-environments) from the environment selector. Otherwise, an Owner recreates it as an organization-shared environment from the **Cloud environments** page in [admin settings](https://claude.ai/admin-settings).

204 

205You can apply it in two ways:

206 

207* Set it as the organization default at [claude.ai/admin-settings/claude-code](https://claude.ai/admin-settings/claude-code).

208* [Set it on the channel](https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one) in the Claude Tag admin settings.

209 

210If you're not an Owner, send this entry to one.

211 

212### Repository not showing

213 

2141. Connect the repository at [claude.ai/code](https://claude.ai/code)

2152. Verify your GitHub permissions for that repository

2163. Try disconnecting and reconnecting your GitHub account

217 

218### Wrong repository selected

219 

220Include the repository name in your request for more accurate selection.

221 

222### Authentication errors

223 

2241. Disconnect and reconnect your Claude account in the App Home

2252. Ensure you're signed into the correct Claude account in your browser

226 

227## Current limitations

228 

229* **GitHub only**: repositories must be on GitHub.

230* **One PR at a time**: each session can create one pull request.

231* **Cloud session access required**: users need access to [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md).

232 

233## Related resources

234 

235> [card] [Claude Code in the cloud](https://code.claude.com/docs/en/claude-code-on-the-web.md)

236>

237> Learn more about cloud sessions

238 

239> [card] [Claude for Slack](https://claude.com/claude-and-slack)

240>

241> General Claude for Slack documentation

242 

243> [card] [Claude Tag](https://claude.com/docs/claude-tag/overview)

244>

245> Organization-managed @Claude in Slack with admin-configured access

246 

247> [card] [Slack App Marketplace](https://slack.com/marketplace/A08SF47R6P4)

248>

249> Install the Claude app from the Slack Marketplace

250 

251> [card] [Claude Help Center](https://support.claude.com)

252>

253> Get additional support

sub-agents.md +6 −6

Details

310| `background` | No | Set to `true` to keep this subagent in the background even when Claude asks to wait for it. By default, custom subagents Claude spawns from the main conversation already [start in the background](#run-subagents-in-foreground-or-background) |310| `background` | No | Set to `true` to keep this subagent in the background even when Claude asks to wait for it. By default, custom subagents Claude spawns from the main conversation already [start in the background](#run-subagents-in-foreground-or-background) |

311| `omitClaudeMd` | No | Set to `true` to start this subagent without the user, project, and local CLAUDE.md files in its [initial context](#what-loads-at-startup); [managed policy files](https://code.claude.com/docs/en/memory.md#how-claude-md-files-load) still load, except for [managed subagents](#choose-the-subagent-scope). Use it for subagents that take everything they need from the delegation prompt. Ignored when the agent runs as the main session agent via `--agent` or the `agent` setting. Requires Claude Code v2.1.271 or later |311| `omitClaudeMd` | No | Set to `true` to start this subagent without the user, project, and local CLAUDE.md files in its [initial context](#what-loads-at-startup); [managed policy files](https://code.claude.com/docs/en/memory.md#how-claude-md-files-load) still load, except for [managed subagents](#choose-the-subagent-scope). Use it for subagents that take everything they need from the delegation prompt. Ignored when the agent runs as the main session agent via `--agent` or the `agent` setting. Requires Claude Code v2.1.271 or later |

312| `effort` | No | Effort level when this subagent is active. Overrides the session effort level, but not the [`CLAUDE_CODE_EFFORT_LEVEL`](https://code.claude.com/docs/en/env-vars#variables) environment variable. Options: `low`, `medium`, `high`, `xhigh`, `max`; available levels depend on the model. See [Choose an effort level](#choose-an-effort-level) |312| `effort` | No | Effort level when this subagent is active. Overrides the session effort level, but not the [`CLAUDE_CODE_EFFORT_LEVEL`](https://code.claude.com/docs/en/env-vars#variables) environment variable. Options: `low`, `medium`, `high`, `xhigh`, `max`; available levels depend on the model. See [Choose an effort level](#choose-an-effort-level) |

313| `isolation` | No | Set to `worktree` to run the subagent in a temporary [git worktree](https://code.claude.com/docs/en/worktrees.md), giving it an isolated copy of the repository branched by default from your [default branch](https://code.claude.com/docs/en/worktrees.md#choose-the-base-branch) rather than the parent session's `HEAD`. The worktree is automatically cleaned up if the subagent makes no changes |313| `isolation` | No | Set to `worktree` to run the subagent in a temporary [git worktree](https://code.claude.com/docs/en/worktrees.md), giving it an isolated copy of the repository. By default, the copy branches from your [default branch](https://code.claude.com/docs/en/worktrees.md#choose-the-base-branch) rather than the parent session's `HEAD`. Claude Code [can remove the worktree](https://code.claude.com/docs/en/worktrees.md#isolate-subagents-with-worktrees) if the subagent makes no changes |

314| `color` | No | Display color for the subagent in the task list and transcript. Accepts `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, or `cyan` |314| `color` | No | Display color for the subagent in the task list and transcript. Accepts `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, or `cyan` |

315| `initialPrompt` | No | Auto-submitted as the first user turn when this agent runs as the main session agent (via `--agent` or the `agent` setting). [Commands](https://code.claude.com/docs/en/commands.md) and [skills](https://code.claude.com/docs/en/skills.md) are processed. Prepended to any user-provided prompt. Ignored for [plugin subagents](#choose-the-subagent-scope) |315| `initialPrompt` | No | Auto-submitted as the first user turn when this agent runs as the main session agent (via `--agent` or the `agent` setting). [Commands](https://code.claude.com/docs/en/commands.md) and [skills](https://code.claude.com/docs/en/skills.md) are processed. Prepended to any user-provided prompt. Ignored for [plugin subagents](#choose-the-subagent-scope) |

316| `experimental` | No | Map of experimental options. Set its `cacheTtl` key to `5m` or `1h` to choose the [prompt cache lifetime](https://code.claude.com/docs/en/prompt-caching.md#choose-the-ttl-yourself) for this subagent's requests, at the frontmatter's place in the [cache lifetime precedence](https://code.claude.com/docs/en/prompt-caching.md#choose-the-ttl-yourself). Claude Code ignores any other value, ignores `1h` while your Claude subscription is using usage credits, and reads the field only from subagent files. Requires Claude Code v2.1.248 or later |316| `experimental` | No | Map of experimental options. Set its `cacheTtl` key to `5m` or `1h` to choose the [prompt cache lifetime](https://code.claude.com/docs/en/prompt-caching.md#choose-the-ttl-yourself) for this subagent's requests, at the frontmatter's place in the [cache lifetime precedence](https://code.claude.com/docs/en/prompt-caching.md#choose-the-ttl-yourself). Claude Code ignores any other value, ignores `1h` while your Claude subscription is using usage credits, and reads the field only from subagent files. Requires Claude Code v2.1.248 or later |


410 410 

411#### When an allowlist blocks a subagent model411#### When an allowlist blocks a subagent model

412 412 

413If your organization's [`availableModels`](https://code.claude.com/docs/en/model-config#restrict-model-selection) allowlist blocks the model set for a subagent other than [`web-fetch`](https://code.claude.com/docs/en/tools-reference#which-model-the-web-fetch-subagent-runs-on), the subagent runs on the first of these that applies:413If an [`availableModels`](https://code.claude.com/docs/en/model-config#restrict-model-selection) allowlist in your settings blocks the model set for a subagent other than [`web-fetch`](https://code.claude.com/docs/en/tools-reference#which-model-the-web-fetch-subagent-runs-on), the subagent runs on the first of these that applies:

414 414 

4151. For a blocked family alias, the newest permitted version in that family, on [providers that support this substitution](https://code.claude.com/docs/en/model-config.md#restrict-model-selection)4151. For a blocked family alias, the newest permitted version in that family, on [providers that support this substitution](https://code.claude.com/docs/en/model-config.md#restrict-model-selection)

4162. The model in `CLAUDE_CODE_SUBAGENT_MODEL`, if you set it, under these same rules4162. The model in `CLAUDE_CODE_SUBAGENT_MODEL`, if you set it, under these same rules


458* `WaitForMcpServers`458* `WaitForMcpServers`

459* `Workflow`459* `Workflow`

460 460 

461The second filter applies to subagents running in the background. `Agent` and `ExitPlanMode` follow the first filter's conditions wherever the subagent runs. A background subagent keeps every MCP tool, and [`SubagentHandback`](https://code.claude.com/docs/en/tools-reference) if it reports through that tool. It also keeps `Read`, `Grep`, `Glob`, `LSP`, `Bash`, `PowerShell`, `Edit`, `Write`, `NotebookEdit`, `WebFetch`, `WebSearch`, `TodoWrite`, `Skill`, `ToolSearch`, `EnterWorktree`, `ExitWorktree`, `Monitor`, `TaskStop`, `SendMessage`, `Artifact`, `ListPlugins`, `ListSkills`, `SearchPlugins`, and `SearchSkills`.461The second filter applies to subagents running in the background. `Agent` and `ExitPlanMode` follow the first filter's conditions wherever the subagent runs. A background subagent keeps every MCP tool, and [`SubagentHandback`](https://code.claude.com/docs/en/tools-reference) if it reports through that tool. It also keeps `Read`, `Grep`, `Glob`, `LSP`, `Bash`, `PowerShell`, `Edit`, `Write`, `NotebookEdit`, `WebFetch`, `WebSearch`, `TodoWrite`, `Skill`, `ToolSearch`, `EnterWorktree`, `ExitWorktree`, `Monitor`, `TaskStop`, `SendMessage`, `Artifact`, `ListPlugins`, `ListSkills`, `SearchPlugins`, `SearchSkills`, and `REPL`.

462 462 

463Don't rely on other built-in tools in a background subagent: Claude Code removes most of them, whether inherited or listed in the `tools` field. The removal reports no error unless it leaves the `tools` list [resolving to nothing](https://code.claude.com/docs/en/errors.md#agent-would-be-spawned-with-zero-tools).463Don't rely on other built-in tools in a background subagent: Claude Code removes most of them, whether inherited or listed in the `tools` field. The removal reports no error unless it leaves the `tools` list [resolving to nothing](https://code.claude.com/docs/en/errors.md#agent-would-be-spawned-with-zero-tools).

464 464 


555 555 

556#### Scope MCP servers to a subagent556#### Scope MCP servers to a subagent

557 557 

558Use the `mcpServers` field to give a subagent access to [MCP](https://code.claude.com/docs/en/mcp.md) servers that aren't available in the main conversation. Inline servers defined here are connected when the subagent starts, subject to the [trust rule for the agent file's folder](#inline-server-trust), and disconnected when it finishes. String references share the parent session's connection.558Use the `mcpServers` field to give a subagent access to [MCP](https://code.claude.com/docs/en/mcp.md) servers that aren't available in the main conversation. Inline servers defined here are connected when the subagent starts, subject to the [trust rule for the agent file's folder](#inline-server-trust), and disconnected when the last agent using them finishes. String references share the parent session's connection.

559 559 

560> [!NOTE]560> [!NOTE]

561>561>


714 714 

715For more dynamic control over tool usage, use `PreToolUse` hooks to validate operations before they execute. This is useful when you need to allow some operations of a tool while blocking others.715For more dynamic control over tool usage, use `PreToolUse` hooks to validate operations before they execute. This is useful when you need to allow some operations of a tool while blocking others.

716 716 

717This example creates a subagent that only allows read-only database queries. The `PreToolUse` hook runs the script specified in `command` before each Bash command executes:717This example creates a subagent that only allows read-only database queries. The `PreToolUse` hook runs the script specified in `command` before each Bash tool call executes:

718 718 

719```yaml theme={null}719```yaml theme={null}

720---720---


927 927 

928If the plugin places the agent in a subfolder of its `agents/` directory, include the subfolder in the scoped name, for example `claude --agent my-plugin:review:security`.928If the plugin places the agent in a subfolder of its `agents/` directory, include the subfolder in the scoped name, for example `claude --agent my-plugin:review:security`.

929 929 

930To make it the default for every session in a project, set `agent` in `.claude/settings.json`:930To make a subagent the default for sessions in a project, set `agent` in `.claude/settings.json`:

931 931 

932```json theme={null}932```json theme={null}

933{933{

tools-reference.md +46 −20

Details

48| `Read` | Reads the contents of files. See [Read tool behavior](#read-tool-behavior) | No |48| `Read` | Reads the contents of files. See [Read tool behavior](#read-tool-behavior) | No |

49| `ReadMcpResourceTool` | Reads a specific MCP resource by URI | No |49| `ReadMcpResourceTool` | Reads a specific MCP resource by URI | No |

50| `RemoteTrigger` | Creates, updates, runs, and lists [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md), formerly routines, on claude.ai. Backs the `/schedule` command. The [`RemoteTrigger` input reference](https://code.claude.com/docs/en/agent-sdk/typescript#remotetrigger) documents every action and the organization policies that remove the tool. Cloud scheduled tasks live on claude.ai and require a Pro, Max, Ultra, Team, or Enterprise plan. This tool is therefore not accessible from Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, or Microsoft Foundry | No |50| `RemoteTrigger` | Creates, updates, runs, and lists [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md), formerly routines, on claude.ai. Backs the `/schedule` command. The [`RemoteTrigger` input reference](https://code.claude.com/docs/en/agent-sdk/typescript#remotetrigger) documents every action and the organization policies that remove the tool. Cloud scheduled tasks live on claude.ai and require a Pro, Max, Ultra, Team, or Enterprise plan. This tool is therefore not accessible from Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, or Microsoft Foundry | No |

51| `REPL` | Runs the JavaScript that Claude writes in [Code Mode](https://code.claude.com/docs/en/code-mode.md). Available only when Code Mode is on. For how Claude Code checks the tool calls in that code, see [Permission checks](https://code.claude.com/docs/en/code-mode.md#permission-checks) | No |

51| `ReportFindings` | Reports code-review findings as a structured list, with a file, summary, and failure scenario per finding, so Claude Code can render them instead of printing them as text. Claude calls it when active code-review instructions tell it to. A finding can also carry an optional `category` slug, such as `correctness` or `test-coverage`, shown next to the file location in the rendered list | No |52| `ReportFindings` | Reports code-review findings as a structured list, with a file, summary, and failure scenario per finding, so Claude Code can render them instead of printing them as text. Claude calls it when active code-review instructions tell it to. A finding can also carry an optional `category` slug, such as `correctness` or `test-coverage`, shown next to the file location in the rendered list | No |

52| `ScheduleWakeup` | Reschedules the next iteration of a [self-paced `/loop`](https://code.claude.com/docs/en/scheduled-tasks#let-claude-choose-the-interval). Claude calls this at the end of each iteration to pick when the next one runs, between one minute and one hour out; you don't call it directly. To end the loop instead, Claude calls it with `stop: true`, which cancels the pending wakeup. The pending wakeup appears in `session_crons` in [Stop hook input](https://code.claude.com/docs/en/hooks.md#stop-input) | No |53| `ScheduleWakeup` | Reschedules the next iteration of a [self-paced `/loop`](https://code.claude.com/docs/en/scheduled-tasks#let-claude-choose-the-interval). Claude calls this at the end of each iteration to pick when the next one runs, between one minute and one hour out; you don't call it directly. To end the loop instead, Claude calls it with `stop: true`, which cancels the pending wakeup. The pending wakeup appears in `session_crons` in [Stop hook input](https://code.claude.com/docs/en/hooks.md#stop-input) | No |

53| `SearchPlugins` | Searches your claude.ai plugin catalog. Available in the same sessions as `ListPlugins` | No |54| `SearchPlugins` | Searches your claude.ai plugin catalog. Available in the same sessions as `ListPlugins` | No |


150 151 

151### What persists between commands152### What persists between commands

152 153 

153* When Claude runs `cd` in the main session, the new working directory carries over to later Bash commands as long as it stays inside the project directory or an [additional working directory](https://code.claude.com/docs/en/permissions.md#working-directories) you added with `--add-dir`, `/add-dir`, or `additionalDirectories` in settings. This includes commands Claude runs in response to your later messages.154* In the main session, Claude's `cd` carries over to later Bash commands only from a foreground command that exits 0. The command must also end inside the project directory or an [additional working directory](https://code.claude.com/docs/en/permissions.md#working-directories), such as one you added with `--add-dir`, `/add-dir`, or `additionalDirectories` in settings.

155 * By default, if that command ends outside those directories, Claude Code resets to the project directory and appends `Shell cwd was reset to <dir>` to the tool result.

156 * To disable this carry-over, set `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1`.

154 * Subagent sessions never carry over working directory changes.157 * Subagent sessions never carry over working directory changes.

155 * If `cd` lands outside those directories, Claude Code resets to the project directory and appends `Shell cwd was reset to <dir>` to the tool result.

156 * To disable this carry-over so every Bash command starts in the project directory, set `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1`.

157* Environment variables don't persist. An `export` in one command won't be available in the next.158* Environment variables don't persist. An `export` in one command won't be available in the next.

158* Claude Code starts a non-interactive shell, sources `~/.zshrc` for Zsh or `~/.bashrc` for Bash, and applies the aliases, functions, and shell options it captures to Bash commands.159* Claude Code starts a non-interactive shell, sources `~/.zshrc` for Zsh or `~/.bashrc` for Bash, and applies the aliases, functions, and shell options it captures to Bash commands.

159 160 


511* `"shell": "powershell"` on individual [command hooks](https://code.claude.com/docs/en/hooks.md#command-hook-fields): runs that hook in PowerShell. Hooks spawn PowerShell directly, so this works regardless of `CLAUDE_CODE_USE_POWERSHELL_TOOL`.512* `"shell": "powershell"` on individual [command hooks](https://code.claude.com/docs/en/hooks.md#command-hook-fields): runs that hook in PowerShell. Hooks spawn PowerShell directly, so this works regardless of `CLAUDE_CODE_USE_POWERSHELL_TOOL`.

512* `shell: powershell` in [skill frontmatter](https://code.claude.com/docs/en/skills.md#frontmatter-reference): runs `` !`command` `` blocks in PowerShell. Requires the PowerShell tool to be enabled.513* `shell: powershell` in [skill frontmatter](https://code.claude.com/docs/en/skills.md#frontmatter-reference): runs `` !`command` `` blocks in PowerShell. Requires the PowerShell tool to be enabled.

513 514 

514PowerShell commands follow the [same main-session working-directory reset behavior](#what-persists-between-commands) as Bash commands, including the `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` environment variable.515### Working directory and variables in PowerShell commands

515 516 

516PowerShell commands also receive the variables hooks persist through `CLAUDE_ENV_FILE`, under the conditions in [Persisted variables in PowerShell commands](https://code.claude.com/docs/en/hooks.md#persisted-variables-in-powershell-commands). Requires Claude Code v2.1.296 or later.517By default, when a foreground PowerShell command in the main session ends outside your [working directories](https://code.claude.com/docs/en/permissions.md#working-directories), Claude Code resets to the project directory. To reset after each command, set `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1`.

518 

519PowerShell commands receive the variables hooks persist through `CLAUDE_ENV_FILE`, under the conditions in [Persisted variables in PowerShell commands](https://code.claude.com/docs/en/hooks.md#persisted-variables-in-powershell-commands). Requires Claude Code v2.1.296 or later.

517 520 

518### Exit code 1 from searches and `git diff` in PowerShell521### Exit code 1 from searches and `git diff` in PowerShell

519 522 


684 687 

685### Block a site or turn WebFetch off688### Block a site or turn WebFetch off

686 689 

687| To | Do this |690| Goal | What to do |

688| :- | :- |691| :- | :- |

689| Block a domain | Add a `WebFetch(domain:...)` rule for it to `deny` |692| Block a domain | Add a `WebFetch(domain:...)` rule for it to `deny` |

690| Require a prompt for a domain | Add a `WebFetch(domain:...)` rule for it to `ask` |693| Require a prompt for a domain | Add a `WebFetch(domain:...)` rule for it to `ask` |

691| Turn WebFetch off | Add `WebFetch` to `deny`, or set [`CLAUDE_CODE_DISABLE_WEB_FETCH`](https://code.claude.com/docs/en/env-vars#variables) to `1` |694| Turn WebFetch off | Add `WebFetch` to `deny`, or set [`CLAUDE_CODE_DISABLE_WEB_FETCH`](https://code.claude.com/docs/en/env-vars#variables) to `1` |

692| Do any of these for your organization | Put the rule in [managed settings](https://code.claude.com/docs/en/managed-settings.md) |

693 695 

694Outside the sandbox, if Bash is allowed, Claude can still use `curl`, `wget`, or other tools to reach any URL. See [Tool-specific permission rules](https://code.claude.com/docs/en/permissions.md#tool-specific-permission-rules).696Outside the sandbox, if Bash is allowed, Claude can still use `curl`, `wget`, or other tools to reach any URL. See [Tool-specific permission rules](https://code.claude.com/docs/en/permissions.md#tool-specific-permission-rules).

695 697 

696### When a fetch prompts, fails, or WebFetch is missing698To apply a `WebFetch` rule to your organization, put it in [managed settings](https://code.claude.com/docs/en/managed-settings.md).

697 699 

698Claude's reply can leave out anything on the page that Claude didn't ask about. In the terminal, press `Ctrl+O` to see what Claude asked and the answer it received.700### Fix unexpected WebFetch prompts and denials

699 701 

700| What you notice | What to do |702If a fetch is blocked or denied, or you see a permission prompt you didn't expect or none at all, find what you see in the first column.

703 

704| Symptom | Fix |

701| :- | :- |705| :- | :- |

702| Claude says a page doesn't cover something you know is there | Ask Claude to fetch the page again and tell it what to look for. For the raw page, ask it to run `curl` on the URL through the Bash tool. |706| A fetch fails for a domain you allowed | The URL also has to pass the [WebFetch domain safety check](https://code.claude.com/docs/en/data-usage.md#webfetch-domain-safety-check), unless you turn the check off with [`skipWebFetchPreflight`](https://code.claude.com/docs/en/settings-reference#skipwebfetchpreflight). See [WebFetch domain safety check failed](https://code.claude.com/docs/en/errors.md#webfetch-domain-safety-check-failed). |

703| Claude leaves out the end of a long page, or says part of it wasn't read | Ask Claude to fetch the next part of the page. This requires Claude Code v2.1.290 or later. The [`web-fetch` subagent](#web-fetch-subagent) reads pages of up to about 48,000 characters in full, and WebFetch reads the first 100,000 when Claude calls it. |

704| Claude describes a page as it was before a recent change | WebFetch reuses its copy of a page for 15 minutes. To change how long, set [`CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS`](https://code.claude.com/docs/en/env-vars#variables). |

705| Claude says the download ran out of time | A download fails after five minutes. To change the limit, set [`CLAUDE_CODE_WEBFETCH_DEADLINE_MS`](https://code.claude.com/docs/en/env-vars#variables). |

706| Claude reports a redirect and stops there | Ask Claude to fetch the new URL. When a redirect changes the host by more than adding or dropping `www.`, WebFetch returns the new URL and no page content. |

707| Claude can't fetch a local or intranet server | WebFetch [refuses `localhost`](https://code.claude.com/docs/en/errors#webfetch-cannot-fetch-localhost) and any other hostname without a dot. Ask Claude to reach the server with `curl` through the Bash tool. |

708| In a cloud session, Claude says the network blocks the domain | An allow rule isn't enough there. Also [add the domain](https://code.claude.com/docs/en/cloud-environments.md#allow-specific-domains) to the cloud environment's network access. |

709| In auto mode, a fetch is blocked and you see no prompt | Add an allow rule for the domain. If the classifier blocked the fetch, you can also open `/permissions` in the terminal and [approve the fetch](https://code.claude.com/docs/en/auto-mode-config.md#review-denials) under the **Recently blocked** tab so Claude can retry. |707| In auto mode, a fetch is blocked and you see no prompt | Add an allow rule for the domain. If the classifier blocked the fetch, you can also open `/permissions` in the terminal and [approve the fetch](https://code.claude.com/docs/en/auto-mode-config.md#review-denials) under the **Recently blocked** tab so Claude can retry. |

710| In `claude -p` or the Agent SDK, a fetch is denied | These runs [start in Manual mode](https://code.claude.com/docs/en/permission-modes.md#which-mode-a-non-interactive-run-starts-in), and a call that needs approval is denied. Add an allow rule or start in auto mode. |708| In `claude -p` or the Agent SDK, a fetch is denied | These runs [start in Manual mode](https://code.claude.com/docs/en/permission-modes.md#which-mode-a-non-interactive-run-starts-in), and a call that needs approval is denied. Add an allow rule or start in auto mode. |

711| A fetch fails for a domain you allowed | The URL also has to pass the [WebFetch domain safety check](https://code.claude.com/docs/en/data-usage.md#webfetch-domain-safety-check), unless you turn the check off with [`skipWebFetchPreflight`](https://code.claude.com/docs/en/settings-reference#skipwebfetchpreflight). See [WebFetch domain safety check failed](https://code.claude.com/docs/en/errors.md#webfetch-domain-safety-check-failed). |

712| A rule in your own settings file has no effect | If your organization sets [`allowManagedPermissionRulesOnly`](https://code.claude.com/docs/en/settings-reference#allowmanagedpermissionrulesonly), Claude Code ignores the rule. Ask your administrator to add it to managed settings. |709| A rule in your own settings file has no effect | If your organization sets [`allowManagedPermissionRulesOnly`](https://code.claude.com/docs/en/settings-reference#allowmanagedpermissionrulesonly), Claude Code ignores the rule. Ask your administrator to add it to managed settings. |

713| Prompts continue after you add the domain to the sandbox's [`allowedDomains`](https://code.claude.com/docs/en/settings-reference#sandbox-network-alloweddomains) | WebFetch doesn't read that list, so add a WebFetch allow rule |710| Prompts continue after you add the domain to the sandbox's [`allowedDomains`](https://code.claude.com/docs/en/settings-reference#sandbox-network-alloweddomains) | WebFetch doesn't read that list, so add a WebFetch allow rule |

714| No prompt for a domain you didn't allow | Claude Code skips the prompt for a built-in set of preapproved documentation domains, and in `auto` and `bypassPermissions` modes. To require the prompt anyway, add an `ask` rule for the domain. Sandboxed Bash commands don't inherit the preapproved set. |711| No prompt for a domain you didn't allow | Claude Code skips the prompt for a built-in set of preapproved documentation domains, and in `auto` and `bypassPermissions` modes. To require the prompt anyway, add an `ask` rule for the domain. Sandboxed Bash commands don't inherit the preapproved set. |

715| A claude.ai artifact link brings another prompt | See [Read an artifact shared with you](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you) |712| A claude.ai artifact link brings another prompt | See [Read an artifact shared with you](https://code.claude.com/docs/en/artifacts.md#read-an-artifact-shared-with-you) |

716| Claude can't fetch any page | Run `/status` in the session. If the `Organization configuration` line lists `HIPAA`, WebFetch is off: see [What developers see in Claude Code](https://code.claude.com/docs/en/hipaa-setup.md#what-developers-see-in-claude-code). If the `Organization policy` line reports that the policy didn't load and names web fetch, follow any fix the line names. WebFetch becomes available again without a restart once a policy that allows it loads. |713 

714### Fix a failed WebFetch request

715 

716If Claude says it couldn't fetch a page, find what happened in the first column.

717 

718| Symptom | Fix |

719| :- | :- |

720| In a cloud session, Claude says the network blocks the domain | An allow rule isn't enough there. Also [add the domain](https://code.claude.com/docs/en/cloud-environments.md#allow-specific-domains) to the cloud environment's network access. |

721| Claude can't fetch a local or intranet server | WebFetch [refuses `localhost`](https://code.claude.com/docs/en/errors#webfetch-cannot-fetch-localhost) and any other hostname without a dot. Ask Claude to reach the server with `curl` through the Bash tool. |

722| Claude reports a redirect and stops there | Ask Claude to fetch the new URL. When a redirect changes the host by more than adding or dropping `www.`, WebFetch returns the new URL and no page content. |

723| Claude says the download ran out of time | A download fails after five minutes. To change the limit, set [`CLAUDE_CODE_WEBFETCH_DEADLINE_MS`](https://code.claude.com/docs/en/env-vars#variables). |

724 

725### Fix missing or outdated page content

726 

727Claude's reply can leave out anything on the page that Claude didn't ask about. In the terminal, press `Ctrl+O` to see what Claude asked and the answer it received.

728 

729| Symptom | Fix |

730| :- | :- |

731| Claude says a page doesn't cover something you know is there | Ask Claude to fetch the page again and tell it what to look for. For the raw page, ask it to run `curl` on the URL through the Bash tool. |

732| Claude leaves out the end of a long page, or says part of it wasn't read | Ask Claude to fetch the next part of the page. This requires Claude Code v2.1.290 or later. The [`web-fetch` subagent](#web-fetch-subagent) reads pages of up to about 48,000 characters in full, and WebFetch reads the first 100,000 when Claude calls it. |

733| Claude describes a page as it was before a recent change | WebFetch reuses its copy of a page for 15 minutes. To change how long, set [`CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS`](https://code.claude.com/docs/en/env-vars#variables). |

734 

735### Find out why WebFetch is unavailable

736 

737If Claude can't fetch any page, run `/status` in the session and check the `Organization configuration` and `Organization policy` lines:

738 

739* **`Organization configuration` lists `HIPAA`**: WebFetch is off. See [What developers see in Claude Code](https://code.claude.com/docs/en/hipaa-setup.md#what-developers-see-in-claude-code).

740* **`Organization policy` reports that the policy didn't load and names web fetch**: follow any fix the line names. WebFetch becomes available again without a restart once a policy that allows it loads.

741 

742If `/status` shows neither, look for `WebFetch` under `deny` in a [settings file](https://code.claude.com/docs/en/settings.md#find-or-create-your-settings-files), or for `CLAUDE_CODE_DISABLE_WEB_FETCH` set to `1`. To turn WebFetch back on, remove the rule, or unset the variable and start a new session. Ask your administrator to remove a rule that's in [managed settings](https://code.claude.com/docs/en/settings.md#check-what-your-organization-enforces).

717 743 

718### The web-fetch subagent744### The web-fetch subagent

719 745 


740 766 

741Your `WebFetch` [permission rules](https://code.claude.com/docs/en/permissions.md#webfetch) apply to the pages the `web-fetch` subagent fetches, and so do the `PreToolUse` and `PostToolUse` [hooks](https://code.claude.com/docs/en/hooks.md) that match `WebFetch`.767Your `WebFetch` [permission rules](https://code.claude.com/docs/en/permissions.md#webfetch) apply to the pages the `web-fetch` subagent fetches, and so do the `PreToolUse` and `PostToolUse` [hooks](https://code.claude.com/docs/en/hooks.md) that match `WebFetch`.

742 768 

743| If you rely on | With the subagent | What to do |769| Your configuration | What changes with the subagent | What to do |

744| :- | :- | :- |770| :- | :- | :- |

745| CLAUDE.md instructions about which pages to fetch | The subagent starts without your CLAUDE.md files, including your organization's managed one | Restrict fetches with `WebFetch` permission rules |771| CLAUDE.md instructions about which pages to fetch | The subagent starts without your CLAUDE.md files, including your organization's managed one | Restrict fetches with `WebFetch` permission rules |

746| `SubagentStart` or `SubagentStop` hooks | Only the hooks defined in [managed settings](https://code.claude.com/docs/en/managed-settings.md) run for this subagent | In any other settings file, use a `PreToolUse` or `PostToolUse` hook that matches `WebFetch` |772| `SubagentStart` or `SubagentStop` hooks | Only the hooks defined in [managed settings](https://code.claude.com/docs/en/managed-settings.md) run for this subagent | In any other settings file, use a `PreToolUse` or `PostToolUse` hook that matches `WebFetch` |

Details

58| `unable to get local issuer certificate` | [Configure corporate CA certificates](#tls-or-ssl-connection-errors) |58| `unable to get local issuer certificate` | [Configure corporate CA certificates](#tls-or-ssl-connection-errors) |

59| `OAuth error`, `That doesn't look like the full code`, or `403 Forbidden` | [Fix authentication](#login-and-authentication) |59| `OAuth error`, `That doesn't look like the full code`, or `403 Forbidden` | [Fix authentication](#login-and-authentication) |

60| `Claude Code access has not been granted for this account` | [Get a role that includes Claude Code](#claude-code-access-has-not-been-granted-for-this-account) |60| `Claude Code access has not been granted for this account` | [Get a role that includes Claude Code](#claude-code-access-has-not-been-granted-for-this-account) |

61| `That code wasn't accepted` | Sign in again and paste the new code |

61| `Unable to connect to Anthropic services` during setup | See [Unable to connect to Anthropic services](https://code.claude.com/docs/en/errors.md#unable-to-connect-to-anthropic-services) in the Error reference |62| `Unable to connect to Anthropic services` during setup | See [Unable to connect to Anthropic services](https://code.claude.com/docs/en/errors.md#unable-to-connect-to-anthropic-services) in the Error reference |

62| `Could not load the default credentials` or `Could not load credentials from any providers` | [Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry credentials](#bedrock-agent-platform-or-foundry-credentials-not-loading) |63| `Could not load the default credentials` or `Could not load credentials from any providers` | [Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry credentials](#bedrock-agent-platform-or-foundry-credentials-not-loading) |

63| `ChainedTokenCredential authentication failed` or `CredentialUnavailableError` | [Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry credentials](#bedrock-agent-platform-or-foundry-credentials-not-loading) |64| `ChainedTokenCredential authentication failed` or `CredentialUnavailableError` | [Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry credentials](#bedrock-agent-platform-or-foundry-credentials-not-loading) |


1244 1245 

1245**1. Check Keychain access**1246**1. Check Keychain access**

1246 1247 

1247Run `claude doctor` to check Keychain access. When the Keychain rejects writes, the report lists a warning that starts with `macOS Keychain is not writable`, followed by a suggested fix. When the report lists no Keychain warning, the Keychain is writable and you can skip to the last step.1248In the shell you run Claude Code from, run `claude doctor` and look for a warning that starts with `macOS Keychain is not writable`. What the report shows decides your next step:

1249 

1250* **No such warning**: skip to the last step

1251* **A warning whose fix says `Unlocking the Keychain won't help`**: follow that fix. If that shell is sandboxed, restart these steps outside the sandbox to move your login back

1252* **A warning with another fix**: go on to the next step

1248 1253 

1249**2. Unlock the Keychain**1254**2. Unlock the Keychain**

1250 1255 

Details

79 79 

80By default, when you release the key, Claude Code inserts the transcript and waits for you to press `Enter`. Set `"autoSubmit": true` in the `voice` settings object to send the prompt automatically when you release the key, as long as the transcript is at least three words long.80By default, when you release the key, Claude Code inserts the transcript and waits for you to press `Enter`. Set `"autoSubmit": true` in the `voice` settings object to send the prompt automatically when you release the key, as long as the transcript is at least three words long.

81 81 

82Holding or tapping `Space` starts dictation only where the keypress would otherwise type into the prompt. In the [transcript viewer](https://code.claude.com/docs/en/interactive-mode.md#transcript-viewer), `Space` pages through the conversation, and in [vim mode](https://code.claude.com/docs/en/interactive-mode.md#vim-editor-mode) outside INSERT it is a command. To dictate from either place, [rebind to a modifier combination](#rebind-the-dictation-key) like `meta+k`.82Holding or tapping `Space` starts dictation only where the keypress would otherwise type into the prompt. In the [transcript viewer](https://code.claude.com/docs/en/interactive-mode.md#transcript-viewer), `Space` pages through the conversation, and in [vim mode](https://code.claude.com/docs/en/interactive-mode.md#vim-editor-mode) outside INSERT it is a command. To dictate outside INSERT, or in hold mode from the transcript viewer, [rebind to a modifier combination](#rebind-the-dictation-key) like `meta+k`.

83 83 

84## Tap to record and send84## Tap to record and send

85 85 


87 87 

88Enable tap mode with `/voice tap`. With the prompt input empty, tap `Space` to start recording. The footer shows `● REC · tap to send` while recording. Tap `Space` again to stop.88Enable tap mode with `/voice tap`. With the prompt input empty, tap `Space` to start recording. The footer shows `● REC · tap to send` while recording. Tap `Space` again to stop.

89 89 

90Claude Code inserts the transcript and submits the prompt automatically when the transcript is at least three words long. Shorter transcripts are inserted but not submitted, so an accidental tap does not send a stray word.90After the second tap, Claude Code inserts the transcript and submits the prompt if the transcript is long enough:

91 

92* **Three words or more**: Claude Code submits the prompt automatically.

93* **Fewer words**: the transcript is inserted but not submitted, so an accidental tap does not send a stray word.

91 94 

92The three-word threshold counts words for languages written without spaces. Japanese, Chinese, and Thai transcripts count individual words, so they auto-submit in tap mode and in hold mode with `autoSubmit`.95The three-word threshold counts words for languages written without spaces. Japanese, Chinese, and Thai transcripts count individual words, so they auto-submit in tap mode and in hold mode with `autoSubmit`.

93 96 

94The first tap only starts recording when the prompt input is empty, so you can still type spaces normally while composing a message. The second tap stops recording regardless of input contents. Recording also stops automatically after 15 seconds of silence or two minutes total.97You tap once to start or resume a recording, and it can stop without a second tap:

98 

99* **Start**: the first tap starts recording when the prompt input is empty, so you can still type spaces normally while composing a message. To add to a recording that stopped by itself, [resume it](#resume-a-recording-that-stopped-by-itself).

100* **Stop**: recording also stops when you send or edit the prompt. It stops by itself after 60 seconds with no recognized words or after 10 minutes total.

101 

102### Resume a recording that stopped by itself

103 

104When a tap-mode recording stops by itself, your words stay in the prompt unsent and the footer says why. You can send the words, or add to them if you haven't edited them:

105 

106* **Send the words**: press `Enter`.

107* **Add to the words**: put the cursor at the end of the words and tap `Space` to record again. When you tap again to stop, Claude Code sends all of the text if you added at least three words.

108 

109To see what stopped the recording, find the part of the footer message that starts with `dictation stopped`:

110 

111| Message | What stopped the recording |

112| :- | :- |

113| `dictation stopped after 1m with no new words` | No words were recognized for 60 seconds. If you were speaking, try the fixes for [`No speech detected`](#troubleshooting) |

114| `dictation stopped at its 10m limit` | The recording reached 10 minutes |

115| `dictation stopped: lost the connection` | The connection to the transcription service closed, or couldn't be opened again after it failed |

116| `dictation stopped: lost the microphone` | The program recording your microphone, such as SoX or `arecord`, exited or couldn't start |

117| `dictation stopped: the prompt lost focus` | A panel such as the model picker opened, or you opened the [transcript viewer](https://code.claude.com/docs/en/interactive-mode.md#transcript-viewer) |

118| `dictation stopped: the terminal detached` | The last remaining terminal detached from a [background session](https://code.claude.com/docs/en/agent-view.md) |

119| `dictation stopped: the prompt changed` | The prompt's text changed, for example because you typed in it. To dictate again, send or clear the prompt first |

95 120 

96## Cancel a recording121## Cancel a recording

97 122 

98Press `Esc` or `Ctrl+C` to cancel a dictation instead of finalizing it. Claude Code stops the microphone, discards the transcript, and restores the prompt to what it held before the recording started.123With no panel, question, or permission prompt open, press `Esc` or `Ctrl+C` to cancel a dictation instead of finalizing it. Claude Code stops the microphone, discards the transcript, and restores the prompt to what it held before the recording started.

99 124 

100Both keys also cancel while a finished recording's transcript is still processing. A prompt you edited or submitted during processing stays as you left it.125At the prompt, both keys also cancel while a finished recording's transcript is still processing. A prompt you edited or submitted during processing stays as you left it.

101 126 

102Neither key does anything else in the press that cancels: `Esc` doesn't interrupt Claude's response, and `Ctrl+C` doesn't clear the prompt or count as the first of the [two presses that exit Claude Code](https://code.claude.com/docs/en/interactive-mode.md#general-controls).127Neither key does anything else in the press that cancels: `Esc` doesn't interrupt Claude's response, and `Ctrl+C` doesn't clear the prompt or count as the first of the [two presses that exit Claude Code](https://code.claude.com/docs/en/interactive-mode.md#general-controls).

103 128 


177* **`Voice mode could not find a working audio recorder in WSL`**: WSLg routes audio through PulseAudio rather than an ALSA device, so SoX needs its PulseAudio backend installed explicitly. Run `sudo apt install sox libsox-fmt-pulse`. Installing `sox` alone pulls in the ALSA backend, which cannot record on WSL because there is no `/dev/snd` device.202* **`Voice mode could not find a working audio recorder in WSL`**: WSLg routes audio through PulseAudio rather than an ALSA device, so SoX needs its PulseAudio backend installed explicitly. Run `sudo apt install sox libsox-fmt-pulse`. Installing `sox` alone pulls in the ALSA backend, which cannot record on WSL because there is no `/dev/snd` device.

178* **`Voice input is failing repeatedly and has been paused`**: voice dictation hit three failures within 10 seconds. Claude Code pauses dictation until 10 seconds have passed since the first of those failures. This usually means the microphone or audio stack on this host can't capture audio, for example a headless server, a remote shell with no audio passthrough, or a denied microphone permission. Confirm a working input device, fix the underlying cause from the entries above, then trigger voice again. Before v2.1.202, only start-up failures counted toward the pause.203* **`Voice input is failing repeatedly and has been paused`**: voice dictation hit three failures within 10 seconds. Claude Code pauses dictation until 10 seconds have passed since the first of those failures. This usually means the microphone or audio stack on this host can't capture audio, for example a headless server, a remote shell with no audio passthrough, or a denied microphone permission. Confirm a working input device, fix the underlying cause from the entries above, then trigger voice again. Before v2.1.202, only start-up failures counted toward the pause.

179* **Nothing happens when holding `Space` in hold mode**: watch the prompt input while you hold. If spaces keep accumulating, voice dictation is likely off; run `/voice hold` to enable it. If only one or two spaces appear and then nothing, voice dictation is on but hold detection is not triggering. Hold detection requires your terminal to send key-repeat events, so it can't detect a held key if key-repeat is disabled at the OS level. Switch to tap mode with `/voice tap` to avoid the key-repeat requirement.204* **Nothing happens when holding `Space` in hold mode**: watch the prompt input while you hold. If spaces keep accumulating, voice dictation is likely off; run `/voice hold` to enable it. If only one or two spaces appear and then nothing, voice dictation is on but hold detection is not triggering. Hold detection requires your terminal to send key-repeat events, so it can't detect a held key if key-repeat is disabled at the OS level. Switch to tap mode with `/voice tap` to avoid the key-repeat requirement.

180* **Tapping `Space` types a space instead of recording in tap mode**: the first tap only starts recording when the prompt input is empty. Clear the input first, or check that you are in tap mode by running `/voice tap`.205* **Tapping `Space` types a space instead of recording in tap mode**: when the prompt has text and you aren't [resuming a recording](#resume-a-recording-that-stopped-by-itself), `Space` types a space. To record, send or clear the prompt first. If the prompt is already empty, run `/voice tap` to turn on tap mode.

181* **`No audio detected from microphone`**: recording started but captured silence. Confirm the correct input device is set as the system default and that its input level is not muted or near zero. On Windows, open Settings → System → Sound → Input and select your microphone. On macOS, open System Settings → Sound → Input.206* **`No audio detected from microphone`**: recording started but captured silence. Confirm the correct input device is set as the system default and that its input level is not muted or near zero. On Windows, open Settings → System → Sound → Input and select your microphone. On macOS, open System Settings → Sound → Input.

182* **`Voice connection failed`**: your recording never reached the transcription service because the connection failed. Check your network and try again. A recording that captures no audio reports `No audio detected from microphone` instead of this message. Before v2.1.200, a silent microphone could report a connection failure, which suggested a network problem when the actual issue was the input device.207* **`Voice connection failed`**: your recording never reached the transcription service because the connection failed. Check your network and try again. A recording that captures no audio reports `No audio detected from microphone` instead of this message. Before v2.1.200, a silent microphone could report a connection failure, which suggested a network problem when the actual issue was the input device.

183* **`Dictation error: WebSocket error:` followed by a certificate error such as `unable to get local issuer certificate`**: see [Dictation or the Web tab fails behind a TLS-inspecting proxy](https://code.claude.com/docs/en/vs-code.md#dictation-or-the-web-tab-fails-behind-a-tls-inspecting-proxy) on the VS Code page.208* **`Dictation error: WebSocket error:` followed by a certificate error such as `unable to get local issuer certificate`**: see [Dictation or the Web tab fails behind a TLS-inspecting proxy](https://code.claude.com/docs/en/vs-code.md#dictation-or-the-web-tab-fails-behind-a-tls-inspecting-proxy) on the VS Code page.

184* **`Voice stream error: WebSocket upgrade rejected with HTTP <status>`**: a server refused your connection with the HTTP status shown, so this isn't a network outage. A status in the 400 range usually means a stale sign-in, or a proxy or bot-protection service answering in place of the transcription service. Run `/login` to refresh your sign-in, and check for a VPN or proxy on your network path if the status persists. If you're still recording when the rejection arrives, Claude Code retries a status outside the 400 range once before showing this message; it doesn't retry a status in the 400 range. In v2.1.229 through v2.1.231, native builds didn't show this message: Claude Code kept recording, the hold-mode footer still showed `listening…`, and it reported `Voice connection failed` after you stopped recording.209* **`Voice stream error: WebSocket upgrade rejected with HTTP <status>`**: a server refused your connection with the HTTP status shown, so this isn't a network outage. A status in the 400 range usually means a stale sign-in, or a proxy or bot-protection service answering in place of the transcription service. Run `/login` to refresh your sign-in, and check for a VPN or proxy on your network path if the status persists. If you're still recording when the rejection arrives, Claude Code retries a status outside the 400 range once before showing this message; it doesn't retry a status in the 400 range. In v2.1.229 through v2.1.231, native builds didn't show this message: Claude Code kept recording, the hold-mode footer still showed `listening…`, and it reported `Voice connection failed` after you stopped recording.

185* **`No speech detected`**: audio reached the transcription service but no words were recognized. Speak closer to the microphone, reduce background noise, and confirm your [dictation language](#change-the-dictation-language) matches the language you are speaking.210* **`No speech detected`**: audio reached the transcription service but no words were recognized. Speak closer to the microphone, reduce background noise, and confirm your [dictation language](#change-the-dictation-language) matches the language you are speaking.

186* **`Dictation stopped: no speech recognized for 15 seconds` or `Dictation stopped at its 2-minute limit`**: in the VS Code extension, a recording ends after 15 seconds with no recognized words, or two minutes after it starts. If you were speaking during those 15 seconds, try the fixes for `No speech detected`. Words already recognized stay in the prompt box and aren't sent. To add more, click the microphone button again.211* **`text kept, Enter to send` or `dictation stopped` in the terminal's footer**: your tap-mode recording stopped without a second tap. Words still in the prompt haven't been sent. Press `Enter` to send them, or [add to them](#resume-a-recording-that-stopped-by-itself). Before v2.1.332, recordings stopped after 15 seconds with no recognized words or after two minutes, and Claude Code then sent a transcript of three or more words.

212* **`Dictation stopped: no speech recognized for 60 seconds`, `Dictation stopped at its 10-minute limit`, or `Dictation stopped: this panel was hidden`**: the VS Code extension stopped your recording. Words already recognized stay in the prompt box and aren't sent. To add more, click the microphone button again. The limits are shorter while the panel is hidden:

213 

214 * **Visible panel**: with a working connection and microphone, the recording ends after 60 seconds with no recognized words, or 10 minutes after it starts. If you were speaking during those 60 seconds, try the fixes for `No speech detected`.

215 * **Hidden panel**: after you hide the panel, the recording ends after 15 seconds with no recognized words, or two minutes after you hid it. Keep the panel visible while you dictate.

216 

217 Before v2.1.332, the first two messages were `Dictation stopped: no speech recognized for 15 seconds` and `Dictation stopped at its 2-minute limit`.

218* **`Dictation error: The microphone stopped sending audio`**: words already recognized stay in the VS Code extension's prompt box and aren't sent. To try again, click the microphone button.

187* **Transcription is garbled or in the wrong language**: dictation defaults to English. If you are dictating in another language, set it in `/config` first. See [Change the dictation language](#change-the-dictation-language).219* **Transcription is garbled or in the wrong language**: dictation defaults to English. If you are dictating in another language, set it in `/config` first. See [Change the dictation language](#change-the-dictation-language).

188 220 

189### Terminal not listed in macOS Microphone settings221### Terminal not listed in macOS Microphone settings

vs-code.md +8 −4

Details

70 70 

71* **Activity Bar**: click the Spark icon in the left sidebar to open the sessions list. Click any session to open it in your [preferred location](#extension-settings), or start a new one. This icon is always visible in the Activity Bar.71* **Activity Bar**: click the Spark icon in the left sidebar to open the sessions list. Click any session to open it in your [preferred location](#extension-settings), or start a new one. This icon is always visible in the Activity Bar.

72* **Command Palette**: `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), type "Claude Code", and select an option like "Open in New Tab"72* **Command Palette**: `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux), type "Claude Code", and select an option like "Open in New Tab"

73* **Status Bar**: click **✻ Claude Code** in the bottom-right corner of the window. This works even when no file is open.73* **Status Bar**: click **✻ Claude Code** in the bottom-right corner of the window. This works without an open file.

74 74 

75You can drag the Claude panel to reposition it anywhere in VS Code. See [Customize your workflow](#customize-your-workflow) for details.75You can drag the Claude panel to reposition it anywhere in VS Code. See [Customize your workflow](#customize-your-workflow) for details.

76 76 


688| New Conversation | `Cmd+N` (Mac) / `Ctrl+N` (Windows/Linux) | Start a new conversation. Requires Claude to be focused and `enableNewConversationShortcut` set to `true` |688| New Conversation | `Cmd+N` (Mac) / `Ctrl+N` (Windows/Linux) | Start a new conversation. Requires Claude to be focused and `enableNewConversationShortcut` set to `true` |

689| Reopen Closed Session | `Cmd+Shift+T` (Mac) / `Ctrl+Shift+T` (Windows/Linux) | Reopen the most recently closed Claude session tab. Falls through to VS Code's normal reopen-closed-editor when the last closed tab wasn't a Claude session. Disable with `enableReopenClosedSessionShortcut` |689| Reopen Closed Session | `Cmd+Shift+T` (Mac) / `Ctrl+Shift+T` (Windows/Linux) | Reopen the most recently closed Claude session tab. Falls through to VS Code's normal reopen-closed-editor when the last closed tab wasn't a Claude session. Disable with `enableReopenClosedSessionShortcut` |

690| Insert @-Mention Reference | `Option+K` (Mac) / `Alt+K` (Windows/Linux) | Insert a reference to the current file and selection (requires editor to be focused) |690| Insert @-Mention Reference | `Option+K` (Mac) / `Alt+K` (Windows/Linux) | Insert a reference to the current file and selection (requires editor to be focused) |

691| Add Cell to Chat | - | Add a notebook cell, its text output or error, and an @-mention of the notebook to the prompt box. Requires Claude Code v2.1.331 or later |

692| Resolve Merge Conflicts | - | Put a conflict-resolution request in the prompt box. Click this command's button in a conflicted file's **Editor Toolbar** or on Source Control's **Merge Changes**. Requires Claude Code v2.1.331 or later |

691| Accept Change at Cursor | - | Accept the change at the cursor while [reviewing a proposed edit](#get-started) one change at a time. Requires Claude Code v2.1.275 or later |693| Accept Change at Cursor | - | Accept the change at the cursor while [reviewing a proposed edit](#get-started) one change at a time. Requires Claude Code v2.1.275 or later |

692| Reject Change at Cursor | - | Revert the change at the cursor while reviewing a proposed edit one change at a time. Requires Claude Code v2.1.275 or later |694| Reject Change at Cursor | - | Revert the change at the cursor while reviewing a proposed edit one change at a time. Requires Claude Code v2.1.275 or later |

693| Toggle Focus view | `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux) | Hide or show tool activity in the conversation. Works while a Claude panel or sidebar is visible. On Windows/Linux, `Ctrl+Alt+F` opens VS Code's Find instead while focus is in the Debug Console or a searchable list such as the Explorer. Focus an editor or the Claude panel and press it again. Requires Claude Code v2.1.221 or later |695| Toggle Focus view | `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux) | Hide or show tool activity in the conversation. Works while a Claude panel or sidebar is visible. On Windows/Linux, `Ctrl+Alt+F` opens VS Code's Find instead while focus is in the Debug Console or a searchable list such as the Explorer. Focus an editor or the Claude panel and press it again. Requires Claude Code v2.1.221 or later |


771| `autosave` | `true` | Auto-save files before the Read, Edit, and Write tools run |773| `autosave` | `true` | Auto-save files before the Read, Edit, and Write tools run |

772| `attachOpenFile` | `true` | Add the file that is open in the editor to your messages and show it in the prompt box. When off, the file is added only along with text you select. Requires Claude Code v2.1.271 or later |774| `attachOpenFile` | `true` | Add the file that is open in the editor to your messages and show it in the prompt box. When off, the file is added only along with text you select. Requires Claude Code v2.1.271 or later |

773| `attachSelection` | `true` | Add the text you select in the editor to your messages and show it in the prompt box. When off, you can still [add a selection as an @-mention](#automatic-context-from-your-selection-and-open-file). Requires Claude Code v2.1.300 or later |775| `attachSelection` | `true` | Add the text you select in the editor to your messages and show it in the prompt box. When off, you can still [add a selection as an @-mention](#automatic-context-from-your-selection-and-open-file). Requires Claude Code v2.1.300 or later |

776| `showFixActions` | `true` | Show **Fix with Claude Code** on editor errors, warnings, and failed tests. Selecting it puts a fix request in the prompt box. Requires Claude Code v2.1.331 or later |

774| `useCtrlEnterToSend` | `false` | Use Ctrl/Cmd+Enter instead of Enter to send prompts |777| `useCtrlEnterToSend` | `false` | Use Ctrl/Cmd+Enter instead of Enter to send prompts |

775| `scrollToBottomOnSend` | `true` | Scroll the conversation to the bottom when you send a message. When off, the conversation stays where you left it. Requires Claude Code v2.1.275 or later |778| `scrollToBottomOnSend` | `true` | Scroll the conversation to the bottom when you send a message. When off, the conversation stays where you left it. Requires Claude Code v2.1.275 or later |

776| `pinPrompt` | `true` | Keep your message pinned at the top while you scroll through Claude's reply. Requires Claude Code v2.1.330 or later |779| `pinPrompt` | `true` | Keep your message pinned at the top while you scroll through Claude's reply. Requires Claude Code v2.1.330 or later |


793 796 

794## Use third-party providers797## Use third-party providers

795 798 

796By default, Claude Code connects directly to Anthropic's API. If your organization uses Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry to access Claude, configure the extension to use your provider instead:799By default, Claude Code connects directly to Anthropic's API. If you use Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry to access Claude, configure the extension to use your provider instead:

797 800 

798**1. Disable login prompt**801**1. Disable login prompt**

799 802 


996| `Could not locate the Claude CLI on PATH` | [Could not locate the Claude CLI on PATH](https://code.claude.com/docs/en/errors.md#could-not-locate-the-claude-cli-on-path) |999| `Could not locate the Claude CLI on PATH` | [Could not locate the Claude CLI on PATH](https://code.claude.com/docs/en/errors.md#could-not-locate-the-claude-cli-on-path) |

997| `The connection to Claude Code ended before this message completed` | [The connection to Claude Code ended before this message completed](https://code.claude.com/docs/en/errors.md#the-connection-to-claude-code-ended-before-this-message-completed) |1000| `The connection to Claude Code ended before this message completed` | [The connection to Claude Code ended before this message completed](https://code.claude.com/docs/en/errors.md#the-connection-to-claude-code-ended-before-this-message-completed) |

998| `The Claude Code program for this computer, the <build> build, could not be found` | [The Claude Code program for this computer could not be found](https://code.claude.com/docs/en/errors.md#the-claude-code-program-for-this-computer-could-not-be-found) |1001| `The Claude Code program for this computer, the <build> build, could not be found` | [The Claude Code program for this computer could not be found](https://code.claude.com/docs/en/errors.md#the-claude-code-program-for-this-computer-could-not-be-found) |

1002| `Failed to set model: Settings file is not valid JSON` | [Fix a broken settings file](https://code.claude.com/docs/en/settings.md#fix-a-broken-settings-file) |

999| `claude` isn't found in VS Code's integrated terminal | [Run CLI in VS Code](#run-cli-in-vs-code) |1003| `claude` isn't found in VS Code's integrated terminal | [Run CLI in VS Code](#run-cli-in-vs-code) |

1000 1004 

1001### Extension won't install1005### Extension won't install


1008 1012 

1009The Spark icon appears in the **Editor Toolbar** (top-right of editor) when you have a file open. If you don't see it:1013The Spark icon appears in the **Editor Toolbar** (top-right of editor) when you have a file open. If you don't see it:

1010 1014 

10111. **Open a file**: The icon requires a file to be open. Having only a folder open isn't enough.10151. **Open a file**: The icon requires a file to be open.

10122. **Check VS Code version**: Requires 1.94.0 or later. Check under **Help > About**10162. **Check VS Code version**: Requires 1.94.0 or later. Check under **Help > About**

10133. **Restart VS Code**: Run "Developer: Reload Window" from the Command Palette10173. **Restart VS Code**: Run "Developer: Reload Window" from the Command Palette

10144. **Disable conflicting extensions**: Temporarily disable other AI extensions (Cline, Continue, etc.)10184. **Disable conflicting extensions**: Temporarily disable other AI extensions (Cline, Continue, etc.)

10155. **Check workspace trust**: The extension doesn't work in Restricted Mode10195. **Check workspace trust**: The extension doesn't work in Restricted Mode

1016 1020 

1017Alternatively, click **✻ Claude Code** in the **Status Bar** at the bottom-right corner of the window. This works even without a file open. You can also use the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type "Claude Code".1021Alternatively, click **✻ Claude Code** in the **Status Bar** at the bottom-right corner of the window. This works without a file open. You can also use the **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) and type "Claude Code".

1018 1022 

1019### Cmd+Esc does nothing on macOS1023### Cmd+Esc does nothing on macOS

1020 1024 

Details

323. **Work**: Claude analyzes code, makes changes, runs tests, and checks its work. You can watch and steer throughout, or step away and come back when it's done.323. **Work**: Claude analyzes code, makes changes, runs tests, and checks its work. You can watch and steer throughout, or step away and come back when it's done.

334. **Push the branch**: when Claude reaches a stopping point, it pushes its branch to GitHub. You review the diff, leave inline comments, create a PR, or send another message to keep going.334. **Push the branch**: when Claude reaches a stopping point, it pushes its branch to GitHub. You review the diff, leave inline comments, create a PR, or send another message to keep going.

34 34 

35The session doesn't close when the branch is pushed. PR creation and further edits all happen within the same conversation.35PR creation and further edits all happen within the same conversation.

36 36 

37## Compare ways to run Claude Code37## Compare ways to run Claude Code

38 38 

workflows.md +1 −1

Details

466* Check `/model` before a large run if you usually switch to a smaller model for routine work466* Check `/model` before a large run if you usually switch to a smaller model for routine work

467* Ask Claude to use a smaller model for stages that don't need the strongest one when you describe the task467* Ask Claude to use a smaller model for stages that don't need the strongest one when you describe the task

468 468 

469When your organization's [`availableModels` allowlist](https://code.claude.com/docs/en/model-config#restrict-model-selection) blocks a model the script requests for an agent, that agent runs on a substituted model instead, following the same [substitution rules as subagents](https://code.claude.com/docs/en/sub-agents.md#when-an-allowlist-blocks-a-subagent-model).469When an [`availableModels` allowlist](https://code.claude.com/docs/en/model-config#restrict-model-selection) blocks a model the script requests for an agent, that agent runs on a substituted model instead, following the same [substitution rules as subagents](https://code.claude.com/docs/en/sub-agents.md#when-an-allowlist-blocks-a-subagent-model).

470 470 

471### Set a size guideline471### Set a size guideline

472 472 

worktrees.md +2 −2

Details

141and report the results.141and report the results.

142```142```

143 143 

144Each subagent gets a temporary worktree that Claude Code removes automatically when the subagent finishes without changes; a worktree with changes stays on disk until the [periodic sweep below](#clean-up-subagent-and-background-session-worktrees) can remove it without losing work. For a worktree your [WorktreeCreate hook](https://code.claude.com/docs/en/hooks.md#worktreecreate) created, see [WorktreeRemove](https://code.claude.com/docs/en/hooks.md#worktreeremove) instead.144When a subagent finishes, Claude Code keeps the worktree if git shows changed files, untracked files, or new commits there. Otherwise, Claude Code can remove the worktree right away. A kept worktree stays on disk until the [periodic sweep](#clean-up-subagent-and-background-session-worktrees) can remove it without losing work. For a worktree your [WorktreeCreate hook](https://code.claude.com/docs/en/hooks.md#worktreecreate) created, see [WorktreeRemove](https://code.claude.com/docs/en/hooks.md#worktreeremove) instead.

145 145 

146Subagent worktrees use the same [base branch](#choose-the-base-branch) as `--worktree`, so they branch from your repository's default branch unless `worktree.baseRef` is set to `"head"`.146Subagent worktrees use the same [base branch](#choose-the-base-branch) as `--worktree`, so they branch from your repository's default branch unless `worktree.baseRef` is set to `"head"`.

147 147 


161 161 

162#### Worktree locks and manual removal162#### Worktree locks and manual removal

163 163 

164While an agent is running, Claude Code holds a `git worktree lock` on its worktree so that concurrent cleanup can't remove it, and releases the lock when the agent finishes. Claude Code holds the same lock on the worktree it created for a backgrounded session while the session runs, so the sweep leaves the worktree in place and `git worktree remove` refuses to remove it.164Claude Code takes a `git worktree lock` on the worktree it creates for an agent, so that concurrent cleanup can't remove it during the agent's first run, before any [resume](https://code.claude.com/docs/en/sub-agents.md#resume-subagents). The worktree Claude Code created for a backgrounded session has the same lock while the session runs, so the sweep keeps the worktree and `git worktree remove` refuses it.

165 165 

166The sweep also releases a lock Claude Code set for a session whose process has exited, so a killed background session doesn't leave its worktree permanently locked. The sweep never releases a lock you set yourself with `git worktree lock`.166The sweep also releases a lock Claude Code set for a session whose process has exited, so a killed background session doesn't leave its worktree permanently locked. The sweep never releases a lock you set yourself with `git worktree lock`.

167 167