SpyBara
Go Premium

Documentation 2026-04-22 21:15 UTC to 2026-04-23 18:19 UTC

39 files changed +706 −188. View all changes and history on the product overview
2026
Wed 29 21:21 Tue 28 21:21 Mon 27 21:20 Sun 26 04:08 Sat 25 21:10 Fri 24 18:11 Thu 23 18:19 Wed 22 21:15 Tue 21 21:14 Mon 20 21:14 Sat 18 18:09 Fri 17 21:13 Thu 16 21:13 Wed 15 18:20 Tue 14 21:14 Mon 13 21:14 Sat 11 00:11 Fri 10 21:09 Thu 9 21:14 Wed 8 21:13 Tue 7 21:14 Sat 4 18:05 Fri 3 21:07 Thu 2 21:08 Wed 1 21:12

admin-setup.md +132 −0 created

Details

1> ## Documentation Index

2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

3> Use this file to discover all available pages before exploring further.

4 

5# Set up Claude Code for your organization

6 

7> A decision map for administrators deploying Claude Code, covering API providers, managed settings, policy enforcement, usage monitoring, and data handling.

8 

9Claude Code enforces organization policy through managed settings that take precedence over local developer configuration. You deliver those settings from the Claude admin console, your mobile device management (MDM) system, or a file on disk. The settings control which tools, commands, servers, and network destinations Claude can reach.

10 

11This page walks through the deployment decisions in order. Each row links to the section below and to the reference page for that area.

12 

13<Note>

14 SSO, SCIM provisioning, and seat assignment are configured at the Claude account level. See the [Claude Enterprise Administrator Guide](https://claude.com/resources/tutorials/claude-enterprise-administrator-guide) and [seat assignment](https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan) for those steps.

15</Note>

16 

17| Decision | What you're choosing | Reference |

18| :---------------------------------------------------------------------- | :-------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------- |

19| [Choose your API provider](#choose-your-api-provider) | Where Claude Code authenticates and how it's billed | [Authentication](/en/authentication), [Bedrock](/en/amazon-bedrock), [Vertex AI](/en/google-vertex-ai), [Foundry](/en/microsoft-foundry) |

20| [Decide how settings reach devices](#decide-how-settings-reach-devices) | How managed policy reaches developer machines | [Server-managed settings](/en/server-managed-settings), [Settings files](/en/settings#settings-files) |

21| [Decide what to enforce](#decide-what-to-enforce) | Which tools, commands, and integrations are allowed | [Permissions](/en/permissions), [Sandboxing](/en/sandboxing) |

22| [Set up usage visibility](#set-up-usage-visibility) | How you track spend and adoption | [Analytics](/en/analytics), [Monitoring](/en/monitoring-usage), [Costs](/en/costs) |

23| [Review data handling](#review-data-handling) | Data retention and compliance posture | [Data usage](/en/data-usage), [Security](/en/security) |

24 

25## Choose your API provider

26 

27Claude Code connects to Claude through one of several API providers. Your choice affects billing, authentication, and which compliance posture you inherit.

28 

29| Provider | Choose this when |

30| :---------------------------- | :------------------------------------------------------------------------------------------------------------------------------------ |

31| Claude for Teams / Enterprise | You want Claude Code and claude.ai under one per-seat subscription with no infrastructure to run. This is the default recommendation. |

32| Claude Console | You're API-first or want pay-as-you-go billing |

33| Amazon Bedrock | You want to inherit existing AWS compliance controls and billing |

34| Google Vertex AI | You want to inherit existing GCP compliance controls and billing |

35| Microsoft Foundry | You want to inherit existing Azure compliance controls and billing |

36 

37For the full provider comparison covering authentication, regions, and feature parity, see the [enterprise deployment overview](/en/third-party-integrations). Each provider's auth setup is in [Authentication](/en/authentication).

38 

39Proxy and firewall requirements in [Network configuration](/en/network-config) apply regardless of provider. If you want a single endpoint in front of multiple providers or centralized request logging, see [LLM gateway](/en/llm-gateway).

40 

41## Decide how settings reach devices

42 

43Managed settings define policy that takes precedence over local developer configuration. Claude Code looks for them in four places and uses the first one it finds on a given device.

44 

45| Mechanism | Delivery | Priority | Platforms |

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

47| Server-managed | Claude.ai admin console | Highest | All |

48| plist / registry policy | macOS: `com.anthropic.claudecode` plist<br />Windows: `HKLM\SOFTWARE\Policies\ClaudeCode` | High | macOS, Windows |

49| File-based managed | macOS: `/Library/Application Support/ClaudeCode/managed-settings.json`<br />Linux and WSL: `/etc/claude-code/managed-settings.json`<br />Windows: `C:\Program Files\ClaudeCode\managed-settings.json` | Medium | All |

50| Windows user registry | `HKCU\SOFTWARE\Policies\ClaudeCode` | Lowest | Windows only |

51 

52Server-managed settings reach devices at authentication time and refresh hourly during active sessions, with no endpoint infrastructure. They require a Claude for Teams or Enterprise plan, so deployments on other providers need one of the file-based or OS-level mechanisms instead.

53 

54If your organization mixes providers, configure [server-managed settings](/en/server-managed-settings) for Claude.ai users plus a [file-based or plist/registry fallback](/en/settings#settings-files) so other users still receive managed policy.

55 

56The plist and HKLM registry locations work with any provider and resist tampering because they require admin privileges to write. The Windows user registry at HKCU is writable without elevation, so treat it as a convenience default rather than an enforcement channel.

57 

58By default WSL reads only the Linux file path at `/etc/claude-code`. To extend your Windows registry and `C:\Program Files\ClaudeCode` policy to WSL on the same machine, set [`wslInheritsWindowsSettings: true`](/en/settings#available-settings) in either of those admin-only Windows sources.

59 

60Whichever mechanism you choose, managed values take precedence over user and project settings. Array settings such as `permissions.allow` and `permissions.deny` merge entries from all sources, so developers can extend managed lists but not remove from them.

61 

62See [Server-managed settings](/en/server-managed-settings) and [Settings files and precedence](/en/settings#settings-files).

63 

64## Decide what to enforce

65 

66Managed settings can lock down tools, sandbox execution, restrict MCP servers and plugin sources, and control which hooks run. Each row is a control surface with the setting keys that drive it.

67 

68| Control | What it does | Key settings |

69| :------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |

70| [Permission rules](/en/permissions) | Allow, ask, or deny specific tools and commands | `permissions.allow`, `permissions.deny` |

71| [Permission lockdown](/en/permissions#managed-only-settings) | Only managed permission rules apply; disable `--dangerously-skip-permissions` | `allowManagedPermissionRulesOnly`, `permissions.disableBypassPermissionsMode` |

72| [Sandboxing](/en/sandboxing) | OS-level filesystem and network isolation with domain allowlists | `sandbox.enabled`, `sandbox.network.allowedDomains` |

73| [Managed policy CLAUDE.md](/en/memory#deploy-organization-wide-claude-md) | Org-wide instructions loaded in every session, cannot be excluded | File at the managed policy path |

74| [MCP server control](/en/mcp#managed-mcp-configuration) | Restrict which MCP servers users can add or connect to | `allowedMcpServers`, `deniedMcpServers`, `allowManagedMcpServersOnly` |

75| [Plugin marketplace control](/en/plugin-marketplaces#managed-marketplace-restrictions) | Restrict which marketplace sources users can add and install from | `strictKnownMarketplaces`, `blockedMarketplaces` |

76| [Hook restrictions](/en/settings#hook-configuration) | Only managed hooks load; restrict HTTP hook URLs | `allowManagedHooksOnly`, `allowedHttpHookUrls` |

77| [Version floor](/en/settings) | Prevent auto-update from installing below an org-wide minimum | `minimumVersion` |

78 

79Permission rules and sandboxing cover different layers. Denying WebFetch blocks Claude's fetch tool, but if Bash is allowed, `curl` and `wget` can still reach any URL. Sandboxing closes that gap with a network domain allowlist enforced at the OS level.

80 

81For the threat model these controls defend against, see [Security](/en/security).

82 

83## Set up usage visibility

84 

85Choose monitoring based on what you need to report on.

86 

87| Capability | What you get | Availability | Where to start |

88| :------------------ | :--------------------------------------------------- | :------------- | :--------------------------------------- |

89| Usage monitoring | OpenTelemetry export of sessions, tools, and tokens | All providers | [Monitoring usage](/en/monitoring-usage) |

90| Analytics dashboard | Per-user metrics, contribution tracking, leaderboard | Anthropic only | [Analytics](/en/analytics) |

91| Cost tracking | Spend limits, rate limits, and usage attribution | Anthropic only | [Costs](/en/costs) |

92 

93Cloud providers expose spend through AWS Cost Explorer, GCP Billing, or Azure Cost Management. Claude for Teams and Enterprise plans include a usage dashboard at [claude.ai/analytics/claude-code](https://claude.ai/analytics/claude-code).

94 

95## Review data handling

96 

97On Team, Enterprise, Claude API, and cloud provider plans, Anthropic does not train models on your code or prompts. Your API provider determines retention and compliance posture.

98 

99| Topic | What to know | Where to start |

100| :------------------------ | :------------------------------------------------------------------------------ | :--------------------------------------------- |

101| Data usage policy | What Anthropic collects, how long it's retained, what's never used for training | [Data usage](/en/data-usage) |

102| Zero Data Retention (ZDR) | Nothing stored after the request completes. Available on Claude for Enterprise | [Zero data retention](/en/zero-data-retention) |

103| Security architecture | Network model, encryption, authentication, audit trail | [Security](/en/security) |

104 

105If you need request-level audit logging or to route traffic by data sensitivity, place an [LLM gateway](/en/llm-gateway) between developers and your provider. For regulatory requirements and certifications, see [Legal and compliance](/en/legal-and-compliance).

106 

107## Verify and onboard

108 

109After configuring managed settings, have a developer run `/status` inside Claude Code. The output includes a line beginning with `Enterprise managed settings` followed by the source in parentheses, one of `(remote)`, `(plist)`, `(HKLM)`, `(HKCU)`, or `(file)`. See [Verify active settings](/en/settings#verify-active-settings).

110 

111Share these resources to help developers get started:

112 

113* [Quickstart](/en/quickstart): first-session walkthrough from install to working with a project

114* [Common workflows](/en/common-workflows): patterns for everyday tasks like code review, refactoring, and debugging

115* [Claude 101](https://anthropic.skilljar.com/claude-101) and [Claude Code in Action](https://anthropic.skilljar.com/claude-code-in-action): self-paced Anthropic Academy courses

116 

117For login issues, point developers to [authentication troubleshooting](/en/troubleshooting#authentication-issues). The most common fixes are:

118 

119* Run `/logout` then `/login` to switch accounts

120* Run `claude update` if the enterprise auth option is missing

121* Restart the terminal after updating

122 

123If a developer sees "You haven't been added to your organization yet," their seat doesn't include Claude Code access and needs to be updated in the admin console.

124 

125## Next steps

126 

127With provider and delivery mechanism chosen, move on to detailed configuration:

128 

129* [Server-managed settings](/en/server-managed-settings): deliver managed policy from the Claude admin console

130* [Settings reference](/en/settings): every setting key, file location, and precedence rule

131* [Amazon Bedrock](/en/amazon-bedrock), [Google Vertex AI](/en/google-vertex-ai), [Microsoft Foundry](/en/microsoft-foundry): provider-specific deployment

132* [Claude Enterprise Administrator Guide](https://claude.com/resources/tutorials/claude-enterprise-administrator-guide): SSO, SCIM, seat management, and rollout playbook

Details

243### When to use which hook type243### When to use which hook type

244 244 

245| Hook type | Best for |245| Hook type | Best for |

246| :---------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |246| :---------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

247| **Filesystem** (`settings.json`) | Sharing hooks between CLI and SDK sessions. Supports `"command"` (shell scripts), `"http"` (POST to an endpoint), `"prompt"` (LLM evaluates a prompt), and `"agent"` (spawns a verifier agent). These fire in the main agent and any subagents it spawns. |247| **Filesystem** (`settings.json`) | Sharing hooks between CLI and SDK sessions. Supports `"command"` (shell scripts), `"http"` (POST to an endpoint), `"mcp_tool"` (call a connected MCP server's tool), `"prompt"` (LLM evaluates a prompt), and `"agent"` (spawns a verifier agent). These fire in the main agent and any subagents it spawns. |

248| **Programmatic** (callbacks in `query()`) | Application-specific logic; returning structured decisions; in-process integration. Scoped to the main session only. |248| **Programmatic** (callbacks in `query()`) | Application-specific logic; returning structured decisions; in-process integration. Scoped to the main session only. |

249 249 

250<Note>250<Note>

Details

145The SDK provides hooks for different stages of agent execution. Some hooks are available in both SDKs, while others are TypeScript-only.145The SDK provides hooks for different stages of agent execution. Some hooks are available in both SDKs, while others are TypeScript-only.

146 146 

147| Hook Event | Python SDK | TypeScript SDK | What triggers it | Example use case |147| Hook Event | Python SDK | TypeScript SDK | What triggers it | Example use case |

148| -------------------- | ---------- | -------------- | --------------------------------------- | ----------------------------------------------- |148| -------------------- | ---------- | -------------- | ------------------------------------------------------------------------------ | ----------------------------------------------- |

149| `PreToolUse` | Yes | Yes | Tool call request (can block or modify) | Block dangerous shell commands |149| `PreToolUse` | Yes | Yes | Tool call request (can block or modify) | Block dangerous shell commands |

150| `PostToolUse` | Yes | Yes | Tool execution result | Log all file changes to audit trail |150| `PostToolUse` | Yes | Yes | Tool execution result | Log all file changes to audit trail |

151| `PostToolUseFailure` | Yes | Yes | Tool execution failure | Handle or log tool errors |151| `PostToolUseFailure` | Yes | Yes | Tool execution failure | Handle or log tool errors |

152| `PostToolBatch` | No | Yes | A full batch of tool calls resolves, once per batch before the next model call | Inject conventions once for the whole batch |

152| `UserPromptSubmit` | Yes | Yes | User prompt submission | Inject additional context into prompts |153| `UserPromptSubmit` | Yes | Yes | User prompt submission | Inject additional context into prompts |

153| `Stop` | Yes | Yes | Agent execution stop | Save session state before exit |154| `Stop` | Yes | Yes | Agent execution stop | Save session state before exit |

154| `SubagentStart` | Yes | Yes | Subagent initialization | Track parallel task spawning |155| `SubagentStart` | Yes | Yes | Subagent initialization | Track parallel task spawning |


235Your callback returns an object with two categories of fields:236Your callback returns an object with two categories of fields:

236 237 

237* **Top-level fields** control the conversation: `systemMessage` injects a message into the conversation visible to the model, and `continue` (`continue_` in Python) determines whether the agent keeps running after this hook.238* **Top-level fields** control the conversation: `systemMessage` injects a message into the conversation visible to the model, and `continue` (`continue_` in Python) determines whether the agent keeps running after this hook.

238* **`hookSpecificOutput`** controls the current operation. The fields inside depend on the hook event type. For `PreToolUse` hooks, this is where you set `permissionDecision` (`"allow"`, `"deny"`, or `"ask"`), `permissionDecisionReason`, and `updatedInput`. For `PostToolUse` hooks, you can set `additionalContext` to append information to the tool result.239* **`hookSpecificOutput`** controls the current operation. The fields inside depend on the hook event type. For `PreToolUse` hooks, this is where you set `permissionDecision` (`"allow"`, `"deny"`, or `"ask"`), `permissionDecisionReason`, and `updatedInput`. In the TypeScript SDK, `permissionDecision` also accepts `"defer"` to end the query and [resume later](/en/hooks#defer-a-tool-call-for-later); this value is not available in the Python SDK. For `PostToolUse` hooks, you can set `additionalContext` to append information to the tool result.

239 240 

240Return `{}` to allow the operation without changes. SDK callback hooks use the same JSON output format as [Claude Code shell command hooks](/en/hooks#json-output), which documents every field and event-specific option. For the SDK type definitions, see the [TypeScript](/en/agent-sdk/typescript#sync-hook-json-output) and [Python](/en/agent-sdk/python#sync-hook-json-output) SDK references.241Return `{}` to allow the operation without changes. SDK callback hooks use the same JSON output format as [Claude Code shell command hooks](/en/hooks#json-output), which documents every field and event-specific option. For the SDK type definitions, see the [TypeScript](/en/agent-sdk/typescript#sync-hook-json-output) and [Python](/en/agent-sdk/python#sync-hook-json-output) SDK references.

241 242 

242<Note>243<Note>

243 When multiple hooks or permission rules apply, **deny** takes priority over **ask**, which takes priority over **allow**. If any hook returns `deny`, the operation is blocked regardless of other hooks.244 When multiple hooks or permission rules apply, **deny** takes priority over **defer**, which takes priority over **ask**, which takes priority over **allow**. If any hook returns `deny`, the operation is blocked regardless of other hooks.

244</Note>245</Note>

245 246 

246#### Asynchronous output247#### Asynchronous output

Details

1799```1799```

1800 1800 

1801<Note>1801<Note>

1802 The TypeScript SDK supports additional hook events not yet available in Python: `SessionStart`, `SessionEnd`, `Setup`, `TeammateIdle`, `TaskCompleted`, `ConfigChange`, `WorktreeCreate`, and `WorktreeRemove`.1802 The TypeScript SDK supports additional hook events not yet available in Python: `SessionStart`, `SessionEnd`, `Setup`, `TeammateIdle`, `TaskCompleted`, `ConfigChange`, `WorktreeCreate`, `WorktreeRemove`, and `PostToolBatch`.

1803</Note>1803</Note>

1804 1804 

1805### `HookCallback`1805### `HookCallback`

Details

22 })) {22 })) {

23 if (message.type === "system" && message.subtype === "init") {23 if (message.type === "system" && message.subtype === "init") {

24 console.log("Available slash commands:", message.slash_commands);24 console.log("Available slash commands:", message.slash_commands);

25 // Example output: ["/compact", "/context", "/cost"]25 // Example output: ["/compact", "/context", "/usage"]

26 }26 }

27 }27 }

28 ```28 ```


36 async for message in query(prompt="Hello Claude", options=ClaudeAgentOptions(max_turns=1)):36 async for message in query(prompt="Hello Claude", options=ClaudeAgentOptions(max_turns=1)):

37 if isinstance(message, SystemMessage) and message.subtype == "init":37 if isinstance(message, SystemMessage) and message.subtype == "init":

38 print("Available slash commands:", message.data["slash_commands"])38 print("Available slash commands:", message.data["slash_commands"])

39 # Example output: ["/compact", "/context", "/cost"]39 # Example output: ["/compact", "/context", "/usage"]

40 40 

41 41 

42 asyncio.run(main())42 asyncio.run(main())


199 if (message.type === "system" && message.subtype === "init") {199 if (message.type === "system" && message.subtype === "init") {

200 // Will include both built-in and custom commands200 // Will include both built-in and custom commands

201 console.log("Available commands:", message.slash_commands);201 console.log("Available commands:", message.slash_commands);

202 // Example: ["/compact", "/context", "/cost", "/refactor", "/security-check"]202 // Example: ["/compact", "/context", "/usage", "/refactor", "/security-check"]

203 }203 }

204 }204 }

205 ```205 ```


224 if isinstance(message, SystemMessage) and message.subtype == "init":224 if isinstance(message, SystemMessage) and message.subtype == "init":

225 # Will include both built-in and custom commands225 # Will include both built-in and custom commands

226 print("Available commands:", message.data["slash_commands"])226 print("Available commands:", message.data["slash_commands"])

227 # Example: ["/compact", "/context", "/cost", "/refactor", "/security-check"]227 # Example: ["/compact", "/context", "/usage", "/refactor", "/security-check"]

228 228 

229 229 

230 asyncio.run(main())230 asyncio.run(main())

Details

895 modelUsage: { [modelName: string]: ModelUsage };895 modelUsage: { [modelName: string]: ModelUsage };

896 permission_denials: SDKPermissionDenial[];896 permission_denials: SDKPermissionDenial[];

897 structured_output?: unknown;897 structured_output?: unknown;

898 deferred_tool_use?: { id: string; name: string; input: Record<string, unknown> };

898 }899 }

899 | {900 | {

900 type: "result";901 type: "result";


918 };919 };

919```920```

920 921 

922When a `PreToolUse` hook returns `permissionDecision: "defer"`, the result has `stop_reason: "tool_deferred"` and `deferred_tool_use` carries the pending tool's `id`, `name`, and `input`. Read this field to surface the request in your own UI, then resume with the same `session_id` to continue. See [Defer a tool call for later](/en/hooks#defer-a-tool-call-for-later) for the full round trip.

923 

921### `SDKSystemMessage`924### `SDKSystemMessage`

922 925 

923System initialization message.926System initialization message.


1019 | "PreToolUse"1022 | "PreToolUse"

1020 | "PostToolUse"1023 | "PostToolUse"

1021 | "PostToolUseFailure"1024 | "PostToolUseFailure"

1025 | "PostToolBatch"

1022 | "Notification"1026 | "Notification"

1023 | "UserPromptSubmit"1027 | "UserPromptSubmit"

1024 | "SessionStart"1028 | "SessionStart"


1069 | PreToolUseHookInput1073 | PreToolUseHookInput

1070 | PostToolUseHookInput1074 | PostToolUseHookInput

1071 | PostToolUseFailureHookInput1075 | PostToolUseFailureHookInput

1076 | PostToolBatchHookInput

1072 | NotificationHookInput1077 | NotificationHookInput

1073 | UserPromptSubmitHookInput1078 | UserPromptSubmitHookInput

1074 | SessionStartHookInput1079 | SessionStartHookInput


1137};1142};

1138```1143```

1139 1144 

1145#### `PostToolBatchHookInput`

1146 

1147Fires once after every tool call in a batch has resolved, before the next model request. `tool_response` carries the serialized `tool_result` content the model sees; the shape differs from `PostToolUseHookInput`'s structured `Output` object.

1148 

1149```typescript theme={null}

1150type PostToolBatchHookInput = BaseHookInput & {

1151 hook_event_name: "PostToolBatch";

1152 tool_calls: PostToolBatchToolCall[];

1153};

1154 

1155type PostToolBatchToolCall = {

1156 tool_name: string;

1157 tool_input: unknown;

1158 tool_use_id: string;

1159 tool_response?: unknown;

1160};

1161```

1162 

1140#### `NotificationHookInput`1163#### `NotificationHookInput`

1141 1164 

1142```typescript theme={null}1165```typescript theme={null}


1326 hookSpecificOutput?:1349 hookSpecificOutput?:

1327 | {1350 | {

1328 hookEventName: "PreToolUse";1351 hookEventName: "PreToolUse";

1329 permissionDecision?: "allow" | "deny" | "ask";1352 permissionDecision?: "allow" | "deny" | "ask" | "defer";

1330 permissionDecisionReason?: string;1353 permissionDecisionReason?: string;

1331 updatedInput?: Record<string, unknown>;1354 updatedInput?: Record<string, unknown>;

1332 additionalContext?: string;1355 additionalContext?: string;


1356 hookEventName: "PostToolUseFailure";1379 hookEventName: "PostToolUseFailure";

1357 additionalContext?: string;1380 additionalContext?: string;

1358 }1381 }

1382 | {

1383 hookEventName: "PostToolBatch";

1384 additionalContext?: string;

1385 }

1359 | {1386 | {

1360 hookEventName: "Notification";1387 hookEventName: "Notification";

1361 additionalContext?: string;1388 additionalContext?: string;


1391 | AskUserQuestionInput1418 | AskUserQuestionInput

1392 | BashInput1419 | BashInput

1393 | TaskOutputInput1420 | TaskOutputInput

1394 | ConfigInput

1395 | EnterWorktreeInput1421 | EnterWorktreeInput

1396 | ExitPlanModeInput1422 | ExitPlanModeInput

1397 | FileEditInput1423 | FileEditInput


1691 1717 

1692Reads a specific MCP resource from a server.1718Reads a specific MCP resource from a server.

1693 1719 

1694### Config

1695 

1696**Tool name:** `Config`

1697 

1698```typescript theme={null}

1699type ConfigInput = {

1700 setting: string;

1701 value?: string | boolean | number;

1702};

1703```

1704 

1705Gets or sets a configuration value.

1706 

1707### EnterWorktree1720### EnterWorktree

1708 1721 

1709**Tool name:** `EnterWorktree`1722**Tool name:** `EnterWorktree`


1730 | AgentOutput1743 | AgentOutput

1731 | AskUserQuestionOutput1744 | AskUserQuestionOutput

1732 | BashOutput1745 | BashOutput

1733 | ConfigOutput

1734 | EnterWorktreeOutput1746 | EnterWorktreeOutput

1735 | ExitPlanModeOutput1747 | ExitPlanModeOutput

1736 | FileEditOutput1748 | FileEditOutput


2146 2158 

2147Returns the contents of the requested MCP resource.2159Returns the contents of the requested MCP resource.

2148 2160 

2149### Config

2150 

2151**Tool name:** `Config`

2152 

2153```typescript theme={null}

2154type ConfigOutput = {

2155 success: boolean;

2156 operation?: "get" | "set";

2157 setting?: string;

2158 value?: unknown;

2159 previousValue?: unknown;

2160 newValue?: unknown;

2161 error?: string;

2162};

2163```

2164 

2165Returns the result of a configuration get or set operation.

2166 

2167### EnterWorktree2161### EnterWorktree

2168 2162 

2169**Tool name:** `EnterWorktree`2163**Tool name:** `EnterWorktree`


2745 2739 

2746### `SDKLocalCommandOutputMessage`2740### `SDKLocalCommandOutputMessage`

2747 2741 

2748Output from a local slash command (for example, `/voice` or `/cost`). Displayed as assistant-style text in the transcript.2742Output from a local slash command (for example, `/voice` or `/usage`). Displayed as assistant-style text in the transcript.

2749 2743 

2750```typescript theme={null}2744```typescript theme={null}

2751type SDKLocalCommandOutputMessage = {2745type SDKLocalCommandOutputMessage = {

Details

12 12 

13For clarifying questions, Claude generates the questions and options. Your role is to present them to users and return their selections. You can't add your own questions to this flow; if you need to ask users something yourself, do that separately in your application logic.13For clarifying questions, Claude generates the questions and options. Your role is to present them to users and return their selections. You can't add your own questions to this flow; if you need to ask users something yourself, do that separately in your application logic.

14 14 

15The callback can stay pending indefinitely. Execution remains paused until your callback returns, and the SDK only cancels the wait when the query itself is cancelled. If a user might take longer to respond than your process can reasonably stay running, the TypeScript SDK supports the [`defer` hook decision](/en/hooks#defer-a-tool-call-for-later), which lets the process exit and resume later from the persisted session; this option is not available in the Python SDK.

16 

15This guide shows you how to detect each type of request and respond appropriately.17This guide shows you how to detect each type of request and respond appropriately.

16 18 

17## Detect when Claude needs input19## Detect when Claude needs input

agent-teams.md +1 −5

Details

262* **Automatic message delivery**: when teammates send messages, they're delivered automatically to recipients. The lead doesn't need to poll for updates.262* **Automatic message delivery**: when teammates send messages, they're delivered automatically to recipients. The lead doesn't need to poll for updates.

263* **Idle notifications**: when a teammate finishes and stops, they automatically notify the lead.263* **Idle notifications**: when a teammate finishes and stops, they automatically notify the lead.

264* **Shared task list**: all agents can see task status and claim available work.264* **Shared task list**: all agents can see task status and claim available work.

265 265* **Teammate messaging**: send a message to one specific teammate by name. To reach everyone, send one message per recipient.

266**Teammate messaging:**

267 

268* **message**: send a message to one specific teammate

269* **broadcast**: send to all teammates simultaneously. Use sparingly, as costs scale with team size.

270 266 

271The lead assigns every teammate a name when it spawns them, and any teammate can message any other by that name. To get predictable names you can reference in later prompts, tell the lead what to call each teammate in your spawn instruction.267The lead assigns every teammate a name when it spawns them, and any teammate can message any other by that name. To get predictable names you can reference in later prompts, tell the lead what to call each teammate in your spawn instruction.

272 268 

Details

45 45 

46For most organizations, `autoMode.environment` is the only field you need to set. It tells the classifier which repos, buckets, and domains are trusted: the classifier uses it to decide what "external" means, so any destination not listed is a potential exfiltration target.46For most organizations, `autoMode.environment` is the only field you need to set. It tells the classifier which repos, buckets, and domains are trusted: the classifier uses it to decide what "external" means, so any destination not listed is a potential exfiltration target.

47 47 

48Setting `environment` replaces the default environment list, which includes the entry that trusts the working repo and its remotes. Run `claude auto-mode defaults` to print the defaults, then include them alongside your own entries so you extend the list rather than narrow it.48The default environment list trusts the working repo and its configured remotes. To add your own entries alongside that default, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them.

49 49 

50```json theme={null}50```json theme={null}

51{51{

52 "autoMode": {52 "autoMode": {

53 "environment": [53 "environment": [

54 "$defaults",

54 "Source control: github.example.com/acme-corp and all repos under it",55 "Source control: github.example.com/acme-corp and all repos under it",

55 "Trusted cloud buckets: s3://acme-build-artifacts, gs://acme-ml-datasets",56 "Trusted cloud buckets: s3://acme-build-artifacts, gs://acme-ml-datasets",

56 "Trusted internal domains: *.corp.example.com, api.internal.example.com",57 "Trusted internal domains: *.corp.example.com, api.internal.example.com",


75{76{

76 "autoMode": {77 "autoMode": {

77 "environment": [78 "environment": [

79 "$defaults",

78 "Organization: {COMPANY_NAME}. Primary use: {PRIMARY_USE_CASE, e.g. software development, infrastructure automation}",80 "Organization: {COMPANY_NAME}. Primary use: {PRIMARY_USE_CASE, e.g. software development, infrastructure automation}",

79 "Source control: {SOURCE_CONTROL, e.g. GitHub org github.example.com/acme-corp}",81 "Source control: {SOURCE_CONTROL, e.g. GitHub org github.example.com/acme-corp}",

80 "Cloud provider(s): {CLOUD_PROVIDERS, e.g. AWS, GCP, Azure}",82 "Cloud provider(s): {CLOUD_PROVIDERS, e.g. AWS, GCP, Azure}",


103 105 

104General requests don't count as explicit intent. Asking Claude to "clean up the repo" does not authorize force-pushing, but asking Claude to "force-push this branch" does.106General requests don't count as explicit intent. Asking Claude to "clean up the repo" does not authorize force-pushing, but asking Claude to "force-push this branch" does.

105 107 

106<Danger>108To loosen, add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don't cover. To tighten, add to `soft_deny` for risks specific to your environment that the defaults miss. To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases.

107 Setting any of `environment`, `allow`, or `soft_deny` replaces the entire default list for that section. If you set `soft_deny` with a single entry, every built-in block rule is discarded: force push, data exfiltration, `curl | bash`, production deploys, and all other default block rules become allowed. To customize safely, run `claude auto-mode defaults` to print the built-in rules, copy them into your settings file, then review each rule against your own pipeline and risk tolerance. Only remove rules for risks your infrastructure already mitigates.

108</Danger>

109 

110To loosen: remove rules from `soft_deny` when the defaults block something your pipeline already guards against with PR review, CI, or staging environments, or add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don't cover. To tighten: add to `soft_deny` for risks specific to your environment that the defaults miss, or remove from `allow` to hold a default exception to the block rules. In all cases, run `claude auto-mode defaults` to get the full default lists, then copy and edit: never start from an empty list.

111 109 

112```json theme={null}110```json theme={null}

113{111{

114 "autoMode": {112 "autoMode": {

115 "environment": [113 "environment": [

114 "$defaults",

116 "Source control: github.example.com/acme-corp and all repos under it"115 "Source control: github.example.com/acme-corp and all repos under it"

117 ],116 ],

118 "allow": [117 "allow": [

118 "$defaults",

119 "Deploying to the staging namespace is allowed: staging is isolated from production and resets nightly",119 "Deploying to the staging namespace is allowed: staging is isolated from production and resets nightly",

120 "Writing to s3://acme-scratch/ is allowed: ephemeral bucket with a 7-day lifecycle policy"120 "Writing to s3://acme-scratch/ is allowed: ephemeral bucket with a 7-day lifecycle policy"

121 ],121 ],

122 "soft_deny": [122 "soft_deny": [

123 "$defaults",

123 "Never run database migrations outside the migrations CLI, even against dev databases",124 "Never run database migrations outside the migrations CLI, even against dev databases",

124 "Never modify files under infra/terraform/prod/: production infrastructure changes go through the review workflow",125 "Never modify files under infra/terraform/prod/: production infrastructure changes go through the review workflow"

125 "...copy full default soft_deny list here first, then add your rules..."

126 ]126 ]

127 }127 }

128}128}

129```129```

130 130 

131Each section replaces only its own default, so setting `environment` alone leaves the default `allow` and `soft_deny` lists intact.131<Danger>

132 Setting any of `environment`, `allow`, or `soft_deny` without `"$defaults"` replaces the entire default list for that section. If you set `soft_deny` with a single entry and omit `"$defaults"`, every built-in block rule is discarded: force push, data exfiltration, `curl | bash`, production deploys, and all other default block rules become allowed. Only omit `"$defaults"` when you intend to take full ownership of the list. In that case, run `claude auto-mode defaults` to print the built-in rules, copy them into your settings file, then review each rule against your own pipeline and risk tolerance.

133</Danger>

134 

135Each section is evaluated independently, so setting `environment` alone leaves the default `allow` and `soft_deny` lists intact.

132 136 

133## Inspect the defaults and your effective config137## Inspect the defaults and your effective config

134 138 

135Because setting any of the three arrays replaces its defaults, start any customization by copying the full default lists. Three CLI subcommands help you inspect and validate.139Three CLI subcommands help you inspect and validate your configuration.

136 140 

137Print the built-in `environment`, `allow`, and `soft_deny` rules as JSON:141Print the built-in `environment`, `allow`, and `soft_deny` rules as JSON:

138 142 


152claude auto-mode critique156claude auto-mode critique

153```157```

154 158 

155Save the output of `claude auto-mode defaults` to a file, edit the lists to match your policy, and paste the result into your settings file. After saving, run `claude auto-mode config` to confirm the effective rules are what you expect. If you've written custom rules, `claude auto-mode critique` reviews them and flags entries that are ambiguous, redundant, or likely to cause false positives.159Run `claude auto-mode config` after saving your settings to confirm the effective rules are what you expect, with `"$defaults"` expanded in place. If you've written custom rules, `claude auto-mode critique` reviews them and flags entries that are ambiguous, redundant, or likely to cause false positives. If you need to remove or rewrite a built-in rule rather than add alongside it, save the output of `claude auto-mode defaults` to a file, edit the lists, and paste the result into your settings file in place of `"$defaults"`.

156 160 

157## Review denials161## Review denials

158 162 

Details

501 ]501 ]

502}`,502}`,

503 docsLink: '/en/keybindings'503 docsLink: '/en/keybindings'

504 }, {

505 id: 'themes',

506 label: 'themes/',

507 type: 'folder',

508 icon: 'folder',

509 color: '#5AA7A7',

510 oneLiner: 'Custom color themes',

511 when: <>Read at session start and hot-reloaded when files change. Listed in <C>/theme</C></>,

512 description: <>Each <C>.json</C> file defines a custom color theme: a built-in <C>base</C> preset plus an <C>overrides</C> map of color tokens. Create one interactively with <C>/theme</C> or write the JSON by hand. Selecting a custom theme stores <C>custom:&lt;slug&gt;</C> as your theme preference.</>,

513 example: `{

514 "name": "Dracula",

515 "base": "dark",

516 "overrides": {

517 "claude": "#bd93f9",

518 "error": "#ff5555",

519 "success": "#50fa7b"

520 }

521}`,

522 docsLink: '/en/terminal-config#create-a-custom-theme',

523 children: []

504 }, {524 }, {

505 id: 'global-projects',525 id: 'global-projects',

506 label: 'projects/',526 label: 'projects/',


1460| [`~/.claude.json`](#ce-claude-json) | Global only | | App state, OAuth, UI toggles, personal MCP servers | [Global config](/en/settings#global-config-settings) |1480| [`~/.claude.json`](#ce-claude-json) | Global only | | App state, OAuth, UI toggles, personal MCP servers | [Global config](/en/settings#global-config-settings) |

1461| [`projects/<project>/memory/`](#ce-global-projects) | Global only | | Auto memory: Claude's notes to itself across sessions | [Auto memory](/en/memory#auto-memory) |1481| [`projects/<project>/memory/`](#ce-global-projects) | Global only | | Auto memory: Claude's notes to itself across sessions | [Auto memory](/en/memory#auto-memory) |

1462| [`keybindings.json`](#ce-keybindings) | Global only | | Custom keyboard shortcuts | [Keybindings](/en/keybindings) |1482| [`keybindings.json`](#ce-keybindings) | Global only | | Custom keyboard shortcuts | [Keybindings](/en/keybindings) |

1483| [`themes/*.json`](#ce-themes) | Global only | | Custom color themes | [Custom themes](/en/terminal-config#create-a-custom-theme) |

1463 1484 

1464## Troubleshoot configuration1485## Troubleshoot configuration

1465 1486 


1493| Path under `~/.claude/` | Contents |1514| Path under `~/.claude/` | Contents |

1494| ----------------------- | ------------------------------------------------------------------------------------- |1515| ----------------------- | ------------------------------------------------------------------------------------- |

1495| `history.jsonl` | Every prompt you've typed, with timestamp and project path. Used for up-arrow recall. |1516| `history.jsonl` | Every prompt you've typed, with timestamp and project path. Used for up-arrow recall. |

1496| `stats-cache.json` | Aggregated token and cost counts shown by `/cost` |1517| `stats-cache.json` | Aggregated token and cost counts shown by `/usage` |

1497| `todos/` | Legacy per-session task lists. No longer written by current versions; safe to delete. |1518| `todos/` | Legacy per-session task lists. No longer written by current versions; safe to delete. |

1498 1519 

1499Other small cache and lock files appear depending on which features you use and are safe to delete.1520Other small cache and lock files appear depending on which features you use and are safe to delete.


1515| `~/.claude/projects/` | Resume, continue, and rewind for past sessions |1536| `~/.claude/projects/` | Resume, continue, and rewind for past sessions |

1516| `~/.claude/history.jsonl` | Up-arrow prompt recall |1537| `~/.claude/history.jsonl` | Up-arrow prompt recall |

1517| `~/.claude/file-history/` | Checkpoint restore for past sessions |1538| `~/.claude/file-history/` | Checkpoint restore for past sessions |

1518| `~/.claude/stats-cache.json` | Historical totals shown by `/cost` |1539| `~/.claude/stats-cache.json` | Historical totals shown by `/usage` |

1519| `~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/` | Nothing user-facing |1540| `~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/` | Nothing user-facing |

1520| `~/.claude/todos/` | Nothing. Legacy directory not written by current versions. |1541| `~/.claude/todos/` | Nothing. Legacy directory not written by current versions. |

1521 1542 

Details

20| `claude -c -p "query"` | Continue via SDK | `claude -c -p "Check for type errors"` |20| `claude -c -p "query"` | Continue via SDK | `claude -c -p "Check for type errors"` |

21| `claude -r "<session>" "query"` | Resume session by ID or name | `claude -r "auth-refactor" "Finish this PR"` |21| `claude -r "<session>" "query"` | Resume session by ID or name | `claude -r "auth-refactor" "Finish this PR"` |

22| `claude update` | Update to latest version | `claude update` |22| `claude update` | Update to latest version | `claude update` |

23| `claude install [version]` | Install or reinstall the native binary. Accepts a version like `2.1.118`, or `stable` or `latest`. See [Install a specific version](/en/setup#install-a-specific-version) | `claude install stable` |

23| `claude auth login` | Sign in to your Anthropic account. Use `--email` to pre-fill your email address, `--sso` to force SSO authentication, and `--console` to sign in with Anthropic Console for API usage billing instead of a Claude subscription | `claude auth login --console` |24| `claude auth login` | Sign in to your Anthropic account. Use `--email` to pre-fill your email address, `--sso` to force SSO authentication, and `--console` to sign in with Anthropic Console for API usage billing instead of a Claude subscription | `claude auth login --console` |

24| `claude auth logout` | Log out from your Anthropic account | `claude auth logout` |25| `claude auth logout` | Log out from your Anthropic account | `claude auth logout` |

25| `claude auth status` | Show authentication status as JSON. Use `--text` for human-readable output. Exits with code 0 if logged in, 1 if not | `claude auth status` |26| `claude auth status` | Show authentication status as JSON. Use `--text` for human-readable output. Exits with code 0 if logged in, 1 if not | `claude auth status` |


49| `--betas` | Beta headers to include in API requests (API key users only) | `claude --betas interleaved-thinking` |50| `--betas` | Beta headers to include in API requests (API key users only) | `claude --betas interleaved-thinking` |

50| `--channels` | (Research preview) MCP servers whose [channel](/en/channels) notifications Claude should listen for in this session. Space-separated list of `plugin:<name>@<marketplace>` entries. Requires Claude.ai authentication | `claude --channels plugin:my-notifier@my-marketplace` |51| `--channels` | (Research preview) MCP servers whose [channel](/en/channels) notifications Claude should listen for in this session. Space-separated list of `plugin:<name>@<marketplace>` entries. Requires Claude.ai authentication | `claude --channels plugin:my-notifier@my-marketplace` |

51| `--chrome` | Enable [Chrome browser integration](/en/chrome) for web automation and testing | `claude --chrome` |52| `--chrome` | Enable [Chrome browser integration](/en/chrome) for web automation and testing | `claude --chrome` |

52| `--continue`, `-c` | Load the most recent conversation in the current directory | `claude --continue` |53| `--continue`, `-c` | Load the most recent conversation in the current directory. Includes sessions that added this directory with `/add-dir` | `claude --continue` |

53| `--dangerously-load-development-channels` | Enable [channels](/en/channels-reference#test-during-the-research-preview) that are not on the approved allowlist, for local development. Accepts `plugin:<name>@<marketplace>` and `server:<name>` entries. Prompts for confirmation | `claude --dangerously-load-development-channels server:webhook` |54| `--dangerously-load-development-channels` | Enable [channels](/en/channels-reference#test-during-the-research-preview) that are not on the approved allowlist, for local development. Accepts `plugin:<name>@<marketplace>` and `server:<name>` entries. Prompts for confirmation | `claude --dangerously-load-development-channels server:webhook` |

54| `--dangerously-skip-permissions` | Skip permission prompts. Equivalent to `--permission-mode bypassPermissions`. See [permission modes](/en/permission-modes#skip-all-checks-with-bypasspermissions-mode) for what this does and does not skip | `claude --dangerously-skip-permissions` |55| `--dangerously-skip-permissions` | Skip permission prompts. Equivalent to `--permission-mode bypassPermissions`. See [permission modes](/en/permission-modes#skip-all-checks-with-bypasspermissions-mode) for what this does and does not skip | `claude --dangerously-skip-permissions` |

55| `--debug` | Enable debug mode with optional category filtering (for example, `"api,hooks"` or `"!statsig,!file"`) | `claude --debug "api,mcp"` |56| `--debug` | Enable debug mode with optional category filtering (for example, `"api,hooks"` or `"!statsig,!file"`) | `claude --debug "api,mcp"` |


86| `--remote-control`, `--rc` | Start an interactive session with [Remote Control](/en/remote-control#start-a-remote-control-session) enabled so you can also control it from claude.ai or the Claude app. Optionally pass a name for the session | `claude --remote-control "My Project"` |87| `--remote-control`, `--rc` | Start an interactive session with [Remote Control](/en/remote-control#start-a-remote-control-session) enabled so you can also control it from claude.ai or the Claude app. Optionally pass a name for the session | `claude --remote-control "My Project"` |

87| `--remote-control-session-name-prefix <prefix>` | Prefix for auto-generated [Remote Control](/en/remote-control) session names when no explicit name is set. Defaults to your machine's hostname, producing names like `myhost-graceful-unicorn`. Set `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` for the same effect | `claude remote-control --remote-control-session-name-prefix dev-box` |88| `--remote-control-session-name-prefix <prefix>` | Prefix for auto-generated [Remote Control](/en/remote-control) session names when no explicit name is set. Defaults to your machine's hostname, producing names like `myhost-graceful-unicorn`. Set `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` for the same effect | `claude remote-control --remote-control-session-name-prefix dev-box` |

88| `--replay-user-messages` | Re-emit user messages from stdin back on stdout for acknowledgment. Requires `--input-format stream-json` and `--output-format stream-json` | `claude -p --input-format stream-json --output-format stream-json --replay-user-messages` |89| `--replay-user-messages` | Re-emit user messages from stdin back on stdout for acknowledgment. Requires `--input-format stream-json` and `--output-format stream-json` | `claude -p --input-format stream-json --output-format stream-json --replay-user-messages` |

89| `--resume`, `-r` | Resume a specific session by ID or name, or show an interactive picker to choose a session | `claude --resume auth-refactor` |90| `--resume`, `-r` | Resume a specific session by ID or name, or show an interactive picker to choose a session. Includes sessions that added this directory with `/add-dir` | `claude --resume auth-refactor` |

90| `--session-id` | Use a specific session ID for the conversation (must be a valid UUID) | `claude --session-id "550e8400-e29b-41d4-a716-446655440000"` |91| `--session-id` | Use a specific session ID for the conversation (must be a valid UUID) | `claude --session-id "550e8400-e29b-41d4-a716-446655440000"` |

91| `--setting-sources` | Comma-separated list of setting sources to load (`user`, `project`, `local`) | `claude --setting-sources user,project` |92| `--setting-sources` | Comma-separated list of setting sources to load (`user`, `project`, `local`) | `claude --setting-sources user,project` |

92| `--settings` | Path to a settings JSON file or a JSON string to load additional settings from | `claude --settings ./settings.json` |93| `--settings` | Path to a settings JSON file or a JSON string to load additional settings from | `claude --settings ./settings.json` |

commands.md +6 −6

Details

18 18 

19| Command | Purpose |19| Command | Purpose |

20| :--------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |20| :--------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

21| `/add-dir <path>` | Add a working directory for file access during the current session. Most `.claude/` configuration is [not discovered](/en/permissions#additional-directories-grant-file-access-not-configuration) from the added directory |21| `/add-dir <path>` | Add a working directory for file access during the current session. Most `.claude/` configuration is [not discovered](/en/permissions#additional-directories-grant-file-access-not-configuration) from the added directory. You can later resume the session from the added directory with `--continue` or `--resume` |

22| `/agents` | Manage [agent](/en/sub-agents) configurations |22| `/agents` | Manage [agent](/en/sub-agents) configurations |

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

24| `/batch <instruction>` | **[Skill](/en/skills#bundled-skills).** Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one background agent per unit in an isolated [git worktree](/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees). Each agent implements its unit, runs tests, and opens a pull request. Requires a git repository. Example: `/batch migrate src/ from Solid to React` |24| `/batch <instruction>` | **[Skill](/en/skills#bundled-skills).** Orchestrate large-scale changes across a codebase in parallel. Researches the codebase, decomposes the work into 5 to 30 independent units, and presents a plan. Once approved, spawns one background agent per unit in an isolated [git worktree](/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees). Each agent implements its unit, runs tests, and opens a pull request. Requires a git repository. Example: `/batch migrate src/ from Solid to React` |


27| `/chrome` | Configure [Claude in Chrome](/en/chrome) settings |27| `/chrome` | Configure [Claude in Chrome](/en/chrome) settings |

28| `/claude-api` | **[Skill](/en/skills#bundled-skills).** Load Claude API reference material for your project's language (Python, TypeScript, Java, Go, Ruby, C#, PHP, or cURL) and Managed Agents reference. Covers tool use, streaming, batches, structured outputs, and common pitfalls. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk` |28| `/claude-api` | **[Skill](/en/skills#bundled-skills).** Load Claude API reference material for your project's language (Python, TypeScript, Java, Go, Ruby, C#, PHP, or cURL) and Managed Agents reference. Covers tool use, streaming, batches, structured outputs, and common pitfalls. Also activates automatically when your code imports `anthropic` or `@anthropic-ai/sdk` |

29| `/clear` | Start a new conversation with empty context. The previous conversation stays available in `/resume`. To free up context while continuing the same conversation, use `/compact` instead. Aliases: `/reset`, `/new` |29| `/clear` | Start a new conversation with empty context. The previous conversation stays available in `/resume`. To free up context while continuing the same conversation, use `/compact` instead. Aliases: `/reset`, `/new` |

30| `/color [color\|default]` | Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset |30| `/color [color\|default]` | Set the prompt bar color for the current session. Available colors: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan`. Use `default` to reset. When [Remote Control](/en/remote-control) is connected, the color syncs to claude.ai/code |

31| `/compact [instructions]` | Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary. See [how compaction handles rules, skills, and memory files](/en/context-window#what-survives-compaction) |31| `/compact [instructions]` | Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary. See [how compaction handles rules, skills, and memory files](/en/context-window#what-survives-compaction) |

32| `/config` | Open the [Settings](/en/settings) interface to adjust theme, model, [output style](/en/output-styles), and other preferences. Alias: `/settings` |32| `/config` | Open the [Settings](/en/settings) interface to adjust theme, model, [output style](/en/output-styles), and other preferences. Alias: `/settings` |

33| `/context` | Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings |33| `/context` | Visualize current context usage as a colored grid. Shows optimization suggestions for context-heavy tools, memory bloat, and capacity warnings |

34| `/copy [N]` | Copy the last assistant response to clipboard. Pass a number `N` to copy the Nth-latest response: `/copy 2` copies the second-to-last. When code blocks are present, shows an interactive picker to select individual blocks or the full response. Press `w` in the picker to write the selection to a file instead of the clipboard, which is useful over SSH |34| `/copy [N]` | Copy the last assistant response to clipboard. Pass a number `N` to copy the Nth-latest response: `/copy 2` copies the second-to-last. When code blocks are present, shows an interactive picker to select individual blocks or the full response. Press `w` in the picker to write the selection to a file instead of the clipboard, which is useful over SSH |

35| `/cost` | Show token usage statistics. See [cost tracking guide](/en/costs#using-the-cost-command) for subscription-specific details |35| `/cost` | Alias for `/usage` |

36| `/debug [description]` | **[Skill](/en/skills#bundled-skills).** Enable debug logging for the current session and troubleshoot issues by reading the session debug log. Debug logging is off by default unless you started with `claude --debug`, so running `/debug` mid-session starts capturing logs from that point forward. Optionally describe the issue to focus the analysis |36| `/debug [description]` | **[Skill](/en/skills#bundled-skills).** Enable debug logging for the current session and troubleshoot issues by reading the session debug log. Debug logging is off by default unless you started with `claude --debug`, so running `/debug` mid-session starts capturing logs from that point forward. Optionally describe the issue to focus the analysis |

37| `/desktop` | Continue the current session in the Claude Code Desktop app. macOS and Windows only. Alias: `/app` |37| `/desktop` | Continue the current session in the Claude Code Desktop app. macOS and Windows only. Alias: `/app` |

38| `/diff` | Open an interactive diff viewer showing uncommitted changes and per-turn diffs. Use left/right arrows to switch between the current git diff and individual Claude turns, and up/down to browse files |38| `/diff` | Open an interactive diff viewer showing uncommitted changes and per-turn diffs. Use left/right arrows to switch between the current git diff and individual Claude turns, and up/down to browse files |


84| `/setup-vertex` | Configure [Google Vertex AI](/en/google-vertex-ai) authentication, project, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_VERTEX=1` is set. First-time Vertex AI users can also access this wizard from the login screen |84| `/setup-vertex` | Configure [Google Vertex AI](/en/google-vertex-ai) authentication, project, region, and model pins through an interactive wizard. Only visible when `CLAUDE_CODE_USE_VERTEX=1` is set. First-time Vertex AI users can also access this wizard from the login screen |

85| `/simplify [focus]` | **[Skill](/en/skills#bundled-skills).** Review your recently changed files for code reuse, quality, and efficiency issues, then fix them. Spawns three review agents in parallel, aggregates their findings, and applies fixes. Pass text to focus on specific concerns: `/simplify focus on memory efficiency` |85| `/simplify [focus]` | **[Skill](/en/skills#bundled-skills).** Review your recently changed files for code reuse, quality, and efficiency issues, then fix them. Spawns three review agents in parallel, aggregates their findings, and applies fixes. Pass text to focus on specific concerns: `/simplify focus on memory efficiency` |

86| `/skills` | List available [skills](/en/skills). Press `t` to sort by token count |86| `/skills` | List available [skills](/en/skills). Press `t` to sort by token count |

87| `/stats` | Visualize daily usage, session history, streaks, and model preferences |87| `/stats` | Alias for `/usage`. Opens on the Stats tab |

88| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity. Works while Claude is responding, without waiting for the current response to finish |88| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity. Works while Claude is responding, without waiting for the current response to finish |

89| `/statusline` | Configure Claude Code's [status line](/en/statusline). Describe what you want, or run without arguments to auto-configure from your shell prompt |89| `/statusline` | Configure Claude Code's [status line](/en/statusline). Describe what you want, or run without arguments to auto-configure from your shell prompt |

90| `/stickers` | Order Claude Code stickers |90| `/stickers` | Order Claude Code stickers |


92| `/team-onboarding` | Generate a team onboarding guide from your Claude Code usage history. Claude analyzes your sessions, commands, and MCP server usage from the past 30 days and produces a markdown guide a teammate can paste as a first message to get set up quickly |92| `/team-onboarding` | Generate a team onboarding guide from your Claude Code usage history. Claude analyzes your sessions, commands, and MCP server usage from the past 30 days and produces a markdown guide a teammate can paste as a first message to get set up quickly |

93| `/teleport` | Pull a [Claude Code on the web](/en/claude-code-on-the-web#from-web-to-terminal) session into this terminal: opens a picker, then fetches the branch and conversation. Also available as `/tp`. Requires a claude.ai subscription |93| `/teleport` | Pull a [Claude Code on the web](/en/claude-code-on-the-web#from-web-to-terminal) session into this terminal: opens a picker, then fetches the branch and conversation. Also available as `/tp`. Requires a claude.ai subscription |

94| `/terminal-setup` | Configure terminal keybindings for Shift+Enter and other shortcuts. Only visible in terminals that need it, like VS Code, Cursor, Windsurf, Alacritty, or Zed |94| `/terminal-setup` | Configure terminal keybindings for Shift+Enter and other shortcuts. Only visible in terminals that need it, like VS Code, Cursor, Windsurf, Alacritty, or Zed |

95| `/theme` | Change the color theme. Includes an `auto` option that matches your terminal's light or dark background, light and dark variants, colorblind-accessible (daltonized) themes, and ANSI themes that use your terminal's color palette |95| `/theme` | Change the color theme. Includes an `auto` option that matches your terminal's light or dark background, light and dark variants, colorblind-accessible (daltonized) themes, ANSI themes that use your terminal's color palette, and any [custom themes](/en/terminal-config#create-a-custom-theme) from `~/.claude/themes/` or plugins. Select **New custom theme…** to create one |

96| `/tui [default\|fullscreen]` | Set the terminal UI renderer and relaunch into it with your conversation intact. `fullscreen` enables the [flicker-free alt-screen renderer](/en/fullscreen). With no argument, prints the active renderer |96| `/tui [default\|fullscreen]` | Set the terminal UI renderer and relaunch into it with your conversation intact. `fullscreen` enables the [flicker-free alt-screen renderer](/en/fullscreen). With no argument, prints the active renderer |

97| `/ultraplan <prompt>` | Draft a plan in an [ultraplan](/en/ultraplan) session, review it in your browser, then execute remotely or send it back to your terminal |97| `/ultraplan <prompt>` | Draft a plan in an [ultraplan](/en/ultraplan) session, review it in your browser, then execute remotely or send it back to your terminal |

98| `/ultrareview [PR]` | Run a deep, multi-agent code review in a cloud sandbox with [ultrareview](/en/ultrareview). Includes 3 free runs on Pro and Max through May 5, 2026, then requires [extra usage](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |98| `/ultrareview [PR]` | Run a deep, multi-agent code review in a cloud sandbox with [ultrareview](/en/ultrareview). Includes 3 free runs on Pro and Max through May 5, 2026, then requires [extra usage](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |

99| `/upgrade` | Open the upgrade page to switch to a higher plan tier |99| `/upgrade` | Open the upgrade page to switch to a higher plan tier |

100| `/usage` | Show plan usage limits and rate limit status |100| `/usage` | Show session cost, plan usage limits, and activity stats. See the [cost tracking guide](/en/costs#using-the-%2Fusage-command) for subscription-specific details. `/cost` and `/stats` are aliases |

101| `/vim` | {/* max-version: 2.1.91 */}Removed in v2.1.92. To toggle between Vim and Normal editing modes, use `/config` → Editor mode |101| `/vim` | {/* max-version: 2.1.91 */}Removed in v2.1.92. To toggle between Vim and Normal editing modes, use `/config` → Editor mode |

102| `/voice [hold\|tap\|off]` | Toggle [voice dictation](/en/voice-dictation), or enable it in a specific mode. Requires a Claude.ai account |102| `/voice [hold\|tap\|off]` | Toggle [voice dictation](/en/voice-dictation), or enable it in a specific mode. Requires a Claude.ai account |

103| `/web-setup` | Connect your GitHub account to [Claude Code on the web](/en/web-quickstart#connect-from-your-terminal) using your local `gh` CLI credentials. `/schedule` prompts for this automatically if GitHub isn't connected |103| `/web-setup` | Connect your GitHub account to [Claude Code on the web](/en/web-quickstart#connect-from-your-terminal) using your local `gh` CLI credentials. `/schedule` prompts for this automatically if GitHub isn't connected |

Details

566 566 

567When the selected session is old and large enough that re-reading it would consume a substantial share of your usage limits, `--resume`, `--continue`, and `/resume` offer to resume from a summary instead of loading the full transcript. This prompt is not available on Amazon Bedrock, Google Cloud Vertex AI, or Microsoft Foundry.567When the selected session is old and large enough that re-reading it would consume a substantial share of your usage limits, `--resume`, `--continue`, and `/resume` offer to resume from a summary instead of loading the full transcript. This prompt is not available on Amazon Bedrock, Google Cloud Vertex AI, or Microsoft Foundry.

568 568 

569Sessions are stored per project directory. By default, the `/resume` picker shows interactive sessions from the current worktree, with keyboard shortcuts to widen the list to other worktrees or projects, search, preview, and rename. See [Use the session picker](#use-the-session-picker) below for the full shortcut reference.569Sessions are stored per project directory. By default, the `/resume` picker shows interactive sessions from the current worktree, with keyboard shortcuts to widen the list to other worktrees or projects, search, preview, and rename. Sessions started elsewhere that added the current directory with `/add-dir` are also included by default. See [Use the session picker](#use-the-session-picker) below for the full shortcut reference.

570 570 

571When you select a session from another worktree of the same repository, Claude Code resumes it directly without requiring you to switch directories first. Selecting a session from an unrelated project copies a `cd` and resume command to your clipboard instead.571When you select a session from another worktree of the same repository, Claude Code resumes it directly without requiring you to switch directories first. Selecting a session from an unrelated project copies a `cd` and resume command to your clipboard instead.

572 572 

costs.md +5 −5

Details

14 14 

15## Track your costs15## Track your costs

16 16 

17### Using the `/cost` command17### Using the `/usage` command

18 18 

19<Note>19<Note>

20 The `/cost` command shows API token usage and is intended for API users. Claude Max and Pro subscribers have usage included in their subscription, so `/cost` data isn't relevant for billing purposes. Subscribers can use `/stats` to view usage patterns.20 The Session block in `/usage` shows API token usage and is intended for API users. Claude Max and Pro subscribers have usage included in their subscription, so the session cost figure isn't relevant for billing purposes. Subscribers see plan usage bars and activity stats on the same screen.

21</Note>21</Note>

22 22 

23The `/cost` command provides detailed token usage statistics for your current session. The dollar figure is an estimate computed locally from token counts and may differ from your actual bill. For authoritative billing, see the Usage page in the [Claude Console](https://platform.claude.com/usage).23The `/usage` command provides detailed token usage statistics for your current session. The dollar figure is an estimate computed locally from token counts and may differ from your actual bill. For authoritative billing, see the Usage page in the [Claude Console](https://platform.claude.com/usage).

24 24 

25```text theme={null}25```text theme={null}

26Total cost: $0.5526Total cost: $0.55


82 82 

83### Manage context proactively83### Manage context proactively

84 84 

85Use `/cost` to check your current token usage, or [configure your status line](/en/statusline#context-window-usage) to display it continuously.85Use `/usage` to check your current token usage, or [configure your status line](/en/statusline#context-window-usage) to display it continuously.

86 86 

87* **Clear between tasks**: Use `/clear` to start fresh when switching to unrelated work. Stale context wastes tokens on every subsequent message. Use `/rename` before clearing so you can easily find the session later, then `/resume` to return to it.87* **Clear between tasks**: Use `/clear` to start fresh when switching to unrelated work. Stale context wastes tokens on every subsequent message. Use `/rename` before clearing so you can easily find the session later, then `/resume` to return to it.

88* **Add custom compaction instructions**: `/compact Focus on code samples and API usage` tells Claude what to preserve during summarization.88* **Add custom compaction instructions**: `/compact Focus on code samples and API usage` tells Claude what to preserve during summarization.


194Claude Code uses tokens for some background functionality even when idle:194Claude Code uses tokens for some background functionality even when idle:

195 195 

196* **Conversation summarization**: Background jobs that summarize previous conversations for the `claude --resume` feature196* **Conversation summarization**: Background jobs that summarize previous conversations for the `claude --resume` feature

197* **Command processing**: Some commands like `/cost` may generate requests to check status197* **Command processing**: Some commands like `/usage` may generate requests to check status

198 198 

199These background processes consume a small amount of tokens (typically under \$0.04 per session) even without active interaction.199These background processes consume a small amount of tokens (typically under \$0.04 per session) even without active interaction.

200 200 

data-usage.md +13 −4

Details

59 59 

60The diagram below shows how Claude Code connects to external services during installation and normal operation. Solid lines indicate required connections, while dashed lines represent optional or user-initiated data flows.60The diagram below shows how Claude Code connects to external services during installation and normal operation. Solid lines indicate required connections, while dashed lines represent optional or user-initiated data flows.

61 61 

62<img src="https://mintcdn.com/claude-code/c5r9_6tjPMzFdDDT/images/claude-code-data-flow.svg?fit=max&auto=format&n=c5r9_6tjPMzFdDDT&q=85&s=b3f71c69d743bff63343207dfb7ad6ce" alt="Diagram showing Claude Code's external connections: install/update connects to NPM, and user requests connect to Anthropic services including Console auth, public-api, and optionally Statsig, Sentry, and bug reporting" width="720" height="520" data-path="images/claude-code-data-flow.svg" />62<img src="https://mintcdn.com/claude-code/YcBW2H7CArGcduPb/images/claude-code-data-flow.svg?fit=max&auto=format&n=YcBW2H7CArGcduPb&q=85&s=b600a89f84fc86f9ff7be00a466c0635" alt="Diagram showing Claude Code's external connections: install/update connects to the distribution server, and user requests connect to Anthropic services including Console auth, public-api, and optionally Statsig, Sentry, and bug reporting" width="720" height="520" data-path="images/claude-code-data-flow.svg" />

63 63 

64Claude Code is installed from [NPM](https://www.npmjs.com/package/@anthropic-ai/claude-code). Claude Code runs locally. In order to interact with the LLM, Claude Code sends data over the network. This data includes all user prompts and model outputs. The data is encrypted in transit via TLS and is not encrypted at rest. Claude Code is compatible with most popular VPNs and LLM proxies.64Claude Code runs locally. To interact with the LLM, Claude Code sends data over the network. This data includes all user prompts and model outputs, encrypted in transit via TLS 1.2+. Claude Code is compatible with most popular VPNs and LLM proxies.

65 65 

66Claude Code is built on Anthropic's APIs. For details regarding our API's security controls, including our API logging procedures, please refer to compliance artifacts offered in the [Anthropic Trust Center](https://trust.anthropic.com).66Encryption at rest depends on your model provider:

67 

68| Provider | Encryption at rest |

69| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |

70| Anthropic API | Infrastructure-level disk encryption (AES-256). Enable [Zero Data Retention](/en/zero-data-retention) for no server-side persistence. |

71| Amazon Bedrock | AES-256 with AWS-managed keys. Customer-managed keys available via AWS KMS. |

72| Google Cloud Vertex AI | Google-managed encryption keys. CMEK available. |

73| Microsoft Foundry | Requests route to Anthropic infrastructure with AES-256 disk encryption. |

74 

75Claude Code is built on Anthropic's APIs. For details on API security controls, including API logging procedures, see the compliance artifacts in the [Anthropic Trust Center](https://trust.anthropic.com).

67 76 

68### Cloud execution: Data flow and dependencies77### Cloud execution: Data flow and dependencies

69 78 


82 91 

83Claude Code connects from users' machines to Sentry for operational error logging. The data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Sentry security documentation](https://sentry.io/security/). To opt out of error logging, set the `DISABLE_ERROR_REPORTING` environment variable.92Claude Code connects from users' machines to Sentry for operational error logging. The data is encrypted in transit using TLS and at rest using 256-bit AES encryption. Read more in the [Sentry security documentation](https://sentry.io/security/). To opt out of error logging, set the `DISABLE_ERROR_REPORTING` environment variable.

84 93 

85When users run the `/feedback` command, a copy of their full conversation history including code is sent to Anthropic. The data is encrypted in transit and at rest. Optionally, a Github issue is created in our public repository. To opt out, set the `DISABLE_FEEDBACK_COMMAND` environment variable to `1`.94When users run the `/feedback` command, a copy of their full conversation history including code is sent to Anthropic. The data is encrypted in transit via TLS. Optionally, a GitHub issue is created in the public repository. To opt out, set the `DISABLE_FEEDBACK_COMMAND` environment variable to `1`.

86 95 

87## Default behaviors by API provider96## Default behaviors by API provider

88 97 

Details

10 10 

11## Compare scheduling options11## Compare scheduling options

12 12 

13Claude Code offers three ways to schedule recurring work:13Claude Code offers three ways to schedule recurring or one-off work:

14 14 

15| | [Cloud](/en/routines) | [Desktop](/en/desktop-scheduled-tasks) | [`/loop`](/en/scheduled-tasks) |15| | [Cloud](/en/routines) | [Desktop](/en/desktop-scheduled-tasks) | [`/loop`](/en/scheduled-tasks) |

16| :------------------------- | :----------------------------- | :------------------------------------- | :---------------------------------- |16| :------------------------- | :----------------------------- | :------------------------------------- | :---------------------------------- |

env-vars.md +2 −1

Details

154| `CLAUDE_ENV_FILE` | Path to a shell script whose contents Claude Code runs before each Bash command in the same shell process, so exports in the file are visible to the command. Use to persist virtualenv or conda activation across commands. Also populated dynamically by [SessionStart](/en/hooks#persist-environment-variables), [CwdChanged](/en/hooks#cwdchanged), and [FileChanged](/en/hooks#filechanged) hooks |154| `CLAUDE_ENV_FILE` | Path to a shell script whose contents Claude Code runs before each Bash command in the same shell process, so exports in the file are visible to the command. Use to persist virtualenv or conda activation across commands. Also populated dynamically by [SessionStart](/en/hooks#persist-environment-variables), [CwdChanged](/en/hooks#cwdchanged), and [FileChanged](/en/hooks#filechanged) hooks |

155| `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` | Prefix for auto-generated [Remote Control](/en/remote-control) session names when no explicit name is provided. Defaults to your machine's hostname, producing names like `myhost-graceful-unicorn`. The `--remote-control-session-name-prefix` CLI flag sets the same value for a single invocation |155| `CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX` | Prefix for auto-generated [Remote Control](/en/remote-control) session names when no explicit name is provided. Defaults to your machine's hostname, producing names like `myhost-graceful-unicorn`. The `--remote-control-session-name-prefix` CLI flag sets the same value for a single invocation |

156| `CLAUDE_STREAM_IDLE_TIMEOUT_MS` | Timeout in milliseconds before the streaming idle watchdog closes a stalled connection. For the byte-level watchdog on the Anthropic API: default and minimum `300000` (5 minutes); lower values are silently clamped to absorb extended thinking pauses and proxy buffering. For the event-level watchdog: default `90000` (90 seconds), no minimum. For third-party providers, requires `CLAUDE_ENABLE_STREAM_WATCHDOG=1` |156| `CLAUDE_STREAM_IDLE_TIMEOUT_MS` | Timeout in milliseconds before the streaming idle watchdog closes a stalled connection. For the byte-level watchdog on the Anthropic API: default and minimum `300000` (5 minutes); lower values are silently clamped to absorb extended thinking pauses and proxy buffering. For the event-level watchdog: default `90000` (90 seconds), no minimum. For third-party providers, requires `CLAUDE_ENABLE_STREAM_WATCHDOG=1` |

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

158| `DISABLE_AUTO_COMPACT` | Set to `1` to disable automatic compaction when approaching the context limit. The manual `/compact` command remains available. Use when you want explicit control over when compaction occurs |158| `DISABLE_AUTO_COMPACT` | Set to `1` to disable automatic compaction when approaching the context limit. The manual `/compact` command remains available. Use when you want explicit control over when compaction occurs |

159| `DISABLE_COMPACT` | Set to `1` to disable all compaction: both automatic compaction and the manual `/compact` command |159| `DISABLE_COMPACT` | Set to `1` to disable all compaction: both automatic compaction and the manual `/compact` command |

160| `DISABLE_COST_WARNINGS` | Set to `1` to disable cost warning messages |160| `DISABLE_COST_WARNINGS` | Set to `1` to disable cost warning messages |


172| `DISABLE_PROMPT_CACHING_OPUS` | Set to `1` to disable prompt caching for Opus models |172| `DISABLE_PROMPT_CACHING_OPUS` | Set to `1` to disable prompt caching for Opus models |

173| `DISABLE_PROMPT_CACHING_SONNET` | Set to `1` to disable prompt caching for Sonnet models |173| `DISABLE_PROMPT_CACHING_SONNET` | Set to `1` to disable prompt caching for Sonnet models |

174| `DISABLE_TELEMETRY` | Set to `1` to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands) |174| `DISABLE_TELEMETRY` | Set to `1` to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands) |

175| `DISABLE_UPDATES` | Set to `1` to block all updates including manual `claude update` and `claude install`. Stricter than `DISABLE_AUTOUPDATER`. Use when distributing Claude Code through your own channels and users should not self-update |

175| `DISABLE_UPGRADE_COMMAND` | Set to `1` to hide the `/upgrade` command |176| `DISABLE_UPGRADE_COMMAND` | Set to `1` to hide the `/upgrade` command |

176| `ENABLE_CLAUDEAI_MCP_SERVERS` | Set to `false` to disable [claude.ai MCP servers](/en/mcp#use-mcp-servers-from-claude-ai) in Claude Code. Enabled by default for logged-in users |177| `ENABLE_CLAUDEAI_MCP_SERVERS` | Set to `false` to disable [claude.ai MCP servers](/en/mcp#use-mcp-servers-from-claude-ai) in Claude Code. Enabled by default for logged-in users |

177| `ENABLE_PROMPT_CACHING_1H` | Set to `1` to request a 1-hour prompt cache TTL instead of the default 5 minutes. Intended for API key, [Bedrock](/en/amazon-bedrock), [Vertex](/en/google-vertex-ai), and [Foundry](/en/microsoft-foundry) users. Subscription users receive 1-hour TTL automatically. 1-hour cache writes are billed at a higher rate |178| `ENABLE_PROMPT_CACHING_1H` | Set to `1` to request a 1-hour prompt cache TTL instead of the default 5 minutes. Intended for API key, [Bedrock](/en/amazon-bedrock), [Vertex](/en/google-vertex-ai), and [Foundry](/en/microsoft-foundry) users. Subscription users receive 1-hour TTL automatically. 1-hour cache writes are billed at a higher rate |

Details

23* **[MCP](/en/mcp)** connects Claude to external services and tools23* **[MCP](/en/mcp)** connects Claude to external services and tools

24* **[Subagents](/en/sub-agents)** run their own loops in isolated context, returning summaries24* **[Subagents](/en/sub-agents)** run their own loops in isolated context, returning summaries

25* **[Agent teams](/en/agent-teams)** coordinate multiple independent sessions with shared tasks and peer-to-peer messaging25* **[Agent teams](/en/agent-teams)** coordinate multiple independent sessions with shared tasks and peer-to-peer messaging

26* **[Hooks](/en/hooks)** run outside the loop entirely as deterministic scripts26* **[Hooks](/en/hooks-guide)** fire on lifecycle events and can run a script, HTTP request, prompt, or subagent

27* **[Plugins](/en/plugins)** and **[marketplaces](/en/plugin-marketplaces)** package and distribute these features27* **[Plugins](/en/plugins)** and **[marketplaces](/en/plugin-marketplaces)** package and distribute these features

28 28 

29[Skills](/en/skills) are the most flexible extension. A skill is a markdown file containing knowledge, workflows, or instructions. You can invoke skills with a command like `/deploy`, or Claude can load them automatically when relevant. Skills can run in your current conversation or in an isolated context via subagents.29[Skills](/en/skills) are the most flexible extension. A skill is a markdown file containing knowledge, workflows, or instructions. You can invoke skills with a command like `/deploy`, or Claude can load them automatically when relevant. Skills can run in your current conversation or in an isolated context via subagents.


33Features range from always-on context that Claude sees every session, to on-demand capabilities you or Claude can invoke, to background automation that runs on specific events. The table below shows what's available and when each one makes sense.33Features range from always-on context that Claude sees every session, to on-demand capabilities you or Claude can invoke, to background automation that runs on specific events. The table below shows what's available and when each one makes sense.

34 34 

35| Feature | What it does | When to use it | Example |35| Feature | What it does | When to use it | Example |

36| ---------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |36| ---------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |

37| **CLAUDE.md** | Persistent context loaded every conversation | Project conventions, "always do X" rules | "Use pnpm, not npm. Run tests before committing." |37| **CLAUDE.md** | Persistent context loaded every conversation | Project conventions, "always do X" rules | "Use pnpm, not npm. Run tests before committing." |

38| **Skill** | Instructions, knowledge, and workflows Claude can use | Reusable content, reference docs, repeatable tasks | `/deploy` runs your deployment checklist; API docs skill with endpoint patterns |38| **Skill** | Instructions, knowledge, and workflows Claude can use | Reusable content, reference docs, repeatable tasks | `/deploy` runs your deployment checklist; API docs skill with endpoint patterns |

39| **Subagent** | Isolated execution context that returns summarized results | Context isolation, parallel tasks, specialized workers | Research task that reads many files but returns only key findings |39| **Subagent** | Isolated execution context that returns summarized results | Context isolation, parallel tasks, specialized workers | Research task that reads many files but returns only key findings |

40| **[Agent teams](/en/agent-teams)** | Coordinate multiple independent Claude Code sessions | Parallel research, new feature development, debugging with competing hypotheses | Spawn reviewers to check security, performance, and tests simultaneously |40| **[Agent teams](/en/agent-teams)** | Coordinate multiple independent Claude Code sessions | Parallel research, new feature development, debugging with competing hypotheses | Spawn reviewers to check security, performance, and tests simultaneously |

41| **MCP** | Connect to external services | External data or actions | Query your database, post to Slack, control a browser |41| **MCP** | Connect to external services | External data or actions | Query your database, post to Slack, control a browser |

42| **Hook** | Deterministic script that runs on events | Predictable automation, no LLM involved | Run ESLint after every file edit |42| **Hook** | Script, HTTP request, prompt, or subagent triggered by events | Automation that must run on every matching event | Run ESLint after every file edit |

43 43 

44**[Plugins](/en/plugins)** are the packaging layer. A plugin bundles skills, hooks, subagents, and MCP servers into a single installable unit. Plugin skills are namespaced (like `/my-plugin:review`) so multiple plugins can coexist. Use plugins when you want to reuse the same setup across multiple repositories or distribute to others via a **[marketplace](/en/plugin-marketplaces)**.44**[Plugins](/en/plugins)** are the packaging layer. A plugin bundles skills, hooks, subagents, and MCP servers into a single installable unit. Plugin skills are namespaced (like `/my-plugin:review`) so multiple plugins can coexist. Use plugins when you want to reuse the same setup across multiple repositories or distribute to others via a **[marketplace](/en/plugin-marketplaces)**.

45 45 


158 158 

159 Example: An MCP server connects Claude to your database. A skill teaches Claude your data model, common query patterns, and which tables to use for different tasks.159 Example: An MCP server connects Claude to your database. A skill teaches Claude your data model, common query patterns, and which tables to use for different tasks.

160 </Tab>160 </Tab>

161 

162 <Tab title="Hook vs Skill">

163 A hook fires on a lifecycle event; a skill is loaded into context for Claude to apply.

164 

165 | Aspect | Hook | Skill |

166 | ---------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------- |

167 | **Runs** | A shell command, HTTP request, LLM prompt, or subagent | Instructions Claude reads and follows |

168 | **Triggered by** | [Lifecycle events](/en/hooks#hook-events) such as `PostToolUse` or `SessionStart` | You typing `/<name>`, or Claude matching the description to your task |

169 | **Determinism** | Always fires on its event; the trigger is guaranteed | Claude interprets the instructions; outcome can vary |

170 | **Context cost** | Zero unless the hook returns output | Description loads each session; full content loads when used |

171 | **Best for** | Linting after edits, blocking unsafe commands, logging, notifications | Workflows that need reasoning, reference material, multi-step tasks |

172 

173 **Use a hook** when the action must happen the same way every time and doesn't need Claude to think. For example: format on save, reject `rm -rf /`, post a Slack message when a session ends.

174 

175 **Use a skill** when Claude should decide how to apply the steps, or when the content is knowledge rather than a script. For example: a `/release` checklist, your API style guide, a debugging playbook.

176 

177 **Put guardrails in hooks.** An instruction like "never edit `.env`" in CLAUDE.md or a skill is a request, not a guarantee. A `PreToolUse` hook that blocks the edit is enforcement. If a rule must hold every time, make it a hook rather than a prompt instruction.

178 

179 **Hook output lands in context.** A `PostToolUse` hook that runs your linter feeds results back as text Claude reads; a `/fix-lint` skill tells Claude how to resolve them.

180 </Tab>

161</Tabs>181</Tabs>

162 182 

163### Understand how features layer183### Understand how features layer


263 <Tab title="Hooks">283 <Tab title="Hooks">

264 **When:** On trigger. Hooks fire at specific lifecycle events like tool execution, session boundaries, prompt submission, permission requests, and compaction. See [Hooks](/en/hooks) for the full list.284 **When:** On trigger. Hooks fire at specific lifecycle events like tool execution, session boundaries, prompt submission, permission requests, and compaction. See [Hooks](/en/hooks) for the full list.

265 285 

266 **What loads:** Nothing by default. Hooks run as external scripts.286 **What loads:** Nothing by default. Hooks execute outside the main conversation.

267 287 

268 **Context cost:** Zero, unless the hook returns output that gets added as messages to your conversation.288 **Context cost:** Zero, unless the hook returns output that gets added as messages to your conversation.

269 289 

hooks.md +122 −19

Details

18 18 

19<div style={{maxWidth: "500px", margin: "0 auto"}}>19<div style={{maxWidth: "500px", margin: "0 auto"}}>

20 <Frame>20 <Frame>

21 <img src="https://mintcdn.com/claude-code/NgDeMMkM7ZmaRibg/images/hooks-lifecycle.svg?fit=max&auto=format&n=NgDeMMkM7ZmaRibg&q=85&s=ec53c77f9943a6470cb2c8ecace6d809" alt="Hook lifecycle diagram showing SessionStart, then a per-turn loop containing UserPromptSubmit, UserPromptExpansion for slash commands, the nested agentic loop (PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, 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, and WorktreeCreate, WorktreeRemove, Notification, ConfigChange, InstructionsLoaded, CwdChanged, and FileChanged as standalone async events" width="520" height="1155" data-path="images/hooks-lifecycle.svg" />21 <img src="https://mintcdn.com/claude-code/_SQ1BnFTP0QUrae-/images/hooks-lifecycle.svg?fit=max&auto=format&n=_SQ1BnFTP0QUrae-&q=85&s=75bd3d4bdefd4f08a7d736167243fd78" alt="Hook lifecycle diagram showing 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, and WorktreeCreate, WorktreeRemove, Notification, ConfigChange, InstructionsLoaded, CwdChanged, and FileChanged as standalone async events" width="520" height="1228" data-path="images/hooks-lifecycle.svg" />

22 </Frame>22 </Frame>

23</div>23</div>

24 24 


34| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |34| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |

35| `PostToolUse` | After a tool call succeeds |35| `PostToolUse` | After a tool call succeeds |

36| `PostToolUseFailure` | After a tool call fails |36| `PostToolUseFailure` | After a tool call fails |

37| `PostToolBatch` | After a full batch of parallel tool calls resolves, before the next model call |

37| `Notification` | When Claude Code sends a notification |38| `Notification` | When Claude Code sends a notification |

38| `SubagentStart` | When a subagent is spawned |39| `SubagentStart` | When a subagent is spawned |

39| `SubagentStop` | When a subagent finishes |40| `SubagentStop` | When a subagent finishes |


154See [How a hook resolves](#how-a-hook-resolves) above for a complete walkthrough with an annotated example.155See [How a hook resolves](#how-a-hook-resolves) above for a complete walkthrough with an annotated example.

155 156 

156<Note>157<Note>

157 This page uses specific terms for each level: **hook event** for the lifecycle point, **matcher group** for the filter, and **hook handler** for the shell command, HTTP endpoint, prompt, or agent that runs. "Hook" on its own refers to the general feature.158 This page uses specific terms for each level: **hook event** for the lifecycle point, **matcher group** for the filter, and **hook handler** for the shell command, HTTP endpoint, MCP tool, prompt, or agent that runs. "Hook" on its own refers to the general feature.

158</Note>159</Note>

159 160 

160### Hook locations161### Hook locations


187Each event type matches on a different field:188Each event type matches on a different field:

188 189 

189| Event | What the matcher filters | Example matcher values |190| Event | What the matcher filters | Example matcher values |

190| :------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |191| :------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |

191| `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied` | tool name | `Bash`, `Edit\|Write`, `mcp__.*` |192| `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied` | tool name | `Bash`, `Edit\|Write`, `mcp__.*` |

192| `SessionStart` | how the session started | `startup`, `resume`, `clear`, `compact` |193| `SessionStart` | how the session started | `startup`, `resume`, `clear`, `compact` |

193| `SessionEnd` | why the session ended | `clear`, `resume`, `logout`, `prompt_input_exit`, `bypass_permissions_disabled`, `other` |194| `SessionEnd` | why the session ended | `clear`, `resume`, `logout`, `prompt_input_exit`, `bypass_permissions_disabled`, `other` |


203| `UserPromptExpansion` | command name | your skill or command names |204| `UserPromptExpansion` | command name | your skill or command names |

204| `Elicitation` | MCP server name | your configured MCP server names |205| `Elicitation` | MCP server name | your configured MCP server names |

205| `ElicitationResult` | MCP server name | same values as `Elicitation` |206| `ElicitationResult` | MCP server name | same values as `Elicitation` |

206| `UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove` | no matcher support | always fires on every occurrence |207| `UserPromptSubmit`, `PostToolBatch`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove` | no matcher support | always fires on every occurrence |

207 208 

208The matcher runs against a field from the [JSON input](#hook-input-and-output) that Claude Code sends to your hook on stdin. For tool events, that field is `tool_name`. Each [hook event](#hook-events) section lists the full set of matcher values and the input schema for that event.209The matcher runs against a field from the [JSON input](#hook-input-and-output) that Claude Code sends to your hook on stdin. For tool events, that field is `tool_name`. Each [hook event](#hook-events) section lists the full set of matcher values and the input schema for that event.

209 210 


227}228}

228```229```

229 230 

230`UserPromptSubmit`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, and `CwdChanged` don't support matchers and always fire on every occurrence. If you add a `matcher` field to these events, it is silently ignored.231`UserPromptSubmit`, `PostToolBatch`, `Stop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`, `WorktreeCreate`, `WorktreeRemove`, and `CwdChanged` don't support matchers and always fire on every occurrence. If you add a `matcher` field to these events, it is silently ignored.

231 232 

232For tool events, you can filter more narrowly by setting the [`if` field](#common-fields) on individual hook handlers. `if` uses [permission rule syntax](/en/permissions) to match against the tool name and arguments together, so `"Bash(git *)"` runs when any subcommand of the Bash input matches `git *` and `"Edit(*.ts)"` runs only for TypeScript files.233For tool events, you can filter more narrowly by setting the [`if` field](#common-fields) on individual hook handlers. `if` uses [permission rule syntax](/en/permissions) to match against the tool name and arguments together, so `"Bash(git *)"` runs when any subcommand of the Bash input matches `git *` and `"Edit(*.ts)"` runs only for TypeScript files.

233 234 


277 278 

278### Hook handler fields279### Hook handler fields

279 280 

280Each object in the inner `hooks` array is a hook handler: the shell command, HTTP endpoint, LLM prompt, or agent that runs when the matcher matches. There are four types:281Each object in the inner `hooks` array is a hook handler: the shell command, HTTP endpoint, MCP tool, LLM prompt, or agent that runs when the matcher matches. There are five types:

281 282 

282* **[Command hooks](#command-hook-fields)** (`type: "command"`): run a shell command. Your script receives the event's [JSON input](#hook-input-and-output) on stdin and communicates results back through exit codes and stdout.283* **[Command hooks](#command-hook-fields)** (`type: "command"`): run a shell command. Your script receives the event's [JSON input](#hook-input-and-output) on stdin and communicates results back through exit codes and stdout.

283* **[HTTP hooks](#http-hook-fields)** (`type: "http"`): send the event's JSON input as an HTTP POST request to a URL. The endpoint communicates results back through the response body using the same [JSON output format](#json-output) as command hooks.284* **[HTTP hooks](#http-hook-fields)** (`type: "http"`): send the event's JSON input as an HTTP POST request to a URL. The endpoint communicates results back through the response body using the same [JSON output format](#json-output) as command hooks.

285* **[MCP tool hooks](#mcp-tool-hook-fields)** (`type: "mcp_tool"`): call a tool on an already-connected [MCP server](/en/mcp). The tool's text output is treated like command-hook stdout.

284* **[Prompt hooks](#prompt-and-agent-hook-fields)** (`type: "prompt"`): send a prompt to a Claude model for single-turn evaluation. The model returns a yes/no decision as JSON. See [Prompt-based hooks](#prompt-based-hooks).286* **[Prompt hooks](#prompt-and-agent-hook-fields)** (`type: "prompt"`): send a prompt to a Claude model for single-turn evaluation. The model returns a yes/no decision as JSON. See [Prompt-based hooks](#prompt-based-hooks).

285* **[Agent hooks](#prompt-and-agent-hook-fields)** (`type: "agent"`): spawn a subagent that can use tools like Read, Grep, and Glob to verify conditions before returning a decision. Agent hooks are experimental and may change. See [Agent-based hooks](#agent-based-hooks).287* **[Agent hooks](#prompt-and-agent-hook-fields)** (`type: "agent"`): spawn a subagent that can use tools like Read, Grep, and Glob to verify conditions before returning a decision. Agent hooks are experimental and may change. See [Agent-based hooks](#agent-based-hooks).

286 288 


289These fields apply to all hook types:291These fields apply to all hook types:

290 292 

291| Field | Required | Description |293| Field | Required | Description |

292| :-------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |294| :-------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

293| `type` | yes | `"command"`, `"http"`, `"prompt"`, or `"agent"` |295| `type` | yes | `"command"`, `"http"`, `"mcp_tool"`, `"prompt"`, or `"agent"` |

294| `if` | no | Permission rule syntax to filter when this hook runs, such as `"Bash(git *)"` or `"Edit(*.ts)"`. The hook only spawns if the tool call matches the pattern, or if a Bash command is too complex to parse. Only evaluated on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, and `PermissionRequest`. On other events, a hook with `if` set never runs. Uses the same syntax as [permission rules](/en/permissions) |296| `if` | no | Permission rule syntax to filter when this hook runs, such as `"Bash(git *)"` or `"Edit(*.ts)"`. The hook only spawns if the tool call matches the pattern, or if a Bash command is too complex to parse. Only evaluated on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, and `PermissionDenied`. On other events, a hook with `if` set never runs. Uses the same syntax as [permission rules](/en/permissions) |

295| `timeout` | no | Seconds before canceling. Defaults: 600 for command, 30 for prompt, 60 for agent |297| `timeout` | no | Seconds before canceling. Defaults: 600 for command, 30 for prompt, 60 for agent |

296| `statusMessage` | no | Custom spinner message displayed while the hook runs |298| `statusMessage` | no | Custom spinner message displayed while the hook runs |

297| `once` | no | If `true`, runs once per session then is removed. Only honored for hooks declared in [skill frontmatter](#hooks-in-skills-and-agents); ignored in settings files and agent frontmatter |299| `once` | no | If `true`, runs once per session then is removed. Only honored for hooks declared in [skill frontmatter](#hooks-in-skills-and-agents); ignored in settings files and agent frontmatter |


348}350}

349```351```

350 352 

353#### MCP tool hook fields

354 

355In addition to the [common fields](#common-fields), MCP tool hooks accept these fields:

356 

357| Field | Required | Description |

358| :------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

359| `server` | yes | Name of a configured MCP server. The server must already be connected; the hook never triggers an OAuth or connection flow |

360| `tool` | yes | Name of the tool to call on that server |

361| `input` | no | Arguments passed to the tool. String values support `${path}` substitution from the hook's [JSON input](#hook-input-and-output), such as `"${tool_input.file_path}"` |

362 

363The tool's text content is treated like command-hook stdout: if it parses as valid [JSON output](#json-output) it is processed as a decision, otherwise it is shown as plain text. If the named server is not connected, or the tool returns `isError: true`, the hook produces a non-blocking error and execution continues.

364 

365MCP tool hooks are available on every hook event once Claude Code has connected to your MCP servers. `SessionStart` and `Setup` typically fire before servers finish connecting, so hooks on those events should expect the "not connected" error on first run.

366 

367This example calls the `security_scan` tool on the `my_server` MCP server after each `Write` or `Edit`, passing the edited file's path:

368 

369```json theme={null}

370{

371 "hooks": {

372 "PostToolUse": [

373 {

374 "matcher": "Write|Edit",

375 "hooks": [

376 {

377 "type": "mcp_tool",

378 "server": "my_server",

379 "tool": "security_scan",

380 "input": { "file_path": "${tool_input.file_path}" }

381 }

382 ]

383 }

384 ]

385 }

386}

387```

388 

351#### Prompt and agent hook fields389#### Prompt and agent hook fields

352 390 

353In addition to the [common fields](#common-fields), prompt and agent hooks accept these fields:391In addition to the [common fields](#common-fields), prompt and agent hooks accept these fields:


448 486 

449Type `/hooks` in Claude Code to open a read-only browser for your configured hooks. The menu shows every hook event with a count of configured hooks, lets you drill into matchers, and shows the full details of each hook handler. Use it to verify configuration, check which settings file a hook came from, or inspect a hook's command, prompt, or URL.487Type `/hooks` in Claude Code to open a read-only browser for your configured hooks. The menu shows every hook event with a count of configured hooks, lets you drill into matchers, and shows the full details of each hook handler. Use it to verify configuration, check which settings file a hook came from, or inspect a hook's command, prompt, or URL.

450 488 

451The menu displays all four hook types: `command`, `prompt`, `agent`, and `http`. Each hook is labeled with a `[type]` prefix and a source indicating where it was defined:489The menu displays all five hook types: `command`, `prompt`, `agent`, `http`, and `mcp_tool`. Each hook is labeled with a `[type]` prefix and a source indicating where it was defined:

452 490 

453* `User`: from `~/.claude/settings.json`491* `User`: from `~/.claude/settings.json`

454* `Project`: from `.claude/settings.json`492* `Project`: from `.claude/settings.json`


558| `StopFailure` | No | Output and exit code are ignored |596| `StopFailure` | No | Output and exit code are ignored |

559| `PostToolUse` | No | Shows stderr to Claude (tool already ran) |597| `PostToolUse` | No | Shows stderr to Claude (tool already ran) |

560| `PostToolUseFailure` | No | Shows stderr to Claude (tool already failed) |598| `PostToolUseFailure` | No | Shows stderr to Claude (tool already failed) |

599| `PostToolBatch` | Yes | Stops the agentic loop before the next model call |

561| `PermissionDenied` | No | Exit code and stderr are ignored (denial already occurred). Use JSON `hookSpecificOutput.retry: true` to tell the model it may retry |600| `PermissionDenied` | No | Exit code and stderr are ignored (denial already occurred). Use JSON `hookSpecificOutput.retry: true` to tell the model it may retry |

562| `Notification` | No | Shows stderr to user only |601| `Notification` | No | Shows stderr to user only |

563| `SubagentStart` | No | Shows stderr to user only |602| `SubagentStart` | No | Shows stderr to user only |


621Not every event supports blocking or controlling behavior through JSON. The events that do each use a different set of fields to express that decision. Use this table as a quick reference before writing a hook:660Not every event supports blocking or controlling behavior through JSON. The events that do each use a different set of fields to express that decision. Use this table as a quick reference before writing a hook:

622 661 

623| Events | Decision pattern | Key fields |662| Events | Decision pattern | Key fields |

624| :------------------------------------------------------------------------------------------------------------------- | :----------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |663| :---------------------------------------------------------------------------------------------------------------------------------- | :----------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

625| UserPromptSubmit, UserPromptExpansion, PostToolUse, PostToolUseFailure, Stop, SubagentStop, ConfigChange, PreCompact | Top-level `decision` | `decision: "block"`, `reason` |664| UserPromptSubmit, UserPromptExpansion, PostToolUse, PostToolUseFailure, PostToolBatch, Stop, SubagentStop, ConfigChange, PreCompact | Top-level `decision` | `decision: "block"`, `reason` |

626| TeammateIdle, TaskCreated, TaskCompleted | Exit code or `continue: false` | Exit code 2 blocks the action with stderr feedback. JSON `{"continue": false, "stopReason": "..."}` also stops the teammate entirely, matching `Stop` hook behavior |665| TeammateIdle, TaskCreated, TaskCompleted | Exit code or `continue: false` | Exit code 2 blocks the action with stderr feedback. JSON `{"continue": false, "stopReason": "..."}` also stops the teammate entirely, matching `Stop` hook behavior |

627| PreToolUse | `hookSpecificOutput` | `permissionDecision` (allow/deny/ask/defer), `permissionDecisionReason` |666| PreToolUse | `hookSpecificOutput` | `permissionDecision` (allow/deny/ask/defer), `permissionDecisionReason` |

628| PermissionRequest | `hookSpecificOutput` | `decision.behavior` (allow/deny) |667| PermissionRequest | `hookSpecificOutput` | `decision.behavior` (allow/deny) |


636 675 

637<Tabs>676<Tabs>

638 <Tab title="Top-level decision">677 <Tab title="Top-level decision">

639 Used by `UserPromptSubmit`, `UserPromptExpansion`, `PostToolUse`, `PostToolUseFailure`, `Stop`, `SubagentStop`, `ConfigChange`, and `PreCompact`. The only value is `"block"`. To allow the action to proceed, omit `decision` from your JSON, or exit 0 without any JSON at all:678 Used by `UserPromptSubmit`, `UserPromptExpansion`, `PostToolUse`, `PostToolUseFailure`, `PostToolBatch`, `Stop`, `SubagentStop`, `ConfigChange`, and `PreCompact`. The only value is `"block"`. To allow the action to proceed, omit `decision` from your JSON, or exit 0 without any JSON at all:

640 679 

641 ```json theme={null}680 ```json theme={null}

642 {681 {


689 728 

690Runs when Claude Code starts a new session or resumes an existing session. Useful for loading development context like existing issues or recent changes to your codebase, or setting up environment variables. For static context that does not require a script, use [CLAUDE.md](/en/memory) instead.729Runs when Claude Code starts a new session or resumes an existing session. Useful for loading development context like existing issues or recent changes to your codebase, or setting up environment variables. For static context that does not require a script, use [CLAUDE.md](/en/memory) instead.

691 730 

692SessionStart runs on every session, so keep these hooks fast. Only `type: "command"` hooks are supported.731SessionStart runs on every session, so keep these hooks fast. Only `type: "command"` and `type: "mcp_tool"` hooks are supported.

693 732 

694The matcher value corresponds to how the session was initiated:733The matcher value corresponds to how the session was initiated:

695 734 


1095}1134}

1096```1135```

1097 1136 

1098There is no timeout or retry limit. The session remains on disk until you resume it. If the answer is not ready when you resume, the hook can return `"defer"` again and the process exits the same way. The calling process controls when to break the loop by eventually returning `"allow"` or `"deny"` from the hook.1137There is no timeout or retry limit. The session remains on disk until you resume it, subject to the [`cleanupPeriodDays`](/en/settings#available-settings) retention sweep that deletes session files after 30 days by default. If the answer is not ready when you resume, the hook can return `"defer"` again and the process exits the same way. The calling process controls when to break the loop by eventually returning `"allow"` or `"deny"` from the hook.

1099 1138 

1100`"defer"` only works when Claude makes a single tool call in the turn. If Claude makes several tool calls at once, `"defer"` is ignored with a warning and the tool proceeds through the normal permission flow. The constraint exists because resume can only re-run one tool: there is no way to defer one call from a batch without leaving the others unresolved.1139`"defer"` only works when Claude makes a single tool call in the turn. If Claude makes several tool calls at once, `"defer"` is ignored with a warning and the tool proceeds through the normal permission flow. The constraint exists because resume can only re-run one tool: there is no way to defer one call from a batch without leaving the others unresolved.

1101 1140 


1295}1334}

1296```1335```

1297 1336 

1337### PostToolBatch

1338 

1339Runs once after every tool call in a batch has resolved, before Claude Code sends the next request to the model. `PostToolUse` fires once per tool, which means it fires concurrently when Claude makes parallel tool calls. `PostToolBatch` fires exactly once with the full batch, so it is the right place to inject context that depends on the set of tools that ran rather than on any single tool. There is no matcher for this event.

1340 

1341#### PostToolBatch input

1342 

1343In addition to the [common input fields](#common-input-fields), PostToolBatch hooks receive `tool_calls`, an array describing every tool call in the batch:

1344 

1345```json theme={null}

1346{

1347 "session_id": "abc123",

1348 "transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",

1349 "cwd": "/Users/...",

1350 "permission_mode": "default",

1351 "hook_event_name": "PostToolBatch",

1352 "tool_calls": [

1353 {

1354 "tool_name": "Read",

1355 "tool_input": {"file_path": "/.../ledger/accounts.py"},

1356 "tool_use_id": "toolu_01...",

1357 "tool_response": " 1\tfrom __future__ import annotations\n 2\t..."

1358 },

1359 {

1360 "tool_name": "Read",

1361 "tool_input": {"file_path": "/.../ledger/transactions.py"},

1362 "tool_use_id": "toolu_02...",

1363 "tool_response": " 1\tfrom __future__ import annotations\n 2\t..."

1364 }

1365 ]

1366}

1367```

1368 

1369`tool_response` contains the same content the model receives in the corresponding `tool_result` block. The value is a serialized string or content-block array, exactly as the tool emitted it. For `Read`, that means line-number-prefixed text rather than raw file contents. Responses can be large, so parse only the fields you need.

1370 

1371<Note>

1372 The `tool_response` shape differs from `PostToolUse`'s. `PostToolUse` passes the tool's structured `Output` object, such as `{filePath: "...", success: true}` for `Write`; `PostToolBatch` passes the serialized `tool_result` content the model sees.

1373</Note>

1374 

1375#### PostToolBatch decision control

1376 

1377`PostToolBatch` hooks can inject context for Claude. In addition to the [JSON output fields](#json-output) available to all hooks, your hook script can return these event-specific fields:

1378 

1379| Field | Description |

1380| :------------------ | :------------------------------------------------------ |

1381| `additionalContext` | Context string injected once before the next model call |

1382 

1383```json theme={null}

1384{

1385 "hookSpecificOutput": {

1386 "hookEventName": "PostToolBatch",

1387 "additionalContext": "These files are part of the ledger module. Run pytest before marking the task complete."

1388 }

1389}

1390```

1391 

1392<Note>

1393 Injected `additionalContext` is persisted to the session transcript. On `--continue` or `--resume`, the saved text is replayed from disk and the hook does not re-run for past turns. Prefer static context such as conventions or file-type guidance over dynamic values like timestamps or the current commit SHA, since those become stale on resume.

1394 

1395 Frame the context as factual information rather than imperative system instructions. Text written as out-of-band system commands can trigger Claude's prompt-injection defenses, which surfaces the injection to the user instead of acting on it.

1396</Note>

1397 

1398Returning `decision: "block"` or `continue: false` stops the agentic loop before the next model call.

1399 

1298### PermissionDenied1400### PermissionDenied

1299 1401 

1300Runs when the [auto mode](/en/permission-modes#eliminate-prompts-with-auto-mode) classifier denies a tool call. This hook only fires in auto mode: it does not run when you manually deny a permission dialog, when a `PreToolUse` hook blocks a call, or when a `deny` rule matches. Use it to log classifier denials, adjust configuration, or tell the model it may retry the tool call.1402Runs when the [auto mode](/en/permission-modes#eliminate-prompts-with-auto-mode) classifier denies a tool call. This hook only fires in auto mode: it does not run when you manually deny a permission dialog, when a `PreToolUse` hook blocks a call, or when a `deny` rule matches. Use it to log classifier denials, adjust configuration, or tell the model it may retry the tool call.


2126 2228 

2127## Prompt-based hooks2229## Prompt-based hooks

2128 2230 

2129In addition to command and HTTP hooks, Claude Code supports prompt-based hooks (`type: "prompt"`) that use an LLM to evaluate whether to allow or block an action, and agent hooks (`type: "agent"`) that spawn an agentic verifier with tool access. Not all events support every hook type.2231In addition to command, HTTP, and MCP tool hooks, Claude Code supports prompt-based hooks (`type: "prompt"`) that use an LLM to evaluate whether to allow or block an action, and agent hooks (`type: "agent"`) that spawn an agentic verifier with tool access. Not all events support every hook type.

2130 2232 

2131Events that support all four hook types (`command`, `http`, `prompt`, and `agent`):2233Events that support all five hook types (`command`, `http`, `mcp_tool`, `prompt`, and `agent`):

2132 2234 

2133* `PermissionRequest`2235* `PermissionRequest`

2236* `PostToolBatch`

2134* `PostToolUse`2237* `PostToolUse`

2135* `PostToolUseFailure`2238* `PostToolUseFailure`

2136* `PreToolUse`2239* `PreToolUse`


2141* `UserPromptExpansion`2244* `UserPromptExpansion`

2142* `UserPromptSubmit`2245* `UserPromptSubmit`

2143 2246 

2144Events that support `command` and `http` hooks but not `prompt` or `agent`:2247Events that support `command`, `http`, and `mcp_tool` hooks but not `prompt` or `agent`:

2145 2248 

2146* `ConfigChange`2249* `ConfigChange`

2147* `CwdChanged`2250* `CwdChanged`


2160* `WorktreeCreate`2263* `WorktreeCreate`

2161* `WorktreeRemove`2264* `WorktreeRemove`

2162 2265 

2163`SessionStart` supports only `command` hooks.2266`SessionStart` and `Setup` support `command` and `mcp_tool` hooks. They do not support `http`, `prompt`, or `agent` hooks.

2164 2267 

2165### How prompt-based hooks work2268### How prompt-based hooks work

2166 2269 

hooks-guide.md +6 −4

Details

435| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |435| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |

436| `PostToolUse` | After a tool call succeeds |436| `PostToolUse` | After a tool call succeeds |

437| `PostToolUseFailure` | After a tool call fails |437| `PostToolUseFailure` | After a tool call fails |

438| `PostToolBatch` | After a full batch of parallel tool calls resolves, before the next model call |

438| `Notification` | When Claude Code sends a notification |439| `Notification` | When Claude Code sends a notification |

439| `SubagentStart` | When a subagent is spawned |440| `SubagentStart` | When a subagent is spawned |

440| `SubagentStop` | When a subagent finishes |441| `SubagentStop` | When a subagent finishes |


457 458 

458When multiple hooks match, each one returns its own result. For decisions, Claude Code picks the most restrictive answer. A `PreToolUse` hook returning `deny` cancels the tool call no matter what the others return. One hook returning `ask` forces the permission prompt even if the rest return `allow`. Text from `additionalContext` is kept from every hook and passed to Claude together.459When multiple hooks match, each one returns its own result. For decisions, Claude Code picks the most restrictive answer. A `PreToolUse` hook returning `deny` cancels the tool call no matter what the others return. One hook returning `ask` forces the permission prompt even if the rest return `allow`. Text from `additionalContext` is kept from every hook and passed to Claude together.

459 460 

460Each hook has a `type` that determines how it runs. Most hooks use `"type": "command"`, which runs a shell command. Three other types are available:461Each hook has a `type` that determines how it runs. Most hooks use `"type": "command"`, which runs a shell command. Four other types are available:

461 462 

462* `"type": "http"`: POST event data to a URL. See [HTTP hooks](#http-hooks).463* `"type": "http"`: POST event data to a URL. See [HTTP hooks](#http-hooks).

464* `"type": "mcp_tool"`: call a tool on an already-connected MCP server. See [MCP tool hooks](/en/hooks#mcp-tool-hook-fields).

463* `"type": "prompt"`: single-turn LLM evaluation. See [Prompt-based hooks](#prompt-based-hooks).465* `"type": "prompt"`: single-turn LLM evaluation. See [Prompt-based hooks](#prompt-based-hooks).

464* `"type": "agent"`: multi-turn verification with tool access. Agent hooks are experimental and may change. See [Agent-based hooks](#agent-based-hooks).466* `"type": "agent"`: multi-turn verification with tool access. Agent hooks are experimental and may change. See [Agent-based hooks](#agent-based-hooks).

465 467 


566Each event type matches on a specific field:568Each event type matches on a specific field:

567 569 

568| Event | What the matcher filters | Example matcher values |570| Event | What the matcher filters | Example matcher values |

569| :--------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |571| :-------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |

570| `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied` | tool name | `Bash`, `Edit\|Write`, `mcp__.*` |572| `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied` | tool name | `Bash`, `Edit\|Write`, `mcp__.*` |

571| `SessionStart` | how the session started | `startup`, `resume`, `clear`, `compact` |573| `SessionStart` | how the session started | `startup`, `resume`, `clear`, `compact` |

572| `SessionEnd` | why the session ended | `clear`, `resume`, `logout`, `prompt_input_exit`, `bypass_permissions_disabled`, `other` |574| `SessionEnd` | why the session ended | `clear`, `resume`, `logout`, `prompt_input_exit`, `bypass_permissions_disabled`, `other` |


581| `ElicitationResult` | MCP server name | same values as `Elicitation` |583| `ElicitationResult` | MCP server name | same values as `Elicitation` |

582| `FileChanged` | literal filenames to watch (see [FileChanged](/en/hooks#filechanged)) | `.envrc\|.env` |584| `FileChanged` | literal filenames to watch (see [FileChanged](/en/hooks#filechanged)) | `.envrc\|.env` |

583| `UserPromptExpansion` | command name | your skill or command names |585| `UserPromptExpansion` | command name | your skill or command names |

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

585 587 

586A few more examples showing matchers on different event types:588A few more examples showing matchers on different event types:

587 589 


688 690 

689The hook process only spawns when a subcommand of the Bash command matches `git *`, or when the command is too complex to parse into subcommands. For compound commands like `npm test && git push`, Claude Code evaluates each subcommand and fires the hook because `git push` matches. The `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.691The hook process only spawns when a subcommand of the Bash command matches `git *`, or when the command is too complex to parse into subcommands. For compound commands like `npm test && git push`, Claude Code evaluates each subcommand and fires the hook because `git push` matches. The `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.

690 692 

691`if` only works on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, and `PermissionRequest`. Adding it to any other event prevents the hook from running.693`if` only works on tool events: `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, and `PermissionDenied`. Adding it to any other event prevents the hook from running.

692 694 

693### Configure hook location695### Configure hook location

694 696 

Details

114### Mode switching114### Mode switching

115 115 

116| Command | Action | From mode |116| Command | Action | From mode |

117| :------ | :-------------------------- | :-------- |117| :------ | :------------------------------------ | :------------- |

118| `Esc` | Enter NORMAL mode | INSERT |118| `Esc` | Enter NORMAL mode | INSERT, VISUAL |

119| `i` | Insert before cursor | NORMAL |119| `i` | Insert before cursor | NORMAL |

120| `I` | Insert at beginning of line | NORMAL |120| `I` | Insert at beginning of line | NORMAL |

121| `a` | Insert after cursor | NORMAL |121| `a` | Insert after cursor | NORMAL |

122| `A` | Insert at end of line | NORMAL |122| `A` | Insert at end of line | NORMAL |

123| `o` | Open line below | NORMAL |123| `o` | Open line below | NORMAL |

124| `O` | Open line above | NORMAL |124| `O` | Open line above | NORMAL |

125| `v` | Start character-wise visual selection | NORMAL |

126| `V` | Start line-wise visual selection | NORMAL |

125 127 

126### Navigation (NORMAL mode)128### Navigation (NORMAL mode)

127 129 


182| `i[`/`a[` | Inner/around brackets |184| `i[`/`a[` | Inner/around brackets |

183| `i{`/`a{` | Inner/around braces |185| `i{`/`a{` | Inner/around braces |

184 186 

187### Visual mode

188 

189Press `v` for character-wise selection or `V` for line-wise selection. Motions extend the selection, and operators act on it directly.

190 

191| Command | Action |

192| :--------------- | :--------------------------------------------------- |

193| `d`/`x` | Delete selection |

194| `y` | Yank selection |

195| `c`/`s` | Change selection |

196| `p` | Replace selection with register contents |

197| `r{char}` | Replace every selected character with `{char}` |

198| `~`/`u`/`U` | Toggle, lowercase, or uppercase selection |

199| `>`/`<` | Indent or dedent selected lines |

200| `J` | Join selected lines |

201| `o` | Swap cursor and anchor |

202| `iw`/`aw`/`i"`/… | Select a text object |

203| `v`/`V` | Toggle between character-wise and line-wise, or exit |

204 

205Block-wise visual mode with `Ctrl+V` is not supported.

206 

185## Command history207## Command history

186 208 

187Claude Code maintains command history for the current session:209Claude Code maintains command history for the current session:

keybindings.md +8 −6

Details

105| `chat:clearInput` | Ctrl+L | Clear prompt input and force a full screen redraw |105| `chat:clearInput` | Ctrl+L | Clear prompt input and force a full screen redraw |

106| `chat:killAgents` | Ctrl+X Ctrl+K | Kill all background agents |106| `chat:killAgents` | Ctrl+X Ctrl+K | Kill all background agents |

107| `chat:cycleMode` | Shift+Tab\* | Cycle permission modes |107| `chat:cycleMode` | Shift+Tab\* | Cycle permission modes |

108| `chat:modelPicker` | Cmd+P / Meta+P | Open model picker |108| `chat:modelPicker` | Meta+P | Open model picker |

109| `chat:fastMode` | Meta+O | Toggle fast mode |109| `chat:fastMode` | Meta+O | Toggle fast mode |

110| `chat:thinkingToggle` | Cmd+T / Meta+T | Toggle extended thinking |110| `chat:thinkingToggle` | Meta+T | Toggle extended thinking |

111| `chat:submit` | Enter | Submit message |111| `chat:submit` | Enter | Submit message |

112| `chat:newline` | Ctrl+J | Insert a newline without submitting |112| `chat:newline` | Ctrl+J | Insert a newline without submitting |

113| `chat:undo` | Ctrl+\_, Ctrl+Shift+- | Undo last action |113| `chat:undo` | Ctrl+\_, Ctrl+Shift+- | Undo last action |


343Use modifier keys with the `+` separator:343Use modifier keys with the `+` separator:

344 344 

345* `ctrl` or `control` - Control key345* `ctrl` or `control` - Control key

346* `alt`, `opt`, or `option` - Alt/Option key

347* `shift` - Shift key346* `shift` - Shift key

348* `meta`, `cmd`, or `command` - Meta/Command key347* `alt`, `opt`, `option`, or `meta` - Alt key on Windows and Linux, Option key on macOS

348* `cmd`, `command`, `super`, or `win` - Command key on macOS, Windows key on Windows, Super key on Linux

349 

350The `cmd` group is only detected in terminals that report the Super modifier, such as those supporting the Kitty keyboard protocol or xterm's `modifyOtherKeys` mode. Most terminals do not send it, so use `ctrl` or `meta` for bindings you want to work everywhere.

349 351 

350For example:352For example:

351 353 

352```text theme={null}354```text theme={null}

353ctrl+k Single key with modifier355ctrl+k Ctrl + K

354shift+tab Shift + Tab356shift+tab Shift + Tab

355meta+p Command/Meta + P357meta+p Option + P on macOS, Alt + P elsewhere

356ctrl+shift+c Multiple modifiers358ctrl+shift+c Multiple modifiers

357```359```

358 360 

model-config.md +2 −2

Details

80 80 

81Enterprise administrators can use `availableModels` in [managed or policy settings](/en/settings#settings-files) to restrict which models users can select.81Enterprise administrators can use `availableModels` in [managed or policy settings](/en/settings#settings-files) to restrict which models users can select.

82 82 

83When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, Config tool, or `ANTHROPIC_MODEL` environment variable.83When `availableModels` is set, users cannot switch to models not in the list via `/model`, `--model` flag, or `ANTHROPIC_MODEL` environment variable.

84 84 

85```json theme={null}85```json theme={null}

86{86{


317 317 

318When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model.318When you pin a model on a third-party provider, the provider-specific ID appears as-is in the `/model` picker and Claude Code may not recognize which features the model supports. You can override the display name and declare capabilities with companion environment variables for each pinned model.

319 319 

320These variables only take effect on third-party providers such as Bedrock, Vertex AI, and Foundry. They have no effect when using the Anthropic API directly.320These variables take effect on third-party providers such as Bedrock, Vertex AI, and Foundry. The `_NAME` and `_DESCRIPTION` variables also take effect when `ANTHROPIC_BASE_URL` points to an [LLM gateway](/en/llm-gateway). They have no effect when connecting directly to `api.anthropic.com`.

321 321 

322| Environment variable | Description |322| Environment variable | Description |

323| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |323| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |

network-config.md +11 −13

Details

104 104 

105## Network access requirements105## Network access requirements

106 106 

107Claude Code requires access to the following URLs:107Claude Code requires access to the following URLs. Allowlist these in your proxy configuration and firewall rules, especially in containerized or restricted network environments.

108 108 

109* `api.anthropic.com`: Claude API endpoints109| URL | Required for |

110* `claude.ai`: authentication for claude.ai accounts110| ------------------------------ | ------------------------------------------------------------------------------------------------- |

111* `platform.claude.com`: authentication for Anthropic Console accounts111| `api.anthropic.com` | Claude API requests |

112| `claude.ai` | claude.ai account authentication |

113| `platform.claude.com` | Anthropic Console account authentication |

114| `downloads.claude.ai` | Plugin executable downloads; native installer and native auto-updater |

115| `storage.googleapis.com` | {/* max-version: 2.1.115 */}Native installer and native auto-updater on versions prior to 2.1.116 |

116| `bridge.claudeusercontent.com` | [Claude in Chrome](/en/chrome) extension WebSocket bridge |

112 117 

113Ensure these URLs are allowlisted in your proxy configuration and firewall rules. This is especially important when using Claude Code in containerized or restricted network environments.118If you install Claude Code through npm or manage your own binary distribution, end users may not need access to `downloads.claude.ai` or `storage.googleapis.com`.

114 119 

115When using [Bedrock](/en/amazon-bedrock), [Vertex AI](/en/google-vertex-ai), or [Foundry](/en/microsoft-foundry), model traffic goes to your provider instead of `api.anthropic.com`. The WebFetch tool still calls `api.anthropic.com` for its [domain safety check](/en/data-usage#webfetch-domain-safety-check) unless you set `skipWebFetchPreflight: true` in [settings](/en/settings).120When using [Amazon Bedrock](/en/amazon-bedrock), [Google Vertex AI](/en/google-vertex-ai), or [Microsoft Foundry](/en/microsoft-foundry), model traffic and authentication go to your provider instead of `api.anthropic.com`, `claude.ai`, or `platform.claude.com`. The WebFetch tool still calls `api.anthropic.com` for its [domain safety check](/en/data-usage#webfetch-domain-safety-check) unless you set `skipWebFetchPreflight: true` in [settings](/en/settings).

116 

117The native installer and update checks also require the following URLs. Allowlist both, since clients running older Claude Code versions fetch from `storage.googleapis.com`. If you install Claude Code through npm or manage your own binary distribution, end users may not need access:

118 

119* `downloads.claude.ai`: download host for the Claude Code binary, auto-updater, version pointers, manifests, install script, signing keys, and plugin executables

120* `storage.googleapis.com`: legacy download host used by older clients

121 

122The [Chrome integration](/en/chrome) connects to the browser extension over a WebSocket bridge. If you use Claude in Chrome, allowlist `bridge.claudeusercontent.com` for outbound WebSocket connections.

123 121 

124[Claude Code on the web](/en/claude-code-on-the-web) and [Code Review](/en/code-review) connect to your repositories from Anthropic-managed infrastructure. If your GitHub Enterprise Cloud organization restricts access by IP address, enable [IP allow list inheritance for installed GitHub Apps](https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps). The Claude GitHub App registers its IP ranges, so enabling this setting allows access without manual configuration. To [add the ranges to your allow list manually](https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#adding-an-allowed-ip-address) instead, or to configure other firewalls, see the [Anthropic API IP addresses](https://platform.claude.com/docs/en/api/ip-addresses).122[Claude Code on the web](/en/claude-code-on-the-web) and [Code Review](/en/code-review) connect to your repositories from Anthropic-managed infrastructure. If your GitHub Enterprise Cloud organization restricts access by IP address, enable [IP allow list inheritance for installed GitHub Apps](https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#allowing-access-by-github-apps). The Claude GitHub App registers its IP ranges, so enabling this setting allows access without manual configuration. To [add the ranges to your allow list manually](https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization#adding-an-allowed-ip-address) instead, or to configure other firewalls, see the [Anthropic API IP addresses](https://platform.claude.com/docs/en/api/ip-addresses).

125 123 

overview.md +2 −0

Details

704 </Tab>704 </Tab>

705 </Tabs>705 </Tabs>

706 706 

707 You can also install with [apt, dnf, or apk](/en/setup#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.

708 

707 Then start Claude Code in any project:709 Then start Claude Code in any project:

708 710 

709 ```bash theme={null}711 ```bash theme={null}

Details

33 <Tab title="CLI">33 <Tab title="CLI">

34 **During a session**: press `Shift+Tab` to cycle `default` → `acceptEdits` → `plan`. The current mode appears in the status bar. Not every mode is in the default cycle:34 **During a session**: press `Shift+Tab` to cycle `default` → `acceptEdits` → `plan`. The current mode appears in the status bar. Not every mode is in the default cycle:

35 35 

36 * `auto`: appears when your account meets the [auto mode requirements](#eliminate-prompts-with-auto-mode)36 * `auto`: appears when your account meets the [auto mode requirements](#eliminate-prompts-with-auto-mode); cycling to auto shows an opt-in prompt until you accept it, or select **No, don't ask again** to remove auto from the cycle

37 * `bypassPermissions`: appears after you start with `--permission-mode bypassPermissions`, `--dangerously-skip-permissions`, or `--allow-dangerously-skip-permissions`; the `--allow-` variant adds the mode to the cycle without activating it37 * `bypassPermissions`: appears after you start with `--permission-mode bypassPermissions`, `--dangerously-skip-permissions`, or `--allow-dangerously-skip-permissions`; the `--allow-` variant adds the mode to the cycle without activating it

38 * `dontAsk`: never appears in the cycle; set it with `--permission-mode dontAsk`38 * `dontAsk`: never appears in the cycle; set it with `--permission-mode dontAsk`

39 39 

permissions.md +2 −1

Details

288The following settings are only read from managed settings. Placing them in user or project settings files has no effect.288The following settings are only read from managed settings. Placing them in user or project settings files has no effect.

289 289 

290| Setting | Description |290| Setting | Description |

291| :--------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |291| :--------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

292| `allowedChannelPlugins` | Allowlist of channel plugins that may push messages. Replaces the default Anthropic allowlist when set. Requires `channelsEnabled: true`. See [Restrict which channel plugins can run](/en/channels#restrict-which-channel-plugins-can-run) |292| `allowedChannelPlugins` | Allowlist of channel plugins that may push messages. Replaces the default Anthropic allowlist when set. Requires `channelsEnabled: true`. See [Restrict which channel plugins can run](/en/channels#restrict-which-channel-plugins-can-run) |

293| `allowManagedHooksOnly` | When `true`, only managed hooks, SDK hooks, and hooks from plugins force-enabled in managed settings `enabledPlugins` are loaded. User, project, and all other plugin hooks are blocked |293| `allowManagedHooksOnly` | When `true`, only managed hooks, SDK hooks, and hooks from plugins force-enabled in managed settings `enabledPlugins` are loaded. User, project, and all other plugin hooks are blocked |

294| `allowManagedMcpServersOnly` | When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See [Managed MCP configuration](/en/mcp#managed-mcp-configuration) |294| `allowManagedMcpServersOnly` | When `true`, only `allowedMcpServers` from managed settings are respected. `deniedMcpServers` still merges from all sources. See [Managed MCP configuration](/en/mcp#managed-mcp-configuration) |


300| `sandbox.filesystem.allowManagedReadPathsOnly` | When `true`, only `filesystem.allowRead` paths from managed settings are respected. `denyRead` still merges from all sources |300| `sandbox.filesystem.allowManagedReadPathsOnly` | When `true`, only `filesystem.allowRead` paths from managed settings are respected. `denyRead` still merges from all sources |

301| `sandbox.network.allowManagedDomainsOnly` | When `true`, only `allowedDomains` and `WebFetch(domain:...)` allow rules from managed settings are respected. Non-allowed domains are blocked automatically without prompting the user. Denied domains still merge from all sources |301| `sandbox.network.allowManagedDomainsOnly` | When `true`, only `allowedDomains` and `WebFetch(domain:...)` allow rules from managed settings are respected. Non-allowed domains are blocked automatically without prompting the user. Denied domains still merge from all sources |

302| `strictKnownMarketplaces` | Controls which plugin marketplace sources users can add and install plugins from. See [managed marketplace restrictions](/en/plugin-marketplaces#managed-marketplace-restrictions) |302| `strictKnownMarketplaces` | Controls which plugin marketplace sources users can add and install plugins from. See [managed marketplace restrictions](/en/plugin-marketplaces#managed-marketplace-restrictions) |

303| `wslInheritsWindowsSettings` | When `true` in the Windows HKLM registry key or `C:\Program Files\ClaudeCode\managed-settings.json`, WSL reads managed settings from the Windows policy chain in addition to `/etc/claude-code`. See [Settings files](/en/settings#settings-files) |

303 304 

304`disableBypassPermissionsMode` is typically placed in managed settings to enforce organizational policy, but it works from any scope. A user can set it in their own settings to lock themselves out of bypass mode.305`disableBypassPermissionsMode` is typically placed in managed settings to enforce organizational policy, but it works from any scope. A user can set it in their own settings to lock themselves out of bypass mode.

305 306 

Details

82 82 

83Version constraints resolve against git tags on the marketplace repository. For Claude Code to find a dependency's available versions, the upstream plugin's releases must be tagged using a specific naming convention.83Version constraints resolve against git tags on the marketplace repository. For Claude Code to find a dependency's available versions, the upstream plugin's releases must be tagged using a specific naming convention.

84 84 

85Tag each release as `{plugin-name}--v{version}`, where `{version}` matches the `version` field in that commit's `plugin.json`.85Tag each release as `{plugin-name}--v{version}`, where `{version}` matches the `version` field in that commit's `plugin.json`. From the plugin directory, run:

86 86 

87```bash theme={null}87```bash theme={null}

88git tag secrets-vault--v2.1.088claude plugin tag --push

89git push origin secrets-vault--v2.1.0

90```89```

91 90 

91The `claude plugin tag` command derives the tag name from the plugin's manifest and the enclosing marketplace entry. Before creating the tag, it validates the plugin contents, checks that `plugin.json` and the marketplace entry agree on the version, requires a clean working tree under the plugin directory, and refuses if the tag already exists. Add `--dry-run` to see what would be tagged without creating it. Running `git tag secrets-vault--v2.1.0` directly is equivalent if you keep `plugin.json` and the marketplace entry in sync yourself.

92 

92The plugin name prefix lets one marketplace repository host multiple plugins with independent version lines. The `--v` separator is parsed as a prefix match on the full plugin name, so plugin names that contain hyphens are handled correctly.93The plugin name prefix lets one marketplace repository host multiple plugins with independent version lines. The `--v` separator is parsed as a prefix match on the full plugin name, so plugin names that contain hyphens are handled correctly.

93 94 

94When you install a plugin that declares `{ "name": "secrets-vault", "version": "~2.1.0" }`, Claude Code lists the marketplace's tags, filters to those starting with `secrets-vault--v`, and fetches the highest version satisfying `~2.1.0`. If no matching tag exists, the dependent plugin is disabled with an error listing the available versions.95When you install a plugin that declares `{ "name": "secrets-vault", "version": "~2.1.0" }`, Claude Code lists the marketplace's tags, filters to those starting with `secrets-vault--v`, and fetches the highest version satisfying `~2.1.0`. If no matching tag exists, the dependent plugin is disabled with an error listing the available versions.

95 96 

97The resolved tag's semver is recorded separately from `plugin.json`'s `version`, so constraint checks use the tag that was actually fetched even if `plugin.json` at that commit has a stale value. The cache directory name for a tag-resolved install includes a 12-character commit-SHA suffix, so if a maintainer force-moves a tag to a different commit, the next install gets a fresh cache directory instead of reusing stale content.

98 

96<Note>99<Note>

97 For `npm` marketplace sources, the constraint does not control which version is fetched, since tag-based resolution applies only to git-backed sources. The constraint is still checked at load time, and the dependent plugin is disabled with `dependency-version-unsatisfied` if the installed version does not satisfy it.100 For `npm` marketplace sources, the constraint does not control which version is fetched, since tag-based resolution applies only to git-backed sources. The constraint is still checked at load time, and the dependent plugin is disabled with `dependency-version-unsatisfied` if the installed version does not satisfy it.

98</Note>101</Note>


107| `~2.1` | `~3.0` | Install of plugin B fails with `range-conflict`. Plugin A and the dependency stay as they were. |110| `~2.1` | `~3.0` | Install of plugin B fails with `range-conflict`. Plugin A and the dependency stay as they were. |

108| `=2.1.0` | none | The dependency stays at `2.1.0`. Auto-update skips newer versions while plugin A is installed. |111| `=2.1.0` | none | The dependency stays at `2.1.0`. Auto-update skips newer versions while plugin A is installed. |

109 112 

110Auto-update checks each constrained dependency against every installed plugin's range before applying an update. If the marketplace moves a dependency to a version outside any range, the update is skipped and the skip message names the constraining plugin.113Auto-update checks each constrained dependency against every installed plugin's range before applying an update. If the marketplace moves a dependency to a version outside any range, the update is skipped and the skip appears in `/doctor` and the `/plugin` Errors tab, naming the constraining plugin.

111 114 

112When you uninstall the last plugin that constrains a dependency, the dependency is no longer held and resumes tracking its marketplace entry on the next update.115When you uninstall the last plugin that constrains a dependency, the dependency is no longer held and resumes tracking its marketplace entry on the next update.

113 116 


129* [Create plugins](/en/plugins): build plugins with skills, agents, and hooks132* [Create plugins](/en/plugins): build plugins with skills, agents, and hooks

130* [Create and distribute a plugin marketplace](/en/plugin-marketplaces): host plugins for your team133* [Create and distribute a plugin marketplace](/en/plugin-marketplaces): host plugins for your team

131* [Plugins reference](/en/plugins-reference#plugin-manifest-schema): the full `plugin.json` schema134* [Plugins reference](/en/plugins-reference#plugin-manifest-schema): the full `plugin.json` schema

132* [Version management](/en/plugins-reference#version-management): semantic versioning guidance for plugin releases135* [Version management](/en/plugins-reference#version-management): how a plugin's own version is resolved and used as the cache key

Details

63 "version": "1.0.0"63 "version": "1.0.0"

64 }64 }

65 ```65 ```

66 

67 <Note>

68 Setting `version` means users only receive updates when you change this field, so bump it on every release. If you omit `version` and host this marketplace in git, every commit automatically counts as a new version. See [Version resolution](#version-resolution-and-release-channels) to choose the right approach.

69 </Note>

66 </Step>70 </Step>

67 71 

68 <Step title="Create the marketplace file">72 <Step title="Create the marketplace file">


192**Standard metadata fields:**196**Standard metadata fields:**

193 197 

194| Field | Type | Description |198| Field | Type | Description |

195| :------------ | :------ | :-------------------------------------------------------------------------------------------------------------------------------- |199| :------------ | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

196| `description` | string | Brief plugin description |200| `description` | string | Brief plugin description |

197| `version` | string | Plugin version |201| `version` | string | Plugin version. If set (here or in `plugin.json`), the plugin is pinned to this string and users only receive updates when it changes. Omit to fall back to the git commit SHA. See [Version resolution](#version-resolution-and-release-channels). |

198| `author` | object | Plugin author information (`name` required, `email` optional) |202| `author` | object | Plugin author information (`name` required, `email` optional) |

199| `homepage` | string | Plugin homepage or documentation URL |203| `homepage` | string | Plugin homepage or documentation URL |

200| `repository` | string | Source code repository URL |204| `repository` | string | Source code repository URL |


692 696 

693### Version resolution and release channels697### Version resolution and release channels

694 698 

695Plugin versions determine cache paths and update detection. You can specify the version in the plugin manifest (`plugin.json`) or in the marketplace entry (`marketplace.json`).699Plugin versions determine cache paths and update detection: if the resolved version matches what a user already has, `/plugin update` and auto-update skip the plugin.

700 

701Claude Code resolves a plugin's version from the first of these that is set:

702 

7031. `version` in the plugin's `plugin.json`

7042. `version` in the plugin's marketplace entry

7053. The git commit SHA of the plugin's source

706 

707For the git-based source types `github`, `url`, `git-subdir`, and relative paths inside a git-hosted marketplace, you can omit `version` entirely and every new commit is treated as a new version. This is the simplest setup for internal or actively-developed plugins.

696 708 

697<Warning>709<Warning>

698 When possible, avoid setting the version in both places. The plugin manifest always wins silently, which can cause the marketplace version to be ignored. For relative-path plugins, set the version in the marketplace entry. For all other plugin sources, set it in the plugin manifest.710 Setting `version` pins the plugin. If `plugin.json` declares `"version": "1.0.0"`, pushing new commits without changing that string does nothing for existing users, because Claude Code sees the same version and keeps the cached copy. Bump the field on every release, or omit it to use the commit SHA.

711 

712 Avoid setting `version` in both `plugin.json` and the marketplace entry. The `plugin.json` value always wins silently, so a stale manifest version can mask a version you set in `marketplace.json`.

699</Warning>713</Warning>

700 714 

701#### Set up release channels715#### Set up release channels


703To support "stable" and "latest" release channels for your plugins, you can set up two marketplaces that point to different refs or SHAs of the same repo. You can then assign the two marketplaces to different user groups through [managed settings](/en/settings#settings-files).717To support "stable" and "latest" release channels for your plugins, you can set up two marketplaces that point to different refs or SHAs of the same repo. You can then assign the two marketplaces to different user groups through [managed settings](/en/settings#settings-files).

704 718 

705<Warning>719<Warning>

706 The plugin's `plugin.json` must declare a different `version` at each pinned ref or commit. If two refs or commits have the same manifest version, Claude Code treats them as identical and skips the update.720 Each channel must resolve to a different version. If you use explicit versions, `plugin.json` must declare a different `version` at each pinned ref. If you omit `version`, the distinct commit SHAs already distinguish the channels. If two refs resolve to the same version string, Claude Code treats them as identical and skips the update.

707</Warning>721</Warning>

708 722 

709##### Example723##### Example


772}786}

773```787```

774 788 

789#### Pin dependency versions

790 

791A plugin can constrain its dependencies to a semver range so that updates to a dependency do not break the dependent plugin. See [Constrain plugin dependency versions](/en/plugin-dependencies) for the `{plugin-name}--v{version}` git-tag convention, range syntax, and how multiple constraints on the same dependency are combined.

792 

775## Validation and testing793## Validation and testing

776 794 

777Test your marketplace before sharing.795Test your marketplace before sharing.

plugins.md +3 −3

Details

84 ```84 ```

85 85 

86 | Field | Purpose |86 | Field | Purpose |

87 | :------------ | :----------------------------------------------------------------------------------------------------- |87 | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

88 | `name` | Unique identifier and skill namespace. Skills are prefixed with this (e.g., `/my-first-plugin:hello`). |88 | `name` | Unique identifier and skill namespace. Skills are prefixed with this (e.g., `/my-first-plugin:hello`). |

89 | `description` | Shown in the plugin manager when browsing or installing plugins. |89 | `description` | Shown in the plugin manager when browsing or installing plugins. |

90 | `version` | Track releases using [semantic versioning](/en/plugins-reference#version-management). |90 | `version` | Optional. If set, users only receive updates when you bump this field. If omitted and your plugin is distributed via git, the commit SHA is used and every commit counts as a new version. See [version management](/en/plugins-reference#version-management). |

91 | `author` | Optional. Helpful for attribution. |91 | `author` | Optional. Helpful for attribution. |

92 92 

93 For additional fields like `homepage`, `repository`, and `license`, see the [full manifest schema](/en/plugins-reference#plugin-manifest-schema).93 For additional fields like `homepage`, `repository`, and `license`, see the [full manifest schema](/en/plugins-reference#plugin-manifest-schema).


328When your plugin is ready to share:328When your plugin is ready to share:

329 329 

3301. **Add documentation**: Include a `README.md` with installation and usage instructions3301. **Add documentation**: Include a `README.md` with installation and usage instructions

3312. **Version your plugin**: Use [semantic versioning](/en/plugins-reference#version-management) in your `plugin.json`3312. **Choose a versioning strategy**: Decide whether to set an explicit `version` or rely on the git commit SHA. See [version management](/en/plugins-reference#version-management)

3323. **Create or use a marketplace**: Distribute through [plugin marketplaces](/en/plugin-marketplaces) for installation3323. **Create or use a marketplace**: Distribute through [plugin marketplaces](/en/plugin-marketplaces) for installation

3334. **Test with others**: Have team members test the plugin before wider distribution3334. **Test with others**: Have team members test the plugin before wider distribution

334 334 

Details

118| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |118| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |

119| `PostToolUse` | After a tool call succeeds |119| `PostToolUse` | After a tool call succeeds |

120| `PostToolUseFailure` | After a tool call fails |120| `PostToolUseFailure` | After a tool call fails |

121| `PostToolBatch` | After a full batch of parallel tool calls resolves, before the next model call |

121| `Notification` | When Claude Code sends a notification |122| `Notification` | When Claude Code sends a notification |

122| `SubagentStart` | When a subagent is spawned |123| `SubagentStart` | When a subagent is spawned |

123| `SubagentStop` | When a subagent finishes |124| `SubagentStop` | When a subagent finishes |


142 143 

143* `command`: execute shell commands or scripts144* `command`: execute shell commands or scripts

144* `http`: send the event JSON as a POST request to a URL145* `http`: send the event JSON as a POST request to a URL

146* `mcp_tool`: call a tool on a configured [MCP server](/en/mcp)

145* `prompt`: evaluate a prompt with an LLM (uses `$ARGUMENTS` placeholder for context)147* `prompt`: evaluate a prompt with an LLM (uses `$ARGUMENTS` placeholder for context)

146* `agent`: run an agentic verifier with tools for complex verification tasks148* `agent`: run an agentic verifier with tools for complex verification tasks

147 149 


318 320 

319Disabling a plugin mid-session does not stop monitors that are already running. They stop when the session ends.321Disabling a plugin mid-session does not stop monitors that are already running. They stop when the session ends.

320 322 

323### Themes

324 

325Plugins can ship color themes that appear in `/theme` alongside the built-in presets and the user's local themes. A theme is a JSON file in `themes/` with a `base` preset and a sparse `overrides` map of color tokens.

326 

327```json theme={null}

328{

329 "name": "Dracula",

330 "base": "dark",

331 "overrides": {

332 "claude": "#bd93f9",

333 "error": "#ff5555",

334 "success": "#50fa7b"

335 }

336}

337```

338 

339Selecting a plugin theme persists `custom:<plugin-name>:<slug>` in the user's config. Plugin themes are read-only; pressing `Ctrl+E` on one in `/theme` copies it into `~/.claude/themes/` so the user can edit the copy.

340 

321***341***

322 342 

323## Plugin installation scopes343## Plugin installation scopes


363 "hooks": "./config/hooks.json",383 "hooks": "./config/hooks.json",

364 "mcpServers": "./mcp-config.json",384 "mcpServers": "./mcp-config.json",

365 "outputStyles": "./styles/",385 "outputStyles": "./styles/",

386 "themes": "./themes/",

366 "lspServers": "./.lsp.json",387 "lspServers": "./.lsp.json",

367 "monitors": "./monitors.json",388 "monitors": "./monitors.json",

368 "dependencies": [389 "dependencies": [


387### Metadata fields408### Metadata fields

388 409 

389| Field | Type | Description | Example |410| Field | Type | Description | Example |

390| :------------ | :----- | :-------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------- |411| :------------ | :----- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------- |

391| `version` | string | Semantic version. If also set in the marketplace entry, `plugin.json` takes priority. You only need to set it in one place. | `"2.1.0"` |412| `version` | string | Optional. Semantic version. Setting this pins the plugin to that version string, so users only receive updates when you bump it. If omitted, Claude Code falls back to the git commit SHA, so every commit is treated as a new version. If also set in the marketplace entry, `plugin.json` wins. See [Version management](#version-management). | `"2.1.0"` |

392| `description` | string | Brief explanation of plugin purpose | `"Deployment automation tools"` |413| `description` | string | Brief explanation of plugin purpose | `"Deployment automation tools"` |

393| `author` | object | Author information | `{"name": "Dev Team", "email": "dev@company.com"}` |414| `author` | object | Author information | `{"name": "Dev Team", "email": "dev@company.com"}` |

394| `homepage` | string | Documentation URL | `"https://docs.example.com"` |415| `homepage` | string | Documentation URL | `"https://docs.example.com"` |


406| `hooks` | string\|array\|object | Hook config paths or inline config | `"./my-extra-hooks.json"` |427| `hooks` | string\|array\|object | Hook config paths or inline config | `"./my-extra-hooks.json"` |

407| `mcpServers` | string\|array\|object | MCP config paths or inline config | `"./my-extra-mcp-config.json"` |428| `mcpServers` | string\|array\|object | MCP config paths or inline config | `"./my-extra-mcp-config.json"` |

408| `outputStyles` | string\|array | Custom output style files/directories (replaces default `output-styles/`) | `"./styles/"` |429| `outputStyles` | string\|array | Custom output style files/directories (replaces default `output-styles/`) | `"./styles/"` |

430| `themes` | string\|array | Color theme files/directories (replaces default `themes/`). See [Themes](#themes) | `"./themes/"` |

409| `lspServers` | string\|array\|object | [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) configs for code intelligence (go to definition, find references, etc.) | `"./.lsp.json"` |431| `lspServers` | string\|array\|object | [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) configs for code intelligence (go to definition, find references, etc.) | `"./.lsp.json"` |

410| `monitors` | string\|array | Background [Monitor](/en/tools-reference#monitor-tool) configurations that start automatically when the plugin is active. See [Monitors](#monitors) | `"./monitors.json"` |432| `monitors` | string\|array | Background [Monitor](/en/tools-reference#monitor-tool) configurations that start automatically when the plugin is active. See [Monitors](#monitors) | `"./monitors.json"` |

411| `userConfig` | object | User-configurable values prompted at enable time. See [User configuration](#user-configuration) | See below |433| `userConfig` | object | User-configurable values prompted at enable time. See [User configuration](#user-configuration) | See below |


482 504 

483### Path behavior rules505### Path behavior rules

484 506 

485For `skills`, `commands`, `agents`, `outputStyles`, and `monitors`, a custom path replaces the default. If the manifest specifies `skills`, the default `skills/` directory is not scanned; if it specifies `monitors`, the default `monitors/monitors.json` is not loaded. [Hooks](#hooks), [MCP servers](#mcp-servers), and [LSP servers](#lsp-servers) have different semantics for handling multiple sources.507For `skills`, `commands`, `agents`, `outputStyles`, `themes`, and `monitors`, a custom path replaces the default. If the manifest specifies `skills`, the default `skills/` directory is not scanned; if it specifies `monitors`, the default `monitors/monitors.json` is not loaded. [Hooks](#hooks), [MCP servers](#mcp-servers), and [LSP servers](#lsp-servers) have different semantics for handling multiple sources.

486 508 

487* All paths must be relative to the plugin root and start with `./`509* All paths must be relative to the plugin root and start with `./`

488* Components from custom paths use the same naming and namespacing rules510* Components from custom paths use the same naming and namespacing rules


631│ └── compliance-checker.md653│ └── compliance-checker.md

632├── output-styles/ # Output style definitions654├── output-styles/ # Output style definitions

633│ └── terse.md655│ └── terse.md

656├── themes/ # Color theme definitions

657│ └── dracula.json

634├── monitors/ # Background monitor configurations658├── monitors/ # Background monitor configurations

635│ └── monitors.json659│ └── monitors.json

636├── hooks/ # Hook configurations660├── hooks/ # Hook configurations


650```674```

651 675 

652<Warning>676<Warning>

653 The `.claude-plugin/` directory contains the `plugin.json` file. All other directories (commands/, agents/, skills/, output-styles/, monitors/, hooks/) must be at the plugin root, not inside `.claude-plugin/`.677 The `.claude-plugin/` directory contains the `plugin.json` file. All other directories (commands/, agents/, skills/, output-styles/, themes/, monitors/, hooks/) must be at the plugin root, not inside `.claude-plugin/`.

654</Warning>678</Warning>

655 679 

656### File locations reference680### File locations reference


662| **Commands** | `commands/` | Skills as flat Markdown files. Use `skills/` for new plugins |686| **Commands** | `commands/` | Skills as flat Markdown files. Use `skills/` for new plugins |

663| **Agents** | `agents/` | Subagent Markdown files |687| **Agents** | `agents/` | Subagent Markdown files |

664| **Output styles** | `output-styles/` | Output style definitions |688| **Output styles** | `output-styles/` | Output style definitions |

689| **Themes** | `themes/` | Color theme definitions |

665| **Hooks** | `hooks/hooks.json` | Hook configuration |690| **Hooks** | `hooks/hooks.json` | Hook configuration |

666| **MCP servers** | `.mcp.json` | MCP server definitions |691| **MCP servers** | `.mcp.json` | MCP server definitions |

667| **LSP servers** | `.lsp.json` | Language server configurations |692| **LSP servers** | `.lsp.json` | Language server configurations |


808| `--available` | Include available plugins from marketplaces. Requires `--json` | |833| `--available` | Include available plugins from marketplaces. Requires `--json` | |

809| `-h, --help` | Display help for command | |834| `-h, --help` | Display help for command | |

810 835 

836### plugin tag

837 

838Create a release git tag for the plugin in the current directory. Run from inside the plugin's folder. See [Tag plugin releases](/en/plugin-dependencies#tag-plugin-releases-for-version-resolution).

839 

840```bash theme={null}

841claude plugin tag [options]

842```

843 

844**Options:**

845 

846| Option | Description | Default |

847| :------------ | :------------------------------------------------------------------------- | :------ |

848| `--push` | Push the tag to the remote after creating it | |

849| `--dry-run` | Print what would be tagged without creating the tag | |

850| `-f, --force` | Create the tag even if the working tree is dirty or the tag already exists | |

851| `-h, --help` | Display help for command | |

852 

811***853***

812 854 

813## Debugging and development tools855## Debugging and development tools


861 903 

8621. Verify the event name is correct (case-sensitive): `PostToolUse`, not `postToolUse`9041. Verify the event name is correct (case-sensitive): `PostToolUse`, not `postToolUse`

8632. Check the matcher pattern matches your tools: `"matcher": "Write|Edit"` for file operations9052. Check the matcher pattern matches your tools: `"matcher": "Write|Edit"` for file operations

8643. Confirm the hook type is valid: `command`, `http`, `prompt`, or `agent`9063. Confirm the hook type is valid: `command`, `http`, `mcp_tool`, `prompt`, or `agent`

865 907 

866### MCP server troubleshooting908### MCP server troubleshooting

867 909 


907 949 

908### Version management950### Version management

909 951 

910Follow semantic versioning for plugin releases:952Claude Code uses the plugin's version as the cache key that determines whether an update is available. When you run `/plugin update` or auto-update fires, Claude Code computes the current version and skips the update if it matches what's already installed.

911 953 

912```json theme={null}954The version is resolved from the first of these that is set:

913{

914 "name": "my-plugin",

915 "version": "2.1.0"

916}

917```

918 955 

919**Version format**: `MAJOR.MINOR.PATCH`9561. The `version` field in the plugin's `plugin.json`

9572. The `version` field in the plugin's marketplace entry in `marketplace.json`

9583. The git commit SHA of the plugin's source, for `github`, `url`, `git-subdir`, and relative-path sources in a git-hosted marketplace

9594. `unknown`, for `npm` sources or local directories not inside a git repository

920 960 

921* **MAJOR**: Breaking changes (incompatible API changes)961This gives you two ways to version a plugin:

922* **MINOR**: New features (backward-compatible additions)

923* **PATCH**: Bug fixes (backward-compatible fixes)

924 962 

925**Best practices**:963| Approach | How | Update behavior | Best for |

926 964| :--------------------- | :--------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------ |

927* Start at `1.0.0` for your first stable release965| **Explicit version** | Set `"version": "2.1.0"` in `plugin.json` | Users get updates only when you bump this field. Pushing new commits without bumping it has no effect, and `/plugin update` reports "already at the latest version". | Published plugins with stable release cycles |

928* Update the version in `plugin.json` before distributing changes966| **Commit-SHA version** | Omit `version` from both `plugin.json` and the marketplace entry | Users get updates on every new commit to the plugin's git source | Internal or team plugins under active development |

929* Document changes in a `CHANGELOG.md` file

930* Use pre-release versions like `2.0.0-beta.1` for testing

931 967 

932<Warning>968<Warning>

933 Claude Code uses the version to determine whether to update your plugin. If you change your plugin's code but don't bump the version in `plugin.json`, your plugin's existing users won't see your changes due to caching.969 If you set `version` in `plugin.json`, you must bump it every time you want users to receive changes. Pushing new commits alone is not enough, because Claude Code sees the same version string and keeps the cached copy. If you're iterating quickly, leave `version` unset so the git commit SHA is used instead.

934 

935 If your plugin is within a [marketplace](/en/plugin-marketplaces) directory, you can manage the version through `marketplace.json` instead and omit the `version` field from `plugin.json`.

936</Warning>970</Warning>

937 971 

972If you use explicit versions, follow [semantic versioning](https://semver.org) (`MAJOR.MINOR.PATCH`): bump MAJOR for breaking changes, MINOR for new features, PATCH for bug fixes. Document changes in a `CHANGELOG.md`.

973 

938***974***

939 975 

940## See also976## See also

quickstart.md +2 −0

Details

601 </Tab>601 </Tab>

602</Tabs>602</Tabs>

603 603 

604You can also install with [apt, dnf, or apk](/en/setup#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.

605 

604## Step 2: Log in to your account606## Step 2: Log in to your account

605 607 

606Claude Code requires an account to use. When you start an interactive session with the `claude` command, you'll need to log in:608Claude Code requires an account to use. When you start an interactive session with the `claude` command, you'll need to log in:

Details

188* **Local process must keep running**: Remote Control runs as a local process. If you close the terminal, quit VS Code, or otherwise stop the `claude` process, the session ends.188* **Local process must keep running**: Remote Control runs as a local process. If you close the terminal, quit VS Code, or otherwise stop the `claude` process, the session ends.

189* **Extended network outage**: if your machine is awake but unable to reach the network for more than roughly 10 minutes, the session times out and the process exits. Run `claude remote-control` again to start a new session.189* **Extended network outage**: if your machine is awake but unable to reach the network for more than roughly 10 minutes, the session times out and the process exits. Run `claude remote-control` again to start a new session.

190* **Ultraplan disconnects Remote Control**: starting an [ultraplan](/en/ultraplan) session disconnects any active Remote Control session because both features occupy the claude.ai/code interface and only one can be connected at a time.190* **Ultraplan disconnects Remote Control**: starting an [ultraplan](/en/ultraplan) session disconnects any active Remote Control session because both features occupy the claude.ai/code interface and only one can be connected at a time.

191* **Some commands are local-only**: commands that open an interactive picker in the terminal, such as `/mcp`, `/plugin`, or `/resume`, work only from the local CLI. Commands that produce text output, including `/compact`, `/clear`, `/context`, `/cost`, `/exit`, `/extra-usage`, `/recap`, and `/reload-plugins`, work from mobile and web.191* **Some commands are local-only**: commands that open an interactive picker in the terminal, such as `/mcp`, `/plugin`, or `/resume`, work only from the local CLI. Commands that produce text output, including `/compact`, `/clear`, `/context`, `/usage`, `/exit`, `/extra-usage`, `/recap`, and `/reload-plugins`, work from mobile and web.

192 192 

193## Troubleshooting193## Troubleshooting

194 194 

routines.md +24 −4

Details

14 14 

15Each routine can have one or more triggers attached to it:15Each routine can have one or more triggers attached to it:

16 16 

17* **Scheduled**: run on a recurring cadence like hourly, nightly, or weekly17* **Scheduled**: run on a recurring cadence like hourly, nightly, or weekly, or once at a specific future time

18* **API**: trigger on demand by sending an HTTP POST to a per-routine endpoint with a bearer token18* **API**: trigger on demand by sending an HTTP POST to a per-routine endpoint with a bearer token

19* **GitHub**: run automatically in response to repository events such as pull requests or releases19* **GitHub**: run automatically in response to repository events such as pull requests or releases

20 20 


84 84 

85 <Tabs>85 <Tabs>

86 <Tab title="Schedule">86 <Tab title="Schedule">

87 Pick a preset frequency: hourly, daily, weekdays, or weekly. See [Add a schedule trigger](#add-a-schedule-trigger) for timezone handling, stagger, and custom cron intervals.87 Pick a preset frequency for a recurring run, or schedule a single one-off run at a specific timestamp. See [Add a schedule trigger](#add-a-schedule-trigger) for timezone handling, stagger, custom cron intervals, and one-off runs.

88 </Tab>88 </Tab>

89 89 

90 <Tab title="GitHub event">90 <Tab title="GitHub event">


110 110 

111### Create from the CLI111### Create from the CLI

112 112 

113Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, as in `/schedule daily PR review at 9am`. Claude walks through the same information the web form collects, then saves the routine to your account.113Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account.

114 114 

115`/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](https://claude.ai/code/routines).115`/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](https://claude.ai/code/routines).

116 116 


126 126 

127### Add a schedule trigger127### Add a schedule trigger

128 128 

129A schedule trigger runs the routine on a recurring cadence. Pick a preset frequency in the **Select a trigger** section: hourly, daily, weekdays, or weekly. Times are entered in your local zone and converted automatically, so the routine runs at that wall-clock time regardless of where the cloud infrastructure is located.129A schedule trigger runs the routine on a recurring cadence, or once at a specific future time. Pick a preset frequency in the **Select a trigger** section: hourly, daily, weekdays, or weekly. Times are entered in your local zone and converted automatically, so the routine runs at that wall-clock time regardless of where the cloud infrastructure is located.

130 130 

131Runs may start a few minutes after the scheduled time due to stagger. The offset is consistent for each routine.131Runs may start a few minutes after the scheduled time due to stagger. The offset is consistent for each routine.

132 132 

133For a custom interval such as every two hours or the first of each month, pick the closest preset in the form, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected.133For a custom interval such as every two hours or the first of each month, pick the closest preset in the form, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected.

134 134 

135#### Schedule a one-off run

136 

137A one-off schedule fires the routine a single time at a specific timestamp. Use it to remind yourself later in the week, to open a cleanup PR after a rollout finishes, or to kick off a follow-up task when an upstream change lands. After the routine fires, it auto-disables and the web UI marks it as **Ran**. To run it again, edit the routine and set a new one-off time.

138 

139Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving.

140 

141```text theme={null}

142/schedule tomorrow at 9am, summarize yesterday's merged PRs

143```

144 

145```text theme={null}

146/schedule in 2 weeks, open a cleanup PR that removes the feature flag

147```

148 

149The same local-to-UTC conversion as recurring schedules applies to one-off timestamps.

150 

151One-off runs do not count against the daily routine run cap. They consume your plan's regular subscription usage like any other session. See [Usage and limits](#usage-and-limits) for details.

152 

135### Add an API trigger153### Add an API trigger

136 154 

137An API trigger gives a routine a dedicated HTTP endpoint. POSTing to the endpoint with the routine's bearer token starts a new session and returns a session URL. Use this to wire Claude Code into alerting systems, deploy pipelines, internal tools, or anywhere you can make an authenticated HTTP request.155An API trigger gives a routine a dedicated HTTP endpoint. POSTing to the endpoint with the routine's bearer token starts a new session and returns a session URL. Use this to wire Claude Code into alerting systems, deploy pipelines, internal tools, or anywhere you can make an authenticated HTTP request.


308 326 

309When a routine hits the daily cap or your subscription usage limit, organizations with extra usage enabled can keep running routines on metered overage. Without extra usage, additional runs are rejected until the window resets. Enable extra usage from **Settings > Billing** on claude.ai.327When a routine hits the daily cap or your subscription usage limit, organizations with extra usage enabled can keep running routines on metered overage. Without extra usage, additional runs are rejected until the window resets. Enable extra usage from **Settings > Billing** on claude.ai.

310 328 

329One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session, but they are exempt from the per-account daily routine run allowance.

330 

311## Related resources331## Related resources

312 332 

313* [`/loop` and in-session scheduling](/en/scheduled-tasks): schedule local tasks within an open CLI session333* [`/loop` and in-session scheduling](/en/scheduled-tasks): schedule local tasks within an open CLI session

Details

16 16 

17## Compare scheduling options17## Compare scheduling options

18 18 

19Claude Code offers three ways to schedule recurring work:19Claude Code offers three ways to schedule recurring or one-off work:

20 20 

21| | [Cloud](/en/routines) | [Desktop](/en/desktop-scheduled-tasks) | [`/loop`](/en/scheduled-tasks) |21| | [Cloud](/en/routines) | [Desktop](/en/desktop-scheduled-tasks) | [`/loop`](/en/scheduled-tasks) |

22| :------------------------- | :----------------------------- | :------------------------------------- | :---------------------------------- |22| :------------------------- | :----------------------------- | :------------------------------------- | :---------------------------------- |

settings.md +3 −2

Details

169| `apiKeyHelper` | Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests | `/bin/generate_temp_api_key.sh` |169| `apiKeyHelper` | Custom script, to be executed in `/bin/sh`, to generate an auth value. This value will be sent as `X-Api-Key` and `Authorization: Bearer` headers for model requests | `/bin/generate_temp_api_key.sh` |

170| `attribution` | Customize attribution for git commits and pull requests. See [Attribution settings](#attribution-settings) | `{"commit": "🤖 Generated with Claude Code", "pr": ""}` |170| `attribution` | Customize attribution for git commits and pull requests. See [Attribution settings](#attribution-settings) | `{"commit": "🤖 Generated with Claude Code", "pr": ""}` |

171| `autoMemoryDirectory` | Custom directory for [auto memory](/en/memory#storage-location) storage. Accepts `~/`-expanded paths. Not accepted in project settings (`.claude/settings.json`) to prevent shared repos from redirecting memory writes to sensitive locations. Accepted from policy, local, and user settings | `"~/my-memory-dir"` |171| `autoMemoryDirectory` | Custom directory for [auto memory](/en/memory#storage-location) storage. Accepts `~/`-expanded paths. Not accepted in project settings (`.claude/settings.json`) to prevent shared repos from redirecting memory writes to sensitive locations. Accepted from policy, local, and user settings | `"~/my-memory-dir"` |

172| `autoMode` | Customize what the [auto mode](/en/permission-modes#eliminate-prompts-with-auto-mode) classifier blocks and allows. Contains `environment`, `allow`, and `soft_deny` arrays of prose rules. See [Configure auto mode](/en/auto-mode-config). Not read from shared project settings | `{"environment": ["Trusted repo: github.example.com/acme"]}` |172| `autoMode` | Customize what the [auto mode](/en/permission-modes#eliminate-prompts-with-auto-mode) classifier blocks and allows. Contains `environment`, `allow`, and `soft_deny` arrays of prose rules. Include the literal string `"$defaults"` in an array to inherit the built-in rules at that position. See [Configure auto mode](/en/auto-mode-config). Not read from shared project settings | `{"soft_deny": ["$defaults", "Never run terraform apply"]}` |

173| `autoUpdatesChannel` | Release channel to follow for updates. Use `"stable"` for a version that is typically about one week old and skips versions with major regressions, or `"latest"` (default) for the most recent release | `"stable"` |173| `autoUpdatesChannel` | Release channel to follow for updates. Use `"stable"` for a version that is typically about one week old and skips versions with major regressions, or `"latest"` (default) for the most recent release | `"stable"` |

174| `availableModels` | Restrict which models users can select via `/model`, `--model`, Config tool, or `ANTHROPIC_MODEL`. Does not affect the Default option. See [Restrict model selection](/en/model-config#restrict-model-selection) | `["sonnet", "haiku"]` |174| `availableModels` | Restrict which models users can select via `/model`, `--model`, or `ANTHROPIC_MODEL`. Does not affect the Default option. See [Restrict model selection](/en/model-config#restrict-model-selection) | `["sonnet", "haiku"]` |

175| `awaySummaryEnabled` | Show a one-line session recap when you return to the terminal after a few minutes away. Set to `false` or turn off Session recap in `/config` to disable. Same as [`CLAUDE_CODE_ENABLE_AWAY_SUMMARY`](/en/env-vars) | `true` |175| `awaySummaryEnabled` | Show a one-line session recap when you return to the terminal after a few minutes away. Set to `false` or turn off Session recap in `/config` to disable. Same as [`CLAUDE_CODE_ENABLE_AWAY_SUMMARY`](/en/env-vars) | `true` |

176| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |176| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |

177| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |177| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |


225| `viewMode` | Default transcript view mode on startup: `"default"`, `"verbose"`, or `"focus"`. Overrides the sticky `/focus` selection when set | `"verbose"` |225| `viewMode` | Default transcript view mode on startup: `"default"`, `"verbose"`, or `"focus"`. Overrides the sticky `/focus` selection when set | `"verbose"` |

226| `voice` | [Voice dictation](/en/voice-dictation) settings: `enabled` turns dictation on, `mode` selects `"hold"` or `"tap"`, and `autoSubmit` sends the prompt on key release in hold mode. Written automatically when you run `/voice`. Requires a Claude.ai account | `{ "enabled": true, "mode": "tap" }` |226| `voice` | [Voice dictation](/en/voice-dictation) settings: `enabled` turns dictation on, `mode` selects `"hold"` or `"tap"`, and `autoSubmit` sends the prompt on key release in hold mode. Written automatically when you run `/voice`. Requires a Claude.ai account | `{ "enabled": true, "mode": "tap" }` |

227| `voiceEnabled` | Legacy alias for `voice.enabled`. Prefer the `voice` object | `true` |227| `voiceEnabled` | Legacy alias for `voice.enabled`. Prefer the `voice` object | `true` |

228| `wslInheritsWindowsSettings` | (Windows managed settings only) When `true`, Claude Code on WSL reads managed settings from the Windows policy chain in addition to `/etc/claude-code`, with Windows sources taking priority. Only honored when set in the HKLM registry key or `C:\Program Files\ClaudeCode\managed-settings.json`, both of which require Windows admin to write. For HKCU policy to also apply on WSL, the flag must additionally be set in HKCU itself. Has no effect on native Windows | `true` |

228 229 

229### Global config settings230### Global config settings

230 231 

setup.md +97 −4

Details

89 </Tab>89 </Tab>

90</Tabs>90</Tabs>

91 91 

92You can also install with [apt, dnf, or apk](/en/setup#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.

93 

92After installation completes, open a terminal in the project you want to work in and start Claude Code:94After installation completes, open a terminal in the project you want to work in and start Claude Code:

93 95 

94```bash theme={null}96```bash theme={null}


171 173 

172## Update Claude Code174## Update Claude Code

173 175 

174Native installations automatically update in the background. You can [configure the release channel](#configure-release-channel) to control whether you receive updates immediately or on a delayed stable schedule, or [disable auto-updates](#disable-auto-updates) entirely. Homebrew and WinGet installations require manual updates.176Native installations automatically update in the background. You can [configure the release channel](#configure-release-channel) to control whether you receive updates immediately or on a delayed stable schedule, or [disable auto-updates](#disable-auto-updates) entirely. Homebrew, WinGet, and [Linux package manager](#install-with-linux-package-managers) installations require manual updates.

175 177 

176### Auto-updates178### Auto-updates

177 179 

178Claude Code checks for updates on startup and periodically while running. Updates download and install in the background, then take effect the next time you start Claude Code.180Claude Code checks for updates on startup and periodically while running. Updates download and install in the background, then take effect the next time you start Claude Code.

179 181 

180<Note>182<Note>

181 Homebrew and WinGet installations do not auto-update. For Homebrew, run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed. For WinGet, run `winget upgrade Anthropic.ClaudeCode`.183 Homebrew, WinGet, apt, dnf, and apk installations do not auto-update. For Homebrew, run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed. For WinGet, run `winget upgrade Anthropic.ClaudeCode`. For Linux package managers, see the upgrade commands in [Install with Linux package managers](#install-with-linux-package-managers).

182 184 

183 **Known issue:** Claude Code may notify you of updates before the new version is available in these package managers. If an upgrade fails, wait and try again later.185 **Known issue:** Claude Code may notify you of updates before the new version is available in these package managers. If an upgrade fails, wait and try again later.

184 186 


233}235}

234```236```

235 237 

238`DISABLE_AUTOUPDATER` only stops the background check; `claude update` and `claude install` still work. To block all update paths, including manual updates, set [`DISABLE_UPDATES`](/en/env-vars) instead. Use this when you distribute Claude Code through your own channels and need users to stay on the version you provide.

239 

236### Update manually240### Update manually

237 241 

238To apply an update immediately without waiting for the next background check, run:242To apply an update immediately without waiting for the next background check, run:


243 247 

244## Advanced installation options248## Advanced installation options

245 249 

246These options are for version pinning, migrating from npm, and verifying binary integrity.250These options are for version pinning, Linux package managers, npm, and verifying binary integrity.

247 251 

248### Install a specific version252### Install a specific version

249 253 


315 </Tab>319 </Tab>

316</Tabs>320</Tabs>

317 321 

322### Install with Linux package managers

323 

324Claude Code publishes signed apt, dnf, and apk repositories. Replace `stable` with `latest` for the rolling channel. Package manager installations do not auto-update through Claude Code; updates arrive through your normal system upgrade workflow.

325 

326All repositories are signed with the [Claude Code release signing key](#binary-integrity-and-code-signing). Before trusting the key, verify it as described in each tab.

327 

328<Tabs>

329 <Tab title="apt">

330 For Debian and Ubuntu. To use the rolling channel, change both `stable` occurrences in the `deb` line: the URL path and the suite name.

331 

332 ```bash theme={null}

333 sudo install -d -m 0755 /etc/apt/keyrings

334 sudo curl -fsSL https://downloads.claude.ai/keys/claude-code.asc \

335 -o /etc/apt/keyrings/claude-code.asc

336 echo "deb [signed-by=/etc/apt/keyrings/claude-code.asc] https://downloads.claude.ai/claude-code/apt/stable stable main" \

337 | sudo tee /etc/apt/sources.list.d/claude-code.list

338 sudo apt update

339 sudo apt install claude-code

340 ```

341 

342 Verify the GPG key fingerprint before trusting it: `gpg --show-keys /etc/apt/keyrings/claude-code.asc` should report `31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE`.

343 

344 To upgrade later, run `sudo apt update && sudo apt upgrade claude-code`.

345 </Tab>

346 

347 <Tab title="dnf">

348 For Fedora and RHEL:

349 

350 ```bash theme={null}

351 sudo tee /etc/yum.repos.d/claude-code.repo <<'EOF'

352 [claude-code]

353 name=Claude Code

354 baseurl=https://downloads.claude.ai/claude-code/rpm/stable

355 enabled=1

356 gpgcheck=1

357 gpgkey=https://downloads.claude.ai/keys/claude-code.asc

358 EOF

359 sudo dnf install claude-code

360 ```

361 

362 dnf downloads the key on first install and prompts you to confirm the fingerprint. Verify it matches `31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACE` before accepting.

363 

364 To upgrade later, run `sudo dnf upgrade claude-code`.

365 </Tab>

366 

367 <Tab title="apk">

368 For Alpine Linux:

369 

370 ```sh theme={null}

371 wget -O /etc/apk/keys/claude-code.rsa.pub \

372 https://downloads.claude.ai/keys/claude-code.rsa.pub

373 echo "https://downloads.claude.ai/claude-code/apk/stable" >> /etc/apk/repositories

374 apk add claude-code

375 ```

376 

377 Verify the downloaded key with `sha256sum /etc/apk/keys/claude-code.rsa.pub`, which should report `395759c1f7449ef4cdef305a42e820f3c766d6090d142634ebdb049f113168b6`.

378 

379 To upgrade later, run `apk update && apk upgrade claude-code`.

380 </Tab>

381</Tabs>

382 

318### Install with npm383### Install with npm

319 384 

320You can also install Claude Code as a global npm package. The package requires [Node.js 18 or later](https://nodejs.org/en/download).385You can also install Claude Code as a global npm package. The package requires [Node.js 18 or later](https://nodejs.org/en/download).


418 483 

419* **macOS**: signed by "Anthropic PBC" and notarized by Apple. Verify with `codesign --verify --verbose ./claude`.484* **macOS**: signed by "Anthropic PBC" and notarized by Apple. Verify with `codesign --verify --verbose ./claude`.

420* **Windows**: signed by "Anthropic, PBC". Verify with `Get-AuthenticodeSignature .\claude.exe`.485* **Windows**: signed by "Anthropic, PBC". Verify with `Get-AuthenticodeSignature .\claude.exe`.

421* **Linux**: use the manifest signature above to verify integrity. Linux binaries are not individually code-signed.486* **Linux**: binaries are not individually code-signed. If you download directly from the `claude-code-releases` bucket or use the native installer, verify integrity with the manifest signature above. If you install with [apt, dnf, or apk](#install-with-linux-package-managers), your package manager verifies signatures automatically using the repository signing key.

422 487 

423## Uninstall Claude Code488## Uninstall Claude Code

424 489 


466winget uninstall Anthropic.ClaudeCode531winget uninstall Anthropic.ClaudeCode

467```532```

468 533 

534### apt / dnf / apk

535 

536Remove the package and the repository configuration:

537 

538<Tabs>

539 <Tab title="apt">

540 ```bash theme={null}

541 sudo apt remove claude-code

542 sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc

543 ```

544 </Tab>

545 

546 <Tab title="dnf">

547 ```bash theme={null}

548 sudo dnf remove claude-code

549 sudo rm /etc/yum.repos.d/claude-code.repo

550 ```

551 </Tab>

552 

553 <Tab title="apk">

554 ```sh theme={null}

555 apk del claude-code

556 sed -i '\|downloads.claude.ai/claude-code/apk|d' /etc/apk/repositories

557 rm /etc/apk/keys/claude-code.rsa.pub

558 ```

559 </Tab>

560</Tabs>

561 

469### npm562### npm

470 563 

471Remove the global npm package:564Remove the global npm package:

statusline.md +1 −1

Details

172| `transcript_path` | Path to conversation transcript file |172| `transcript_path` | Path to conversation transcript file |

173| `version` | Claude Code version |173| `version` | Claude Code version |

174| `output_style.name` | Name of the current output style |174| `output_style.name` | Name of the current output style |

175| `vim.mode` | Current vim mode (`NORMAL` or `INSERT`) when [vim mode](/en/interactive-mode#vim-editor-mode) is enabled |175| `vim.mode` | Current vim mode (`NORMAL`, `INSERT`, `VISUAL`, or `VISUAL LINE`) when [vim mode](/en/interactive-mode#vim-editor-mode) is enabled |

176| `agent.name` | Agent name when running with the `--agent` flag or agent settings configured |176| `agent.name` | Agent name when running with the `--agent` flag or agent settings configured |

177| `worktree.name` | Name of the active worktree. Present only during `--worktree` sessions |177| `worktree.name` | Name of the active worktree. Present only during `--worktree` sessions |

178| `worktree.path` | Absolute path to the worktree directory |178| `worktree.path` | Absolute path to the worktree directory |

Details

107 107 

108## Match the color theme108## Match the color theme

109 109 

110Use the `/theme` command, or the theme picker in `/config`, to choose a Claude Code theme that matches your terminal. Selecting the auto option detects your terminal's light or dark background, so the theme follows OS appearance changes whenever your terminal does. The available themes are built in; there is no custom theme file. Claude Code does not control the terminal's own color scheme, which is set by the terminal application.110Use the `/theme` command, or the theme picker in `/config`, to choose a Claude Code theme that matches your terminal. Selecting the auto option detects your terminal's light or dark background, so the theme follows OS appearance changes whenever your terminal does. Claude Code does not control the terminal's own color scheme, which is set by the terminal application.

111 111 

112To customize what appears at the bottom of the interface, configure a [custom status line](/en/statusline) that shows the current model, working directory, git branch, or other context.112To customize what appears at the bottom of the interface, configure a [custom status line](/en/statusline) that shows the current model, working directory, git branch, or other context.

113 113 

114### Create a custom theme

115 

116<Note>

117 Custom themes require Claude Code v2.1.118 or later.

118</Note>

119 

120In addition to the built-in presets, `/theme` lists any custom themes you have defined and any themes contributed by installed [plugins](/en/plugins-reference#themes). Select **New custom theme…** at the end of the list to create one interactively: you name the theme, then pick individual color tokens to override. Press `Ctrl+E` while a custom theme is highlighted to edit it.

121 

122Each custom theme is a JSON file in `~/.claude/themes/`. The filename without the `.json` extension is the theme's slug, and selecting the theme stores `custom:<slug>` as your theme preference. The file has three optional fields:

123 

124| Field | Type | Description |

125| :---------- | :----- | :---------------------------------------------------------------------------------------------------------------------------------------------- |

126| `name` | string | Display label shown in `/theme`. Defaults to the filename slug |

127| `base` | string | Built-in preset the theme starts from: `dark`, `light`, `dark-daltonized`, `light-daltonized`, `dark-ansi`, or `light-ansi`. Defaults to `dark` |

128| `overrides` | object | Map of color token names to color values. Tokens not listed here fall through to the base preset |

129 

130Color values accept `#rrggbb`, `#rgb`, `rgb(r,g,b)`, `ansi256(n)`, or `ansi:<name>` where `<name>` is one of the 16 standard ANSI color names such as `red` or `cyanBright`. Unknown tokens and invalid color values are ignored, so a typo cannot break rendering.

131 

132The following example defines a theme that keeps the dark preset but recolors the prompt accent, error text, and success text:

133 

134```json ~/.claude/themes/dracula.json theme={null}

135{

136 "name": "Dracula",

137 "base": "dark",

138 "overrides": {

139 "claude": "#bd93f9",

140 "error": "#ff5555",

141 "success": "#50fa7b"

142 }

143}

144```

145 

146Claude Code watches `~/.claude/themes/` and reloads when a file changes, so edits made in your editor apply to a running session without a restart.

147 

114## Switch to fullscreen rendering148## Switch to fullscreen rendering

115 149 

116If the display flickers or the scroll position jumps while Claude is working, switch to [fullscreen rendering mode](/en/fullscreen). It draws to a separate screen the terminal reserves for full-screen apps instead of appending to your normal scrollback, which keeps memory usage flat and adds mouse support for scrolling and selection. In this mode you scroll with the mouse or PageUp inside Claude Code rather than with your terminal's native scrollback; see the [fullscreen page](/en/fullscreen#search-and-review-the-conversation) for how to search and copy.150If the display flickers or the scroll position jumps while Claude is working, switch to [fullscreen rendering mode](/en/fullscreen). It draws to a separate screen the terminal reserves for full-screen apps instead of appending to your normal scrollback, which keeps memory usage flat and adds mouse support for scrolling and selection. In this mode you scroll with the mouse or PageUp inside Claude Code rather than with your terminal's native scrollback; see the [fullscreen page](/en/fullscreen#search-and-review-the-conversation) for how to search and copy.


145 179 

146Claude Code includes a Vim-style editing mode for the prompt input. Enable it through `/config` → Editor mode, or by setting the [`editorMode`](/en/settings#global-config-settings) global config key to `"vim"` in `~/.claude.json`. Set Editor mode back to `normal` to turn it off.180Claude Code includes a Vim-style editing mode for the prompt input. Enable it through `/config` → Editor mode, or by setting the [`editorMode`](/en/settings#global-config-settings) global config key to `"vim"` in `~/.claude.json`. Set Editor mode back to `normal` to turn it off.

147 181 

148Vim mode supports a subset of NORMAL-mode motions and operators, such as `hjkl` navigation and `d`/`c`/`y` with text objects. See the [Vim editor mode reference](/en/interactive-mode#vim-editor-mode) for the full key table. Vim motions are not remappable through the keybindings file.182Vim mode supports a subset of NORMAL- and VISUAL-mode motions and operators, such as `hjkl` navigation, `v`/`V` selection, and `d`/`c`/`y` with text objects. See the [Vim editor mode reference](/en/interactive-mode#vim-editor-mode) for the full key table. Vim motions are not remappable through the keybindings file.

149 183 

150Pressing Enter still submits your prompt in INSERT mode, unlike standard Vim. Use `o` or `O` in NORMAL mode, or Ctrl+J, to insert a newline instead.184Pressing Enter still submits your prompt in INSERT mode, unlike standard Vim. Use `o` or `O` in NORMAL mode, or Ctrl+J, to insert a newline instead.

151 185